1KRAMDOWN(1) General Commands Manual KRAMDOWN(1)
2
3
4
6 kramdown - a fast, pure-Ruby Markdown-superset converter
7
9 kramdown [options] [FILE...]
10
12 kramdown is primarily used for parsing a superset of Markdown and con‐
13 verting it to different output formats. It supports standard Markdown
14 (with some minor modifications) and various extensions like tables and
15 definition lists. Due to its modular architecture it also allows other
16 input formats than Markdown, for example, HTML or Github Flavored Mark‐
17 down.
18
19 If FILE is not specified, kramdown reads from the standard input. The
20 result is written to the standard output.
21
22 There are two sets of options that kramdown accepts: The first one in‐
23 cludes the options that are used directly by the kramdown binary. The
24 second set of options controls how kramdown parses and converts its in‐
25 put.
26
27 Default values for this second set can be set using YAML via the con‐
28 figuration file kramdownrc. Note that configuration option names use
29 underscores, not dashes (dashes are just used in the CLI options
30 names), and boolean options do not have a no variant but a value of
31 true or false. This file has to be in XDG_CONFIG_HOME on Linux/Unix,
32 ~/Library/Preferences on macOS and ~/AppData/Local on Windows.
33
35 -i FORMAT, --input FORMAT
36 Specify the input format. Available input formats: kramdown
37 (this is the default), markdown, or html. The input format GFM
38 is available through the kramdown-parser-gfm gem.
39
40 -o FORMAT, --output FORMAT
41 Specify one or more output formats separated by commas: html
42 (default), kramdown, latex, man or remove_html_tags. The con‐
43 verter pdf is available through the kramdown-converter-pdf gem.
44
45 -x EXT, --extension EXT
46 Load one or more extensions. The name of the extension should
47 not include the kramdown- prefix, e.g. just parser-gfm. Multiple
48 extensions can be loaded by separating them with commas.
49
50 Note: This option has to be used before any other options that
51 rely on the extension already being loaded.
52
53 --no-config-file
54 Do not read any configuration file. Default behavior is to check
55 for a configuration file and read it if it exists.
56
57 --config-file FILE
58 Override the default path and name of the configuration file.
59
60 -v, --version
61 Show the version of kramdown.
62
63 -h, --help
64 Show the help.
65
67 --auto-id-prefix ARG
68 Prefix used for automatically generated header IDs
69
70 This option can be used to set a prefix for the automatically
71 generated header IDs so that there is no conflict when rendering
72 multiple kramdown documents into one output file separately. The
73 prefix should only contain characters that are valid in an ID!
74
75 Default: ‘’ Used by: HTML/Latex converter
76
77 --[no-]auto-id-stripping
78 Strip all formatting from header text for automatic ID genera‐
79 tion
80
81 If this option is true, only the text elements of a header are
82 used for generating the ID later (in contrast to just using the
83 raw header text line).
84
85 This option will be removed in version 2.0 because this will be
86 the default then.
87
88 Default: false Used by: kramdown parser
89
90 --[no-]auto-ids
91 Use automatic header ID generation
92
93 If this option is true, ID values for all headers are automati‐
94 cally generated if no ID is explicitly specified.
95
96 Default: true Used by: HTML/Latex converter
97
98 --entity-output ARG
99 Defines how entities are output
100
101 The possible values are :as_input (entities are output in the
102 same form as found in the input), :numeric (entities are output
103 in numeric form), :symbolic (entities are output in symbolic
104 form if possible) or :as_char (entities are output as characters
105 if possible, only available on Ruby 1.9).
106
107 Default: :as_char Used by: HTML converter, kramdown converter
108
109 --footnote-backlink ARG
110 Defines the text that should be used for the footnote backlinks
111
112 The footnote backlink is just text, so any special HTML charac‐
113 ters will be escaped.
114
115 If the footnote backlint text is an empty string, no footnote
116 backlinks will be generated.
117
118 Default: ‘8617;’ Used by: HTML converter
119
120 --[no-]footnote-backlink-inline
121 Specifies whether the footnote backlink should always be inline
122
123 With the default of false the footnote backlink is placed at the
124 end of the last paragraph if there is one, or an extra paragraph
125 with only the footnote backlink is created.
126
127 Setting this option to true tries to place the footnote backlink
128 in the last, possibly nested paragraph or header. If this fails
129 (e.g. in the case of a table), an extra paragraph with only the
130 footnote backlink is created.
131
132 Default: false Used by: HTML converter
133
134 --footnote-nr ARG
135 The number of the first footnote
136
137 This option can be used to specify the number that is used for
138 the first footnote.
139
140 Default: 1 Used by: HTML converter
141
142 --footnote-prefix ARG
143 Prefix used for footnote IDs
144
145 This option can be used to set a prefix for footnote IDs. This
146 is useful when rendering multiple documents into the same output
147 file to avoid duplicate IDs. The prefix should only contain
148 characters that are valid in an ID!
149
150 Default: ‘’ Used by: HTML
151
152 --forbidden-inline-options ARG
153 Defines the options that may not be set using the {::options}
154 extension
155
156 Default: template Used by: HTML converter
157
158 --header-offset ARG
159 Sets the output offset for headers
160
161 If this option is c (may also be negative) then a header with
162 level n will be output as a header with level c+n. If c+n is
163 lower than 1, level 1 will be used. If c+n is greater than 6,
164 level 6 will be used.
165
166 Default: 0 Used by: HTML converter, Kramdown converter, Latex
167 converter
168
169 --[no-]html-to-native
170 Convert HTML elements to native elements
171
172 If this option is true, the parser converts HTML elements to na‐
173 tive elements. For example, when parsing <em>hallo</em> the em‐
174 phasis tag would normally be converted to an :html element with
175 tag type :em. If html_to_native is true, then the emphasis would
176 be converted to a native :em element.
177
178 This is useful for converters that cannot deal with HTML ele‐
179 ments.
180
181 Default: false Used by: kramdown parser
182
183 --latex-headers ARG
184 Defines the LaTeX commands for different header levels
185
186 The commands for the header levels one to six can be specified
187 by separating them with commas.
188
189 Default: section,subsection,subsubsection,paragraph,subpara‐
190 graph,subparagraph Used by: Latex converter
191
192 --line-width ARG
193 Defines the line width to be used when outputting a document
194
195 Default: 72 Used by: kramdown converter
196
197 --link-defs ARG
198 Pre-defines link definitions
199
200 This option can be used to pre-define link definitions. The
201 value needs to be a Hash where the keys are the link identifiers
202 and the values are two element Arrays with the link URL and the
203 link title.
204
205 If the value is a String, it has to contain a valid YAML hash
206 and the hash has to follow the above guidelines.
207
208 Default: {} Used by: kramdown parser
209
210 --math-engine ARG
211 Set the math engine
212
213 Specifies the math engine that should be used for converting
214 math blocks/spans. If this option is set to +nil+, no math en‐
215 gine is used and the math blocks/spans are output as is.
216
217 Options for the selected math engine can be set with the
218 math_engine_opts configuration option.
219
220 Default: mathjax Used by: HTML converter
221
222 --math-engine-opts ARG
223 Set the math engine options
224
225 Specifies options for the math engine set via the math_engine
226 configuration option.
227
228 The value needs to be a hash with key-value pairs that are un‐
229 derstood by the used math engine.
230
231 Default: {} Used by: HTML converter
232
233 --[no-]parse-block-html
234 Process kramdown syntax in block HTML tags
235
236 If this option is true, the kramdown parser processes the con‐
237 tent of block HTML tags as text containing block-level elements.
238 Since this is not wanted normally, the default is false. It is
239 normally better to selectively enable kramdown processing via
240 the markdown attribute.
241
242 Default: false Used by: kramdown parser
243
244 --[no-]parse-span-html
245 Process kramdown syntax in span HTML tags
246
247 If this option is true, the kramdown parser processes the con‐
248 tent of span HTML tags as text containing span-level elements.
249
250 Default: true Used by: kramdown parser
251
252 --[no-]remove-block-html-tags
253 Remove block HTML tags
254
255 If this option is true, the RemoveHtmlTags converter removes
256 block HTML tags.
257
258 Default: true Used by: RemoveHtmlTags converter
259
260 --[no-]remove-line-breaks-for-cjk
261 Specifies whether line breaks should be removed between CJK
262 characters
263
264 Default: false Used by: HTML converter
265
266 --[no-]remove-span-html-tags
267 Remove span HTML tags
268
269 If this option is true, the RemoveHtmlTags converter removes
270 span HTML tags.
271
272 Default: false Used by: RemoveHtmlTags converter
273
274 --smart-quotes ARG
275 Defines the HTML entity names or code points for smart quote
276 output
277
278 The entities identified by entity name or code point that should
279 be used for, in order, a left single quote, a right single
280 quote, a left double and a right double quote are specified by
281 separating them with commas.
282
283 Default: lsquo,rsquo,ldquo,rdquo Used by: HTML/Latex converter
284
285 --syntax-highlighter ARG
286 Set the syntax highlighter
287
288 Specifies the syntax highlighter that should be used for high‐
289 lighting code blocks and spans. If this option is set to +nil+,
290 no syntax highlighting is done.
291
292 Options for the syntax highlighter can be set with the syn‐
293 tax_highlighter_opts configuration option.
294
295 Default: rouge Used by: HTML/Latex converter
296
297 --syntax-highlighter-opts ARG
298 Set the syntax highlighter options
299
300 Specifies options for the syntax highlighter set via the syn‐
301 tax_highlighter configuration option.
302
303 The value needs to be a hash with key-value pairs that are un‐
304 derstood by the used syntax highlighter.
305
306 Default: {} Used by: HTML/Latex converter
307
308 --template ARG
309 The name of an ERB template file that should be used to wrap the
310 output or the ERB template itself.
311
312 This is used to wrap the output in an environment so that the
313 output can be used as a stand-alone document. For example, an
314 HTML template would provide the needed header and body tags so
315 that the whole output is a valid HTML file. If no template is
316 specified, the output will be just the converted text.
317
318 When resolving the template file, the given template name is
319 used first. If such a file is not found, the converter extension
320 (the same as the converter name) is appended. If the file still
321 cannot be found, the templates name is interpreted as a template
322 name that is provided by kramdown (without the converter exten‐
323 sion). If the file is still not found, the template name is
324 checked if it starts with ‘string://’ and if it does, this pre‐
325 fix is removed and the rest is used as template content.
326
327 kramdown provides a default template named ‘document’ for each
328 converter.
329
330 Default: ‘’ Used by: all converters
331
332 --toc-levels ARG
333 Defines the levels that are used for the table of contents
334
335 The individual levels can be specified by separating them with
336 commas (e.g. 1,2,3) or by using the range syntax (e.g. 1..3).
337 Only the specified levels are used for the table of contents.
338
339 Default: 1..6 Used by: HTML/Latex converter
340
341 --[no-]transliterated-header-ids
342 Transliterate the header text before generating the ID
343
344 Only ASCII characters are used in headers IDs. This is not good
345 for languages with many non-ASCII characters. By enabling this
346 option the header text is transliterated to ASCII as good as
347 possible so that the resulting header ID is more useful.
348
349 The stringex library needs to be installed for this feature to
350 work!
351
352 Default: false Used by: HTML/Latex converter
353
354 --typographic-symbols ARG
355 Defines a mapping from typographical symbol to output characters
356
357 Typographical symbols are normally output using their equivalent
358 Unicode codepoint. However, sometimes one wants to change the
359 output, mostly to fallback to a sequence of ASCII characters.
360
361 This option allows this by specifying a mapping from typographi‐
362 cal symbol to its output string. For example, the mapping {hel‐
363 lip: ...} would output the standard ASCII representation of an
364 ellipsis.
365
366 The available typographical symbol names are:
367
368 • hellip: ellipsis
369
370 • mdash: em-dash
371
372 • ndash: en-dash
373
374 • laquo: left guillemet
375
376 • raquo: right guillemet
377
378 • laquo_space: left guillemet followed by a space
379
380 • raquo_space: right guillemet preceeded by a space
381
382 Default: {} Used by: HTML/Latex converter
383
385 The exit status is 0 if no error happened. Otherwise it is 1.
386
388 The kramdown website ⟨http://kramdown.gettalong.org⟩ for more informa‐
389 tion, especially on the supported input syntax.
390
392 kramdown was written by Thomas Leitner ⟨t_leitner@gmx.at⟩ .
393
394 This manual page was written by Thomas Leitner ⟨t_leitner@gmx.at⟩ .
395
396
397
398 January 2019 KRAMDOWN(1)