FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Final cleanup for Zensical transition · Python-Markdown/markdown@36cdbd3 · GitHub

Repository navigation

Commit 36cdbd3

Browse files
committed
Final cleanup for Zensical transition
- Add redirects for moved/renamed sections - Implement and document manual result blocks - Various other minor tweaks.
1 parent 8a96db5 commit 36cdbd3

9 files changed

Lines changed: 164 additions & 74 deletions

File tree

‎docs/changelog.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ See the [Contributing Guide](contributing.md) for details.
2020
performance for repeated inline patterns (#1619).
2121
* Officially support Python 3.15 and drop support for Python 3.10
2222
* Walk backtick runs in `BacktickInlineProcessor` without a regex (#1620).
23+
* Switch static site generator for documentation from MkDocs to Zensical
24+
(#1627, #1635, #1637, and #1638).
2325

2426
### Fixed
2527

‎docs/cli.md‎

Lines changed: 55 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,56 @@ Python-Markdown's command line script takes advantage of Python's `-m` flag.
2020
Therefore, assuming the python executable is on your system path, use the
2121
following format:
2222

23-
```bash
23+
``` shell
2424
python -m markdown [options] [args]
2525
```
2626

2727
That will run the module as a script with the options and arguments provided.
2828

2929
At its most basic usage, one would simply pass in a file name as the only argument:
3030

31-
```bash
31+
``` shell
3232
python -m markdown input_file.txt
3333
```
3434

3535
Use the `--help` option for a list of all available options and arguments:
3636

37-
```bash
38-
python -m markdown --help
37+
``` console
38+
$ python -m markdown --help
39+
Usage: __main__.py [options] [INPUTFILE]
40+
(STDIN is assumed if no INPUTFILE is given)
41+
42+
A Python implementation of John Gruber's Markdown. https://python-
43+
markdown.github.io/
44+
45+
Options:
46+
--version show program's version number and exit
47+
-h, --help show this help message and exit
48+
-f OUTPUT_FILE, --file=OUTPUT_FILE
49+
Write output to OUTPUT_FILE. Defaults to STDOUT.
50+
-e ENCODING, --encoding=ENCODING
51+
Encoding for input and output files.
52+
-o OUTPUT_FORMAT, --output_format=OUTPUT_FORMAT
53+
Use output format 'xhtml' (default) or 'html'.
54+
-x EXTENSION, --extension=EXTENSION
55+
Load extension EXTENSION.
56+
-c CONFIG_FILE, --extension_configs=CONFIG_FILE
57+
Read extension configurations from CONFIG_FILE.
58+
CONFIG_FILE must be of JSON or YAML format. YAML
59+
format requires that a python YAML library be
60+
installed. The parsed JSON or YAML must result in a
61+
python dictionary which would be accepted by the
62+
'extension_configs' keyword on the markdown.Markdown
63+
class. The extensions must also be loaded with the
64+
`--extension` option.
65+
-q, --quiet Suppress all warnings.
66+
-v, --verbose Print all warnings.
67+
--noisy Print debug messages.
68+
69+
WARNING: The Python-Markdown library does NOT sanitize its HTML output. If you
70+
are processing Markdown input from an untrusted source, it is your
71+
responsibility to ensure that it is properly sanitized. For more information
72+
see <https://python-markdown.github.io/sanitization/>.
3973
```
4074

4175
!!! warning
@@ -50,14 +84,15 @@ python -m markdown --help
5084
Piping input and output (on `STDIN` and `STDOUT`) is fully supported.
5185
For example:
5286

53-
```bash
87+
``` shell { title="Console" }
5488
echo "Some **Markdown** text." | python -m markdown > output.html
5589
```
5690

57-
The above command would generate a file named `output.html` with the following content:
58-
```html
91+
/// html | div.result
92+
```html { title='output.html'}
5993
<p>Some <strong>Markdown</strong> Text.</p>
6094
```
95+
///
6196

6297
As Python-Markdown only ever outputs HTML fragments (no `<html>`, `<head>`,
6398
and `<body>` tags), it is generally expected that the command line interface
@@ -67,20 +102,20 @@ otherwise empty `<html>`, `<head>`, and `<body>` tags,
67102
[JustHTML](https://emilstenstrom.github.io/justhtml/) can do that with with
68103
a single command:
69104

70-
```bash
105+
``` shell { title="Console" }
71106
echo "Some **Markdown** text." | python -m markdown | justhtml - --fragment > output.html
72107
```
73108

74-
The above command would generate a file named `output.html` with the following content:
75-
76-
```html
109+
/// html | div.result
110+
```html { title='output.html'}
77111
<html>
78112
<head></head>
79113
<body>
80114
<p>Some <strong>Markdown</strong> Text.</p>
81115
</body>
82116
</html>
83117
```
118+
///
84119

85120
If you don't need or want JustHTML's HTML sanitation, you can disable it with the
86121
`--unsafe` flag, although that is not recommended. See JustHTML's
@@ -98,27 +133,27 @@ notation to point to an extension
98133
For example, to load an extension with the assigned entry point name `myext`,
99134
run the following command:
100135

101-
```bash
136+
``` shell
102137
python -m markdown -x myext input.txt
103138
```
104139

105140
And to load an extension with Python's dot notation:
106141

107-
```bash
142+
``` shell
108143
python -m markdown -x path.to.module:MyExtClass input.txt
109144
```
110145

111146
To load multiple extensions, specify an `-x` option for each extension:
112147

113-
```bash
148+
``` shell
114149
python -m markdown -x myext -x path.to.module:MyExtClass input.txt
115150
```
116151

117152
If the extension supports configuration options (see the documentation for the
118153
extension you are using to determine what settings it supports, if any), you
119154
can pass them in as well:
120155

121-
```bash
156+
``` shell
122157
python -m markdown -x myext -c config.yml input.txt
123158
```
124159

@@ -128,15 +163,15 @@ map to a Python Dictionary in the format required by the
128163
[`extension_configs`][ec] keyword of the `markdown.Markdown` class. Therefore,
129164
the file `config.yaml` referenced in the above example might look like this:
130165

131-
```yaml
166+
``` yaml
132167
myext:
133168
option1: 'value1'
134169
option2: True
135170
```
136171
137172
Similarly, a JSON configuration file might look like this:
138173
139-
```json
174+
``` json
140175
{
141176
"myext":
142177
{
@@ -216,18 +251,18 @@ path.
216251

217252
To use `markdown_py` from the command line, run it as
218253

219-
```bash
254+
``` shell
220255
markdown_py input_file.txt
221256
```
222257

223258
or
224259

225-
```bash
260+
``` shell
226261
markdown_py input_file.txt > output_file.html
227262
```
228263

229264
For a complete list of options, run
230265

231-
```bash
266+
``` shell
232267
markdown_py --help
233268
```

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL