This plugin allows using Markdown syntax in Stog documents, by converting this syntax to XHTML, using the Omd library or by calling an external command.

Usage:

$ stog --package stog.markdown ...

The first version of this plugin was contributed by Gabriel Scherer.

Example

This plugin adds a new base rule <markdown>.

## A typical markdown example [Markdown](http://daringfireball.net/projects/markdown/) is a markup language meant to be written simply in a text editor, with a markup that is both easy to read and write. It is later translated into HTML by one of the numerous `markdown` implementations. ````ocaml let f x = x + 1;; ```` ]]>
<markdown>
## A typical markdown example

[Markdown](http://daringfireball.net/projects/markdown/) is
a markup language meant to be written simply in a text editor,
with a markup that is both easy to read and write. It is later
translated into HTML by one of the numerous `markdown`
implementations.

````ocaml
let f x = x + 1;;
````
 </markdown>

The <markdown> rule converts Markdown syntax to (X)HTML, which is then rewritten by the Stog engine like any other XML. Here is the result, embedded in a box:

A typical markdown example

Markdown is a markup language meant to be written simply in a text editor, with a markup that is both easy to read and write. It is later translated into HTML by one of the numerous markdown implementations.

let f x = x + 1;;
Command and arguments

The <markdown> rule handles attributes command and args.

The command attribute is used to specify an external command to run to convert Markdown to (X)HTML. The value of args attribute is added on the command line.

Here is an example of using pandoc command, using args attribute to make it translate our markdown code into XHTML:

## A typical markdown example [Markdown](http://daringfireball.net/projects/markdown/) is a markup language meant to be written simply in a text editor, with a markup that is both easy to read and write. It is later translated into HTML by one of the numerous `markdown` implementations. ````ocaml let f x = x + 1;; ```` ]]>
<markdown command="pandoc" args="-f markdown -t html">
## A typical markdown example

[Markdown](http://daringfireball.net/projects/markdown/) is
a markup language meant to be written simply in a text editor,
with a markup that is both easy to read and write. It is later
translated into HTML by one of the numerous `markdown`
implementations.

````ocaml
let f x = x + 1;;
````
</markdown>

Here is the result, embedded in a box:

A typical markdown example

Markdown is a markup language meant to be written simply in a text editor, with a markup that is both easy to read and write. It is later translated into HTML by one of the numerous markdown implementations.

let f x = x + 1;;