MARKDOWN(3) | Library Functions Manual | MARKDOWN(3) |
markdown
— process
Markdown documents
Markdown (libmarkdown, -lmarkdown)
#include
<mkdio.h>
MMIOT
*mkd_in
(FILE
*input, int
flags);
MMIOT
*mkd_string
(char
*string, int size,
int flags);
int
markdown
(MMIOT
*doc, FILE *output,
int flags);
These functions convert Markdown documents and
strings into HTML.
markdown
()
processes an entire document, while
mkd_text
()
processes a single string.
To process a file, you pass a FILE* to
mkd_in
(),
and if it returns a nonzero value you pass that in to
markdown
(), which then writes the converted document
to the specified
FILE*.
If your input has already been written into a string (generated input or a
file opened with mmap(2)) you can feed that string to
mkd_string
()
and pass its return value to
markdown.
()
Markdown
()
accepts the following flag values (or-ed together if needed) to restrict how
it processes input:
markdown
() returns 0 on success, 1 on
failure. The mkd_in
() and
mkd_string
() functions return a MMIOT* on success,
null on failure.
markdown(1), mkd-callbacks(3), mkd-functions(3), mkd-line(3), markdown(7), mkd-extensions(7), mmap(2).
http://daringfireball.net/projects/markdown/syntax
Error handling is minimal at best.
The MMIOT created by
mkd_string
() is deleted by the
markdown
function.
December 20, 2007 | Mastodon |