![]() |
![]()
| ![]() |
![]()
NAME
LIBRARYlibrary “liblowdown” SYNOPSIS
struct lowdown_node *
DESCRIPTIONParse a
lowdown(5)
document input of length inputsz
into an AST with the parser doc. The
maxn argument, if not If metaq is not
This function may be invoked multiple times with a single doc and different input. RETURN VALUESReturns the root of the parse tree or EXAMPLESThe following parses b of length bsz. It first allocates the parser, then the document, then the renderer (HTML is used in this case). Then it passes output to the renderer, prints it, and cleans up resources. On any memory errors, it exits with err(3). struct lowdown_doc *doc; struct lowdown_node *n; struct lowdown_buf *ob; void *rndr; if ((doc = lowdown_doc_new(NULL)) == NULL) err(1, NULL); if ((n = lowdown_doc_parse(doc, NULL, b, bsz, NULL)) == NULL) err(1, NULL); if ((rndr = lowdown_html_new(NULL)) == NULL) err(1, NULL); if ((ob = lowdown_buf_new(1024)) == NULL) err(1, NULL); if (!lowdown_html_rndr(ob, rndr, n)) err(1, NULL); fwrite(stdout, 1, ob->size, ob->data); lowdown_buf_free(ob); lowdown_html_rndr_free(rndr); lowdown_node_free(n); lowdown_doc_free(doc); SEE ALSO
|