cmark(1)
π cmark(1) β the General Commands Manual, but make it cute π
okay bestie, sit down, hydrate, and let me tell you about cmark β it's the Unix manual page for cmark, and it's lowkey one of the most useful little tools you'll ever meet. no cap.
β¨ NAME β¨
cmark β convert CommonMark formatted text to HTML π¦
β¨ SYNOPSIS β¨
cmark [options] file*
like, that's it. that's the whole vibe. you give it options, you give it files, it does its thing. π
β¨ DESCRIPTION β¨
okay so here's the tea π: cmark takes Markdown formatted plain text and converts it into HTML, groff man, CommonMark XML, LaTeX, or CommonMark β using the conventions described in the CommonMark spec. it's giving "one tool, five glow-ups."
where does it get its input? either from stdin, or from the files you list (and if you list more than one, bestie, it concatenates their contents β yes, mashes them together). and where does the output go? straight to stdout. iconic behavior. π
β¨ OPTIONS β¨
--to,-tFORMAT β pick your output format, queen. the options arehtml,man,xml,latex,commonmark. choose your fighter. π--widthWIDTH β sets the column width that the output wraps at. want no wrapping at all? use the value0β and guess what, that's the default anyway. ngl, this option currently only does anything for thecommonmark,latex, andmanrenderers. the others are just standing there. π--hardbreaksβ renders soft breaks (those newlines inside paragraphs in the CommonMark source) as hard line breaks in the target format. β οΈ heads up though: if you use this, hard wrapping gets disabled for CommonMark output, no matter what value you handed to--width. it's a package deal, babe.--nobreaksβ renders soft breaks as spaces instead. and yeah, if you specify this one, hard wrapping is disabled for all output formats, regardless of whatever you gave--width. she said "no wrapping, periodt." π«--sourceposβ include the source position attribute. tracking where everything came from. very main character energy. π--validate-utf8β validates UTF-8, and replaces any illegal sequences withU+FFFD. cleaning up the mess fr fr. π§--smartβ turns on smart punctuation β¨:- straight double and single quotes get rendered as curly quotes, depending on where they sit
--becomes an en-dash---becomes an em-dash...becomes ellipses
--safeβ omits raw HTML and potentially dangerous URLs. this is the default, bestie, so it's already protecting you. raw HTML gets replaced by a placeholder comment, and potentially dangerous URLs get replaced by empty strings. which URLs are "potentially dangerous"? the ones that begin withjavascript:,vbscript:,file:, ordata:β EXCEPT forimage/png,image/gif,image/jpeg, orimage/webpmime types, those are fine. π‘οΈ--unsafeβ renders raw HTML and potentially dangerous URLs, overriding the default (--safe) behavior. > β οΈ bestie be careful, this is literally the "turn off the safety rails" button. know what you're doing before you press it. π₯--helpβ prints usage information. when in doubt, ask for help. we love a self-aware icon. π«Ά--versionβ prints the version. gotta know what you're working with. π
β¨ AUTHORS β¨
the legends themselves: John MacFarlane, Vicent Marti, KΔrlis GaΕΔ£is, Nick Wellnhofer. ππππ
β¨ SEE ALSO β¨
the CommonMark spec: https://spec.commonmark.org β go read it, iykyk, it's the source of truth and it ate. πβ¨
and that's the whole page, bestie!! this one lives in the LOCAL section, dated February 11, 2020, and it's the cmark(1) manual β so if you ever forget how to convert your markdown, you know exactly where to look. mwah. πππ¦πΈ
π¦ where this page comes from
- alpine 3.24: cmark-doc 0.31.2-r0 Β· BSD-2-Clause
- arch rolling: cmark 0.31.2-1 Β· BSD-2-Clause
- epel 10: cmark 0.30.3-5.el10_0 Β· BSD-2-Clause AND MIT
- fedora 43: cmark 0.30.3-8.fc43 Β· BSD-2-Clause AND MIT
- fedora 43: cmark 0.30.3-8.fc43 Β· BSD-2-Clause AND MIT
- fedora 44: cmark 0.31.1-3.fc44 Β· BSD-2-Clause AND MIT
- fedora 44: cmark 0.31.1-3.fc44 Β· BSD-2-Clause AND MIT
- nixos 26.05: cmark 0.31.1
- nixpkgs unstable: cmark 0.31.2
- opensuse-leap 16.0: cmark 0.31.0-160000.2.2 Β· BSD-2-Clause AND MIT AND CC-BY-SA-4.0
- opensuse-leap 16.0: cmark 0.31.0-160000.2.2 Β· BSD-2-Clause AND MIT AND CC-BY-SA-4.0
- opensuse-leap 16.0: cmark 0.31.0-160000.2.2 Β· BSD-2-Clause AND MIT AND CC-BY-SA-4.0
- opensuse-leap 16.0: cmark 0.31.0-160000.2.2 Β· BSD-2-Clause AND MIT AND CC-BY-SA-4.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms