markdown-exec 1.11.0__tar.gz → 1.12.1__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.11.0 → markdown_exec-1.12.1}/CHANGELOG.md +16 -0
- markdown_exec-1.12.1/PKG-INFO +214 -0
- markdown_exec-1.12.1/README.md +178 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/config/pytest.ini +2 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/docs/.overrides/main.html +5 -7
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/docs/snippets/gallery/argparse.py +1 -1
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/docs/snippets/gallery/argparse_format.py +1 -1
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/docs/snippets/gallery/d2.py +0 -4
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/docs/snippets/gallery/runpy.py +4 -4
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/docs/usage/index.md +8 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/docs/usage/pyodide.md +0 -2
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/docs/usage/tree.md +53 -1
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/duties.py +21 -64
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/mkdocs.yml +1 -11
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/pyproject.toml +2 -3
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/scripts/get_version.py +6 -1
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/scripts/make.py +48 -13
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/src/markdown_exec/_internal/debug.py +1 -1
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/src/markdown_exec/_internal/formatters/sh.py +1 -0
- markdown_exec-1.12.1/src/markdown_exec/_internal/formatters/tree.py +163 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/src/markdown_exec/_internal/main.py +8 -3
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/src/markdown_exec/_internal/rendering.py +5 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/tests/test_api.py +4 -2
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/tests/test_base_formatter.py +2 -2
- markdown_exec-1.11.0/PKG-INFO +0 -147
- markdown_exec-1.11.0/README.md +0 -110
- markdown_exec-1.11.0/docs/css/insiders.css +0 -124
- markdown_exec-1.11.0/docs/insiders/changelog.md +0 -12
- markdown_exec-1.11.0/docs/insiders/goals.yml +0 -16
- markdown_exec-1.11.0/docs/insiders/index.md +0 -157
- markdown_exec-1.11.0/docs/insiders/installation.md +0 -67
- markdown_exec-1.11.0/docs/js/insiders.js +0 -74
- markdown_exec-1.11.0/scripts/insiders.py +0 -173
- markdown_exec-1.11.0/src/markdown_exec/_internal/formatters/tree.py +0 -60
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/CODE_OF_CONDUCT.md +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/CONTRIBUTING.md +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/LICENSE +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/config/coverage.ini +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/config/git-changelog.toml +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/config/mypy.ini +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/config/ruff.toml +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/config/vscode/launch.json +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/config/vscode/settings.json +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/config/vscode/tasks.json +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/docs/.overrides/partials/comments.html +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/docs/.overrides/partials/path-item.html +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/docs/changelog.md +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/docs/code_of_conduct.md +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/docs/contributing.md +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/docs/credits.md +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/docs/css/material.css +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/docs/css/mkdocstrings.css +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/docs/gallery.md +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/docs/index.md +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/docs/js/feedback.js +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/docs/license.md +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/docs/reference/api.md +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/docs/schema.json +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/docs/snippets/gallery/ansi.sh +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/docs/snippets/gallery/chalk.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/docs/snippets/gallery/diagrams.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/docs/snippets/gallery/drawsvg.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/docs/snippets/gallery/expandable_filetree.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/docs/snippets/gallery/hyperbolic.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/docs/snippets/gallery/matplotlib.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/docs/snippets/gallery/plotly.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/docs/snippets/gallery/pydeps.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/docs/snippets/gallery/qrcode.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/docs/snippets/gallery/rich.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/docs/snippets/gallery/rich_terminal.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/docs/snippets/gallery/textual.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/docs/snippets/usage/boolean_matrix.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/docs/snippets/usage/hide.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/docs/snippets/usage/multiple.pycon +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/docs/snippets/usage/platform_html.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/docs/snippets/usage/platform_md.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/docs/snippets/usage/source.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/docs/snippets/usage/source.pycon +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/docs/usage/python.md +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/docs/usage/shell.md +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/scripts/gen_credits.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/scripts/make +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/src/markdown_exec/__init__.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/src/markdown_exec/_internal/__init__.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/src/markdown_exec/_internal/formatters/__init__.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/src/markdown_exec/_internal/formatters/_exec_python.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/src/markdown_exec/_internal/formatters/base.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/src/markdown_exec/_internal/formatters/bash.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/src/markdown_exec/_internal/formatters/console.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/src/markdown_exec/_internal/formatters/markdown.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/src/markdown_exec/_internal/formatters/pycon.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/src/markdown_exec/_internal/formatters/pyodide.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/src/markdown_exec/_internal/formatters/python.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/src/markdown_exec/_internal/logger.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/src/markdown_exec/_internal/mkdocs_plugin.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/src/markdown_exec/_internal/processors.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/src/markdown_exec/assets/ansi.css +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/src/markdown_exec/assets/pyodide.css +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/src/markdown_exec/assets/pyodide.js +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/src/markdown_exec/formatters/__init__.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/src/markdown_exec/formatters/base.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/src/markdown_exec/formatters/bash.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/src/markdown_exec/formatters/console.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/src/markdown_exec/formatters/markdown.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/src/markdown_exec/formatters/pycon.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/src/markdown_exec/formatters/pyodide.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/src/markdown_exec/formatters/python.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/src/markdown_exec/formatters/sh.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/src/markdown_exec/formatters/tree.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/src/markdown_exec/logger.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/src/markdown_exec/mkdocs_plugin.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/src/markdown_exec/processors.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/src/markdown_exec/py.typed +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/src/markdown_exec/rendering.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/tests/__init__.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/tests/conftest.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/tests/test_converter.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/tests/test_headings.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/tests/test_python.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/tests/test_shell.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/tests/test_toc.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/tests/test_tree.py +0 -0
- {markdown_exec-1.11.0 → markdown_exec-1.12.1}/tests/test_validator.py +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.1](https://github.com/pawamoy/markdown-exec/releases/tag/1.12.1) - 2025-11-11
|
|
9
|
+
|
|
10
|
+
<small>[Compare with 1.12.0](https://github.com/pawamoy/markdown-exec/compare/1.12.0...1.12.1)</small>
|
|
11
|
+
|
|
12
|
+
### Code Refactoring
|
|
13
|
+
|
|
14
|
+
- Always register tables extension, needed for Zensical ([1f95bf0](https://github.com/pawamoy/markdown-exec/commit/1f95bf0a8b4a056a14f737b9bada0acc11de5e02) by Timothée Mazzucotelli).
|
|
15
|
+
|
|
16
|
+
## [1.12.0](https://github.com/pawamoy/markdown-exec/releases/tag/1.12.0) - 2025-11-10
|
|
17
|
+
|
|
18
|
+
<small>[Compare with 1.11.0](https://github.com/pawamoy/markdown-exec/compare/1.11.0...1.12.0)</small>
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
- Support per-file-extension icons ([e6e0d59](https://github.com/pawamoy/markdown-exec/commit/e6e0d59904dff70920e72290ce19adacb720b0c6) by Timothée Mazzucotelli).
|
|
23
|
+
|
|
8
24
|
## [1.11.0](https://github.com/pawamoy/markdown-exec/releases/tag/1.11.0) - 2025-06-28
|
|
9
25
|
|
|
10
26
|
<small>[Compare with 1.10.4](https://github.com/pawamoy/markdown-exec/compare/1.10.4...1.11.0)</small>
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: markdown-exec
|
|
3
|
+
Version: 1.12.1
|
|
4
|
+
Summary: Utilities to execute code blocks in Markdown files.
|
|
5
|
+
Keywords: markdown,python,exec,shell,bash,mkdocs
|
|
6
|
+
Author-Email: =?utf-8?q?Timoth=C3=A9e_Mazzucotelli?= <dev@pawamoy.fr>
|
|
7
|
+
License-Expression: ISC
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Classifier: Development Status :: 4 - Beta
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: Programming Language :: Python
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
19
|
+
Classifier: Topic :: Documentation
|
|
20
|
+
Classifier: Topic :: Software Development
|
|
21
|
+
Classifier: Topic :: Utilities
|
|
22
|
+
Classifier: Typing :: Typed
|
|
23
|
+
Project-URL: Homepage, https://pawamoy.github.io/markdown-exec
|
|
24
|
+
Project-URL: Documentation, https://pawamoy.github.io/markdown-exec
|
|
25
|
+
Project-URL: Changelog, https://pawamoy.github.io/markdown-exec/changelog
|
|
26
|
+
Project-URL: Repository, https://github.com/pawamoy/markdown-exec
|
|
27
|
+
Project-URL: Issues, https://github.com/pawamoy/markdown-exec/issues
|
|
28
|
+
Project-URL: Discussions, https://github.com/pawamoy/markdown-exec/discussions
|
|
29
|
+
Project-URL: Gitter, https://gitter.im/markdown-exec/community
|
|
30
|
+
Project-URL: Funding, https://github.com/sponsors/pawamoy
|
|
31
|
+
Requires-Python: >=3.10
|
|
32
|
+
Requires-Dist: pymdown-extensions>=9
|
|
33
|
+
Provides-Extra: ansi
|
|
34
|
+
Requires-Dist: pygments-ansi-color>=0.3; extra == "ansi"
|
|
35
|
+
Description-Content-Type: text/markdown
|
|
36
|
+
|
|
37
|
+
# Markdown Exec
|
|
38
|
+
|
|
39
|
+
[](https://github.com/pawamoy/markdown-exec/actions?query=workflow%3Aci)
|
|
40
|
+
[](https://pawamoy.github.io/markdown-exec/)
|
|
41
|
+
[](https://pypi.org/project/markdown-exec/)
|
|
42
|
+
[](https://app.gitter.im/#/room/#markdown-exec:gitter.im)
|
|
43
|
+
[](https://app.radicle.at/nodes/seed.radicle.at/rad:z77aiLJkzYXtuNpZuvizfGkDuZbQ)
|
|
44
|
+
|
|
45
|
+
Utilities to execute code blocks in Markdown files.
|
|
46
|
+
|
|
47
|
+
For example, you write a Python code block that computes some HTML,
|
|
48
|
+
and this HTML is injected in place of the code block.
|
|
49
|
+
|
|
50
|
+
## Installation
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
pip install "markdown-exec[ansi]"
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
The `ansi` extra provides the necessary bits (`pygments-ansi-color` and a CSS file)
|
|
57
|
+
to render ANSI colors in HTML code blocks. The CSS file is automatically added
|
|
58
|
+
to MkDocs' `extra_css` when Markdown Exec is activated via `plugins` (see below).
|
|
59
|
+
|
|
60
|
+
## Configuration
|
|
61
|
+
|
|
62
|
+
This extension relies on the
|
|
63
|
+
[SuperFences](https://facelessuser.github.io/pymdown-extensions/extensions/superfences/)
|
|
64
|
+
extension of
|
|
65
|
+
[PyMdown Extensions](https://facelessuser.github.io/pymdown-extensions/).
|
|
66
|
+
|
|
67
|
+
To allow execution of code blocks,
|
|
68
|
+
configure a custom fence from Python:
|
|
69
|
+
|
|
70
|
+
```python
|
|
71
|
+
from markdown import Markdown
|
|
72
|
+
from markdown_exec import formatter, validator
|
|
73
|
+
|
|
74
|
+
Markdown(
|
|
75
|
+
extensions=["pymdownx.superfences"],
|
|
76
|
+
extension_configs={
|
|
77
|
+
"pymdownx.superfences": {
|
|
78
|
+
"custom_fences": [
|
|
79
|
+
{
|
|
80
|
+
"name": "python",
|
|
81
|
+
"class": "python",
|
|
82
|
+
"validator": validator,
|
|
83
|
+
"format": formatter,
|
|
84
|
+
}
|
|
85
|
+
# ...one fence for each language we support:
|
|
86
|
+
# bash, console, md, markdown, py, python, pycon, pyodide, sh, tree, etc.
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
)
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
...or in MkDocs configuration file, as a Markdown extension:
|
|
94
|
+
|
|
95
|
+
```yaml
|
|
96
|
+
# mkdocs.yml
|
|
97
|
+
markdown_extensions:
|
|
98
|
+
- pymdownx.superfences:
|
|
99
|
+
custom_fences:
|
|
100
|
+
- name: python
|
|
101
|
+
class: python
|
|
102
|
+
validator: !!python/name:markdown_exec.validator
|
|
103
|
+
format: !!python/name:markdown_exec.formatter
|
|
104
|
+
# ...one fence for each language we support:
|
|
105
|
+
# bash, console, md, markdown, py, python, pycon, sh, tree
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
...or in MkDocs configuration file, as a plugin:
|
|
109
|
+
|
|
110
|
+
```yaml
|
|
111
|
+
# mkdocs.yml
|
|
112
|
+
plugins:
|
|
113
|
+
- search
|
|
114
|
+
- markdown-exec
|
|
115
|
+
|
|
116
|
+
# SuperFences must still be enabled!
|
|
117
|
+
markdown_extensions:
|
|
118
|
+
- pymdownx.superfences
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
TIP: We recommend enabling Markdown Exec with the MkDocs plugin
|
|
122
|
+
if you are using MkDocs: it will take care of adding relevant
|
|
123
|
+
assets (CSS/JS) to the final site when needed.
|
|
124
|
+
|
|
125
|
+
WARNING: **Limitation of configuration through Markdown/PyMDown.**
|
|
126
|
+
Configuration through `pymdownx.superfences` directly is not well supported for fences that require assets inclusion, like `pyodide`.
|
|
127
|
+
For these you will have to include the assets manually. In the future we will provide ways to include them automatically.
|
|
128
|
+
|
|
129
|
+
## Usage
|
|
130
|
+
|
|
131
|
+
You are now able to execute code blocks instead of displaying them:
|
|
132
|
+
|
|
133
|
+
````md
|
|
134
|
+
```python exec="on"
|
|
135
|
+
print("Hello Markdown!")
|
|
136
|
+
```
|
|
137
|
+
````
|
|
138
|
+
|
|
139
|
+
The `exec` option will be true for every possible value except `0`, `no`, `off` and `false` (case insensitive).
|
|
140
|
+
|
|
141
|
+
Below you can see an example of running a bash script that is expected to
|
|
142
|
+
return a non-zero exit code:
|
|
143
|
+
|
|
144
|
+
````md
|
|
145
|
+
```bash exec="1" source="tabbed-left" returncode="2"
|
|
146
|
+
grep extra_css README.md && exit 2
|
|
147
|
+
```
|
|
148
|
+
````
|
|
149
|
+
|
|
150
|
+
See [usage](https://pawamoy.github.io/markdown-exec/usage/) for more details,
|
|
151
|
+
and the [gallery](https://pawamoy.github.io/markdown-exec/gallery/) for more examples!
|
|
152
|
+
|
|
153
|
+
## Sponsors
|
|
154
|
+
|
|
155
|
+
<!-- sponsors-start -->
|
|
156
|
+
|
|
157
|
+
<div id="premium-sponsors" style="text-align: center;">
|
|
158
|
+
|
|
159
|
+
<div id="silver-sponsors"><b>Silver sponsors</b><p>
|
|
160
|
+
<a href="https://squidfunk.github.io/mkdocs-material/"><img alt="Material for MkDocs" src="https://raw.githubusercontent.com/squidfunk/mkdocs-material/master/.github/assets/logo.svg" style="height: 320px; "></a><br>
|
|
161
|
+
<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>
|
|
162
|
+
<a href="https://docs.pydantic.dev/latest/"><img alt="Pydantic" src="https://pydantic.dev/assets/for-external/pydantic_logfire_logo_endorsed_lithium_rgb.svg" style="height: 180px; "></a><br>
|
|
163
|
+
</p></div>
|
|
164
|
+
|
|
165
|
+
<div id="bronze-sponsors"><b>Bronze sponsors</b><p>
|
|
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>
|
|
167
|
+
</p></div>
|
|
168
|
+
</div>
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
<div id="sponsors"><p>
|
|
173
|
+
<a href="https://github.com/ofek"><img alt="ofek" src="https://avatars.githubusercontent.com/u/9677399?u=386c330f212ce467ce7119d9615c75d0e9b9f1ce&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
174
|
+
<a href="https://github.com/samuelcolvin"><img alt="samuelcolvin" src="https://avatars.githubusercontent.com/u/4039449?u=42eb3b833047c8c4b4f647a031eaef148c16d93f&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
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>
|
|
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>
|
|
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://github.com/cmarqu"><img alt="cmarqu" src="https://avatars.githubusercontent.com/u/360986?v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
179
|
+
<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>
|
|
180
|
+
<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>
|
|
181
|
+
<a href="https://github.com/machow"><img alt="machow" src="https://avatars.githubusercontent.com/u/2574498?u=c41e3d2f758a05102d8075e38d67b9c17d4189d7&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
182
|
+
<a href="https://github.com/BenHammersley"><img alt="BenHammersley" src="https://avatars.githubusercontent.com/u/99436?u=4499a7b507541045222ee28ae122dbe3c8d08ab5&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
183
|
+
<a href="https://github.com/trevorWieland"><img alt="trevorWieland" src="https://avatars.githubusercontent.com/u/28811461?u=74cc0e3756c1d4e3d66b5c396e1d131ea8a10472&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
184
|
+
<a href="https://github.com/laenan8466"><img alt="laenan8466" src="https://avatars.githubusercontent.com/u/21331242?v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
185
|
+
<a href="https://github.com/MarcoGorelli"><img alt="MarcoGorelli" src="https://avatars.githubusercontent.com/u/33491632?u=7de3a749cac76a60baca9777baf71d043a4f884d&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
186
|
+
<a href="https://github.com/analog-cbarber"><img alt="analog-cbarber" src="https://avatars.githubusercontent.com/u/7408243?u=642fc2bdcc9904089c62fe5aec4e03ace32da67d&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
187
|
+
<a href="https://github.com/OdinManiac"><img alt="OdinManiac" src="https://avatars.githubusercontent.com/u/22727172?u=36ab20970f7f52ae8e7eb67b7fcf491fee01ac22&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
188
|
+
<a href="https://github.com/rstudio-sponsorship"><img alt="rstudio-sponsorship" src="https://avatars.githubusercontent.com/u/58949051?u=0c471515dd18111be30dfb7669ed5e778970959b&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
189
|
+
<a href="https://github.com/schlich"><img alt="schlich" src="https://avatars.githubusercontent.com/u/21191435?u=6f1240adb68f21614d809ae52d66509f46b1e877&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
190
|
+
<a href="https://github.com/SuperCowPowers"><img alt="SuperCowPowers" src="https://avatars.githubusercontent.com/u/6900187?v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
191
|
+
<a href="https://github.com/butterlyn"><img alt="butterlyn" src="https://avatars.githubusercontent.com/u/53323535?v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
192
|
+
<a href="https://github.com/livingbio"><img alt="livingbio" src="https://avatars.githubusercontent.com/u/10329983?v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
193
|
+
<a href="https://github.com/NemetschekAllplan"><img alt="NemetschekAllplan" src="https://avatars.githubusercontent.com/u/912034?v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
194
|
+
<a href="https://github.com/EricJayHartman"><img alt="EricJayHartman" src="https://avatars.githubusercontent.com/u/9259499?u=7e58cc7ec0cd3e85b27aec33656aa0f6612706dd&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
195
|
+
<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>
|
|
196
|
+
<a href="https://github.com/cdwilson"><img alt="cdwilson" src="https://avatars.githubusercontent.com/u/14631?v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
197
|
+
<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>
|
|
198
|
+
<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>
|
|
199
|
+
<a href="https://github.com/wrath-codes"><img alt="wrath-codes" src="https://avatars.githubusercontent.com/u/90050913?u=b26582409dfff8ce2b60016fd119be09309708da&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
200
|
+
<a href="https://github.com/leodevian"><img alt="leodevian" src="https://avatars.githubusercontent.com/u/167141781?v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
201
|
+
<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>
|
|
202
|
+
<a href="https://github.com/blaisep"><img alt="blaisep" src="https://avatars.githubusercontent.com/u/254456?u=97d584b7c0a6faf583aa59975df4f993f671d121&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
203
|
+
<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>
|
|
204
|
+
<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>
|
|
205
|
+
<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>
|
|
206
|
+
<a href="https://github.com/blakeNaccarato"><img alt="blakeNaccarato" src="https://avatars.githubusercontent.com/u/20692450?u=bb919218be30cfa994514f4cf39bb2f7cf952df4&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
207
|
+
<a href="https://github.com/ChargeStorm"><img alt="ChargeStorm" src="https://avatars.githubusercontent.com/u/26000165?v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
208
|
+
<a href="https://github.com/Alphadelta14"><img alt="Alphadelta14" src="https://avatars.githubusercontent.com/u/480845?v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
209
|
+
</p></div>
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
*And 8 more private sponsor(s).*
|
|
213
|
+
|
|
214
|
+
<!-- sponsors-end -->
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
# Markdown Exec
|
|
2
|
+
|
|
3
|
+
[](https://github.com/pawamoy/markdown-exec/actions?query=workflow%3Aci)
|
|
4
|
+
[](https://pawamoy.github.io/markdown-exec/)
|
|
5
|
+
[](https://pypi.org/project/markdown-exec/)
|
|
6
|
+
[](https://app.gitter.im/#/room/#markdown-exec:gitter.im)
|
|
7
|
+
[](https://app.radicle.at/nodes/seed.radicle.at/rad:z77aiLJkzYXtuNpZuvizfGkDuZbQ)
|
|
8
|
+
|
|
9
|
+
Utilities to execute code blocks in Markdown files.
|
|
10
|
+
|
|
11
|
+
For example, you write a Python code block that computes some HTML,
|
|
12
|
+
and this HTML is injected in place of the code block.
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
pip install "markdown-exec[ansi]"
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
The `ansi` extra provides the necessary bits (`pygments-ansi-color` and a CSS file)
|
|
21
|
+
to render ANSI colors in HTML code blocks. The CSS file is automatically added
|
|
22
|
+
to MkDocs' `extra_css` when Markdown Exec is activated via `plugins` (see below).
|
|
23
|
+
|
|
24
|
+
## Configuration
|
|
25
|
+
|
|
26
|
+
This extension relies on the
|
|
27
|
+
[SuperFences](https://facelessuser.github.io/pymdown-extensions/extensions/superfences/)
|
|
28
|
+
extension of
|
|
29
|
+
[PyMdown Extensions](https://facelessuser.github.io/pymdown-extensions/).
|
|
30
|
+
|
|
31
|
+
To allow execution of code blocks,
|
|
32
|
+
configure a custom fence from Python:
|
|
33
|
+
|
|
34
|
+
```python
|
|
35
|
+
from markdown import Markdown
|
|
36
|
+
from markdown_exec import formatter, validator
|
|
37
|
+
|
|
38
|
+
Markdown(
|
|
39
|
+
extensions=["pymdownx.superfences"],
|
|
40
|
+
extension_configs={
|
|
41
|
+
"pymdownx.superfences": {
|
|
42
|
+
"custom_fences": [
|
|
43
|
+
{
|
|
44
|
+
"name": "python",
|
|
45
|
+
"class": "python",
|
|
46
|
+
"validator": validator,
|
|
47
|
+
"format": formatter,
|
|
48
|
+
}
|
|
49
|
+
# ...one fence for each language we support:
|
|
50
|
+
# bash, console, md, markdown, py, python, pycon, pyodide, sh, tree, etc.
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
)
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
...or in MkDocs configuration file, as a Markdown extension:
|
|
58
|
+
|
|
59
|
+
```yaml
|
|
60
|
+
# mkdocs.yml
|
|
61
|
+
markdown_extensions:
|
|
62
|
+
- pymdownx.superfences:
|
|
63
|
+
custom_fences:
|
|
64
|
+
- name: python
|
|
65
|
+
class: python
|
|
66
|
+
validator: !!python/name:markdown_exec.validator
|
|
67
|
+
format: !!python/name:markdown_exec.formatter
|
|
68
|
+
# ...one fence for each language we support:
|
|
69
|
+
# bash, console, md, markdown, py, python, pycon, sh, tree
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
...or in MkDocs configuration file, as a plugin:
|
|
73
|
+
|
|
74
|
+
```yaml
|
|
75
|
+
# mkdocs.yml
|
|
76
|
+
plugins:
|
|
77
|
+
- search
|
|
78
|
+
- markdown-exec
|
|
79
|
+
|
|
80
|
+
# SuperFences must still be enabled!
|
|
81
|
+
markdown_extensions:
|
|
82
|
+
- pymdownx.superfences
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
TIP: We recommend enabling Markdown Exec with the MkDocs plugin
|
|
86
|
+
if you are using MkDocs: it will take care of adding relevant
|
|
87
|
+
assets (CSS/JS) to the final site when needed.
|
|
88
|
+
|
|
89
|
+
WARNING: **Limitation of configuration through Markdown/PyMDown.**
|
|
90
|
+
Configuration through `pymdownx.superfences` directly is not well supported for fences that require assets inclusion, like `pyodide`.
|
|
91
|
+
For these you will have to include the assets manually. In the future we will provide ways to include them automatically.
|
|
92
|
+
|
|
93
|
+
## Usage
|
|
94
|
+
|
|
95
|
+
You are now able to execute code blocks instead of displaying them:
|
|
96
|
+
|
|
97
|
+
````md
|
|
98
|
+
```python exec="on"
|
|
99
|
+
print("Hello Markdown!")
|
|
100
|
+
```
|
|
101
|
+
````
|
|
102
|
+
|
|
103
|
+
The `exec` option will be true for every possible value except `0`, `no`, `off` and `false` (case insensitive).
|
|
104
|
+
|
|
105
|
+
Below you can see an example of running a bash script that is expected to
|
|
106
|
+
return a non-zero exit code:
|
|
107
|
+
|
|
108
|
+
````md
|
|
109
|
+
```bash exec="1" source="tabbed-left" returncode="2"
|
|
110
|
+
grep extra_css README.md && exit 2
|
|
111
|
+
```
|
|
112
|
+
````
|
|
113
|
+
|
|
114
|
+
See [usage](https://pawamoy.github.io/markdown-exec/usage/) for more details,
|
|
115
|
+
and the [gallery](https://pawamoy.github.io/markdown-exec/gallery/) for more examples!
|
|
116
|
+
|
|
117
|
+
## Sponsors
|
|
118
|
+
|
|
119
|
+
<!-- sponsors-start -->
|
|
120
|
+
|
|
121
|
+
<div id="premium-sponsors" style="text-align: center;">
|
|
122
|
+
|
|
123
|
+
<div id="silver-sponsors"><b>Silver sponsors</b><p>
|
|
124
|
+
<a href="https://squidfunk.github.io/mkdocs-material/"><img alt="Material for MkDocs" src="https://raw.githubusercontent.com/squidfunk/mkdocs-material/master/.github/assets/logo.svg" style="height: 320px; "></a><br>
|
|
125
|
+
<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>
|
|
126
|
+
<a href="https://docs.pydantic.dev/latest/"><img alt="Pydantic" src="https://pydantic.dev/assets/for-external/pydantic_logfire_logo_endorsed_lithium_rgb.svg" style="height: 180px; "></a><br>
|
|
127
|
+
</p></div>
|
|
128
|
+
|
|
129
|
+
<div id="bronze-sponsors"><b>Bronze sponsors</b><p>
|
|
130
|
+
<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>
|
|
131
|
+
</p></div>
|
|
132
|
+
</div>
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
<div id="sponsors"><p>
|
|
137
|
+
<a href="https://github.com/ofek"><img alt="ofek" src="https://avatars.githubusercontent.com/u/9677399?u=386c330f212ce467ce7119d9615c75d0e9b9f1ce&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
138
|
+
<a href="https://github.com/samuelcolvin"><img alt="samuelcolvin" src="https://avatars.githubusercontent.com/u/4039449?u=42eb3b833047c8c4b4f647a031eaef148c16d93f&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
139
|
+
<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>
|
|
140
|
+
<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>
|
|
141
|
+
<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>
|
|
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>
|
|
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>
|
|
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>
|
|
145
|
+
<a href="https://github.com/machow"><img alt="machow" src="https://avatars.githubusercontent.com/u/2574498?u=c41e3d2f758a05102d8075e38d67b9c17d4189d7&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
146
|
+
<a href="https://github.com/BenHammersley"><img alt="BenHammersley" src="https://avatars.githubusercontent.com/u/99436?u=4499a7b507541045222ee28ae122dbe3c8d08ab5&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
147
|
+
<a href="https://github.com/trevorWieland"><img alt="trevorWieland" src="https://avatars.githubusercontent.com/u/28811461?u=74cc0e3756c1d4e3d66b5c396e1d131ea8a10472&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
148
|
+
<a href="https://github.com/laenan8466"><img alt="laenan8466" src="https://avatars.githubusercontent.com/u/21331242?v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
149
|
+
<a href="https://github.com/MarcoGorelli"><img alt="MarcoGorelli" src="https://avatars.githubusercontent.com/u/33491632?u=7de3a749cac76a60baca9777baf71d043a4f884d&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
150
|
+
<a href="https://github.com/analog-cbarber"><img alt="analog-cbarber" src="https://avatars.githubusercontent.com/u/7408243?u=642fc2bdcc9904089c62fe5aec4e03ace32da67d&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
151
|
+
<a href="https://github.com/OdinManiac"><img alt="OdinManiac" src="https://avatars.githubusercontent.com/u/22727172?u=36ab20970f7f52ae8e7eb67b7fcf491fee01ac22&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
152
|
+
<a href="https://github.com/rstudio-sponsorship"><img alt="rstudio-sponsorship" src="https://avatars.githubusercontent.com/u/58949051?u=0c471515dd18111be30dfb7669ed5e778970959b&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
153
|
+
<a href="https://github.com/schlich"><img alt="schlich" src="https://avatars.githubusercontent.com/u/21191435?u=6f1240adb68f21614d809ae52d66509f46b1e877&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
154
|
+
<a href="https://github.com/SuperCowPowers"><img alt="SuperCowPowers" src="https://avatars.githubusercontent.com/u/6900187?v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
155
|
+
<a href="https://github.com/butterlyn"><img alt="butterlyn" src="https://avatars.githubusercontent.com/u/53323535?v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
156
|
+
<a href="https://github.com/livingbio"><img alt="livingbio" src="https://avatars.githubusercontent.com/u/10329983?v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
157
|
+
<a href="https://github.com/NemetschekAllplan"><img alt="NemetschekAllplan" src="https://avatars.githubusercontent.com/u/912034?v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
158
|
+
<a href="https://github.com/EricJayHartman"><img alt="EricJayHartman" src="https://avatars.githubusercontent.com/u/9259499?u=7e58cc7ec0cd3e85b27aec33656aa0f6612706dd&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
159
|
+
<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>
|
|
160
|
+
<a href="https://github.com/cdwilson"><img alt="cdwilson" src="https://avatars.githubusercontent.com/u/14631?v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
161
|
+
<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
|
+
<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/wrath-codes"><img alt="wrath-codes" src="https://avatars.githubusercontent.com/u/90050913?u=b26582409dfff8ce2b60016fd119be09309708da&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
164
|
+
<a href="https://github.com/leodevian"><img alt="leodevian" src="https://avatars.githubusercontent.com/u/167141781?v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
165
|
+
<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>
|
|
166
|
+
<a href="https://github.com/blaisep"><img alt="blaisep" src="https://avatars.githubusercontent.com/u/254456?u=97d584b7c0a6faf583aa59975df4f993f671d121&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
167
|
+
<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>
|
|
168
|
+
<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>
|
|
169
|
+
<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>
|
|
170
|
+
<a href="https://github.com/blakeNaccarato"><img alt="blakeNaccarato" src="https://avatars.githubusercontent.com/u/20692450?u=bb919218be30cfa994514f4cf39bb2f7cf952df4&v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
171
|
+
<a href="https://github.com/ChargeStorm"><img alt="ChargeStorm" src="https://avatars.githubusercontent.com/u/26000165?v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
172
|
+
<a href="https://github.com/Alphadelta14"><img alt="Alphadelta14" src="https://avatars.githubusercontent.com/u/480845?v=4" style="height: 32px; border-radius: 100%;"></a>
|
|
173
|
+
</p></div>
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
*And 8 more private sponsor(s).*
|
|
177
|
+
|
|
178
|
+
<!-- sponsors-end -->
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
{% extends "base.html" %}
|
|
2
2
|
|
|
3
3
|
{% block announce %}
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
</span> —
|
|
10
|
-
|
|
4
|
+
<strong>Fund this project</strong> through
|
|
5
|
+
<a href="https://github.com/sponsors/pawamoy"><strong>sponsorship</strong></a>
|
|
6
|
+
<span class="twemoji heart pulse">
|
|
7
|
+
{% include ".icons/octicons/heart-fill-16.svg" %}
|
|
8
|
+
</span> —
|
|
11
9
|
Follow
|
|
12
10
|
<strong>@pawamoy</strong> on
|
|
13
11
|
<a rel="me" href="https://fosstodon.org/@pawamoy">
|
|
@@ -6,13 +6,13 @@ from runpy import run_module
|
|
|
6
6
|
|
|
7
7
|
old_argv = list(sys.argv)
|
|
8
8
|
sys.argv = ["mkdocs"]
|
|
9
|
-
|
|
10
|
-
sys.
|
|
9
|
+
old_stderr = sys.stderr
|
|
10
|
+
sys.stderr = StringIO()
|
|
11
11
|
warnings.filterwarnings("ignore", category=RuntimeWarning)
|
|
12
12
|
with suppress(SystemExit):
|
|
13
13
|
run_module("mkdocs", run_name="__main__")
|
|
14
|
-
output = sys.
|
|
15
|
-
sys.
|
|
14
|
+
output = sys.stderr.getvalue()
|
|
15
|
+
sys.stderr = old_stderr
|
|
16
16
|
sys.argv = old_argv
|
|
17
17
|
|
|
18
18
|
print(f"```\n{output}\n```")
|
|
@@ -271,6 +271,14 @@ $ cat .git/config
|
|
|
271
271
|
```
|
|
272
272
|
````
|
|
273
273
|
|
|
274
|
+
If you just want a basic code block without any syntax highlighting, use the `text` language:
|
|
275
|
+
|
|
276
|
+
````md exec="1" source="tabbed-left" tabs="Markdown|Rendered"
|
|
277
|
+
```console exec="1" result="text"
|
|
278
|
+
$ echo 'print("some python code that is not highlighted")'
|
|
279
|
+
```
|
|
280
|
+
````
|
|
281
|
+
|
|
274
282
|
WARNING: **Limitation:**
|
|
275
283
|
Wrapping the result is not possible when HTML output is enabled.
|
|
276
284
|
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
# Pyodide
|
|
2
2
|
|
|
3
|
-
[:octicons-tag-24: Insiders 1.0.0](../insiders/changelog.md#1.0.0)
|
|
4
|
-
|
|
5
3
|
This special `pyodide` fence uses [Pyodide](https://pyodide.org), [Ace](https://ace.c9.io/)
|
|
6
4
|
and [Highlight.js](https://highlightjs.org/) to render an interactive Python editor.
|
|
7
5
|
Everything runs on the client side. The first time Pyodide is loaded by the browser
|
|
@@ -19,6 +19,8 @@ root2
|
|
|
19
19
|
```
|
|
20
20
|
````
|
|
21
21
|
|
|
22
|
+
## Syntax highlight
|
|
23
|
+
|
|
22
24
|
By default, the language used for syntax highlight is `bash`.
|
|
23
25
|
It means you can add comments with `#`:
|
|
24
26
|
|
|
@@ -56,6 +58,8 @@ root2
|
|
|
56
58
|
```
|
|
57
59
|
````
|
|
58
60
|
|
|
61
|
+
## Leaf directories
|
|
62
|
+
|
|
59
63
|
You can force an entry to be displayed as a directory instead of a regular file
|
|
60
64
|
by appending a trailing slash to the name:
|
|
61
65
|
|
|
@@ -68,7 +72,55 @@ root1
|
|
|
68
72
|
```
|
|
69
73
|
````
|
|
70
74
|
|
|
71
|
-
It is recommended to always append trailing slashes to
|
|
75
|
+
It is recommended to always append trailing slashes to directories anyway.
|
|
72
76
|
|
|
73
77
|
WARNING: **Limitation:**
|
|
74
78
|
Spaces in file names are not supported when searching for a trailing slash.
|
|
79
|
+
|
|
80
|
+
## Custom icons
|
|
81
|
+
|
|
82
|
+
Custom icons based on the file name and extension can be used in tree fences.
|
|
83
|
+
This feature requires that the [Material for MkDocs](https://squidfunk.github.io/mkdocs-material/) theme is used.
|
|
84
|
+
By default, if Material for MkDocs is used, custom icons will be rendered.
|
|
85
|
+
You can opt-out with `icons="basic"` to use the basic folder and file emojis,
|
|
86
|
+
or even remove all icons/emojis with `icons="none"`.
|
|
87
|
+
|
|
88
|
+
````md exec="1" source="tabbed-left" tabs="Markdown|Rendered"
|
|
89
|
+
```tree icons="none"
|
|
90
|
+
folder/
|
|
91
|
+
file
|
|
92
|
+
file.py
|
|
93
|
+
file.rb
|
|
94
|
+
file.js
|
|
95
|
+
```
|
|
96
|
+
````
|
|
97
|
+
|
|
98
|
+
````md exec="1" source="tabbed-left" tabs="Markdown|Rendered"
|
|
99
|
+
```tree icons="basic"
|
|
100
|
+
folder/
|
|
101
|
+
file
|
|
102
|
+
file.py
|
|
103
|
+
file.rb
|
|
104
|
+
file.rs
|
|
105
|
+
```
|
|
106
|
+
````
|
|
107
|
+
|
|
108
|
+
````md exec="1" source="tabbed-left" tabs="Markdown|Rendered"
|
|
109
|
+
```tree icons="material"
|
|
110
|
+
folder/
|
|
111
|
+
file
|
|
112
|
+
file.py
|
|
113
|
+
file.rb
|
|
114
|
+
file.rs
|
|
115
|
+
```
|
|
116
|
+
````
|
|
117
|
+
|
|
118
|
+
````md exec="1" source="tabbed-left" tabs="Markdown|Rendered"
|
|
119
|
+
```tree icons="auto"
|
|
120
|
+
folder/
|
|
121
|
+
file
|
|
122
|
+
file.py
|
|
123
|
+
file.rb
|
|
124
|
+
file.rs
|
|
125
|
+
```
|
|
126
|
+
````
|