.\" generated by kramdown .TH "KRAMDOWN" "1" "November 2016" .SH NAME kramdown \- a fast, pure\-Ruby Markdown\-superset converter .SH "SYNOPSIS" \fBkramdown\fP [\fIoptions\fP] [\fIFILE\fP\.\.\.] .SH "DESCRIPTION" kramdown is primarily used for parsing a superset of Markdown and converting it to different output formats\. It supports standard Markdown (with some minor modifications) and various extensions like tables and definition lists\. Due to its modular architecture it also allows other input formats than Markdown, for example, HTML or Github Flavored Markdown\. .P If \fIFILE\fP is not specified, kramdown reads from the standard input\. The result is written to the standard output\. .P There are two sets of options that kramdown accepts: The first one includes the options that are used directly by the kramdown binary\. The second set of options controls how kramdown parses and converts its input\. .P Default values for this second set can be set using YAML via the configuration file \fBkramdownrc\fP\&\. Note that configuration option names use underscores, not dashes (dashes are just used in the CLI options names), and boolean options do not have a \fBno\fP variant but a value of \fBtrue\fP or \fBfalse\fP\&\. This file has to be in XDG_CONFIG_HOME on Linux/Unix, ~/Library/Preferences on macOS and ~/AppData/Local on Windows\. .SH "CLI\-ONLY OPTIONS" .TP \fB\-i\fP \fIFORMAT\fP, \fB\-\-input\fP \fIFORMAT\fP Specify the input format\. Available input formats: \fIkramdown\fP (this is the default), \fImarkdown\fP, \fIGFM\fP or \fIhtml\fP\&\. .TP \fB\-o\fP \fIFORMAT\fP, \fB\-\-output\fP \fIFORMAT\fP Specify one or more output formats separated by commas: \fIhtml\fP (default), \fIkramdown\fP, \fIlatex\fP, \fIpdf\fP, \fIman\fP or \fIremove_html_tags\fP\&\. .TP \fB\-\-no\-config\-file\fP Do not read any configuration file\. Default behavior is to check for a configuration file and read it if it exists\. .TP \fB\-\-config\-file\fP \fIFILE\fP Override the default path and name of the configuration file\. .TP \fB\-v\fP, \fB\-\-version\fP Show the version of kramdown\. .TP \fB\-h\fP, \fB\-\-help\fP Show the help\. .SH "KRAMDOWN OPTIONS" .TP \fB\-\-auto\-id\-prefix\fP \fIARG\fP Prefix used for automatically generated header IDs .RS .P This option can be used to set a prefix for the automatically generated header IDs so that there is no conflict when rendering multiple kramdown documents into one output file separately\. The prefix should only contain characters that are valid in an ID! .P Default: \[u2018]\[u2019] Used by: HTML/Latex converter .RE .TP \fB\-\-[no\-]auto\-id\-stripping\fP Strip all formatting from header text for automatic ID generation .RS .P If this option is \fBtrue\fP, only the text elements of a header are used for generating the ID later (in contrast to just using the raw header text line)\. .P This option will be removed in version 2\.0 because this will be the default then\. .P Default: false Used by: kramdown parser .RE .TP \fB\-\-[no\-]auto\-ids\fP Use automatic header ID generation .RS .P If this option is \fBtrue\fP, ID values for all headers are automatically generated if no ID is explicitly specified\. .P Default: true Used by: HTML/Latex converter .RE .TP \fB\-\-coderay\-bold\-every\fP \fIARG\fP Defines how often a line number should be made bold .RS .P Can either be an integer or false (to turn off bold line numbers completely)\. .P Default: 10 Used by: HTML converter .RE .TP \fB\-\-coderay\-css\fP \fIARG\fP Defines how the highlighted code gets styled .RS .P Possible values are :class (CSS classes are applied to the code elements, one must supply the needed CSS file) or :style (default CSS styles are directly applied to the code elements)\. .P Default: style Used by: HTML converter .RE .TP \fB\-\-coderay\-default\-lang\fP \fIARG\fP Sets the default language for highlighting code blocks .RS .P If no language is set for a code block, the default language is used instead\. The value has to be one of the languages supported by coderay or nil if no default language should be used\. .P Default: nil Used by: HTML converter .RE .TP \fB\-\-coderay\-line\-number\-start\fP \fIARG\fP The start value for the line numbers .RS .P Default: 1 Used by: HTML converter .RE .TP \fB\-\-coderay\-line\-numbers\fP \fIARG\fP Defines how and if line numbers should be shown .RS .P The possible values are :table, :inline or nil\. If this option is nil, no line numbers are shown\. .P Default: :inline Used by: HTML converter .RE .TP \fB\-\-coderay\-tab\-width\fP \fIARG\fP The tab width used in highlighted code .RS .P Used by: HTML converter .RE .TP \fB\-\-coderay\-wrap\fP \fIARG\fP Defines how the highlighted code should be wrapped .RS .P The possible values are :span, :div or nil\. .P Default: :div Used by: HTML converter .RE .TP \fB\-\-[no\-]enable\-coderay\fP Use coderay for syntax highlighting .RS .P If this option is \fBtrue\fP, coderay is used by the HTML converter for syntax highlighting the content of code spans and code blocks\. .P Default: true Used by: HTML converter .RE .TP \fB\-\-entity\-output\fP \fIARG\fP Defines how entities are output .RS .P 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) or :as_char (entities are output as characters if possible, only available on Ruby 1\.9)\. .P Default: :as_char Used by: HTML converter, kramdown converter .RE .TP \fB\-\-footnote\-backlink\fP \fIARG\fP Defines the text that should be used for the footnote backlinks .RS .P The footnote backlink is just text, so any special HTML characters will be escaped\. .P If the footnote backlint text is an empty string, no footnote backlinks will be generated\. .P Default: '&8617;' Used by: HTML converter .RE .TP \fB\-\-[no\-]footnote\-backlink\-inline\fP Specifies whether the footnote backlink should always be inline .RS .P With the default of false the footnote backlink is placed at the end of the last paragraph if there is one, or an extra paragraph with only the footnote backlink is created\. .P Setting this option to true tries to place the footnote backlink in the last, possibly nested paragraph or header\. If this fails (e\.g\. in the case of a table), an extra paragraph with only the footnote backlink is created\. .P Default: false Used by: HTML converter .RE .TP \fB\-\-footnote\-nr\fP \fIARG\fP The number of the first footnote .RS .P This option can be used to specify the number that is used for the first footnote\. .P Default: 1 Used by: HTML converter .RE .TP \fB\-\-gfm\-quirks\fP \fIARG\fP Enables a set of GFM specific quirks .RS .P The way how GFM is transformed on Github often differs from the way kramdown does things\. Many of these differences are negligible but others are not\. .P This option allows one to enable/disable certain GFM quirks, i\.e\. ways in which GFM parsing differs from kramdown parsing\. .P The value has to be a list of quirk names that should be enabled, separated by commas\. Possible names are: .IP \(bu 4 paragraph_end .RS .P Disables the kramdown restriction that at least one blank line has to be used after a paragraph before a new block element can be started\. .P Note that if this quirk is used, lazy line wrapping does not fully work anymore! .RE .IP \(bu 4 no_auto_typographic .RS .P Disables automatic conversion of some characters into their corresponding typographic symbols (like \fB\-\-\fP to em\-dash etc)\. This helps to achieve results closer to what GitHub Flavored Markdown produces\. .RE .P Default: paragraph_end Used by: GFM parser .RE .TP \fB\-\-[no\-]hard\-wrap\fP Interprets line breaks literally .RS .P Insert HTML \fB
\fP tags inside paragraphs where the original Markdown document had newlines (by default, Markdown ignores these newlines)\. .P Default: true Used by: GFM parser .RE .TP \fB\-\-header\-offset\fP \fIARG\fP Sets the output offset for headers .RS .P If this option is c (may also be negative) then a header with level n will be output as a header with level c+n\. If c+n is lower than 1, level 1 will be used\. If c+n is greater than 6, level 6 will be used\. .P Default: 0 Used by: HTML converter, Kramdown converter, Latex converter .RE .TP \fB\-\-[no\-]html\-to\-native\fP Convert HTML elements to native elements .RS .P If this option is \fBtrue\fP, the parser converts HTML elements to native elements\. For example, when parsing \fBhallo\fP the emphasis tag would normally be converted to an \fB:html\fP element with tag type \fB:em\fP\&\. If \fBhtml_to_native\fP is \fBtrue\fP, then the emphasis would be converted to a native \fB:em\fP element\. .P This is useful for converters that cannot deal with HTML elements\. .P Default: false Used by: kramdown parser .RE .TP \fB\-\-latex\-headers\fP \fIARG\fP Defines the LaTeX commands for different header levels .RS .P The commands for the header levels one to six can be specified by separating them with commas\. .P Default: section,subsection,subsubsection,paragraph,subparagraph,subparagraph Used by: Latex converter .RE .TP \fB\-\-line\-width\fP \fIARG\fP Defines the line width to be used when outputting a document .RS .P Default: 72 Used by: kramdown converter .RE .TP \fB\-\-link\-defs\fP \fIARG\fP Pre\-defines link definitions .RS .P This option can be used to pre\-define link definitions\. The value needs to be a Hash where the keys are the link identifiers and the values are two element Arrays with the link URL and the link title\. .P If the value is a String, it has to contain a valid YAML hash and the hash has to follow the above guidelines\. .P Default: {} Used by: kramdown parser .RE .TP \fB\-\-math\-engine\fP \fIARG\fP Set the math engine .RS .P 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\. .P Options for the selected math engine can be set with the math_engine_opts configuration option\. .P Default: mathjax Used by: HTML converter .RE .TP \fB\-\-math\-engine\-opts\fP \fIARG\fP Set the math engine options .RS .P Specifies options for the math engine set via the math_engine configuration option\. .P The value needs to be a hash with key\-value pairs that are understood by the used math engine\. .P Default: {} Used by: HTML converter .RE .TP \fB\-\-[no\-]parse\-block\-html\fP Process kramdown syntax in block HTML tags .RS .P If this option is \fBtrue\fP, the kramdown parser processes the content of block HTML tags as text containing block\-level elements\. Since this is not wanted normally, the default is \fBfalse\fP\&\. It is normally better to selectively enable kramdown processing via the markdown attribute\. .P Default: false Used by: kramdown parser .RE .TP \fB\-\-[no\-]parse\-span\-html\fP Process kramdown syntax in span HTML tags .RS .P If this option is \fBtrue\fP, the kramdown parser processes the content of span HTML tags as text containing span\-level elements\. .P Default: true Used by: kramdown parser .RE .TP \fB\-\-[no\-]remove\-block\-html\-tags\fP Remove block HTML tags .RS .P If this option is \fBtrue\fP, the RemoveHtmlTags converter removes block HTML tags\. .P Default: true Used by: RemoveHtmlTags converter .RE .TP \fB\-\-[no\-]remove\-span\-html\-tags\fP Remove span HTML tags .RS .P If this option is \fBtrue\fP, the RemoveHtmlTags converter removes span HTML tags\. .P Default: false Used by: RemoveHtmlTags converter .RE .TP \fB\-\-smart\-quotes\fP \fIARG\fP Defines the HTML entity names or code points for smart quote output .RS .P The entities identified by entity name or code point that should be used for, in order, a left single quote, a right single quote, a left double and a right double quote are specified by separating them with commas\. .P Default: lsquo,rsquo,ldquo,rdquo Used by: HTML/Latex converter .RE .TP \fB\-\-syntax\-highlighter\fP \fIARG\fP Set the syntax highlighter .RS .P Specifies the syntax highlighter that should be used for highlighting code blocks and spans\. If this option is set to +nil+, no syntax highlighting is done\. .P Options for the syntax highlighter can be set with the syntax_highlighter_opts configuration option\. .P Default: coderay Used by: HTML/Latex converter .RE .TP \fB\-\-syntax\-highlighter\-opts\fP \fIARG\fP Set the syntax highlighter options .RS .P Specifies options for the syntax highlighter set via the syntax_highlighter configuration option\. .P The value needs to be a hash with key\-value pairs that are understood by the used syntax highlighter\. .P Default: {} Used by: HTML/Latex converter .RE .TP \fB\-\-template\fP \fIARG\fP The name of an ERB template file that should be used to wrap the output or the ERB template itself\. .RS .P This is used to wrap the output in an environment so that the output can be used as a stand\-alone document\. For example, an HTML template would provide the needed header and body tags so that the whole output is a valid HTML file\. If no template is specified, the output will be just the converted text\. .P When resolving the template file, the given template name is used first\. If such a file is not found, the converter extension (the same as the converter name) is appended\. If the file still cannot be found, the templates name is interpreted as a template name that is provided by kramdown (without the converter extension)\. If the file is still not found, the template name is checked if it starts with \[u2018]string://\[u2019] and if it does, this prefix is removed and the rest is used as template content\. .P kramdown provides a default template named \[u2018]document\[u2019] for each converter\. .P Default: \[u2018]\[u2019] Used by: all converters .RE .TP \fB\-\-toc\-levels\fP \fIARG\fP Defines the levels that are used for the table of contents .RS .P The individual levels can be specified by separating them with commas (e\.g\. 1,2,3) or by using the range syntax (e\.g\. 1\.\.3)\. Only the specified levels are used for the table of contents\. .P Default: 1\.\.6 Used by: HTML/Latex converter .RE .TP \fB\-\-[no\-]transliterated\-header\-ids\fP Transliterate the header text before generating the ID .RS .P Only ASCII characters are used in headers IDs\. This is not good for languages with many non\-ASCII characters\. By enabling this option the header text is transliterated to ASCII as good as possible so that the resulting header ID is more useful\. .P The stringex library needs to be installed for this feature to work! .P Default: false Used by: HTML/Latex converter .RE .TP \fB\-\-typographic\-symbols\fP \fIARG\fP Defines a mapping from typographical symbol to output characters .RS .P Typographical symbols are normally output using their equivalent Unicode codepoint\. However, sometimes one wants to change the output, mostly to fallback to a sequence of ASCII characters\. .P This option allows this by specifying a mapping from typographical symbol to its output string\. For example, the mapping {hellip: \.\.\.} would output the standard ASCII representation of an ellipsis\. .P The available typographical symbol names are: .IP \(bu 4 hellip: ellipsis .IP \(bu 4 mdash: em\-dash .IP \(bu 4 ndash: en\-dash .IP \(bu 4 laquo: left guillemet .IP \(bu 4 raquo: right guillemet .IP \(bu 4 laquo_space: left guillemet followed by a space .IP \(bu 4 raquo_space: right guillemet preceeded by a space .P Default: {} Used by: HTML/Latex converter .RE .SH "EXIT STATUS" The exit status is 0 if no error happened\. Otherwise it is 1\. .SH "SEE ALSO" The kramdown website .UR http://kramdown\.gettalong\.org .UE for more information, especially on the supported input syntax\. .SH "AUTHOR" kramdown was written by Thomas Leitner .MT t_leitner@gmx\.at .UE \&\. .P This manual page was written by Thomas Leitner .MT t_leitner@gmx\.at .UE \&\.