Skip to content
This repository was archived by the owner on Dec 18, 2024. It is now read-only.

Commit c27cbd1

Browse files
committed
Docs now use dot notation for all extensions.
Except were "short names" are explained in the docs, all references to the buitlin extensions now use `markdown.extensions.*` in anticipation of Python-Markdown#336.
1 parent b1643eb commit c27cbd1

18 files changed

+52
-59
lines changed

docs/cli.txt

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -113,41 +113,34 @@ Using Extensions
113113
----------------
114114

115115
To load a Python-Markdown extension from the command line use the `-x`
116-
(or `--extension`) option. For extensions included with Python-Markdown, use
117-
the short "Name" [documented] for that extension.
118-
119-
[documented]: index.html#officially-supported-extensions
120-
121-
$ python -m markdown -x footnotes text_with_footnotes.txt
122-
123-
For third party extensions, the extension module must be on your `PYTHONPATH`
116+
(or `--extension`) option. The extension module must be on your `PYTHONPATH`
124117
(see the [Extension API](extensions/api.html) for details). The extension can
125118
then be invoked by the name of that module using Python's dot syntax:
126119

127120
$ python -m markdown -x path.to.module input.txt
128121

129122
To load multiple extensions, specify an `-x` option for each extension:
130123

131-
$ python -m markdown -x footnotes -x codehilite input.txt
124+
$ python -m markdown -x markdown.extensions.footnotes -x markdown.extensions.codehilite input.txt
132125

133126
If the extension supports configuration options (see the documentation for the
134127
extension you are using to determine what settings it supports, if any), you
135128
can pass them in as well:
136129

137-
$ python -m markdown -x footnotes -c config.yml input.txt
130+
$ python -m markdown -x markdown.extensions.footnotes -c config.yml input.txt
138131

139132
The `-c` (or `--extension_configs`) option accepts a file name. The file must be in
140133
either the [YAML] or [JSON] format and contain YAML or JSON data that would map to
141134
a Python Dictionary in the format required by the [`extension_configs`][ec] keyword
142135
of the `markdown.Markdown` class. Therefore, the file `config.yaml` referenced in the
143136
above example might look like this:
144137

145-
footnotes:
138+
markdown.extensions.footnotes:
146139
PLACE_MARKER: ~~~~~~~~
147140
UNIQUE_IDS: True
148141

149-
Note that while the `--extension_configs` option does specify the "footnotes" extension,
150-
you still need to load the extension with the `-x` option, or the configs for that
142+
Note that while the `--extension_configs` option does specify the "markdown.extensions.footnotes"
143+
extension, you still need to load the extension with the `-x` option, or the configs for that
151144
extension will be ignored.
152145

153146
The `--extension_configs` option will only support YAML config files if [PyYaml] is
@@ -157,7 +150,7 @@ of your config file is automatically detected.
157150
As an alternative, you may append the extension configs as a string to the extension name
158151
that is provided to the `-x-` option in the following format:
159152

160-
$ python -m markdown -x "footnotes(PLACE_MARKER=~~~~~~~~,UNIQUE_IDS=1)" input.txt
153+
$ python -m markdown -x "markdown.extensions.footnotes(PLACE_MARKER=~~~~~~~~,UNIQUE_IDS=1)" input.txt
161154

162155
Note that there are no quotes or whitespace in the above format, which severely limits
163156
how it can be used. For more complex settings, it is suggested that the

docs/extensions/abbreviations.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ will be rendered as:
3939
Usage
4040
-----
4141

42-
See [Extensions](index.html) for general extension usage, specify `abbr`
42+
See [Extensions](index.html) for general extension usage, specify `markdown.extensions.abbr`
4343
as the name of the extension.
4444

4545
This extension does not accept any special configuration options.

docs/extensions/attr_list.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ The above results in the following output:
8282
Usage
8383
-----
8484

85-
See [Extensions](index.html) for general extension usage, specify `attr_list`
85+
See [Extensions](index.html) for general extension usage, specify `markdown.extensions.attr_list`
8686
as the name of the extension.
8787

8888
This extension does not accept any special configuration options.

docs/extensions/code_hilite.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ Lets see the source for that:
128128
Usage
129129
-----
130130

131-
See [Extensions](index.html) for general extension usage, specify `codehilite`
131+
See [Extensions](index.html) for general extension usage, specify `markdown.extensions.codehilite`
132132
as the name of the extension.
133133

