I am experimenting with using Multimarkdown to create files for a website, compiling to .md opening in Marked2, from which I can export to HTML. Basically, I am getting there, but I have a problem with heading styles.
In the attached zip, is a small trial project I have created to test things out, together with a compile format and the .md that results.
The heading levels are as I want, (I think!) but on inspecting the code the various tags are given an ID which is the same as the wording of the heading, e.g. <h2 id="garbage1">Garbage 1</h2>, <h2 id="garbage2">Garbage 2</h2>, etc.
What do I have to do to get it to merely have <h2>Garbage 1</h2>, <h2>Garbage 2</h2>, and so on.
This sounds like a Marked question to me, since that is what you are using to run the actual HTML conversion instead of Scrivener.
There is an MMD command-line argument that will omit header labels: --nolabels. So whichever program you use, that’s going to be what you’re looking to customise the settings with.
To hook that into Scrivener, double-click the “Basic MultiMarkdown” (or whatever you decided to use) Format to edit it, and in the Processing pane, set it up like this:
Field values...
And here are the values for easier copy and paste:
Of course, if you have your own copy of MMD installed, you’d want to use that for the path instead of Scrivener’s built-in copy. It’s usually found in:
/usr/local/bin/multimarkdown
With Marked it’s going to be very similar. You’ll find processor settings in the Advanced preference tab.
I had tried compiling directly to HTML, but, as you say, it creates a complete web page with HTML head and body container.
That’s a somewhat hidden MultiMarkdown quirk in how it works, in that if you supply an .md file with document-oriented metadata at the top of the file, then it will presume you want a document. If you do not then you will get a snippet that is meant to be pasted into boilerplate. So by default Scrivener inserts Title and Author metadata fields—as naturally most people do want a full document when they compile. If you delete both of those fields from the compiler, you will get a snippet.
If you don’t want to remove that metadata for whatever reason, then add the --snippet command-line flag to the Processor pane setup.
Here is some example content compiled from Scrivener, using the --nolabels flag and metadata removed, from to top to bottom of the file.
Update: edited .zip to include both a Mac and Windows variant, each using the default Scrivener install location for locating the multimarkdown executable embedded within it.