Multimarkdown to .mobi/ePub and Scrivener plugin architecture

to
tomcam
Posts: 13
Joined: Sat Apr 23, 2016 6:26 am
Platform: Mac

Thu Mar 09, 2017 11:33 pm Post

Going from Multimarkdown to an eBook requires something like this, correct?

  • Install Fletcher Penny's MultiMarkdown
  • Install pandoc
  • From the File menu, choose Compile.
  • From the Format as dropdown, choose Custom.
  • From the Compile for dropdown, choose MultiMarkdown -> Web Page (.html)
  • Open a terminal and run the resultant HTML file through pandoc to create the actual ebook--a .mobi or ePub file

If that's true, I'd like to learn how to exec pandoc from the Compile menu the way Multimarkdown does to avoid having to run pandoc from the command line directly. Ideally this could all be turned into a plugin or whatever architecture Scrivener uses... but I can't find any documentation of it. Can someone point me in the right direction?

User avatar
kewms
Posts: 3230
Joined: Fri Feb 02, 2007 5:22 pm
Platform: Mac

Thu Mar 09, 2017 11:47 pm Post

I'm sorry, but Scrivener does not support plugins. You haven't found documentation because this function doesn't exist.

Katherine
Scrivener Support Team

to
tomcam
Posts: 13
Joined: Sat Apr 23, 2016 6:26 am
Platform: Mac

Fri Mar 10, 2017 12:50 am Post

At least I know--thanks

User avatar
nontroppo
Posts: 752
Joined: Mon Mar 05, 2007 5:22 pm
Platform: Mac
Location: Airstrip One

Fri Mar 10, 2017 4:16 am Post

@tomcam, first off why don't you compile to Multimarkdown directly, you don't need to compile to HTML first from Scrivener, and Pandoc will work better I think.

Secondly, it is true that Scrivener doesn't run Pandoc or even know about Pandoc (although there have been some rumblings this will change in Scrivener 3), but you can get an automated workflow if you are willing to invest some time. Basically there are several tools that "monitor" a folder and trigger a script when a file changes. Pandoc has a list of very cool extras here: https://github.com/jgm/pandoc/wiki/Pandoc-Extras

I used to use a folder action for auto-pandoc some time ago (folder actions are a part of core macOS automator.app), but in the end i preferred more control. So now I use an automator workflow triggered by Quicksilver file selection, but I have made a similar thing for a friend who uses Alfred. I select the compile.md and trigger the script. I'm happy to share scripts (though I don't use EPub/Mobi, I compile to ODT, DOCX and LaTeX PDF)

to
tomcam
Posts: 13
Joined: Sat Apr 23, 2016 6:26 am
Platform: Mac

Tue Mar 21, 2017 12:30 am Post

WOW, thanks, @nontroppo. Awesome ideas. Thanks for pointing me in the right direction.