Section: C Library Functions (3)Local indexUp BSD mandoc
Mastodon
NAME
markdown
- process Markdown documents
LIBRARY
Markdown
(libmarkdown , -lmarkdown)
SYNOPSIS
Fd #include <mkdio.h>
Ft MMIOT
Fn *mkd_in FILE *input int flags
Ft MMIOT
Fn *mkd_string char *string int size int flags
Ft int
Fn markdown MMIOT *doc FILE *output int flags
DESCRIPTION
These functions
convert
Markdown
documents and strings into HTML.
Fn markdown
processes an entire document, while
Fn mkd_text
processes a single string.
To process a file, you pass a FILE* to
Fn mkd_in ,
and if it returns a nonzero value you pass that in to
Fn 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
Fn mkd_string
and pass its return value to
Fn markdown.
Fn Markdown
accepts the following flag values (or-ed together if needed)
to restrict how it processes input:
MKD_NOLINKS
Don't do link processing, block
<a>
tags.
MKD_NOIMAGE
Don't do image processing, block
<img>
MKD_NOPANTS
Don't run
smartypants()
MKD_NOHTML
Don't allow raw html through AT ALL
MKD_STRICT
Disable
superscript and relaxed emphasis.
MKD_TAGTEXT
Process text inside an html tag; no
<em>
no
<bold>
no html or
[]
expansion.