Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
MARKDOWN(3)	       FreeBSD 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
     single string.

     To	process	a file,	you pass a FILE* to mkd_in(), and if it	returns	a non-
     zero 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 to put inside an	html tag (ID=, NAME=,
			  <title>, &tc); no _em_, no _bold_, no	html or	[] ex-
			  pansion.
     MKD_NO_EXT		  Don't	allow pseudo-protocols.
     MKD_CDATA		  Generate code	for xml	![CDATA[...]].
     MKD_NOSUPERSCRIPT	  Don't	generate superscripts.	Emphasis happens _ev-
			  erywhere_
     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_NODLDISCOUNT	  Disable the discount definition list syntax style.
     MKD_DLEXTRA	  Enable the extra definition list syntax style.
     MKD_EXTRA_FOOTNOTE	  Enable markdown extra-style footnotes.
     MKD_NOSTYLE	  Do not extract (omit)	<style/> blocks	from the out-
			  put.
     MKD_FENCEDCODE	  Allow	fenced code blocks.
     MKD_IDANCHOR	  Use id= anchors instead of <a	name=/>	for table-of-
			  contents links.
     MKD_GITHUBTAGS	  Allow	underscore and dash in passed through element
			  names.
     MKD_URLENCODEDANCHOR
			  Use html5 encoding for multibyte and nonalphanumeric
			  characters rather than hex expansion in toc links.

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

NAME | LIBRARY | SYNOPSIS | DESCRIPTION | RETURN VALUES | SEE ALSO | BUGS

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=markdown&sektion=3&manpath=FreeBSD+13.0-RELEASE+and+Ports>

home | help