MultiMarkDown in Scrivener/Linux?

My understanding from reading posts here is that MultiMarkDown module is for Mac users only?

What is needed to add MultiMarkDown to Scrivener/Linux?

+1. This would be the killer feature for me (txt files instead of rtf)

I don’t know if there’s a limitation for the Linux build, but the Windows version, from which the Linux version is built, has various MMD “Compile For:” options. It’s definitely not Mac-only anymore. And besides that, if you are looking for plain text output, there’s the “Plain Text (.txt)” compile output format. That might get you there even if you have to find a mmd script that will convert from the raw MMD to whatever format you’re after.

I have moved to writing all my stuff in MMD. I thought that the 1.2.6 version couldn’t compile to MMD, but it looks like I’m wrong. I see the options for it. Guess I never checked before. Just write the document like any other MMD doc, and when you Compile, change the Compile For: to MultiMarkdown, or one of the other MMD variants.

Yes, to clarify Scrivener’s support for MMD: you basically need to handle most of the syntax yourself. It’s not a syntax generator, with only a few exceptions. I’d encourage you to go through the chapter on MultiMarkdown in the user manual PDF, as you may come across some items which save you a lot of time. Generating image syntax and automatically gathering images is one area we can handle, as well as footnotes. Depth-aware section titles are also supposed to be supported, but there is currently a bug causing that to fail (even in the latest beta build).

Beyond that it basically handles the processing for you, so you don’t have to run command-line tools to get formatted output. I’m not sure how well this works on Linux, or if you need a separate MMD installation on the system. I’ve never tested that.

I found this guide on installing multimarkdown in ubuntu
I shortened the installation by using Synaptic Package Manager to install

sudo apt-get install libtext-multimarkdown-perl

I found where it was installed by running command

locate multimarkdown

it was installed in /home/username/peg-multimarkdown

Following the guide I then added multimarkdown to path … on-ubuntu/

export PATH=$HOME/peg-multimarkdown:$PATH

then ran the commands

. ~/.bashrc
multimarkdown -v

In that guide above there is a link to an online markdown editor (note: not a multimarkdown editor) to play with.

A further note …
By using the option to compile into *.txt opens up the option
to import the *.txt file into a TextSTAT corpus for concordance analysis.

This topic of concordance analysis is perhaps unrelated to multimarkdown topic but I throw it in as a useful concordance analysis tool for a large Scrivener document.

Just add your scriv *.txt output to a new corpus and analyse.

I’ve placed TextSTAT in /usr/share/TextSTAT-2.9

then run TextSTAT.pyw to launch TextSTAT

sudo /usr/share/TextSTAT-2.9/TextSTAT.pyw

Create and save new corpus
Add your scriv compiled *.txt file(s) to corpus
Click on Concordance

As in previous post I have multimarkdown installed in ubuntu 12.04

$ multimarkdown --version

This is MultiMarkdown, version 1.000034.
Copyright 2004 John Gruber
Copyright 2006 Fletcher Penny
Copyright 2008 Tomas Doran
Parts contributed by several other

But if I try to compile a simple *.mmd file in Scrivener I get this error in compilation which suggests that Scrivener does not see the multimarkdown installation.

Note that for some reason I cannot resize this popup error message but I guess it says “multimarkdown missing”

How do I link Scrivener to the multimarkdown package installation?

I admit to being baffled.
I’ve read the manual and I don’t see how to apply these compile options …

MultiMarkdown (.mmd)
MultiMarkdown to Web Page (.html)
MultiMarkdown to OpenDocument Flat XML (.fodt)
MultiMarkdown to Outline Processor Markup Language (.opml)
MultiMarkdown to Latex (.tex)

Instead I can compile a document (with mmd syntax) into *.txt format
and then pipe the mmd file through an external multimarkdown app to convert to other formats.
Scrivener doesn’t come into the mmd workflow.

Ok, miscommunication :slight_smile:
I don’t want to export to mmd, I want all the files that are now .rtf to be .mmd.
The whole point is to use version control and edit from multiple locations.
This works on mac version, and I’ve been waiting for it for years on the other side (win, linux).

After making sure it’s in the path, scrivener still doesn’t find the multimarkdown executable.

I’m sorry if this mmd topic has been spread over two threads … but

is what I found here … Adding Post-Compile scripts (bash or python)

[p.s.] In my searching around I stumbled onto Lyx-Outline … -outline02

I installed Lyx Document Processor from Ubuntu repo and I’ll play around with it.

Just to make sure, writing markdown all the way, and storing plain text files instead of .rdf is not a feature that we will see on win+linux anytime soon, right?

So, I am trying to solve this same problem. I compiled the multimarkdown source from git://, then put ‘multimarkdown’ in /usr/local/bin. Sure. Scrivener still can’t find anything.

So, I tried to Compile to MMD while running an strace on Scrivener, and:

6119 12:41:43.607146 stat64("/home/anna/opt/Scrivener/bin/docformats/mmd", 0xffffffffff8ef5d8) = -1 ENOENT (No such file or directory) <0.000009>

It is looking for a file in the Scrivener install called ‘mmd’. The bin/docformats directory doesn’t even exist by default. So I created the directory and put ‘mmd’ (from the scripts/ directory in the MMD source tree) in it.

It still doesn’t work, though. Now I don’t get an error, but all I do get is an empty directory with whatever filename I specify in the compile menu.

Further research:

I tried strace again with the mmd file present. It stats it, just like before, except now obviously there’s no error:

6119  15:47:45.638070 stat64("/home/anna/opt/Scrivener/bin/docformats/mmd", {st_dev=makedev(253, 3), st_ino=3812179, st_mode=S_IFREG|0775, st_nlink=1, st_uid=1000, st_gid=1000, st_blksize=4096, st_blocks=8, st_size=368, st_atime=2012/12/27-15:47:05, st_mtime=2012/12/27-12:07:28, st_ctime=2012/12/27-15:46:53}) = 0 <0.000010>

Except… that’s the only reference to this file in the strace. Scrivener never attempts to exec() it. So I’m not sure what that check is doing in there in the first place.

So I thought maybe we check for those on startup, and never use them if they weren’t found there. Restarting Scrivener, and compiling again, I still get a directory… but I also get spacewalk_info.pdf (I am using the tutorial as my test data, just to have some random data to throw at the problem). So that’s odd. Only seems to happen the first time I hit ‘compile’; have to restart Scrivener to get that behavior again.

Here’s the system calls where the directory ends up getting created. I entered ‘test’ when prompted for a filename in the Compile dialog box:

8737  15:57:20.358450 stat64("/home/anna/Documents/test", 0xffffffffffefdbd8) = -1 ENOENT (No such file or directory) <0.000063>
8737  15:57:20.358660 stat64("/home", {st_dev=makedev(253, 3), st_ino=2, st_mode=S_IFDIR|0755, st_nlink=9, st_uid=0, st_gid=0, st_blksize=4096
, st_blocks=8, st_size=4096, st_atime=2012/12/26-17:23:39, st_mtime=2012/09/07-15:55:14, st_ctime=2012/09/07-15:55:14}) = 0 <0.000034>
8737  15:57:20.358843 stat64("/home/anna", {st_dev=makedev(253, 3), st_ino=3276801, st_mode=S_IFDIR|0700, st_nlink=75, st_uid=1000, st_gid=100
0, st_blksize=4096, st_blocks=8, st_size=4096, st_atime=2012/12/27-12:44:10, st_mtime=2012/12/27-12:43:42, st_ctime=2012/12/27-12:43:42}) = 0 
8737  15:57:20.359002 stat64("/home/anna/Documents", {st_dev=makedev(253, 3), st_ino=3276819, st_mode=S_IFDIR|0775, st_nlink=3, st_uid=1000, s
t_gid=1000, st_blksize=4096, st_blocks=8, st_size=4096, st_atime=2012/12/27-15:56:46, st_mtime=2012/12/27-15:57:19, st_ctime=2012/12/27-15:57:
19}) = 0 <0.000032>
8737  15:57:20.359149 stat64("/home/anna/Documents/test", 0xffffffffffefdb9c) = -1 ENOENT (No such file or directory) <0.000030>
8737  15:57:20.359261 mkdir("/home/anna/Documents/test", 0777) = 0 <0.000187>

EDIT to add: In case any devs are reading this, 8737 was the pid of the original Scrivener process, not a child thread / sub-process:

8737  15:57:04.220525 execve("/home/anna/opt/Scrivener/bin/Scrivener", ...

I am very sorry to add that you will not be able to compile to MMD with Scrivener for Linux at the moment and there is no way to make it work with the released Linux versions up to now( We have implemented a fix which will be available for download in the Linux forum within few weeks. Sorry about that!

I don’t speak for Lit & Lat, but this is not a feature in the Mac version, so I doubt it will be implemented in the Win/Linux version (which must maintain project compatibility). I haven’t found svn compatibility to be all that useful, as Scriv doesn’t svn add or svn delete files that I add or delete (and purge from the trash). Svn does have the capacity to track diffs in binary format files, so it can certainly do that with rtfd, if you insist on using it; you might even be able to use it outside of the Scrivener interface, though I’d experiment with that first before trying it with your actual writing.