cmark(1)

πŸ“¦
version 0.31.2 Β· 3 versions
, in alpine 3.24, arch rolling, epel 10, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0

πŸ’– 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, -t FORMAT β€” pick your output format, queen. the options are html, man, xml, latex, commonmark. choose your fighter. 🌈
  • --width WIDTH β€” sets the column width that the output wraps at. want no wrapping at all? use the value 0 β€” and guess what, that's the default anyway. ngl, this option currently only does anything for the commonmark, latex, and man renderers. 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 with U+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 with javascript:, vbscript:, file:, or data: β€” EXCEPT for image/png, image/gif, image/jpeg, or image/webp mime 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