Yes, this option unfortunately still does not exist, nor does it work internally if you try to force it by adding the correct XML to your compile settings file directly (in fact all of the supplied Pandoc-based formats already do, to no avail).
Without external tools
The Scrivener-only solution at this point in time requires a bit more work, more like how a rich text user would have to use Scrivener with multi-level headings:
- Having a type-based declaration of the project structure in Project Settings.
- Assign those types to level-specific Layouts in the compiler.
- Setting up these layouts to generate title prefix, which outputs the correct number of hashes.
While it involves more manual setup than a Markdown user would typically have to employ, it is all fairly automatic once you do have it set up.
The attached sample project demonstrates a simple 3-level setup, which should be enough to show how one could add more hierarchy if needed.
closing_hashes_demo.zip (160.3 KB)
Project setup notes...
- Open
Project ⸠Project Settings...
to the Section Layouts pane.
-
We have some basic generic hierarchical names here. This is where you would add more.
-
In the Default Types by Structure tab, you can see how these generic names are applied to the outline structure automatically.
Note: the Export...
button would export both the name list and the structure settings to a file that can be imported into your project, if this is a good enough start for you.
-
While here, click on the Custom Metadata tab. Iâve created an Attributes field to demonstrate how we can keep this kind of clutter out of the binder itself.
- So to see these two settings in action, cancel out of project settings and take a look at the Outliner view of the Draft.
- Here we have the Attributes column added, and this where you could type in custom IDs, classes, or whatever else you need.
- The third column shows the Section Types, so you can see how the automatic structure feature is working. Changing indents or dragging things around will cause them to automatically become âchaptersâ, âsubsectionsâ or whatever.
- Now head into the compiler. From the preview column in the middle, you can see how the headed sections all have a similar setup, only the number of hashes are different. Double-click on the âPandoc Hierarchical Levelsâ format, in the left sidebar, to take a look at the setup.
- In Section Layouts, click on the Title Options tab, and cycle through the three âLevel nâ layouts. Pretty straight-forward stuff here in the prefix field.
- The setting that might be easy to miss though is at the bottom of this tab. Normally the Number of hashes dropdown is set to âby levelâ, but here we use â0â to take total control of heading output.
- In the suffix field we have the Attributes field being inserted, if there is text to insert, after the output of the binder item title.
Thatâs all there is too it. If you want to use this compile Format as a starter, either change the Save to dropdown at the top to âMy Formatsâ (to make it global), or cancel out, then use the gear button in the Format sidebar to âExport FormatâŚâ.
Sometimes techniques like this can be really useful. Maybe you want to force a particular part of the output to use a specific heading level instead of whatever the outliner dictates it would be (either fully automatically, or with a configuration such as the one demonstrated here). Manually assigned section types, or local type structure overrides, can achieve this. I do something similar for the âWhatâs Newâ appendix in the user manual, where I donât want the typical multi-level numbered heading setup.
But in this case, we can also use it to work around missing implementations. The convenience of multi-level automatic heading output is just that⌠a convenience.
External processing
There is one other approach, though it is one I am less familiar with on Windows, and that is post-processing automation. On Linux for example, I could run Scrivenerâs raw output through sed and strip out the extraneous hashes on the fly, or perhaps run it through a Ruby script that does that and more. Like I say, I donât really know much about Windows, or whether it has something equivalent to sed preinstalled, or if thatâs something youâd have to install, etc. But if you do have scripting knowledge, and maybe even a scripting environment already installed, then you can do anything to Scrivenerâs .md file that youâd be able to do otherwise, only have it executed automatically upon clicking the Compile
button.