What I’m trying to do
Work around the file sorting order in Obsidian. There are a few related posts about this already, but essentially the order in which files are sorted in Obsidian makes things like compiling books via Pandoc tricky, as well as just being confusing.
Given the list of files:
-
- foo.md
-
- foo.md
-
- foo.md
to get a file between the first and second files, it would have to be named “001.2. foo.md”, and not “0012. foo.md”. This is confusing because both the shell and the sort
command (by default) sort 0012 in between 001 and 002, as expected.
When writing a book, scenes are often re-arranged, and the only way to do this is in Obsidian is to rename the file, so file names and ordering are important here.
Things I have tried
I’ve tried the Longform plugin. Unfortunately I found it to be unreliable, and don’t feel confident trusting my writing to it.
I’ve tried renaming files in the manner described above, but it makes things awkward. Other than looking weird after multiple re-orders, I have to remember to pass the -n
flag to sort
during a Pandoc compile, else they are compiled in the wrong order.