LOWDOWN_FILE(3)
π LOWDOWN_FILE(3) β the group chat edition π
okay bestie, gather round, because this is the lowdown_file page from the Library Functions Manual and it's literally about to become your new hyperfixation. it lives in the library liblowdown and it does one thing and it does it flawlessly: it parses a Markdown file into formatted output. slay. π
β¨ NAME β¨
lowdown_file β parse a Markdown file into formatted output π
π LIBRARY π
library liblowdown π¦
β¨ SYNOPSIS β¨
#include <sys/queue.h>
#include <stdio.h>
#include <lowdown.h>
int
lowdown_file(const struct lowdown_opts *opts, FILE *in, char **ret,
size_t *retsz, struct lowdown_metaq *metaq);
πΈ DESCRIPTION πΈ
so here's the tea β: this function parses a lowdown(5) file stream coming in through in, and it dumps the goods into an output buffer ret that's retsz big β all according to the configuration you handed it in opts. the output format? that's decided by opts->type, no cap. π
and listen β if LOWDOWN_METADATA is set inside opts->feat and metaq is not NULL, then metaq gets filled with metadata rendered in the given output format. iconic behaviour, honestly. β¨
π«Ά heads up bestie: on success, you are the one responsible for freeingretandmetaq. that's your child now. take care of it.
π RETURN VALUES π
returns zero on failure, non-zero on success. and on failure? the values pointed to by res and rsz are undefined β like, do not trust them, do not look at them, they are not your friends. π
π EXAMPLES π
okay so this next bit parses standard input into a standalone HTML5 document. it enables footnotes, autolinks, tables, superscript, strikethrough, fenced codeblocks, commonmark, definition lists, extended image attributes, and metadata processing. the output passes through raw HTML and has smart typography. it's giving main character energy fr fr.
struct lowdown_opts opts;
char *buf;
size_t bufsz;
memset(&opts, 0, sizeof(struct lowdown_opts));
opts.type = LOWDOWN_HTML;
opts.feat = LOWDOWN_FOOTNOTES |
LOWDOWN_AUTOLINK |
LOWDOWN_TABLES |
LOWDOWN_SUPER |
LOWDOWN_STRIKE |
LOWDOWN_FENCED |
LOWDOWN_COMMONMARK |
LOWDOWN_DEFLIST |
LOWDOWN_IMG_EXT |
LOWDOWN_METADATA;
opts.oflags = LOWDOWN_HTML_HEAD_IDS |
LOWDOWN_HTML_NUM_ENT |
LOWDOWN_HTML_OWASP |
LOWDOWN_SMARTY |
LOWDOWN_STANDALONE;
if (!lowdown_file(&opts, stdin, &buf, &bufsz, NULL))
errx(1, "lowdown_file");
fwrite(buf, 1, bufsz, stdout);
free(buf);
π SEE ALSO π
lowdown(3), lowdown_metaq_free(3) β go read them, they're the supporting cast and they ate. π
and that's the whole page, bestie!! this one shipped from Debian with the date stamp $Mdocdate$, and it's the LOWDOWN_FILE(3) page, periodt. π now go free your buffers. mwah. π§β¨
π¦ where this page comes from
- alpine 3.24: lowdown-doc 3.0.1-r0 Β· ISC
- arch rolling: lowdown 3.2.1-1 Β· ISC
- debian trixie: liblowdown-dev 2.0.2-2 Β· ISC
- fedora 43: lowdown-libs 2.0.2-2.fc43 Β· ISC AND BSD-3-Clause AND MIT
- fedora 43: lowdown-libs 2.0.2-2.fc43 Β· ISC AND BSD-3-Clause AND MIT
- fedora 44: lowdown-libs 2.0.2-3.fc44 Β· ISC AND BSD-3-Clause AND MIT
- fedora 44: lowdown-libs 2.0.2-3.fc44 Β· ISC AND BSD-3-Clause AND MIT
- nixpkgs unstable: lowdown 3.0.1
- nixpkgs unstable: lowdown-unsandboxed 3.0.1
- opensuse-leap 16.0: lowdown-devel 1.1.0+git20231119.1200b9f-bp160.1.13 Β· ISC
- opensuse-leap 16.0: lowdown-devel 1.1.0+git20231119.1200b9f-bp160.1.13 Β· ISC
- opensuse-leap 16.0: lowdown-devel 1.1.0+git20231119.1200b9f-bp160.1.13 Β· ISC
- opensuse-leap 16.0: lowdown-devel 1.1.0+git20231119.1200b9f-bp160.1.13 Β· ISC
- ubuntu noble: liblowdown-dev 1.1.0-1 Β· ISC
- ubuntu questing: liblowdown-dev 2.0.2-2
- ubuntu resolute: liblowdown-dev 2.0.4-2 Β· ISC
- ubuntu stonking: liblowdown-dev 3.0.1-1 Β· ISC
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms