Exporting a document to Markdown

I’m creating a series of documents in Scrivener and need to export them to Markdown. Some will have footnotes.

So far, I have not found a way to do this - the output is always just plain, unformatted text with no Markdown attributes at all.

I have bolded, centered, and heading tags in the documents in Scrivener.

I go File → Export and select MultiMarkdown (.md) and choose UTF-8 (Recommended) for Select Encoding.

Am I missing something?

Thank you,
Ernie

Exactly how are you accomplishing this? With rich text formatting? With Markdown markup? With named styles?

Scrivener should pass Markdown markup straight through to the output document, since it’s just plain text, after all. But the Export engine isn’t smart enough to do much more than that. If you’re trying to convert rich text to Markdown, you might have more luck with the Compile command, which has an option to do exactly that.

1 Like

Right, as @kewms mentions, Compile is a better friend for making markdown than export. Read through Section 21 of the manual. Particularly Section 21.4 highlights the three ways to use markdown with Scrivener: (1) Purist (2) Hybrid (3) Incidental

For purist mode you must manually type the markdown yourself in your document, and then export to plain text should work. For the other modes, you use either rich text (clicking the bold or italic buttons in the toolbar), or Styles which an be converted for you by Scrivener, but only when you Compile, not export your work…

2 Likes

The text is mostly copied and pasted from Word (.docx) files, but soon I’ll be pulling in text recognition from documents scanned into PDF with text recognition. The documents are over 100 years old, yellowed, and in small type, so a lot of corrections will be involved in each document. I’ll be formatting and inserting footnotes as I go to prepare each document.

Thank you for the answer - I have not yet learned about compiling. I gave it a try, and most of the settings worked. I may need to tweak a few things, but it seems to have worked for the most part.

The .md file, when it’s ready, will be pasted into a Mighty Networks community as lessons in an online course. They just added the .md support. It will save me a lot of time not having to redo all the formatting I’m doing in the Scrivener text.

Thank you,
Ernie

1 Like

I reccomend you try to use (2) Hybrid mode (using Scrivener styles for inline and paragraph blocks that need to be formatted in some way, think of block quotes, small caps, emphasis etc.) if possible as this is the most flexible. But if all you really need to manage is bold/italic then (3) Incidental mode (where Scrivener’s compiler will convert editor bold and italic for you) will also suffice, and it is easier to use for simpler needs. I’m not on Windows so I hope the hybrid mode works as well as it does on macOS… Good luck!

2 Likes

Yes, it works fine. The Scapple user manual PDF is regularly compiled in the Windows version. I still have to boot up the Mac to compile the Scrivener manual, but that has less to do with its Markdown output than other bugs and missing features (like the placeholder that can reference a distant ancestor item, which is used to construct the “Return to chapter” links). Both projects are hybrid through and through, mixing style-based Markdown generation with Markdown itself.

You can see what this means by double-clicking on the “Basic MultiMarkdown/Pandoc” compile Format, in the left sidebar of Compile overview, and the examining some of the Styles it configures. Putting asterisk around the “Emphasis” style is a very basic example of this idea.

We call it hybrid though because you don’t have to create and configure a style for every single thing you might want to do. You can also just type in the asterisks while writing. That is how I prefer it. I save styles for more complex stuff, by and large.

3 Likes