MKD_LINE(3)

πŸ“¦
version 3.0.2.0 Β· 2 versions
, in arch rolling, epel 10, epel 9, fedora 43, fedora 44, opensuse-leap 16.0

πŸ’– 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 a char **doc to point at the freshly allocated output. you get the buffer, it gets filled, everybody wins πŸ’–
  • mkd_generateline β€” writes the output to the specified FILE *output instead. 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 πŸ’–πŸŒΈβœ¨