Pre-process markdown code blocks with external tools to produce html. Because we want to do everything with markdown right?
npm install exemd
> [object Object]
``bash`
npm i -g exemd
`
Usage:
exemd list
exemd FILE [ -r | --raw ] [ -g | --force-png ] [ -p | --pdf ]
exemd -h | --help
Options:
-g, --force-png Generate html+png(inline). Default is html+svg(inline).
-r, --raw Generate md+png(inline).
-p, --pdf Generate md+pdf(external). Output can be used by pandoc to generate pdf docs.
-h, --help
Commands:
list List available plugins
Arguments:
FILE markdown file name.
`
What is it
----------
It is a markdown pre-processor that runs code inside code blocks, by
pasting the output back into the original document. Regarding output:
- The default output is HTML+SVG while option -g forces HTML+PNG.
- If you need markdown, use -r for Markdown+PNG. If you need-p
Markdown+PDF (compatible with pdf generation in pandoc), use .
News
----
As of March 2015, I am rewriting the documentation of the plugins. Stay
tuned for other updates.
Available plugins:
------------------
To see the list of currently available plugins and links to the docs,
type:
` {.bash}`
> exemd list
If you are on NPM.js, look
here for more examples.
Syntax
------
Each Markdown code block should begin with the language specifier
followed by a bang (!) between brackets {}, e.g., if you have a
diagram in the dot language:
`{dot !}
digraph {
a -> b[label="0.2",weight="0.2"];
a -> c[label="0.4",weight="0.4"];
c -> b[label="0.6",weight="0.6"];
c -> e[label="0.6",weight="0.6"];
e -> e[label="0.1",weight="0.1"];
e -> b[label="0.7",weight="0.7"];
}
`
exemd will invoke the exemd-dot plugin (which should be installeddot
separately). The plugin will parse the block code by invoking the actual executable and the parsed svg will be pasted into the final
markdown (or html).
Depending on the plugin, you can also pass parameters (just as in
org-mode)
`{plugin-name ! plugin parameters string}
`
Plugins
-------
This section is obsolete, wait for the new documentation that should arrive soon.
Look for npm modules prefixed with exemd. I wrote only exemd-dot andexemd-ditaa for diagrams. Feel free to provide plugins for R (likekintr) or other languages.
Each plugin should export a process(block, opts) function, where:
- block is the string representing the inner part of the block codeopts
- is an object with the following properties:
- tmpdir an already setup temporary directory where the pluginparams
can mess around but not delete.
- the string following the bang (!) in the blocktarget-mode
declaration
- it can be either html, pdf, or raw
The process` function should return the markdown text to replace the
original block either directly or through a promise.
* Vittorio Zaccaria
*
_This file was generated by verb-cli on March 20, 2015._