KRAMDOWN(1)
โจ KRAMDOWN(1) โจ
okay bestie, come sit, we're doing this ๐ this is the manual page for kramdown, and honestly? it's giving main character energy. everything you'd ever need is in here and we are reading all of it, no skipping, no "tl;dr", we're doing this together ๐ซถ
๐ธ NAME ๐ธ
kramdown โ a fast, pure-Ruby Markdown-superset converter โจ
๐ฆ SYNOPSIS ๐ฆ
kramdown [options] [FILE...]
๐ DESCRIPTION ๐
so, kramdown's whole thing โ its literal purpose, its โจraison d'รชtreโจ โ is parsing a superset of Markdown and converting it into different output formats. It's got standard Markdown in there (with a few minor modifications, ngl), plus a whole bunch of extensions like tables and definition lists. And because its architecture is modular โ we love a modular queen โ it can also take in input formats that aren't Markdown at all, for example HTML or Github Flavored Markdown. versatile icon ๐
If you don't hand it a FILE, kramdown just reads from the standard input. And the result? Goes straight to standard output. easy peasy, no notes.
There are two sets of options that kramdown accepts:
- the first one is the options used directly by the
kramdownbinary ๐ซก - the second set controls how kramdown parses and converts its input ๐
Default values for that second set? You can set them with YAML, via the configuration file kramdownrc. but okay, listen, some things you need to know, fr fr:
- configuration option names use underscores, not dashes โ dashes are only a thing in the CLI option names
- boolean options don't have a "no" variant ๐ซ โ they just take a value of
trueorfalse - this file has to live in
XDG_CONFIG_HOMEon Linux/Unix,~/Library/Preferenceson macOS, and~/AppData/Localon Windows.
๐ CLI-ONLY OPTIONS ๐
these are the ones handled by the binary itself, no cap:
-i FORMAT,--input FORMATโ pick your input format ๐ available input formats:kramdown(this is the default, bestie),markdown, orhtml. And the input formatGFM? That one's available through thekramdown-parser-gfmgem โจ-o FORMAT,--output FORMATโ pick one or more output formats, separated by commas:html(default ๐ฅ),kramdown,latex,man, orremove_html_tags. The converterpdfis available through thekramdown-converter-pdfgem.-x EXT,--extension EXTโ load one or more extensions ๐ the name of the extension should not include thekramdown-prefix โ like, justparser-gfm, okay? You can load multiple extensions by separating them with commas.
โ ๏ธ Note: this option has to be used before any other options that rely on the extension already being loaded. order matters bestie, it's giving โจsequenceโจ
--no-config-fileโ do not read any configuration file ๐ the default behavior is to check for a configuration file and read it if it exists.--config-file FILEโ override the default path and name of the configuration file ๐-v,--versionโ show the version of kramdown ๐-h,--helpโ show the help ๐
๐ KRAMDOWN OPTIONS ๐
this is the big one. strap in. every single one of these controls how kramdown parses and converts its input ๐
--auto-id-prefix ARGโ prefix used for automatically generated header IDs ๐ท๏ธ this lets you set a prefix on the auto-generated header IDs so there's no conflict when you render multiple kramdown documents into one output file separately. The prefix should only contain characters that are valid in an ID!
Default: โโ โ Used by: HTML/Latex converter
--[no-]auto-id-strippingโ strip all formatting from header text for automatic ID generation โ๏ธ if this istrue, only the text elements of a header get used for generating the ID later (in contrast to just using the raw header text line).
๐ heads up: this option will be removed in version 2.0 because this will be the default then.
Default: false โ Used by: kramdown parser
--[no-]auto-idsโ use automatic header ID generation ๐ if this istrue, ID values for all headers are automatically generated whenever no ID is explicitly specified.
Default: true โ Used by: HTML/Latex converter
--entity-output ARGโ defines how entities are output ๐ญ the possible values are::as_inputโ entities are output in the same form as found in the input:numericโ entities are output in numeric form:symbolicโ entities are output in symbolic form if possible:as_charโ entities are output as characters if possible, only available on Ruby 1.9
Default: :as_char โ Used by: HTML converter, kramdown converter
--footnote-backlink ARGโ defines the text that should be used for the footnote backlinks ๐ the footnote backlink is just text, so any special HTML characters will be escaped. and if that backlink text is an empty string, no footnote backlinks will be generated at all ๐ซ
Default: '&8617;' โ Used by: HTML converter
--[no-]footnote-backlink-inlineโ specifies whether the footnote backlink should always be inline ๐ with the default offalse, the footnote backlink gets placed at the end of the last paragraph if there is one, or else an extra paragraph with only the footnote backlink is created. Setting this option totruetries to place the footnote backlink in the last, possibly nested, paragraph or header. If that fails (e.g. in the case of a table), an extra paragraph with only the footnote backlink is created anyway.
Default: false โ Used by: HTML converter
--footnote-link-text ARGโ the text used for the footnote number in a footnote link ๐ข this one lets you add extra text to the footnote link. It should be a format string, and it's passed the footnote number as the only argument to that format string. e.g.[footnote %s]would display as[footnote 1]โจ
Default: โ%sโ โ Used by: HTML
--footnote-nr ARGโ the number of the first footnote ๐ฅ lets you specify the number used for the first footnote.
Default: 1 โ Used by: HTML converter
--footnote-prefix ARGโ prefix used for footnote IDs ๐ท๏ธ super handy when you're rendering multiple documents into the same output file and you want to avoid duplicate IDs. and yeah โ the prefix should only contain characters that are valid in an ID!
Default: โโ โ Used by: HTML
--forbidden-inline-options ARGโ defines the options that may not be set using the{::options}extension ๐ the value needs to be an array of option names.
Default: [template] โ Used by: HTML converter
--[no-]header-linksโ adds anchor tags within headers that can be used to generate permalinks when you're not using a table of contents ๐ the anchor tags are empty, but you can style them to your liking ๐
Default: false
--header-offset ARGโ sets the output offset for headers ๐ if this option isc(it may also be negative), then a header with levelnwill be output as a header with levelc+n. Ifc+nis lower than1, level1will be used. Ifc+nis greater than6, level6will be used. math, but make it slay ๐งฎ
Default: 0 โ Used by: HTML converter, Kramdown converter, Latex converter
--[no-]html-to-nativeโ convert HTML elements to native elements ๐ if this istrue, the parser converts HTML elements to native elements. For example, when parsing<em>hallo</em>the emphasis tag would normally be converted to an:htmlelement with tag type:em. But ifhtml_to_nativeistrue, then the emphasis would be converted to a native:emelement instead. super useful for converters that can't deal with HTML elements ๐
Default: false โ Used by: kramdown parser
--latex-headers ARGโ defines the LaTeX commands for different header levels ๐ the commands for header levels one through six can be specified by separating them with commas.
Default: section,subsection,subsubsection,paragraph,subparagraph,subparagraph โ Used by: Latex converter
--line-width ARGโ defines the line width to be used when outputting a document ๐
Default: 72 โ Used by: kramdown converter
--link-defs ARGโ pre-defines link definitions ๐ this one lets you pre-define link definitions. The value needs to be aHashwhere the keys are the link identifiers and the values are two-elementArrays with the link URL and the link title. If the value is aString, it has to contain a valid YAML hash, and that hash has to follow the guidelines above ๐
Default: {} โ Used by: kramdown parser
--list-indent ARGโ sets the number of spaces to use for list indentation โฃ
Default: 2 โ Used by: Kramdown converter
--math-engine ARGโ set the math engine ๐งฎ specifies the math engine that should be used for converting math blocks/spans. If this option is set to+nil+, no math engine is used and the math blocks/spans are output as is. Options for the selected math engine can be set with themath_engine_optsconfiguration option.
Default: mathjax โ Used by: HTML converter
--math-engine-opts ARGโ set the math engine options โ๏ธ specifies options for the math engine set via themath_engineconfiguration option. The value needs to be a hash with key-value pairs that are understood by the used math engine.
Default: {} โ Used by: HTML converter
--[no-]parse-block-htmlโ process kramdown syntax in block HTML tags ๐งฑ if this istrue, the kramdown parser processes the content of block HTML tags as text containing block-level elements. Since this is not wanted normally, the default isfalse. It's normally better to selectively enable kramdown processing via themarkdownattribute โจ
Default: false โ Used by: kramdown parser
--[no-]parse-span-htmlโ process kramdown syntax in span HTML tags ๐งต if this istrue, the kramdown parser processes the content of span HTML tags as text containing span-level elements.
Default: true โ Used by: kramdown parser
--[no-]remove-block-html-tagsโ remove block HTML tags ๐๏ธ if this istrue, theRemoveHtmlTagsconverter removes block HTML tags.
Default: true โ Used by: RemoveHtmlTags converter
--[no-]remove-line-breaks-for-cjkโ specifies whether line breaks should be removed between CJK characters ๐
Default: false โ Used by: HTML converter
--[no-]remove-span-html-tagsโ remove span HTML tags ๐๏ธ if this istrue, theRemoveHtmlTagsconverter removes span HTML tags.
Default: false โ Used by: RemoveHtmlTags converter
--smart-quotes ARGโ defines the HTML entity names or code points for smart quote output ๐ฌ
The entities you wanna use for โ in this exact order โ a left single quote, a right single quote, a left double quote and a right double quote get picked by entity name or by code point, and you separate them with commas. That's the whole entire thing, no notes. ๐
Default: lsquo,rsquo,ldquo,rdquo Used by: HTML/Latex converter
--syntax-highlighter ARGโ picks the syntax highlighter, obviously ๐
This is the one that decides who's doing the glow-up on your code blocks and spans. Set it to +nil+ and no syntax highlighting happens at all โ bare-faced, we're going natural, and honestly? valid.
Whatever options your chosen highlighter needs go in via the syntax_highlighter_opts configuration option.
Default: rouge Used by: HTML/Latex converter
--syntax-highlighter-opts ARGโ hands your highlighter its little snack pack ๐
These are the options for whatever highlighter you set with the syntax_highlighter configuration option.
The value has to be a hash with key-value pairs that the highlighter you're actually using understands. It doesn't magically know, bestie โ it's gotta be a real hash it gets.
Default: {} Used by: HTML/Latex converter
--template ARGโ wraps your output in a cute lil outfit ๐
This is the name of an ERB template file that should wrap the output, or the ERB template itself, right there in the argument.
It's used to wrap your output in an environment so the result can stand on its own as a whole document. Say you've got an HTML template โ it supplies the header and body tags so your whole output is a legit, valid HTML file. If you give it no template at all, you just get the converted text and nothing else.
Now here's how it finds the thing, in order, no skipping ๐:
- The template name you gave is tried first.
- If that file isn't found, the converter extension gets appended โ that's the same extension as the converter name.
- If it still can't find it, the template name is treated as a template name that kramdown itself provides (without the converter extension).
- If the file is still not found, the template name gets checked for starting with โstring://โ โ and if it does, that prefix is removed and the rest is used as the template content.
kramdown ships with a default template named โdocumentโ for every single converter, so you're never truly alone. ๐ซถ
Default: โโ (yes, empty, the void, nothing) Used by: all converters
--toc-levels ARGโ sets which heading levels make it into the table of contents ๐
You list the levels by separating them with commas (like 1,2,3) or you use the range syntax (like 1..3). Only the levels you list get used in the table of contents. That's it, that's the rule.
Default: 1..6 Used by: HTML/Latex converter
--[no-]transliterated-header-idsโ transliterates the header text before generating the ID โจ
Only ASCII characters go into header IDs, which is kind of a problem for languages rocking a whole lotta non-ASCII characters. Turn this option on and the header text gets transliterated to ASCII as best as it possibly can be, so the resulting header ID is actually useful instead of cursed.
The stringex library has to be installed for this feature to work at all! No library, no transliteration, periodt.
Default: false Used by: HTML/Latex converter
--typographic-symbols ARGโ maps typographical symbols to the characters that get output ๐ค
Typographical symbols normally get output as their equivalent Unicode codepoint. But sometimes you want to change that up โ usually to fall back to a sequence of ASCII characters instead.
This option is how you do it: you give a mapping from typographical symbol to its output string. For example, the mapping {hellip: ...} would output the standard ASCII representation of an ellipsis. Cute and functional.
The available typographical symbol names are:
hellipโ ellipsismdashโ em-dashndashโ en-dashlaquoโ left guillemetraquoโ right guillemetlaquo_spaceโ left guillemet followed by a spaceraquo_spaceโ right guillemet preceded by a space
Default: {} Used by: HTML/Latex converter
๐ฆ EXIT STATUS
The exit status is 0 if no error happened. Otherwise it's 1. That's it. Clean success or a lil snack of failure, no in-between ๐
๐ SEE ALSO
The kramdown website at http://kramdown.gettalong.org for more information โ especially if you wanna know about the supported input syntax. Go read it, it slaps.
๐ AUTHOR
kramdown was written by Thomas Leitner t_leitner@gmx.at .
This manual page was written by Thomas Leitner t_leitner@gmx.at .
and that's the whole page, bestie!! ๐โจ This was KRAMDOWN(1) โ dated January 2019 โ so if you're reading this way later, hi, you're doing amazing, go render some markdown ๐
๐ฆ
๐ฆ where this page comes from
- debian trixie: kramdown 2.5.1-1
- ubuntu questing: kramdown 2.5.1-1
- ubuntu resolute: kramdown 2.5.2-1
- ubuntu stonking: kramdown 2.5.2-1
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms