MARKDOWN2(1)
πΈ markdown2 β the manual page, but make it cute β¨
okay bestie, welcome to the markdown2 man page π this is from User Commands, it lives in section 1 of the manual (that's the (1) bestie, that's the whole vibe), and it is literally the command that turns your markdown into HTML. no cap.
π NAME π
markdown2 β the Command to convert a markdown file to HTML. that's it. that's the job. she does one thing and she ATE π
β¨ SYNOPSIS β¨
markdown2 [PATHS...]
give her some PATHS... and she'll go off. periodt.
π¦ DESCRIPTION π¦
okay so. markdown2 is a fast and complete Python implementation of Markdown β aka a text-to-HTML conversion tool for web writers. she's giving main character energy, she's thorough, she's quick, she's iconic. π
Now the tea β β here are the supported extra syntax options. (peep the -x|--extras option down in OPTIONS, and peep <https://github.com/trentm/python-markdown2/wiki/Extras> for the full details, iykyk):
code-friendlyβ Disable_and__for em and strong. bye bye italics, we're being literal now πcuddled-listsβ Allow lists to be cuddled to the preceding paragraph. so cozy. so close. let them snuggle π«Άfenced-code-blocksβ Allows a code block to not have to be indented by fencing it with'```'on a line before and after. Based on <http://github.github.com/github-flavored-markdown/> with support for syntax highlighting. no indentation required, she's β¨flexibleβ¨footnotesβ Support footnotes as in use on daringfireball.net and implemented in other Markdown processors (tho not in Markdown.pl v1.0.1). the little numbers at the bottom?? yes queen πheader-idsβ Adds "id" attributes to headers. The id value is a slug of the header text. every header gets a lil name tag π·οΈhighlightjs-langβ Allows specifying the language which used for syntax highlighting when using fenced-code-blocks and highlightjs. tell her which language so she can glow it up βhtml-classesβ Takes a dict mapping html tag names (lowercase) to a string to use for a "class" tag attribute. Currently only supports "img", "table", "pre" and "code" tags. Add an issue if you require this for other tags. just those four bestie, don't come for her πlink-patternsβ Auto-link given regex patterns in text (e.g. bug number references, revision number references). regex girlies rise up π₯markdown-in-htmlβ Allow the use of`markdown="1"`in a block HTML tag to have markdown processing be done on its contents. Similar to <http://michelf.com/projects/php-markdown/extra/#markdown-attr> but with some limitations. (yes, limitations, noted, read the wiki babe π)metadataβ Extract metadata from a leading'---'-fenced block. See <https://github.com/trentm/python-markdown2/issues/77> for details. front matter stans, this one's for you πnofollowβ Add`rel="nofollow"`to add<a>tags with an href. See <http://en.wikipedia.org/wiki/Nofollow>. SEO girlies, she's got you π§numberingβ Support of generic counters. Non standard extension to allow sequential numbering of figures, tables, equations, exhibits etc. she counts things now. non standard, but she's doing it anyway πpyshellβ Treats unindented Python interactive shell sessions as<code>blocks.>>>girlies we see you πsmarty-pantsβ Replaces'and"with curly quotation marks or curly apostrophes. Replaces--,---,..., and. . .with en dashes, em dashes, and ellipses. she's making your punctuation FANCY, no cap β¨spoilerβ A special kind of blockquote commonly hidden behind a click on SO. Syntax per <http://meta.stackexchange.com/a/72878>. click to reveal, the drama of it all πstrikeβ text inside of double tilde is~~strikethrough~~. striking it out like a text message you almost sent πtag-friendlyβ Requires atx style headers to have a space between the#and the header text. Useful for applications that require twitter style tags to pass through the parser. space it out bestie, the#hashtagsneed to survive πΈtablesβ Tables using the same format as GFM <https://help.github.com/articles/github-flavored-markdown#tables> and PHP-Markdown Extra <https://michelf.ca/projects/php-markdown/extra/#table>. tables!! the people's format!! πtocβ The returned HTML string gets a new "toc_html" attribute which is a Table of Contents for the document. (experimental) β she's experimental, she's growing, be nice π¦use-file-varsβ Look for an Emacs-style markdown-extras file variable to turn on Extras. emacs besties, she remembered you π«Άwiki-tablesβ Google Code Wiki-style tables. See <http://code.google.com/p/support/wiki/WikiSyntax#Tables>. another table format because one is never enough πxmlβ Passes one-liner processing instructions and namespaced XML tags. xml girlies, she sees you, she passes you through π
π OPTIONS π
one bullet per flag, no skipping, we do not leave anyone out in this group chat π
--versionβ show program's version number and exit. know your queen's version, it's the bare minimum β¨-h,--helpβ show this help message and exit. lost? confused? just ask her π-v,--verboseβ more verbose output. she will tell you EVERYTHING. every detail. she's a yapper and we love her for it π--encoding=ENCODINGβ specify encoding of text content. tell her what encoding your text is in, she's not a mind reader π§--html4tagsβ use HTML 4 style for empty element tags. retro. vintage. nostalgic. HTML 4 era π-s MODE,--safe=MODEβ sanitize literal HTML:'escape'escapes HTML meta chars,'replace'replaces with an[HTML_REMOVED]note. safety first bestie, especially if the HTML is sketchy π¨-x EXTRAS,--extras=EXTRASβ Turn on specific extra features (not part of the core Markdown spec). See above. π that big list up there? this is how you turn them on--use-file-vars=USE_FILE_VARSβ Look for and use Emacs-style'markdown-extras'file var to turn on extras. See <https://github.com/trentm/pythonmarkdown2/wiki/Extras> π--link-patterns-file=LINK_PATTERNS_FILEβ path to a link pattern file. point her at the file, she does the rest π--self-testβ run internal self-tests (some doctests). she checks herself before she wrecks herself π--compareβ run against Markdown.pl as well (for testing). a little friendly competition, for science π
β οΈ heads up bestie: a couple of these extras are marked as non standard (numbering), experimental (toc), or come with stated limitations (markdown-in-html). that's straight from the source, don't shoot the messenger π
π SEE ALSO π
okay so she didn't put a formal SEE ALSO section in here, but the links she dropped are basically it β go read the Extras wiki at <https://github.com/trentm/python-markdown2/wiki/Extras> for the full lore, and check the markdown-in-html and tables links up above for the deep cuts. iykyk π
π«Ά the sign-off π«Ά
this whole thing is markdown2 2.3.7, dated December 2018 β that's the source and the version and the date, all wrapped up in a little bow π she's been serving since 2018 and she's still that girl. slay, periodt, no cap πβ¨
π¦ where this page comes from
- debian bookworm: python3-markdown2 2.4.1-1 Β· MIT
- debian trixie: python3-markdown2 2.4.11-1 Β· MIT
- ubuntu jammy: python3-markdown2 2.4.1-1 Β· MIT
- ubuntu noble: python3-markdown2 2.4.11-1 Β· MIT
- ubuntu questing: python3-markdown2 2.4.11-1
- ubuntu resolute: python3-markdown2 2.5.4-3 Β· MIT
- ubuntu stonking: python3-markdown2 2.5.4-3 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms