Debian Codegraph @

docs/extensions/definition_lists.md

raw
1 title: Definition Lists Extension
2
3 Definition Lists
4 ================
5
6 Summary
7 -------
8
9 The Definition Lists extension adds the ability to create definition lists in
10 Markdown documents.
11
12 This extension is included in the standard Markdown library.
13
14 !!! Note
15
16 This extension is in __maintenance mode__. We will continue to fix bugs
17 and keep it up-to-date with the core parser, but no new features or
18 changes in behavior will be made. If you need a feature that this
19 extension does not offer, then you have three options (1) find an
20 existing [third-party extension] which meets your needs, (2) [build your
21 own extension], or (3) fork this extension (pursuant to its licensing
22 requirements) and maintain it as a third-party extension.
23
24 We recommend [PyMdown Definition] as an actively developed alternative.
25
26 [third-party extension]: index.md#third-party-extensions
27 [build your own extension]: api.md
28 [PyMdown Definition]: https://facelessuser.github.io/pymdown-extensions/extensions/blocks/plugins/definition/
29
30 Syntax
31 ------
32
33 Definition lists are defined using the syntax established in
34 [PHP Markdown Extra][php].
35
36 [php]: http://www.michelf.com/projects/php-markdown/extra/#def-list
37
38 Thus, the following text (taken from the above referenced PHP documentation):
39
40 ```md
41 Apple
42 : Pomaceous fruit of plants of the genus Malus in
43 the family Rosaceae.
44
45 Orange
46 : The fruit of an evergreen tree of the genus Citrus.
47 ```
48
49 will be rendered as:
50
51 ```html
52 <dl>
53 <dt>Apple</dt>
54 <dd>Pomaceous fruit of plants of the genus Malus in
55 the family Rosaceae.</dd>
56
57 <dt>Orange</dt>
58 <dd>The fruit of an evergreen tree of the genus Citrus.</dd>
59 </dl>
60 ```
61
62 Usage
63 -----
64
65 See [Extensions](index.md) for general extension usage. Use `def_list` as the
66 name of the extension.
67
68 This extension does not accept any special configuration options.
69
70 A trivial example:
71
72 ```python
73 markdown.markdown(some_text, extensions=['def_list'])
74 ```