50 lines
1.4 KiB
Text
50 lines
1.4 KiB
Text
|
---
|
||
|
title: Options
|
||
|
---
|
||
|
## Options
|
||
|
|
||
|
The behaviour of kramdown can be adjusted via the available options.
|
||
|
|
||
|
Options can be specified in multiple ways:
|
||
|
|
||
|
On the command line
|
||
|
: The `kramdown` binary allows setting any option by using command line switches.
|
||
|
|
||
|
For example, the following command will disable automatic header ID generation and defines the
|
||
|
first footnote number as 5:
|
||
|
|
||
|
~~~
|
||
|
$ kramdown --no-auto-ids --footnote-nr 5
|
||
|
~~~
|
||
|
|
||
|
As you can see all underscores in option names have to be replaced with dashes. The built-in help
|
||
|
of the binary as well as the man-page show all available options.
|
||
|
|
||
|
Within a kramdown document
|
||
|
: By using the special extension syntax, it is possible to set options within a document.
|
||
|
|
||
|
Using the above example, the options would be set like this within a document:
|
||
|
|
||
|
~~~
|
||
|
{::options auto_ids="false" footnote_nr="5" /}
|
||
|
~~~
|
||
|
|
||
|
Using Ruby code
|
||
|
|
||
|
: If you are using kramdown as a library, you can pass any options as second parameter to the
|
||
|
`Kramdown::Document.new` method.
|
||
|
|
||
|
Again, using the above example you would initalize the kramdown document class as follows:
|
||
|
|
||
|
~~~ ruby
|
||
|
Kramdown::Document.new(source_text, \{auto_ids: false, footnote_nr: 5})
|
||
|
~~~
|
||
|
|
||
|
|
||
|
## Available Options
|
||
|
|
||
|
Below is a list of all currently available options. Have a look at the documentation of a converter
|
||
|
or parser to see directly which options they support!
|
||
|
|
||
|
{options: {items: all}}
|