<commit_before>.\"
.Dd December 20, 2007
.Dt MARKDOWN 3
.Os Mastodon
.Sh NAME
.Nm markdown
.Nd process Markdown documents
.Sh LIBRARY
Markdown 
.Pq libmarkdown , -lmarkdown
.Sh SYNOPSIS
.Fd #include <mkdio.h>
.Ft void*
.Fn mkd_in "FILE *input"
.Ft void*
.Fn mkd_string "char *string" "int size"
.Ft int
.Fn markdown "void *blob" "FILE *output" "int flags"
.Ft int
.Fn mkd_text "char *string" "int size" "FILE *output" "int flags"
.Sh DESCRIPTION
These functions
convert
.Em Markdown
documents and strings into HTML.
.Fn markdown
processes an entire document, while
.Fn mkd_text
processes a single string.
.Pp
The 
.Fn markdown
function expects to recieve a preprocessed text from the
.Fn mkd_in
or
.Fn mkd_string
functions, while
.Fn mkd_text
treats your input text as a single paragraph of markup.
.Pp
To process a file, you pass a FILE* to
.Fn mkd_in ,
and if it returns a nonzero value you pass that in to 
.Fn markdown ,
which then writes the converted document to the specified
.Em FILE* .
If your input has already been written into a string (generated
input or a file opened 
with 
.Xr mmap 2 )
you can feed that string to 
.Fn mkd_string
and pass its return value to
.Fn markdown.
.Pp
.Fn Markdown
and
.Fn mkd_text
accept the following flag values (or-ed together if needed)
to restrict how they process their input:
.Bl -tag -width MKD_NOIMAGE -compact
.It Ar MKD_NOIMAGE
Do not process `![]' and
remove
.Em \<img\>
tags from the output.
.It Ar MKD_NOLINKS
Do not process `[]' and remove
.Em \<a\>
tags from the output.
.It Ar MKD_NOPANTS
Do not do Smartypants-style mangling of quotes, dashes, or ellipses.
.El
.Sh RETURN VALUES
The functions
.Fn markdown
and
.Fn mkd_text
return 0 on success, 1 on failure.
The
.Fn mkd_in
and
.Fn mkd_string
functions return a compiled object blob on success, null on failure.
.Sh SEE ALSO
.Xr markdown 1 ,<commit_msg>Use the new **MMIOT** abstract type in the manpage instead of `void *blob`<commit_after>.\"
.Dd December 20, 2007
.Dt MARKDOWN 3
.Os Mastodon
.Sh NAME
.Nm markdown
.Nd process Markdown documents
.Sh LIBRARY
Markdown 
.Pq libmarkdown , -lmarkdown
.Sh SYNOPSIS
.Fd #include <mkdio.h>
.Ft void*
.Fn mkd_in "FILE *input"
.Ft void*
.Fn mkd_string "char *string" "int size"
.Ft int
.Fn markdown "MMIOT" "FILE *output" "int flags"
.Ft int
.Fn mkd_text "char *string" "int size" "FILE *output" "int flags"
.Sh DESCRIPTION
These functions
convert
.Em Markdown
documents and strings into HTML.
.Fn markdown
processes an entire document, while
.Fn mkd_text
processes a single string.
.Pp
The 
.Fn markdown
function expects to recieve a preprocessed text from the
.Fn mkd_in
or
.Fn mkd_string
functions, while
.Fn mkd_text
treats your input text as a single paragraph of markup.
.Pp
To process a file, you pass a FILE* to
.Fn mkd_in ,
and if it returns a nonzero value you pass that in to 
.Fn markdown ,
which then writes the converted document to the specified
.Em FILE* .
If your input has already been written into a string (generated
input or a file opened 
with 
.Xr mmap 2 )
you can feed that string to 
.Fn mkd_string
and pass its return value to
.Fn markdown.
.Pp
.Fn Markdown
and
.Fn mkd_text
accept the following flag values (or-ed together if needed)
to restrict how they process their input:
.Bl -tag -width MKD_NOIMAGE -compact
.It Ar MKD_NOIMAGE
Do not process `![]' and
remove
.Em \<img\>
tags from the output.
.It Ar MKD_NOLINKS
Do not process `[]' and remove
.Em \<a\>
tags from the output.
.It Ar MKD_NOPANTS
Do not do Smartypants-style mangling of quotes, dashes, or ellipses.
.El
.Sh RETURN VALUES
The functions
.Fn markdown
and
.Fn mkd_text
return 0 on success, 1 on failure.
The
.Fn mkd_in
and
.Fn mkd_string
functions return a MMIOT on success, null on failure.
.Sh SEE ALSO
.Xr markdown 1 ,
{'fraction_non_alphanumeric': 0.07649402390438247, 'fraction_numerical': 0.0058432934926958835, 'mean_word_length': 3.755050505050505, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2670883', 'n_tokens_mistral': 1385, 'n_tokens_neox': 1312, 'n_words': 617}