Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

markdown(3) [debian man page]

MARKDOWN(3)						   BSD Library Functions Manual 					       MARKDOWN(3)

NAME
markdown -- process Markdown documents LIBRARY
Markdown (libmarkdown, -lmarkdown) SYNOPSIS
#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); DESCRIPTION
These functions convert Markdown documents and strings into HTML. markdown() processes an entire document, while mkd_text() processes a sin- gle 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 con- verted 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: 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. MKD_NO_EXT Don't allow pseudo-protocols. MKD_CDATA Generate code for xml ![CDATA[...]]. MKD_NOSUPERSCRIPT Don't generate superscripts. Emphasis happens _everywhere_ MKD_NOTABLES Disallow tables. MKD_NOSTRIKETHROUGH Forbid ~~strikethrough~~. MKD_TOC Do table-of-contents processing. MKD_1_COMPAT Compatibility with MarkdownTest_1.0 MKD_AUTOLINK Make http://foo.com into a link even without <> s. MKD_SAFELINK Paranoid check for link protocol. MKD_NOHEADER Don't process header blocks. MKD_TABSTOP Expand tabs to 4 spaces. MKD_NODIVQUOTE Forbid >%class% blocks. MKD_NOALPHALIST Forbid alphabetic lists. MKD_NODLIST Forbid definition lists. MKD_EXTRA_FOOTNOTE Enable markdown extra-style footnotes. RETURN VALUES
markdown() returns 0 on success, 1 on failure. The mkd_in() and mkd_string() functions return a MMIOT* on success, null on failure. SEE ALSO
markdown(1), mkd-callbacks(3), mkd-functions(3), mkd-line(3), markdown(7), mkd-extensions(7), mmap(2). http://daringfireball.net/projects/markdown/syntax BUGS
Error handling is minimal at best. The MMIOT created by mkd_string() is deleted by the markdown function. Mastodon December 20, 2007 Mastodon

Check Out this Related Man Page

MKD_CALLBACKS(3)					   BSD Library Functions Manual 					  MKD_CALLBACKS(3)

NAME
mkd_callbacks -- functions that modify link targets LIBRARY
Markdown (libmarkdown, -lmarkdown) SYNOPSIS
#include <mkdio.h> char* (*mkd_callback_t)(const char*, const int, void*); void (*mkd_free_t)(char *, void*); void mkd_e_url(MMIOT *document, mkd_callback_t edit); void mkd_e_flags(MMIOT *document, mkd_callback_t edit); void mkd_e_free(MMIOT *document, mkd_free_t dealloc); void mkd_e_data(MMIOT *document, void *data); DESCRIPTION
Discount provides a small set of data access functions to let a library user modify the targets given in a `[]' link, and to add additional flags to the generated link. The data access functions are passed a character pointer to the url being generated, the size of the url, and a data pointer pointing to a user data area (set by the mkd_e_data() function.) After the callback function is called (either mkd_e_url() or mkd_e_flags()) the data freeing function (if supplied) is called and passed the character pointer and user data pointer. EXAMPLE
The mkd_basename() function (in the module basename.c) is implemented by means of mkd callbacks; it modifies urls that start with a `/' so that they begin with a user-supplied url base by allocating a new string and filling it with the base + the url. Discount plugs that url in in place of the original, then calls the basename free function (it only does this when mkd_e_url() or mkd_e_flags() returns nonzero) to deallocate this memory. Note that only one level of callbacks are supported; if you wish to do multiple callbacks, you need to write your own code to handle them all. SEE ALSO
markdown(1), markdown(3), mkd-line(3), markdown(7), mkd-extensions(7), mmap(2). basename.c http://daringfireball.net/projects/markdown/syntax BUGS
Error handling is minimal at best. Mastodon January 18, 2008 Mastodon
Man Page