Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Export a markdown folder as a single document #41

Open
davidrsim-p opened this issue Jun 24, 2021 · 4 comments
Open

Feature Request: Export a markdown folder as a single document #41

davidrsim-p opened this issue Jun 24, 2021 · 4 comments
Milestone

Comments

@davidrsim-p
Copy link

Great plugin. I tend to break my writing projects into separate sections/chapters - sometimes a large number of them. I control their order by name e.g. 000 Introduction, 002 Chapter 1, 003 Chapter 1 Notes, 004 Chapter 2

What would be useful is if the export could be done on a folder. It would then run through the files in alphabetical order and export to the requested format as a single document. I know applications like Zettlr can do this for nested folders ("projects") but a single folder and its md content would be sufficient for me. The pandoc command itself is pretty straightforward - just passing multiple filenames as the input instead of just one.

I'd like to help but need to get my head around how plugins work first!

@OliverBalfour
Copy link
Owner

OliverBalfour commented Jun 25, 2021

Hi David, that's an interesting idea. Currently, the best you can do is use Obsidian's note embedding syntax, like ![[note]].

Here's a workaround that does what you want, but it involves the terminal:

  1. Run this command in the correct folder: ls | sed -e 's/^/![[/' | sed -e 's/$/]]/' > chapters.md. This will create a file embedding every note in that folder in alphabetical order, ie something like ![[000 Intro.md]] on each line
  2. Add a YAML title, etc. to chapters.md
  3. Export chapters.md to your desired format

When I add #27 I'll probably add a context menu option to export everything in a folder as well. I might instead make the button generate an index file like the chapters.md above so you can edit it before exporting it, I'll have to think about it. (note: relates to #10)

@filipaldi
Copy link

Hi @OliverBalfour,

I have a similar thing, but maybe a more thorough one. Here it is:

  1. Same as @davidrsim-p I prefer to split (5+pages) document into sections. Sometimes I compose a document using those atomic thoughts.

  2. Moreover, I collect my bibliography in markdown documents.
    a) sources
    b) citations

At the end my file looks like this:
"Some citation sentence."^[![[embeded_md_file]]]

with embeded_md_file which looks like this (depends on reference style)
Author Name, Source title, Year, and other fancy stuff.

I have edited obsidian CSS so it makes a nice list of footnotes that includes files from my bibliography.

However, when exporting out of obsidian nothing is included.

@evitiello
Copy link

I'd expand this a bit too - I want to export my whole obsidian vault as a single ePub. (currently ~2300 files)

@inkygirl
Copy link

I don't have as many files as evitiello above (2300, wow!) but tend to write in scenes rather than chapters, so would have several hundred. I rearrange the scenes in revision. I'm sure there's a techie way to have automatic file numbering of these scenes, which I will try to research, but would love to eventually be able to export many pieces. Would be happy to help contribute toward funding of this revised plugin!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants