markdown-exec 1.12.4__tar.gz → 1.12.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/CHANGELOG.md +16 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/PKG-INFO +2 -6
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/README.md +1 -5
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/config/ruff.toml +1 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/docs/gallery.md +24 -0
- markdown_exec-1.12.6/docs/snippets/gallery/highcharts.py +17 -0
- markdown_exec-1.12.6/docs/snippets/gallery/vega.py +59 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/pyproject.toml +2 -2
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/scripts/make.py +2 -2
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/src/markdown_exec/_internal/formatters/base.py +3 -3
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/src/markdown_exec/_internal/formatters/tree.py +2 -2
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/src/markdown_exec/_internal/mkdocs_plugin.py +1 -1
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/src/markdown_exec/_internal/processors.py +7 -1
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/src/markdown_exec/_internal/rendering.py +19 -4
- markdown_exec-1.12.6/tests/test_headings.py +122 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/tests/test_toc.py +38 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/tests/test_tree.py +12 -0
- markdown_exec-1.12.4/tests/test_headings.py +0 -48
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/AI_POLICY.md +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/CODE_OF_CONDUCT.md +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/CONTRIBUTING.md +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/LICENSE +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/config/coverage.ini +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/config/git-changelog.toml +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/config/pytest.ini +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/config/ty.toml +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/config/vscode/launch.json +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/config/vscode/settings.json +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/config/vscode/tasks.json +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/config/zed/debug.json +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/config/zed/settings.json +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/config/zed/tasks.json +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/docs/.overrides/main.html +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/docs/.overrides/partials/comments.html +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/docs/changelog.md +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/docs/code_of_conduct.md +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/docs/contributing.md +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/docs/credits.md +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/docs/css/apidocs.css +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/docs/index.md +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/docs/js/feedback.js +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/docs/license.md +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/docs/reference/api.md +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/docs/schema.json +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/docs/snippets/gallery/ansi.sh +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/docs/snippets/gallery/argparse.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/docs/snippets/gallery/argparse_format.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/docs/snippets/gallery/chalk.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/docs/snippets/gallery/d2.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/docs/snippets/gallery/diagrams.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/docs/snippets/gallery/drawsvg.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/docs/snippets/gallery/expandable_filetree.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/docs/snippets/gallery/hyperbolic.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/docs/snippets/gallery/matplotlib.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/docs/snippets/gallery/plotly.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/docs/snippets/gallery/pydeps.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/docs/snippets/gallery/qrcode.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/docs/snippets/gallery/rich.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/docs/snippets/gallery/rich_terminal.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/docs/snippets/gallery/runpy.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/docs/snippets/gallery/textual.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/docs/snippets/usage/boolean_matrix.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/docs/snippets/usage/hide.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/docs/snippets/usage/multiple.pycon +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/docs/snippets/usage/platform_html.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/docs/snippets/usage/platform_md.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/docs/snippets/usage/source.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/docs/snippets/usage/source.pycon +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/docs/usage/index.md +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/docs/usage/pyodide.md +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/docs/usage/python.md +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/docs/usage/shell.md +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/docs/usage/tree.md +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/duties.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/scripts/gen_credits.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/scripts/get_version.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/scripts/make +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/src/markdown_exec/__init__.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/src/markdown_exec/_internal/__init__.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/src/markdown_exec/_internal/debug.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/src/markdown_exec/_internal/formatters/__init__.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/src/markdown_exec/_internal/formatters/_exec_python.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/src/markdown_exec/_internal/formatters/bash.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/src/markdown_exec/_internal/formatters/console.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/src/markdown_exec/_internal/formatters/markdown.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/src/markdown_exec/_internal/formatters/pycon.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/src/markdown_exec/_internal/formatters/pyodide.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/src/markdown_exec/_internal/formatters/python.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/src/markdown_exec/_internal/formatters/sh.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/src/markdown_exec/_internal/logger.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/src/markdown_exec/_internal/main.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/src/markdown_exec/assets/ansi.css +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/src/markdown_exec/assets/pyodide.css +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/src/markdown_exec/assets/pyodide.js +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/src/markdown_exec/formatters/__init__.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/src/markdown_exec/formatters/base.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/src/markdown_exec/formatters/bash.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/src/markdown_exec/formatters/console.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/src/markdown_exec/formatters/markdown.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/src/markdown_exec/formatters/pycon.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/src/markdown_exec/formatters/pyodide.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/src/markdown_exec/formatters/python.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/src/markdown_exec/formatters/sh.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/src/markdown_exec/formatters/tree.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/src/markdown_exec/logger.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/src/markdown_exec/mkdocs_plugin.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/src/markdown_exec/processors.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/src/markdown_exec/py.typed +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/src/markdown_exec/rendering.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/tests/__init__.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/tests/conftest.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/tests/test_api.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/tests/test_base_formatter.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/tests/test_converter.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/tests/test_python.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/tests/test_shell.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/tests/test_validator.py +0 -0
- {markdown_exec-1.12.4 → markdown_exec-1.12.6}/zensical.toml +0 -0
|
@@ -5,6 +5,22 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
7
|
<!-- insertion marker -->
|
|
8
|
+
## [1.12.6](https://github.com/pawamoy/markdown-exec/releases/tag/1.12.6) - 2026-10-31
|
|
9
|
+
|
|
10
|
+
<small>[Compare with 1.12.5](https://github.com/pawamoy/markdown-exec/compare/1.12.5...1.12.6)</small>
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
- Resolve Zensical icons through the theme directory accessor ([6c69e7d](https://github.com/pawamoy/markdown-exec/commit/6c69e7ddd88afc6fb5960f1ecdd10f59a059949e) by David Hotham). [Issue-zensical-1111](https://github.com/zensical/zensical/issues/1111), [PR-109](https://github.com/pawamoy/markdown-exec/pull/109)
|
|
15
|
+
|
|
16
|
+
## [1.12.5](https://github.com/pawamoy/markdown-exec/releases/tag/1.12.5) - 2026-10-14
|
|
17
|
+
|
|
18
|
+
<small>[Compare with 1.12.4](https://github.com/pawamoy/markdown-exec/compare/1.12.4...1.12.5)</small>
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
- Preserve heading placeholders across Markdown conversions ([f071b31](https://github.com/pawamoy/markdown-exec/commit/f071b31c614fd008e8a88a417f9223d4a53ca051) by Timothée Mazzucotelli). [Issue-97](https://github.com/pawamoy/markdown-exec/issues/97)
|
|
23
|
+
|
|
8
24
|
## [1.12.4](https://github.com/pawamoy/markdown-exec/releases/tag/1.12.4) - 2026-10-06
|
|
9
25
|
|
|
10
26
|
<small>[Compare with 1.12.3](https://github.com/pawamoy/markdown-exec/compare/1.12.3...1.12.4)</small>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: markdown-exec
|
|
3
|
-
Version: 1.12.
|
|
3
|
+
Version: 1.12.6
|
|
4
4
|
Summary: Utilities to execute code blocks in Markdown files.
|
|
5
5
|
Keywords: markdown,python,exec,shell,bash,mkdocs
|
|
6
6
|
Author-Email: Timothée Mazzucotelli <dev@pawamoy.fr>
|
|
@@ -162,10 +162,6 @@ and the [gallery](https://pawamoy.github.io/markdown-exec/gallery/) for more exa
|
|
|
162
162
|
|
|
163
163
|
<div id="premium-sponsors" style="text-align: center;">
|
|
164
164
|
|
|
165
|
-
<div id="silver-sponsors"><b>Silver sponsors</b><p>
|
|
166
|
-
<a href="https://fastapi.tiangolo.com/"><img alt="FastAPI" src="https://raw.githubusercontent.com/tiangolo/fastapi/master/docs/en/docs/img/logo-margin/logo-teal.png" style="height: 200px; "></a><br>
|
|
167
|
-
</p></div>
|
|
168
|
-
|
|
169
165
|
<div id="bronze-sponsors"><b>Bronze sponsors</b><p>
|
|
170
166
|
<a href="https://www.nixtla.io/"><picture><source media="(prefers-color-scheme: light)" srcset="https://www.nixtla.io/img/logo/full-black.svg"><source media="(prefers-color-scheme: dark)" srcset="https://www.nixtla.io/img/logo/full-white.svg"><img alt="Nixtla" src="https://www.nixtla.io/img/logo/full-black.svg" style="height: 60px; "></picture></a><br>
|
|
171
167
|
</p></div>
|
|
@@ -179,6 +175,7 @@ and the [gallery](https://pawamoy.github.io/markdown-exec/gallery/) for more exa
|
|
|
179
175
|
<a href="https://github.com/tlambert03"><img alt="tlambert03" src="https://avatars.githubusercontent.com/u/1609449?u=922abf0524b47739b37095e553c99488814b05db&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
180
176
|
<a href="https://github.com/ssbarnea"><img alt="ssbarnea" src="https://avatars.githubusercontent.com/u/102495?u=c7bd9ddf127785286fc939dd18cb02db0a453bce&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
181
177
|
<a href="https://github.com/femtomc"><img alt="femtomc" src="https://avatars.githubusercontent.com/u/34410036?u=f13a71daf2a9f0d2da189beaa94250daa629e2d8&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
178
|
+
<a href="https://fastapi.tiangolo.com/"><img alt="FastAPI" src="https://raw.githubusercontent.com/tiangolo/fastapi/master/docs/en/docs/img/logo-margin/logo-teal.png" style="height: 200px; "></a>
|
|
182
179
|
<a href="https://github.com/cmarqu"><img alt="cmarqu" src="https://avatars.githubusercontent.com/u/360986?v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
183
180
|
<a href="https://github.com/kolenaIO"><img alt="kolenaIO" src="https://avatars.githubusercontent.com/u/77010818?v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
184
181
|
<a href="https://github.com/ramnes"><img alt="ramnes" src="https://avatars.githubusercontent.com/u/835072?u=3fca03c3ba0051e2eb652b1def2188a94d1e1dc2&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
@@ -197,7 +194,6 @@ and the [gallery](https://pawamoy.github.io/markdown-exec/gallery/) for more exa
|
|
|
197
194
|
<a href="https://github.com/15r10nk"><img alt="15r10nk" src="https://avatars.githubusercontent.com/u/44680962?u=f04826446ff165742efa81e314bd03bf1724d50e&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
198
195
|
<a href="https://github.com/activeloopai"><img alt="activeloopai" src="https://avatars.githubusercontent.com/u/34816118?v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
199
196
|
<a href="https://github.com/roboflow"><img alt="roboflow" src="https://avatars.githubusercontent.com/u/53104118?v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
200
|
-
<a href="https://github.com/cmclaughlin"><img alt="cmclaughlin" src="https://avatars.githubusercontent.com/u/1061109?u=ddf6eec0edd2d11c980f8c3aa96e3d044d4e0468&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
201
197
|
<a href="https://github.com/RapidataAI"><img alt="RapidataAI" src="https://avatars.githubusercontent.com/u/104209891?v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
202
198
|
<a href="https://github.com/rodolphebarbanneau"><img alt="rodolphebarbanneau" src="https://avatars.githubusercontent.com/u/46493454?u=6c405452a40c231cdf0b68e97544e07ee956a733&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
203
199
|
<a href="https://github.com/theSymbolSyndicate"><img alt="theSymbolSyndicate" src="https://avatars.githubusercontent.com/u/111542255?v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
@@ -125,10 +125,6 @@ and the [gallery](https://pawamoy.github.io/markdown-exec/gallery/) for more exa
|
|
|
125
125
|
|
|
126
126
|
<div id="premium-sponsors" style="text-align: center;">
|
|
127
127
|
|
|
128
|
-
<div id="silver-sponsors"><b>Silver sponsors</b><p>
|
|
129
|
-
<a href="https://fastapi.tiangolo.com/"><img alt="FastAPI" src="https://raw.githubusercontent.com/tiangolo/fastapi/master/docs/en/docs/img/logo-margin/logo-teal.png" style="height: 200px; "></a><br>
|
|
130
|
-
</p></div>
|
|
131
|
-
|
|
132
128
|
<div id="bronze-sponsors"><b>Bronze sponsors</b><p>
|
|
133
129
|
<a href="https://www.nixtla.io/"><picture><source media="(prefers-color-scheme: light)" srcset="https://www.nixtla.io/img/logo/full-black.svg"><source media="(prefers-color-scheme: dark)" srcset="https://www.nixtla.io/img/logo/full-white.svg"><img alt="Nixtla" src="https://www.nixtla.io/img/logo/full-black.svg" style="height: 60px; "></picture></a><br>
|
|
134
130
|
</p></div>
|
|
@@ -142,6 +138,7 @@ and the [gallery](https://pawamoy.github.io/markdown-exec/gallery/) for more exa
|
|
|
142
138
|
<a href="https://github.com/tlambert03"><img alt="tlambert03" src="https://avatars.githubusercontent.com/u/1609449?u=922abf0524b47739b37095e553c99488814b05db&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
143
139
|
<a href="https://github.com/ssbarnea"><img alt="ssbarnea" src="https://avatars.githubusercontent.com/u/102495?u=c7bd9ddf127785286fc939dd18cb02db0a453bce&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
144
140
|
<a href="https://github.com/femtomc"><img alt="femtomc" src="https://avatars.githubusercontent.com/u/34410036?u=f13a71daf2a9f0d2da189beaa94250daa629e2d8&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
141
|
+
<a href="https://fastapi.tiangolo.com/"><img alt="FastAPI" src="https://raw.githubusercontent.com/tiangolo/fastapi/master/docs/en/docs/img/logo-margin/logo-teal.png" style="height: 200px; "></a>
|
|
145
142
|
<a href="https://github.com/cmarqu"><img alt="cmarqu" src="https://avatars.githubusercontent.com/u/360986?v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
146
143
|
<a href="https://github.com/kolenaIO"><img alt="kolenaIO" src="https://avatars.githubusercontent.com/u/77010818?v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
147
144
|
<a href="https://github.com/ramnes"><img alt="ramnes" src="https://avatars.githubusercontent.com/u/835072?u=3fca03c3ba0051e2eb652b1def2188a94d1e1dc2&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
@@ -160,7 +157,6 @@ and the [gallery](https://pawamoy.github.io/markdown-exec/gallery/) for more exa
|
|
|
160
157
|
<a href="https://github.com/15r10nk"><img alt="15r10nk" src="https://avatars.githubusercontent.com/u/44680962?u=f04826446ff165742efa81e314bd03bf1724d50e&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
161
158
|
<a href="https://github.com/activeloopai"><img alt="activeloopai" src="https://avatars.githubusercontent.com/u/34816118?v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
162
159
|
<a href="https://github.com/roboflow"><img alt="roboflow" src="https://avatars.githubusercontent.com/u/53104118?v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
163
|
-
<a href="https://github.com/cmclaughlin"><img alt="cmclaughlin" src="https://avatars.githubusercontent.com/u/1061109?u=ddf6eec0edd2d11c980f8c3aa96e3d044d4e0468&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
164
160
|
<a href="https://github.com/RapidataAI"><img alt="RapidataAI" src="https://avatars.githubusercontent.com/u/104209891?v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
165
161
|
<a href="https://github.com/rodolphebarbanneau"><img alt="rodolphebarbanneau" src="https://avatars.githubusercontent.com/u/46493454?u=6c405452a40c231cdf0b68e97544e07ee956a733&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
166
162
|
<a href="https://github.com/theSymbolSyndicate"><img alt="theSymbolSyndicate" src="https://avatars.githubusercontent.com/u/111542255?v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
@@ -13,6 +13,7 @@ ignore = [
|
|
|
13
13
|
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
|
|
14
14
|
"ARG005", # Unused lambda argument
|
|
15
15
|
"C901", # Too complex
|
|
16
|
+
"COM812", # Trailing comma, making formatting unstable
|
|
16
17
|
"D105", # Missing docstring in magic method
|
|
17
18
|
"D417", # Missing argument description in the docstring
|
|
18
19
|
"E501", # Line too long
|
|
@@ -29,6 +29,18 @@ Welcome to our gallery of examples!
|
|
|
29
29
|
```
|
|
30
30
|
````
|
|
31
31
|
|
|
32
|
+
### with [Highcharts](https://www.highcharts.com/)
|
|
33
|
+
|
|
34
|
+
> A JavaScript library for interactive charts.
|
|
35
|
+
|
|
36
|
+
This example generates chart options in Python and loads Highcharts from a CDN. Hover over the columns to see their values.
|
|
37
|
+
|
|
38
|
+
````md exec="1" source="tabbed-right"
|
|
39
|
+
```python exec="true" html="true" id="highcharts"
|
|
40
|
+
--8<-- "gallery/highcharts.py"
|
|
41
|
+
```
|
|
42
|
+
````
|
|
43
|
+
|
|
32
44
|
### with [Matplotlib](https://matplotlib.org/)
|
|
33
45
|
|
|
34
46
|
> Matplotlib is a comprehensive library for creating static, animated, and interactive visualizations in Python.
|
|
@@ -85,6 +97,18 @@ pydeps uses [Graphviz](https://graphviz.org/) under the hood to generate graphs.
|
|
|
85
97
|
```
|
|
86
98
|
````
|
|
87
99
|
|
|
100
|
+
### with [Vega](https://vega.github.io/vega/)
|
|
101
|
+
|
|
102
|
+
> A visualization grammar for interactive graphics.
|
|
103
|
+
|
|
104
|
+
This example generates a Vega specification in Python and loads Vega from a CDN. Hover over the bars to highlight them.
|
|
105
|
+
|
|
106
|
+
````md exec="1" source="tabbed-right"
|
|
107
|
+
```python exec="true" html="true" id="vega"
|
|
108
|
+
--8<-- "gallery/vega.py"
|
|
109
|
+
```
|
|
110
|
+
````
|
|
111
|
+
|
|
88
112
|
## Code snippets
|
|
89
113
|
|
|
90
114
|
### with [Rich](https://github.com/Textualize/rich)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import json
|
|
2
|
+
|
|
3
|
+
options = {
|
|
4
|
+
"chart": {"type": "column"},
|
|
5
|
+
"title": {"text": "Example bar chart"},
|
|
6
|
+
"xAxis": {"categories": ["a", "b", "c"]},
|
|
7
|
+
"yAxis": {"title": {"text": "Value"}},
|
|
8
|
+
"series": [{"name": "Values", "data": [1, 3, 2]}],
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
print(f"""
|
|
12
|
+
<div id="highcharts-chart" style="width: 100%; height: 300px;"></div>
|
|
13
|
+
<script src="https://cdn.jsdelivr.net/npm/highcharts@12/highcharts.js"></script>
|
|
14
|
+
<script>
|
|
15
|
+
Highcharts.chart('highcharts-chart', {json.dumps(options)});
|
|
16
|
+
</script>
|
|
17
|
+
""")
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import json
|
|
2
|
+
|
|
3
|
+
spec = {
|
|
4
|
+
"$schema": "https://vega.github.io/schema/vega/v6.json",
|
|
5
|
+
"width": 400,
|
|
6
|
+
"height": 200,
|
|
7
|
+
"padding": 5,
|
|
8
|
+
"data": [{"name": "table", "values": [
|
|
9
|
+
{"category": "a", "amount": 1},
|
|
10
|
+
{"category": "b", "amount": 3},
|
|
11
|
+
{"category": "c", "amount": 2},
|
|
12
|
+
]}],
|
|
13
|
+
"scales": [
|
|
14
|
+
{
|
|
15
|
+
"name": "x",
|
|
16
|
+
"type": "band",
|
|
17
|
+
"domain": {"data": "table", "field": "category"},
|
|
18
|
+
"range": "width",
|
|
19
|
+
"padding": 0.1,
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"name": "y",
|
|
23
|
+
"domain": {"data": "table", "field": "amount"},
|
|
24
|
+
"range": "height",
|
|
25
|
+
"nice": True,
|
|
26
|
+
"zero": True,
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
"axes": [
|
|
30
|
+
{"orient": "bottom", "scale": "x"},
|
|
31
|
+
{"orient": "left", "scale": "y", "tickMinStep": 1},
|
|
32
|
+
],
|
|
33
|
+
"marks": [{
|
|
34
|
+
"type": "rect",
|
|
35
|
+
"from": {"data": "table"},
|
|
36
|
+
"encode": {
|
|
37
|
+
"enter": {
|
|
38
|
+
"x": {"scale": "x", "field": "category"},
|
|
39
|
+
"width": {"scale": "x", "band": 1},
|
|
40
|
+
"y": {"scale": "y", "field": "amount"},
|
|
41
|
+
"y2": {"scale": "y", "value": 0},
|
|
42
|
+
},
|
|
43
|
+
"update": {"fill": {"value": "steelblue"}},
|
|
44
|
+
"hover": {"fill": {"value": "orange"}},
|
|
45
|
+
},
|
|
46
|
+
}],
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
print(f"""
|
|
50
|
+
<div id="vega-chart"></div>
|
|
51
|
+
<script src="https://cdn.jsdelivr.net/npm/vega@6"></script>
|
|
52
|
+
<script>
|
|
53
|
+
new vega.View(vega.parse({json.dumps(spec)}), {{
|
|
54
|
+
renderer: 'svg',
|
|
55
|
+
container: '#vega-chart',
|
|
56
|
+
hover: true
|
|
57
|
+
}}).runAsync();
|
|
58
|
+
</script>
|
|
59
|
+
""")
|
|
@@ -45,7 +45,7 @@ dependencies = [
|
|
|
45
45
|
"markupsafe>=2",
|
|
46
46
|
"pymdown-extensions>=9",
|
|
47
47
|
]
|
|
48
|
-
version = "1.12.
|
|
48
|
+
version = "1.12.6"
|
|
49
49
|
|
|
50
50
|
[project.optional-dependencies]
|
|
51
51
|
ansi = [
|
|
@@ -120,7 +120,7 @@ docs = [
|
|
|
120
120
|
"ghp-import>=2.1",
|
|
121
121
|
"markdown-callouts>=0.4",
|
|
122
122
|
"mkdocstrings[python]>=0.29",
|
|
123
|
-
"zensical>=0.0.
|
|
123
|
+
"zensical>=0.0.41",
|
|
124
124
|
"pydeps>=3.0; python_version == '3.12'",
|
|
125
125
|
"diagrams>=0.24.1; python_version == '3.12'",
|
|
126
126
|
"rich>=13.9; python_version == '3.12'",
|
|
@@ -29,7 +29,7 @@ from textwrap import dedent
|
|
|
29
29
|
from typing import TYPE_CHECKING, Any
|
|
30
30
|
|
|
31
31
|
if TYPE_CHECKING:
|
|
32
|
-
from collections.abc import
|
|
32
|
+
from collections.abc import Generator
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
PYTHON_VERSIONS = os.getenv("PYTHON_VERSIONS", "3.11 3.12 3.13 3.14 3.15").split()
|
|
@@ -45,7 +45,7 @@ def shell(cmd: str, *, capture_output: bool = False, **kwargs: Any) -> str | Non
|
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
@contextmanager
|
|
48
|
-
def environ(**kwargs: str) ->
|
|
48
|
+
def environ(**kwargs: str) -> Generator[None]:
|
|
49
49
|
"""Temporarily set environment variables."""
|
|
50
50
|
original = dict(os.environ)
|
|
51
51
|
os.environ.update(kwargs)
|
{markdown_exec-1.12.4 → markdown_exec-1.12.6}/src/markdown_exec/_internal/formatters/base.py
RENAMED
|
@@ -33,7 +33,7 @@ from markdown_exec._internal.logger import get_logger
|
|
|
33
33
|
from markdown_exec._internal.rendering import MarkdownConverter, add_source, code_block
|
|
34
34
|
|
|
35
35
|
if TYPE_CHECKING:
|
|
36
|
-
from collections.abc import Callable,
|
|
36
|
+
from collections.abc import Callable, Generator
|
|
37
37
|
|
|
38
38
|
from markdown.core import Markdown
|
|
39
39
|
|
|
@@ -44,7 +44,7 @@ default_tabs = ("Source", "Result")
|
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
@contextmanager
|
|
47
|
-
def working_directory(path: str | None = None) ->
|
|
47
|
+
def working_directory(path: str | None = None) -> Generator[None]:
|
|
48
48
|
"""Change the working directory for the duration of the context.
|
|
49
49
|
|
|
50
50
|
Parameters:
|
|
@@ -62,7 +62,7 @@ def working_directory(path: str | None = None) -> Iterator[None]:
|
|
|
62
62
|
|
|
63
63
|
|
|
64
64
|
@contextmanager
|
|
65
|
-
def console_width(width: int | None = None) ->
|
|
65
|
+
def console_width(width: int | None = None) -> Generator[None]:
|
|
66
66
|
"""Set the console width for the duration of the context.
|
|
67
67
|
|
|
68
68
|
The console width is set using the `COLUMNS` environment variable.
|
{markdown_exec-1.12.4 → markdown_exec-1.12.6}/src/markdown_exec/_internal/formatters/tree.py
RENAMED
|
@@ -36,7 +36,7 @@ except ImportError:
|
|
|
36
36
|
material = None
|
|
37
37
|
|
|
38
38
|
try:
|
|
39
|
-
import zensical
|
|
39
|
+
import zensical.config
|
|
40
40
|
except ImportError:
|
|
41
41
|
zensical = None
|
|
42
42
|
|
|
@@ -48,7 +48,7 @@ if material is not None or zensical is not None:
|
|
|
48
48
|
if material is not None:
|
|
49
49
|
_icons_path = Path(material.__file__).parent / "templates" / ".icons"
|
|
50
50
|
elif zensical is not None:
|
|
51
|
-
_icons_path = Path(zensical.
|
|
51
|
+
_icons_path = Path(zensical.config.get_builtin_theme_dir()) / ".icons"
|
|
52
52
|
|
|
53
53
|
_icons = {
|
|
54
54
|
"*.cpp": ":simple-cplusplus:",
|
|
@@ -150,7 +150,7 @@ class MarkdownExecPlugin(BasePlugin[MarkdownExecPluginConfig]):
|
|
|
150
150
|
|
|
151
151
|
def _add_asset(self, config: MkDocsConfig, asset_file: str, asset_type: str) -> None:
|
|
152
152
|
asset_filename = f"assets/_markdown_exec_{asset_file}"
|
|
153
|
-
asset_content = Path(__file__).parent.parent.joinpath("assets", asset_file).read_text()
|
|
153
|
+
asset_content = Path(__file__).parent.parent.joinpath("assets", asset_file).read_text(encoding="utf8")
|
|
154
154
|
write_file(asset_content.encode("utf-8"), os.path.join(config.site_dir, asset_filename)) # noqa: PTH118
|
|
155
155
|
config[f"extra_{asset_type}"].insert(0, asset_filename)
|
|
156
156
|
|
|
@@ -87,7 +87,7 @@ class HeadingReportingTreeprocessor(Treeprocessor):
|
|
|
87
87
|
"""Run the treeprocessor."""
|
|
88
88
|
for el in root.iter():
|
|
89
89
|
if self.regex.fullmatch(el.tag):
|
|
90
|
-
el = copy.
|
|
90
|
+
el = copy.deepcopy(el) # noqa: PLW2901
|
|
91
91
|
# 'toc' extension's first pass (which we require to build heading stubs/ids) also edits the HTML.
|
|
92
92
|
# Undo the permalink edit so we can pass this heading to the outer pass of the 'toc' extension.
|
|
93
93
|
if len(el) > 0 and el[-1].get("class") == self.md.treeprocessors["toc"].permalink_class: # ty:ignore[unresolved-attribute]
|
|
@@ -117,9 +117,15 @@ class InsertHeadings(Treeprocessor):
|
|
|
117
117
|
return
|
|
118
118
|
|
|
119
119
|
for el in root.iter():
|
|
120
|
+
# Only block containers hold generated output. Heading content can use another Markdown instance's stash.
|
|
121
|
+
if not self.md.is_block_level(el.tag) or HeadingReportingTreeprocessor.regex.fullmatch(el.tag):
|
|
122
|
+
continue
|
|
123
|
+
|
|
120
124
|
match = HTML_PLACEHOLDER_RE.match(el.text or "")
|
|
121
125
|
if match:
|
|
122
126
|
counter = int(match.group(1))
|
|
127
|
+
if counter >= len(self.md.htmlStash.rawHtmlBlocks):
|
|
128
|
+
continue
|
|
123
129
|
markup: Markup = self.md.htmlStash.rawHtmlBlocks[counter] # ty:ignore[invalid-assignment]
|
|
124
130
|
if headings := self.headings.get(markup):
|
|
125
131
|
div = Element("div", {"class": "markdown-exec"})
|
|
@@ -27,6 +27,7 @@ from typing import TYPE_CHECKING, Any
|
|
|
27
27
|
from warnings import warn
|
|
28
28
|
|
|
29
29
|
from markdown import Markdown
|
|
30
|
+
from markdown.util import HTML_PLACEHOLDER_RE
|
|
30
31
|
from markupsafe import Markup
|
|
31
32
|
|
|
32
33
|
from markdown_exec._internal.processors import (
|
|
@@ -37,7 +38,8 @@ from markdown_exec._internal.processors import (
|
|
|
37
38
|
)
|
|
38
39
|
|
|
39
40
|
if TYPE_CHECKING:
|
|
40
|
-
|
|
41
|
+
import re
|
|
42
|
+
from collections.abc import Generator
|
|
41
43
|
from xml.etree.ElementTree import Element
|
|
42
44
|
|
|
43
45
|
from markdown import Extension
|
|
@@ -250,7 +252,7 @@ def _mimic(md: Markdown, headings: list[Element], *, update_toc: bool = True) ->
|
|
|
250
252
|
|
|
251
253
|
|
|
252
254
|
@contextmanager
|
|
253
|
-
def _id_prefix(md: Markdown, prefix: str | None) ->
|
|
255
|
+
def _id_prefix(md: Markdown, prefix: str | None) -> Generator[None]:
|
|
254
256
|
MarkdownConverter.counter += 1
|
|
255
257
|
id_prepending_processor = md.treeprocessors[IdPrependingTreeprocessor.name]
|
|
256
258
|
id_prepending_processor.id_prefix = prefix if prefix is not None else f"exec-{MarkdownConverter.counter}--" # ty:ignore[unresolved-attribute]
|
|
@@ -275,7 +277,20 @@ class MarkdownConverter:
|
|
|
275
277
|
def _original_md(self) -> Markdown:
|
|
276
278
|
return getattr(self._md_ref, "_original_md", self._md_ref)
|
|
277
279
|
|
|
278
|
-
def _report_headings(self, markup: Markup) -> None:
|
|
280
|
+
def _report_headings(self, markup: Markup, md: Markdown) -> None:
|
|
281
|
+
def restash(match: re.Match[str]) -> str:
|
|
282
|
+
html = md.postprocessors["raw_html"].run(match.group(0))
|
|
283
|
+
return self._original_md.htmlStash.store(html)
|
|
284
|
+
|
|
285
|
+
# Resolve placeholders in their own stash before passing heading copies to the outer conversion.
|
|
286
|
+
for heading in self._headings:
|
|
287
|
+
for element in heading.iter():
|
|
288
|
+
# Preserve AtomicString values so inline processing does not reinterpret code.
|
|
289
|
+
if element.text:
|
|
290
|
+
element.text = type(element.text)(HTML_PLACEHOLDER_RE.sub(restash, element.text))
|
|
291
|
+
if element.tail:
|
|
292
|
+
element.tail = type(element.tail)(HTML_PLACEHOLDER_RE.sub(restash, element.tail))
|
|
293
|
+
|
|
279
294
|
self._original_md.treeprocessors[InsertHeadings.name].headings[markup] = self._headings # ty:ignore[unresolved-attribute]
|
|
280
295
|
self._headings = []
|
|
281
296
|
|
|
@@ -303,6 +318,6 @@ class MarkdownConverter:
|
|
|
303
318
|
|
|
304
319
|
# pass headings to upstream conversion layer
|
|
305
320
|
if self._update_toc:
|
|
306
|
-
self._report_headings(markup)
|
|
321
|
+
self._report_headings(markup, md)
|
|
307
322
|
|
|
308
323
|
return markup
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# SPDX-License-Identifier: ISC
|
|
2
|
+
#
|
|
3
|
+
# ISC License
|
|
4
|
+
#
|
|
5
|
+
# Copyright (c) 2022, Timothée Mazzucotelli and contributors
|
|
6
|
+
#
|
|
7
|
+
# Permission to use, copy, modify, and/or distribute this software for any
|
|
8
|
+
# purpose with or without fee is hereby granted, provided that the above
|
|
9
|
+
# copyright notice and this permission notice appear in all copies.
|
|
10
|
+
#
|
|
11
|
+
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
12
|
+
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
13
|
+
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
14
|
+
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
15
|
+
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
16
|
+
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
17
|
+
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
18
|
+
|
|
19
|
+
"""Tests for headings."""
|
|
20
|
+
|
|
21
|
+
from __future__ import annotations
|
|
22
|
+
|
|
23
|
+
from textwrap import dedent
|
|
24
|
+
from typing import TYPE_CHECKING
|
|
25
|
+
|
|
26
|
+
import pytest
|
|
27
|
+
from mkdocs.commands.build import build
|
|
28
|
+
from mkdocs.config import load_config
|
|
29
|
+
|
|
30
|
+
from markdown_exec import markdown_config
|
|
31
|
+
|
|
32
|
+
if TYPE_CHECKING:
|
|
33
|
+
from pathlib import Path
|
|
34
|
+
|
|
35
|
+
from markdown import Markdown
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def test_headings_removal(md: Markdown) -> None:
|
|
39
|
+
"""Headings should leave no trace behind.
|
|
40
|
+
|
|
41
|
+
Parameters:
|
|
42
|
+
md: A Markdown instance (fixture).
|
|
43
|
+
"""
|
|
44
|
+
html = md.convert(
|
|
45
|
+
dedent(
|
|
46
|
+
"""
|
|
47
|
+
=== "File layout"
|
|
48
|
+
|
|
49
|
+
```tree
|
|
50
|
+
./
|
|
51
|
+
hello.md
|
|
52
|
+
```
|
|
53
|
+
""",
|
|
54
|
+
),
|
|
55
|
+
)
|
|
56
|
+
assert 'class="markdown-exec"' not in html
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
@pytest.mark.parametrize("exec_first", [True, False])
|
|
60
|
+
def test_exec_block_with_mkdocstrings_headings(
|
|
61
|
+
tmp_path: Path,
|
|
62
|
+
monkeypatch: pytest.MonkeyPatch,
|
|
63
|
+
exec_first: bool,
|
|
64
|
+
) -> None:
|
|
65
|
+
"""Build a page with an executed block and docstring headings containing inline code."""
|
|
66
|
+
# Keep the plugin's saved configuration local to this build.
|
|
67
|
+
monkeypatch.setattr(markdown_config, "exts", None)
|
|
68
|
+
monkeypatch.setattr(markdown_config, "exts_config", None)
|
|
69
|
+
|
|
70
|
+
config_file = tmp_path / "mkdocs.yml"
|
|
71
|
+
config_file.write_text("site_name: Heading reproduction\n", encoding="utf-8")
|
|
72
|
+
docs_dir = tmp_path / "docs"
|
|
73
|
+
docs_dir.mkdir()
|
|
74
|
+
|
|
75
|
+
# Four headings reproduce the invalid stash indices without a large package.
|
|
76
|
+
(tmp_path / "repro97.py").write_text(
|
|
77
|
+
dedent(
|
|
78
|
+
'''\
|
|
79
|
+
"""Summary.
|
|
80
|
+
|
|
81
|
+
# Heading `1`
|
|
82
|
+
|
|
83
|
+
Text with `code`.
|
|
84
|
+
|
|
85
|
+
# Heading `2`
|
|
86
|
+
|
|
87
|
+
Text with `code again`.
|
|
88
|
+
|
|
89
|
+
# Heading `3`
|
|
90
|
+
|
|
91
|
+
Text with `code again and again`.
|
|
92
|
+
|
|
93
|
+
# Heading `4`.
|
|
94
|
+
|
|
95
|
+
Text with `code again and again again`.
|
|
96
|
+
"""
|
|
97
|
+
''',
|
|
98
|
+
),
|
|
99
|
+
encoding="utf-8",
|
|
100
|
+
)
|
|
101
|
+
exec_block = '```python exec="1"\nprint("hello from the exec block")\n```'
|
|
102
|
+
directive = "::: repro97"
|
|
103
|
+
blocks = [exec_block, directive] if exec_first else [directive, exec_block]
|
|
104
|
+
(docs_dir / "index.md").write_text("\n\n".join(blocks), encoding="utf-8")
|
|
105
|
+
config = load_config(
|
|
106
|
+
config_file=str(config_file),
|
|
107
|
+
docs_dir=str(docs_dir),
|
|
108
|
+
site_dir=str(tmp_path / "site"),
|
|
109
|
+
plugins=[
|
|
110
|
+
"markdown-exec",
|
|
111
|
+
{"mkdocstrings": {"handlers": {"python": {"paths": [str(tmp_path)], "options": {"show_source": False}}}}},
|
|
112
|
+
],
|
|
113
|
+
markdown_extensions=["toc", "pymdownx.superfences"],
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
build(config)
|
|
117
|
+
|
|
118
|
+
# Both parts of the page render successfully, in either order.
|
|
119
|
+
html = (tmp_path / "site" / "index.html").read_text(encoding="utf-8")
|
|
120
|
+
assert "hello from the exec block" in html
|
|
121
|
+
assert "Heading <code>1</code>" in html
|
|
122
|
+
assert "Heading <code>4</code>." in html
|
|
@@ -23,6 +23,7 @@ from __future__ import annotations
|
|
|
23
23
|
from textwrap import dedent
|
|
24
24
|
from typing import TYPE_CHECKING
|
|
25
25
|
|
|
26
|
+
import pytest
|
|
26
27
|
from markdown.extensions.toc import TocExtension
|
|
27
28
|
|
|
28
29
|
if TYPE_CHECKING:
|
|
@@ -105,3 +106,40 @@ def test_both_updating_and_not_updating_toc(md: Markdown) -> None:
|
|
|
105
106
|
assert "medium-heading" in md.toc # ty:ignore[unresolved-attribute]
|
|
106
107
|
assert "small-heading" not in md.toc # ty:ignore[unresolved-attribute]
|
|
107
108
|
assert "tiny-heading" in md.toc # ty:ignore[unresolved-attribute]
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
@pytest.mark.parametrize(
|
|
112
|
+
("heading", "expected_name", "expected_html"),
|
|
113
|
+
[
|
|
114
|
+
("Heading —", "Heading —", "Heading —"),
|
|
115
|
+
(
|
|
116
|
+
"Heading **—** tail ©",
|
|
117
|
+
"Heading — tail ©",
|
|
118
|
+
"Heading <strong>—</strong> tail ©",
|
|
119
|
+
),
|
|
120
|
+
("Heading <span>inline</span>", "Heading inline", "Heading <span>inline</span>"),
|
|
121
|
+
("Heading `*code*`", "Heading *code*", "Heading <code>*code*</code>"),
|
|
122
|
+
("—", "—", "—"),
|
|
123
|
+
],
|
|
124
|
+
)
|
|
125
|
+
def test_generated_headings_keep_stashed_content(
|
|
126
|
+
md: Markdown,
|
|
127
|
+
heading: str,
|
|
128
|
+
expected_name: str,
|
|
129
|
+
expected_html: str,
|
|
130
|
+
) -> None:
|
|
131
|
+
"""Keep heading content when the inner and outer HTML stashes use the same IDs."""
|
|
132
|
+
TocExtension(permalink=True).extendMarkdown(md)
|
|
133
|
+
|
|
134
|
+
# Entities and inline HTML belong to the generated block's Markdown instance.
|
|
135
|
+
source = f'```md exec="1" idprefix=""\n# {heading}\n```'
|
|
136
|
+
|
|
137
|
+
html = md.convert(source)
|
|
138
|
+
|
|
139
|
+
# The page keeps the rendered heading, and its ToC uses the same content.
|
|
140
|
+
assert '<h1 id="' in html
|
|
141
|
+
assert expected_html in html
|
|
142
|
+
assert md.toc_tokens[0]["name"] == expected_name # ty:ignore[unresolved-attribute]
|
|
143
|
+
assert md.toc_tokens[0]["html"] == expected_html # ty:ignore[unresolved-attribute]
|
|
144
|
+
assert expected_name in md.toc # ty:ignore[unresolved-attribute]
|
|
145
|
+
assert "wzxhzdk" not in html
|
|
@@ -18,11 +18,23 @@
|
|
|
18
18
|
|
|
19
19
|
"""Tests for the shell formatters."""
|
|
20
20
|
|
|
21
|
+
from pathlib import Path
|
|
21
22
|
from textwrap import dedent
|
|
22
23
|
|
|
24
|
+
import pytest
|
|
23
25
|
from markdown import Markdown
|
|
24
26
|
|
|
25
27
|
|
|
28
|
+
def test_zensical_theme_has_icons() -> None:
|
|
29
|
+
"""Check that Zensical's theme accessor exposes the icons directory."""
|
|
30
|
+
config = pytest.importorskip("zensical.config")
|
|
31
|
+
|
|
32
|
+
# Check the private API directly, even when Material supplies the formatter's icons.
|
|
33
|
+
theme_dir = Path(config.get_builtin_theme_dir())
|
|
34
|
+
|
|
35
|
+
assert (theme_dir / ".icons").is_dir()
|
|
36
|
+
|
|
37
|
+
|
|
26
38
|
def test_output_markdown(md: Markdown) -> None:
|
|
27
39
|
"""Assert we can highlight lines in the output.
|
|
28
40
|
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
# SPDX-License-Identifier: ISC
|
|
2
|
-
#
|
|
3
|
-
# ISC License
|
|
4
|
-
#
|
|
5
|
-
# Copyright (c) 2022, Timothée Mazzucotelli and contributors
|
|
6
|
-
#
|
|
7
|
-
# Permission to use, copy, modify, and/or distribute this software for any
|
|
8
|
-
# purpose with or without fee is hereby granted, provided that the above
|
|
9
|
-
# copyright notice and this permission notice appear in all copies.
|
|
10
|
-
#
|
|
11
|
-
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
12
|
-
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
13
|
-
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
14
|
-
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
15
|
-
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
16
|
-
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
17
|
-
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
18
|
-
|
|
19
|
-
"""Tests for headings."""
|
|
20
|
-
|
|
21
|
-
from __future__ import annotations
|
|
22
|
-
|
|
23
|
-
from textwrap import dedent
|
|
24
|
-
from typing import TYPE_CHECKING
|
|
25
|
-
|
|
26
|
-
if TYPE_CHECKING:
|
|
27
|
-
from markdown import Markdown
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
def test_headings_removal(md: Markdown) -> None:
|
|
31
|
-
"""Headings should leave no trace behind.
|
|
32
|
-
|
|
33
|
-
Parameters:
|
|
34
|
-
md: A Markdown instance (fixture).
|
|
35
|
-
"""
|
|
36
|
-
html = md.convert(
|
|
37
|
-
dedent(
|
|
38
|
-
"""
|
|
39
|
-
=== "File layout"
|
|
40
|
-
|
|
41
|
-
```tree
|
|
42
|
-
./
|
|
43
|
-
hello.md
|
|
44
|
-
```
|
|
45
|
-
""",
|
|
46
|
-
),
|
|
47
|
-
)
|
|
48
|
-
assert 'class="markdown-exec"' not in html
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{markdown_exec-1.12.4 → markdown_exec-1.12.6}/src/markdown_exec/_internal/formatters/__init__.py
RENAMED
|
File without changes
|
{markdown_exec-1.12.4 → markdown_exec-1.12.6}/src/markdown_exec/_internal/formatters/_exec_python.py
RENAMED
|
File without changes
|
{markdown_exec-1.12.4 → markdown_exec-1.12.6}/src/markdown_exec/_internal/formatters/bash.py
RENAMED
|
File without changes
|
{markdown_exec-1.12.4 → markdown_exec-1.12.6}/src/markdown_exec/_internal/formatters/console.py
RENAMED
|
File without changes
|
{markdown_exec-1.12.4 → markdown_exec-1.12.6}/src/markdown_exec/_internal/formatters/markdown.py
RENAMED
|
File without changes
|
{markdown_exec-1.12.4 → markdown_exec-1.12.6}/src/markdown_exec/_internal/formatters/pycon.py
RENAMED
|
File without changes
|
{markdown_exec-1.12.4 → markdown_exec-1.12.6}/src/markdown_exec/_internal/formatters/pyodide.py
RENAMED
|
File without changes
|
{markdown_exec-1.12.4 → markdown_exec-1.12.6}/src/markdown_exec/_internal/formatters/python.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|