134134
See the [Library Reference](../reference.html#extensions) for information about

docs/extensions/definition_lists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ will be rendered as:
4747
Usage
4848
-----
4949

50-
See [Extensions](index.html) for general extension usage, specify `def_list`
50+
See [Extensions](index.html) for general extension usage, specify `markdown.extensions.def_list`
5151
as the name of the extension.
5252

5353
This extension does not accept any special configuration options.

docs/extensions/extra.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Usage
3232
From the Python interpreter:
3333

3434
>>> import markdown
35-
>>> html = markdown.markdown(text, ['extra'])
35+
>>> html = markdown.markdown(text, ['markdown.extensions.extra'])
3636

3737
There may be [additional extensions](index.html) that are distributed with
3838
Python-Markdown that are not included here in Extra. The features
@@ -45,7 +45,7 @@ your own clone of Extra under a different name
4545
Markdown Inside HTML Blocks
4646
---------------------------
4747

48-
Unlike the other Extra features, this feature is built into the markdown core and is turned on when `extra` is enabled.
48+
Unlike the other Extra features, this feature is built into the markdown core and is turned on when `markdown.extensions.extra` is enabled.
4949

5050
The content of any raw html block element can be Markdown-formatted simply by adding a `markdown` attribute to the opening tag. The markdown attribute will be stripped from the output, but all other attributes will be preserved.
5151

docs/extensions/fenced_code_blocks.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ The lines can be specified with PHP Extra's syntax:
106106
Usage
107107
-----
108108

109-
See [Extensions](index.html) for general extension usage, specify `fenced_code`
109+
See [Extensions](index.html) for general extension usage, specify `markdown.extensions.fenced_code`
110110
as the name of the extension.
111111

112112
This extension does not accept any special configuration options.

docs/extensions/footnotes.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ is indented consistently and any errors are more easily discernible by the autho
6464
Usage
6565
-----
6666

67-
See [Extensions](index.html) for general extension usage, specify `footnotes`
67+
See [Extensions](index.html) for general extension usage, specify `markdown.extensions.footnotes`
6868
as the name of the extension.
6969

7070
See the [Library Reference](../reference.html#extensions) for information about

docs/extensions/header_id.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Results in:
3535
Usage
3636
-----
3737

38-
See [Extensions](index.html) for general extension usage, specify `headerid`
38+
See [Extensions](index.html) for general extension usage, specify `markdown.extensions.headerid`
3939
as the name of the extension.
4040

4141
See the [Library Reference](../reference.html#extensions) for information about

docs/extensions/index.txt

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ actual source files.
1414

1515
To use an extension, pass it to markdown with the `extensions` keyword.
1616

17-
markdown.markdown(some_text, extensions=[MyExtension(), 'path.to.my.ext', 'footnotes'])
17+
markdown.markdown(some_text, extensions=[MyExtension(), 'path.to.my.ext', 'markdown.extensions.footnotes'])
1818

1919
See the [Library Reference](../reference.html#extensions) for more details.
2020

2121
From the command line, specify an extension with the `-x` option.
2222

23-
$ python -m markdown -x footnotes -x tables input.txt > output.html
23+
$ python -m markdown -x markdown.extensions.footnotes -x markdown.extensions.tables input.txt > output.html
2424

2525
See the [Command Line docs](../cli.html) or use the `--help` option for more details.
2626

@@ -39,23 +39,23 @@ available to you using the "name" listed in the second column below.
3939

4040
Extension | "Name"
4141
------------------------------------ | ---------------
42-
[Extra] | `extra`
43-
    [Abbreviations][] | `abbr`
44-
    [Attribute Lists][] | `attr_list`
45-
    [Definition Lists][] | `def_list`
46-
    [Fenced Code Blocks][] | `fenced_code`
47-
    [Footnotes][] | `footnotes`
48-
    [Tables][] | `tables`
49-
    [Smart Strong][] | `smart_strong`
50-
[Admonition][] | `admonition`
51-
[CodeHilite][] | `codehilite`
52-
[HeaderId] | `headerid`
53-
[Meta-Data] | `meta`
54-
[New Line to Break] | `nl2br`
55-
[Sane Lists] | `sane_lists`
56-
[SmartyPants] | `smarty`
57-
[Table of Contents] | `toc`
58-
[WikiLinks] | `wikilinks`
42+
[Extra] | `markdown.extensions.extra`
43+
    [Abbreviations][] | `markdown.extensions.abbr`
44+
    [Attribute Lists][] | `markdown.extensions.attr_list`
45+
    [Definition Lists][] | `markdown.extensions.def_list`
46+
    [Fenced Code Blocks][] | `markdown.extensions.fenced_code`
47+
    [Footnotes][] | `markdown.extensions.footnotes`
48+
    [Tables][] | `markdown.extensions.tables`
49+
    [Smart Strong][] | `markdown.extensions.smart_strong`
50+
[Admonition][] | `markdown.extensions.admonition`
51+
[CodeHilite][] | `markdown.extensions.codehilite`
52+
[HeaderId] | `markdown.extensions.headerid`
53+
[Meta-Data] | `markdown.extensions.meta`
54+
[New Line to Break] | `markdown.extensions.nl2br`
55+
[Sane Lists] | `markdown.extensions.sane_lists`
56+
[SmartyPants] | `markdown.extensions.smarty`
57+
[Table of Contents] | `markdown.extensions.toc`
58+
[WikiLinks] | `markdown.extensions.wikilinks`
5959

6060
[Extra]: extra.html
6161
[Abbreviations]: abbreviations.html

0 commit comments

Comments
 (0)