LOWDOWN_HTML_NEW(3)
hey bestie π
welcome to LOWDOWN_HTML_NEW(3) β the liblowdown Library Functions Manual page thatβs all about allocating your very own Markdown HTML renderer β¨
π NAME π
lowdown_html_new β allocate a Markdown HTML renderer, bestie π
π LIBRARY π
library βliblowdownβ β thatβs the squad π«Ά
β¨ SYNOPSIS β¨
#include <sys/queue.h>
#include <stdio.h>
#include <lowdown.h>
void *
lowdown_html_new(const struct lowdown_opts *opts);
πΈ DESCRIPTION πΈ
okay so lowdown_html_new allocates an HTML5 renderer using opts->flags, or zero if opts is NULL. that opts->flags field has its whole own explanation in lowdown(3), iykyk π
the returned pointer is reusable: you can use it with multiple invocations of lowdown_html_rndr(3), and you must free it with lowdown_html_free(3). no leaking, bestie ππ
the bits recognised in opts->oflags are literally these exact ones:
LOWDOWN_HTML_HTML_CUSTOM_ATTRSLOWDOWN_HTML_OWASPLOWDOWN_HTML_NUM_ENTLOWDOWN_HTML_HEAD_IDSLOWDOWN_HTML_HARD_WRAPLOWDOWN_SKIP_HTMLLOWDOWN_HTML_ESCAPELOWDOWN_HTML_CALLOUT_MDNLOWDOWN_HTML_CALLOUT_GFMLOWDOWN_STANDALONE
π₯ RETURN VALUES π₯
returns a pointer to the renderer or NULL on memory failure. the returned pointer must be freed with lowdown_html_free(3) β yes, again, free it, bestie π
π¦ EXAMPLES π¦
the following parses b of length bsz and outputs in HTML format. iconic pipeline behavior:
struct lowdown_buf *out;
struct lowdown_doc *doc;
struct lowdown_node *n;
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 ((out = lowdown_buf_new(256)) == NULL)
err(1, NULL);
if ((rndr = lowdown_html_new(NULL)) == NULL)
err(1, NULL);
if (!lowdown_html_rndr(out, rndr, n))
err(1, NULL);
fwrite(out->data, 1, out->size, stdout);
lowdown_html_free(rndr);
lowdown_buf_free(out);
lowdown_node_free(n);
lowdown_doc_free(doc);
π SEE ALSO π
lowdown(3), lowdown_html_free(3), lowdown_html_rndr(3) β go read those too, bestie π«Ά
π STANDARDS π
the referenced HTML5 standard is HTML5.2: https://www.w3.org/TR/html52. output is compatible with prior HTML5 standards. periodt π
okay thatβs the whole page, bestie π«Ά source/version vibes: Debian; date: $Mdocdate$; title: LOWDOWN_HTML_NEW(3). mwah πβ¨
π¦ where this page comes from
- arch rolling: lowdown 3.2.1-1 Β· ISC
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms