MKD_LINE(3)
π MKD_LINE(3) β the girlies' guide to tiny markdown translations π
okay bestie, welcome to the manual page for mkd_line β it lives in section 3 (Library Functions Manual), so it's a C function situation, not a command you type into your shell. come sit with me π«Ά
β¨ NAME β¨
mkd_line β do Markdown translation of small items π
like. that's the whole vibe. small items. translated. slay.
π LIBRARY π
Markdown β the library is literally called libmarkdown, and you link against it with -lmarkdown. that's it, that's the tea π
π¦ SYNOPSIS π¦
so here's what you gotta put at the top of your file:
#include <mkdio.h>
and here are the two function signatures, verbatim, no edits, don't come for me:
int
mkd_line(char *string, int size, char **doc, int flags);
int
mkd_generateline(char *string, int size, FILE *output, int flags);
both return int, both take the same first two and last arguments, and they differ in the middle. iconic of them honestly πΈ
π DESCRIPTION π
okay so. sometimes you don't have a whole document. sometimes you just have a fragment. like the title of a weblog article, or a date, or a simple signature line. and you're sitting there like... bestie, can I still get markdown translation on this little scrap of text? π
and the answer is yes, because that is EXACTLY what mkd_line and mkd_generateline are for β they let you do markdown translations on small blocks of text. no cap. π§
the way they split the work is lowkey elegant:
mkd_lineβ allocates a buffer, then writes the translated text into that buffer. so it's giving you achar **docto point at the freshly allocated output. you get the buffer, it gets filled, everybody wins πmkd_generatelineβ writes the output to the specifiedFILE *outputinstead. no buffer allocation moment, it just streams straight to your file handle. main character energy π₯
both of them take your string, your size, and your flags. periodt. π
π SEE ALSO π
go read these too, they're all part of the extended universe:
and also, the original markdown syntax spec itself, hosted at:
http://daringfireball.net/projects/markdown/syntax
iykyk β
π BUGS π
Error handling is minimal at best.
like. genuinely minimal. at BEST. so please, for the love of everything, don't be out here trusting these functions to hold your hand when something goes wrong, because they will NOT. check your stuff yourself, bestie π
π a lil sign-off π
this page came from Mastodon and it's dated January 18, 2008 β so yes, this function is old enough to have its own vintage aesthetic and honestly? we respect the heritage ππ
that's the whole page. go translate your little fragments. mwah ππΈβ¨
π¦ where this page comes from
- arch rolling: discount 3.0.2.0-1 Β· BSD-3-Clause
- epel 10: discount 2.2.7-9.el10_0 Β· BSD
- epel 9: libmarkdown-devel 2.2.4-7.el9 Β· BSD
- fedora 43: discount 2.2.7-12.fc43 Β· LicenseRef-Callaway-BSD
- fedora 44: discount 2.2.7-14.fc44 Β· LicenseRef-Callaway-BSD
- opensuse-leap 16.0: libmarkdown-devel 3.0.0a-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: libmarkdown-devel 3.0.0a-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: libmarkdown-devel 3.0.0a-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: libmarkdown-devel 3.0.0a-160000.2.2 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms