This project is now deprecated. Please use MultiMarkdown-5 instead!
C Makefile Shell Perl Batchfile
Permalink
Failed to load latest commit information.
MarkdownTest @ 0da341b Fix error in new link matching code; expand search tree for abbreviat… Oct 7, 2015
MultiMarkdown.xcodeproj add toc files to Xcode project (fixes #106) Apr 15, 2015
Support @ 685c95c update submodules Oct 11, 2013
cheat-sheet @ 199dae8 update submodules Jan 13, 2014
documentation @ 38c887e Fix error in new link matching code; expand search tree for abbreviat… Oct 7, 2015
greg @ 98ecf13 update greg Dec 10, 2014
mac_installer add Mac Installer support back May 22, 2013
scripts Manually import MatthiasLohr's improvements (from #138) Nov 12, 2015
windows_installer quote paths in Windows batch scripts May 21, 2014
.gitignore Update .gitignore for Dev-C++ development Dec 29, 2013
.gitmodules include documentation as a submodule Jan 5, 2014
GLibFacade.c add support for 'mmd header' metadata Jan 20, 2015
GLibFacade.h Update GLibFacade.h Mar 6, 2015
LICENSE Merge branch 'master' of github.com:fletcher/MultiMarkdown-4 Jan 17, 2015
Makefile incorporate Makefile tweak for OpenBSD from StAlphonsos (#105) Mar 31, 2015
README.md fix old links Nov 24, 2014
beamer.c Merge branch 'master' of github.com:fletcher/MultiMarkdown-4 Jan 17, 2015
beamer.h Initialize project May 10, 2013
critic.c update copyright Jan 17, 2015
critic.h Initialize project May 10, 2013
enumsToPerl.pl Initialize project May 10, 2013
glib.h Initialize project May 10, 2013
html.c reference labels should be case-insensitive (fixes #124) Aug 25, 2015
html.h Initialize project May 10, 2013
latex.c allow tables to exist inside footnotes in LaTeX Jun 23, 2015
latex.h Initialize project May 10, 2013
libMultiMarkdown.h Merge pull request #134 from danielpunkass/document-dangerous-exports Nov 12, 2015
lyx.c properly encode variables when including in the text output(fixes #120) Jun 9, 2015
lyx.h Merge crcowan's changes Aug 19, 2014
lyxbeamer.c Merge crcowan's changes Aug 19, 2014
lyxbeamer.h Add support for LyX export -- by Charles R. Cowan Dec 17, 2013
memoir.c Merge branch 'master' of github.com:fletcher/MultiMarkdown-4 Jan 17, 2015
memoir.h Initialize project May 10, 2013
multimarkdown.c improve wildcard transclusion when exporting to HTML May 13, 2015
odf.c don't insert newline after footnotes in ODF; (fixes #137) Nov 12, 2015
odf.h Initialize project May 10, 2013
opml.c Merge branch 'master' of github.com:fletcher/MultiMarkdown-4 Jan 17, 2015
opml.h Initialize project May 10, 2013
parse_utilities.c reference labels should be case-insensitive (fixes #124) Aug 25, 2015
parser.h reference labels should be case-insensitive (fixes #124) Aug 25, 2015
parser.leg fix single-line code blocks being treated as code fence type (fixes #129 Nov 12, 2015
rng.c use Knuth's random number generator for equivalence across platforms … Nov 23, 2013
rtf.c properly encode variables when including in the text output(fixes #120) Jun 9, 2015
rtf.h more RTF stuff Dec 29, 2013
strtok.c fix bug in public domain strtok_r Nov 19, 2013
strtok.h add strtok_r for Windows compiling Nov 17, 2013
text.c clarify that this is not meant for actual use at the moment May 13, 2015
text.h Initialize project May 10, 2013
toc.c support variables in headers for TOC May 2, 2015
toc.h add support for {{TOC}} Mar 3, 2015
transclude.c Quiet warning about implicit downcasting from long to int. It seems l… Sep 4, 2015
transclude.h add support for 'mmd header' metadata Jan 20, 2015
writer.c fix memory leak Nov 11, 2015
writer.h add support for {{TOC}} Mar 3, 2015

README.md

Title: MultiMarkdown 4 ReadMe
Author: Fletcher T. Penney
Base Header Level: 2

Introduction

Markdown is a simple markup language used to convert plain text into HTML.

MultiMarkdown is a derivative of Markdown that adds new syntax features, such as footnotes, tables, and metadata. Additionally, it offers mechanisms to convert plain text into LaTeX in addition to HTML.

Background

MultiMarkdown started as a Perl script, which was modified from the original Markdown.pl.

MultiMarkdown v3 (aka 'peg-multimarkdown') was based on John MacFarlane's peg-markdown. It used a parsing expression grammar (PEG), and was written in C in order to compile on almost any operating system. Thanks to work by Daniel Jalkut, MMD v3 was built so that it didn't have any external library requirements.

MultiMarkdown v4 is basically a complete rewrite of v3. It uses the same basic PEG for parsing (Multi)Markdown text, but otherwise is almost completely rebuilt:

  • The code is designed to be easier to maintain --- it's divided into separate files on a more logical structure
  • All memory leaks (to my knowledge) have been fixed
  • greg is used instead of peg/leg to create the parser --- this allows the parser to be thread-safe
  • The test suite has been modified to account for several improvements. MMD should fail one of the basic Markdown tests (see peg-markdown for more information).
  • Command line options are slightly different.

Installation

You can compile for yourself, or download a precompiled binary from the downloads page.

  • Download the source from the github web site using git
  • git submodule init and then git submodule update to download greg and the test suite
  • Run make to compile.
  • Run make test-all | less to verify that the build is correct. As mentioned, one of the tests is expected to fail; the rest should pass on all systems.
  • Run sudo make install and (optionally) sudo make install-scripts to install multimarkdown and the helper scripts.

Usage

Once installed, you simply do something like the following:

  • multimarkdown file.txt --- process text into HTML.

  • multimarkdown -c file.txt --- use a compatibility mode that emulates the original Markdown.

  • multimarkdown -t latex file.txt --- output the results as LaTeX instead of HTML. This can then be processed into a PDF if you have LaTeX installed. You can further specify the LaTeX Mode metadata to customize output for compatibility with memoir or beamer classes.

  • multimarkdown -t odf file.txt --- output the results as an OpenDocument Text Flat XML file. Does require the plugin be installed in your copy of OpenOffice, which is available at the peg-multimarkdown-downloads page. LibreOffice includes this plugin by default.

  • multimarkdown -t opml file.txt --- convert the MMD text file to an MMD OPML file, compatible with OmniOutliner and certain other outlining and mind-mapping programs (including iThoughts and iThoughtsHD).

  • multimarkdown -h --- display help and additional options.

  • multimarkdown -b *.txt --- -b or --batch mode can process multiple files at once, converting file.txt to file.html or file.tex as directed. Using this feature, you can convert a directory of MultiMarkdown text files into HTML files, or LaTeX files with a single command without having to specify the output files manually. CAUTION: This will overwrite existing files with the html or tex extension, so use with caution.

Notes

If you get an error that greg fails to build try touch greg/greg.c. I had an issue where the timestamp on that file might have been too old, which caused the build to fail.

LyX Support

Charles R. Cowan (https://github.com/crcowan) added support for conversion to LyX. Support for this should be considered to be in alpha/beta, and is not guaranteed. Issues related to LyX can be added to the MultiMarkdown issues page on github, but will need to be answered by Charles. I am happy to include this code in the main MMD repo, but since I don't use LyX I can't support it myself. If this arrangement becomes a problem, then LyX support can be removed and it can be kept as a separate fork.

More Information

To get more information about MultiMarkdown, check out the website or User's Guide.