Debian Codegraph @

docs/extensions/extra.md

raw
1 title: Extra Extension
2
3 # Python-Markdown Extra
4
5 ## Summary
6
7 A compilation of various Python-Markdown extensions that (mostly) imitates
8 [PHP Markdown Extra](http://michelf.com/projects/php-markdown/extra/).
9
10 The supported extensions include:
11
12 * [Abbreviations](abbreviations.md)
13 * [Attribute Lists](attr_list.md)
14 * [Definition Lists](definition_lists.md)
15 * [Fenced Code Blocks](fenced_code_blocks.md)
16 * [Footnotes](footnotes.md)
17 * [Tables](tables.md)
18 * [Markdown in HTML](md_in_html.md)
19
20 See each individual extension for syntax documentation. Extra and all its
21 supported extensions are included in the standard Markdown library.
22
23 !!! Note
24
25 This extension is in __maintenance mode__. We will continue to fix bugs
26 and keep it up-to-date with the core parser, but no new features or
27 changes in behavior will be made. If you need a feature that this
28 extension does not offer, then you have three options (1) find an
29 existing [third-party extension] which meets your needs, (2) [build your
30 own extension], or (3) fork this extension (pursuant to its licensing
31 requirements) and maintain it as a third-party extension.
32
33 [third-party extension]: index.md#third-party-extensions
34 [build your own extension]: api.md
35
36 ## Usage
37
38 From the Python interpreter:
39
40 ```pycon
41 >>> import markdown
42 >>> html = markdown.markdown(text, extensions=['extra'])
43 ```
44
45 To pass configuration options to the extensions included with Extra, they must be passed to Extra, with the
46 underlying extension identified as well. In that way Extra will have access to the options and can pass them on to
47 the appropriate underlying extension.
48
49 ```python
50 config = {
51 'extra': {
52 'footnotes': {
53 'UNIQUE_IDS': True
54 },
55 'fenced_code': {
56 'lang_prefix': 'lang-'
57 }
58 },
59 'toc': {
60 'permalink': True
61 }
62 }
63
64 html = markdown.markdown(text, extensions=['extra', 'toc'], extension_configs=config)
65 ```
66
67 Note that in the above example, `footnotes` and `fenced_code` are both nested under the `extra` key as those
68 extensions are included with Extra. However, the `toc` extension is not included with `extra` and therefore its
69 configuration options are not nested under the `extra` key.
70
71 See each individual extension for a list of supported configuration options.
72
73 There are many other [extensions](index.md) which are distributed with Python-Markdown that are not included here in
74 Extra. The features of those extensions are not part of PHP Markdown Extra, and therefore, not part of Python-Markdown
75 Extra.