Compile export to name.md file vs name.md directory.

mm
mmynsted
Posts: 14
Joined: Mon Aug 14, 2017 8:57 pm
Platform: Mac

Mon May 11, 2020 3:16 pm Post

I have a template that I often use. It compiles the Scrivener content to markdown format. If my project is named 'foo' then when I first compile a new directory named foo.md is created. Inside foo.md is another file name foo.md. I have other files appear in the directory as well for post processing. This is the behavior I expect.

I just used this same template yesterday for a new project and when I compiled, the exported bar.md was a file, not a directory with a bar.md file inside. I do not know why. What controls this behavior? How can I ensure that the behavior I described above, with the foo.md directory, is always true for new uses of the template?

This is the non-appstore version of Scrivener 3 for macOS, if that makes a difference.

User avatar
AmberV
Posts: 24121
Joined: Sun Jun 18, 2006 4:30 am
Platform: Mac + Linux
Location: Ourense, Galiza
Contact:

Mon May 11, 2020 9:15 pm Post

The details on this behaviour can all be found in §21.5.1, Compile Folder, in the user manual PDF. From the opening paragraph:

If the compile process will generate more than one file, a compile folder will be created, containing the document itself along with any support files it needs. This will most often be graphics, or supporting .tex documents for typesetting. The folder name will match the output filename, such as novel.md, or novel.tex.


So if you want a folder, but there is no good reason for the compiler to create one, simply make it yourself, first (hint, you can do this right inside the Save dialogue box itself, with the ⇧⌘N shortcut). Use the same naming convention with “.md” on the end to ensure it is treated as a compile folder rather than a normal folder target. The referenced section in the manual goes into all of the implications of that, but in short it means that if you do add an image in the future, you won’t get foo.md/foo.md/foo.md as a result. There are other naming conventions you can use as well. Myself, I prefer the "_mmd" suffix.
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles

mm
mmynsted
Posts: 14
Joined: Mon Aug 14, 2017 8:57 pm
Platform: Mac

Mon May 11, 2020 9:23 pm Post

Perfect. Thank you! :D