markdown-exec 1.12.1__tar.gz → 1.12.3__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.
Files changed (118) hide show
  1. markdown_exec-1.12.3/AI_POLICY.md +15 -0
  2. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/CHANGELOG.md +21 -0
  3. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/CONTRIBUTING.md +6 -16
  4. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/LICENSE +1 -1
  5. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/PKG-INFO +15 -16
  6. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/README.md +14 -15
  7. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/config/ruff.toml +9 -24
  8. markdown_exec-1.12.3/config/ty.toml +6 -0
  9. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/config/vscode/launch.json +1 -2
  10. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/config/vscode/settings.json +1 -3
  11. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/docs/.overrides/partials/comments.html +1 -1
  12. markdown_exec-1.12.3/docs/css/apidocs.css +21 -0
  13. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/docs/gallery.md +18 -18
  14. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/docs/snippets/gallery/matplotlib.py +5 -2
  15. markdown_exec-1.12.3/docs/snippets/gallery/pydeps.py +19 -0
  16. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/docs/usage/index.md +16 -26
  17. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/docs/usage/pyodide.md +15 -35
  18. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/docs/usage/shell.md +2 -2
  19. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/docs/usage/tree.md +8 -0
  20. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/duties.py +38 -43
  21. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/pyproject.toml +7 -13
  22. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/scripts/gen_credits.py +15 -16
  23. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/scripts/make.py +7 -7
  24. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/src/markdown_exec/_internal/debug.py +1 -1
  25. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/src/markdown_exec/_internal/formatters/_exec_python.py +2 -2
  26. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/src/markdown_exec/_internal/formatters/base.py +4 -3
  27. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/src/markdown_exec/_internal/formatters/pyodide.py +19 -13
  28. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/src/markdown_exec/_internal/formatters/python.py +2 -2
  29. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/src/markdown_exec/_internal/formatters/tree.py +12 -4
  30. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/src/markdown_exec/_internal/logger.py +4 -1
  31. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/src/markdown_exec/_internal/mkdocs_plugin.py +2 -2
  32. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/src/markdown_exec/_internal/processors.py +1 -1
  33. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/src/markdown_exec/_internal/rendering.py +13 -13
  34. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/tests/test_api.py +8 -7
  35. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/tests/test_toc.py +6 -6
  36. markdown_exec-1.12.3/zensical.toml +199 -0
  37. markdown_exec-1.12.1/config/mypy.ini +0 -9
  38. markdown_exec-1.12.1/docs/.overrides/partials/path-item.html +0 -22
  39. markdown_exec-1.12.1/docs/css/material.css +0 -4
  40. markdown_exec-1.12.1/docs/css/mkdocstrings.css +0 -72
  41. markdown_exec-1.12.1/docs/snippets/gallery/pydeps.py +0 -43
  42. markdown_exec-1.12.1/mkdocs.yml +0 -187
  43. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/CODE_OF_CONDUCT.md +0 -0
  44. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/config/coverage.ini +0 -0
  45. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/config/git-changelog.toml +0 -0
  46. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/config/pytest.ini +0 -0
  47. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/config/vscode/tasks.json +0 -0
  48. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/docs/.overrides/main.html +0 -0
  49. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/docs/changelog.md +0 -0
  50. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/docs/code_of_conduct.md +0 -0
  51. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/docs/contributing.md +0 -0
  52. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/docs/credits.md +0 -0
  53. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/docs/index.md +0 -0
  54. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/docs/js/feedback.js +0 -0
  55. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/docs/license.md +0 -0
  56. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/docs/reference/api.md +0 -0
  57. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/docs/schema.json +0 -0
  58. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/docs/snippets/gallery/ansi.sh +0 -0
  59. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/docs/snippets/gallery/argparse.py +0 -0
  60. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/docs/snippets/gallery/argparse_format.py +0 -0
  61. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/docs/snippets/gallery/chalk.py +0 -0
  62. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/docs/snippets/gallery/d2.py +0 -0
  63. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/docs/snippets/gallery/diagrams.py +0 -0
  64. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/docs/snippets/gallery/drawsvg.py +0 -0
  65. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/docs/snippets/gallery/expandable_filetree.py +0 -0
  66. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/docs/snippets/gallery/hyperbolic.py +0 -0
  67. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/docs/snippets/gallery/plotly.py +0 -0
  68. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/docs/snippets/gallery/qrcode.py +0 -0
  69. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/docs/snippets/gallery/rich.py +0 -0
  70. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/docs/snippets/gallery/rich_terminal.py +0 -0
  71. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/docs/snippets/gallery/runpy.py +0 -0
  72. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/docs/snippets/gallery/textual.py +0 -0
  73. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/docs/snippets/usage/boolean_matrix.py +0 -0
  74. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/docs/snippets/usage/hide.py +0 -0
  75. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/docs/snippets/usage/multiple.pycon +0 -0
  76. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/docs/snippets/usage/platform_html.py +0 -0
  77. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/docs/snippets/usage/platform_md.py +0 -0
  78. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/docs/snippets/usage/source.py +0 -0
  79. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/docs/snippets/usage/source.pycon +0 -0
  80. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/docs/usage/python.md +0 -0
  81. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/scripts/get_version.py +0 -0
  82. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/scripts/make +0 -0
  83. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/src/markdown_exec/__init__.py +0 -0
  84. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/src/markdown_exec/_internal/__init__.py +0 -0
  85. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/src/markdown_exec/_internal/formatters/__init__.py +0 -0
  86. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/src/markdown_exec/_internal/formatters/bash.py +0 -0
  87. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/src/markdown_exec/_internal/formatters/console.py +0 -0
  88. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/src/markdown_exec/_internal/formatters/markdown.py +0 -0
  89. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/src/markdown_exec/_internal/formatters/pycon.py +0 -0
  90. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/src/markdown_exec/_internal/formatters/sh.py +0 -0
  91. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/src/markdown_exec/_internal/main.py +0 -0
  92. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/src/markdown_exec/assets/ansi.css +0 -0
  93. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/src/markdown_exec/assets/pyodide.css +0 -0
  94. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/src/markdown_exec/assets/pyodide.js +0 -0
  95. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/src/markdown_exec/formatters/__init__.py +0 -0
  96. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/src/markdown_exec/formatters/base.py +0 -0
  97. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/src/markdown_exec/formatters/bash.py +0 -0
  98. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/src/markdown_exec/formatters/console.py +0 -0
  99. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/src/markdown_exec/formatters/markdown.py +0 -0
  100. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/src/markdown_exec/formatters/pycon.py +0 -0
  101. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/src/markdown_exec/formatters/pyodide.py +0 -0
  102. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/src/markdown_exec/formatters/python.py +0 -0
  103. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/src/markdown_exec/formatters/sh.py +0 -0
  104. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/src/markdown_exec/formatters/tree.py +0 -0
  105. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/src/markdown_exec/logger.py +0 -0
  106. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/src/markdown_exec/mkdocs_plugin.py +0 -0
  107. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/src/markdown_exec/processors.py +0 -0
  108. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/src/markdown_exec/py.typed +0 -0
  109. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/src/markdown_exec/rendering.py +0 -0
  110. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/tests/__init__.py +0 -0
  111. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/tests/conftest.py +0 -0
  112. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/tests/test_base_formatter.py +0 -0
  113. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/tests/test_converter.py +0 -0
  114. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/tests/test_headings.py +0 -0
  115. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/tests/test_python.py +0 -0
  116. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/tests/test_shell.py +0 -0
  117. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/tests/test_tree.py +0 -0
  118. {markdown_exec-1.12.1 → markdown_exec-1.12.3}/tests/test_validator.py +0 -0
@@ -0,0 +1,15 @@
1
+ # AI Contribution Policy
2
+
3
+ We accept AI-*assisted* contributions, both for code and documentation, with the following expectations:
4
+
5
+ - AI-assisted contributions must disclaim their use of AI.
6
+ - Contributors must fully understand the proposed changes and be able to explain why they are the correct approach.
7
+ - Issues must be created before creating pull requests (unless there is already a relevant issue).
8
+ - Issue and pull request templates must be followed.
9
+ - Comments (including bodies) in issues and pull requests must be written by humans. If you use LLMs to translate from one language to another, please include your original comment and the translated one.
10
+ - Git commits must be authored by humans, not AI/bot accounts or identities.
11
+ - Git commit messages must be written by humans, in English. If you cannot write English, please state so in the pull request body and we will write the commit messages ourselves.
12
+
13
+ Failure to comply with any of these requirements will result in issues or pull requests being closed immediately without comment. Repeated violations of this policy will result in a ban of the offending accounts/identities from contributing to this project and any related project from the same author/organization.
14
+
15
+ We do not accept AI-generated content in community spaces we maintain or moderate, such as GitHub discussions or Matrix rooms.
@@ -5,6 +5,27 @@ 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.3](https://github.com/pawamoy/markdown-exec/releases/tag/1.12.3) - 2026-07-07
9
+
10
+ <small>[Compare with 1.12.2](https://github.com/pawamoy/markdown-exec/compare/1.12.2...1.12.3)</small>
11
+
12
+ ### Bug Fixes
13
+
14
+ - Provide Pyodide options to Zensical ([abcb044](https://github.com/pawamoy/markdown-exec/commit/abcb0443751d4871968d20bddf66b0b4a9d45620) by Timothée Mazzucotelli). [Issue-100](https://github.com/pawamoy/markdown-exec/issues/100)
15
+
16
+ ### Code Refactoring
17
+
18
+ - Rename material-block source display option to block ([2cefa97](https://github.com/pawamoy/markdown-exec/commit/2cefa97a3ee918cf009afda0fa881286c92626b9) by Timothée Mazzucotelli).
19
+ - Update Pyodide hardcoded version to 314.0.2 ([eef2661](https://github.com/pawamoy/markdown-exec/commit/eef2661d878f9e13cbd3d923edba21037e478c41) by Timothée Mazzucotelli).
20
+
21
+ ## [1.12.2](https://github.com/pawamoy/markdown-exec/releases/tag/1.12.2) - 2026-07-05
22
+
23
+ <small>[Compare with 1.12.1](https://github.com/pawamoy/markdown-exec/compare/1.12.1...1.12.2)</small>
24
+
25
+ ### Code Refactoring
26
+
27
+ - Better integrate with Zensical ([e4f60c1](https://github.com/pawamoy/markdown-exec/commit/e4f60c12de3b05fb31486b5823f45258d281d001) by Timothée Mazzucotelli). [PR-99](https://github.com/pawamoy/markdown-exec/pull/99)
28
+
8
29
  ## [1.12.1](https://github.com/pawamoy/markdown-exec/releases/tag/1.12.1) - 2025-11-11
9
30
 
10
31
  <small>[Compare with 1.12.0](https://github.com/pawamoy/markdown-exec/compare/1.12.0...1.12.1)</small>
@@ -1,36 +1,26 @@
1
1
  # Contributing
2
2
 
3
- Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given.
3
+ Contributions are welcome, and they are greatly appreciated. Every little bit helps, and credit will always be given.
4
4
 
5
- ## Environment setup
5
+ **Please always create an issue before working on a new feature or a bug fix, so that we can discuss the implementation and make sure that your work will be merged.**
6
6
 
7
- Nothing easier!
7
+ ## Environment setup
8
8
 
9
- Fork and clone the repository, then:
9
+ Install [uv](https://github.com/astral-sh/uv) and [direnv](https://direnv.net/), fork and clone the repository, then:
10
10
 
11
11
  ```bash
12
12
  cd markdown-exec
13
+ direnv allow
13
14
  make setup
14
15
  ```
15
16
 
16
- > NOTE: If it fails for some reason, you'll need to install [uv](https://github.com/astral-sh/uv) manually.
17
- >
18
- > You can install it with:
19
- >
20
- > ```bash
21
- > curl -LsSf https://astral.sh/uv/install.sh | sh
22
- > ```
23
- >
24
- > Now you can try running `make setup` again, or simply `uv sync`.
25
-
26
17
  You now have the dependencies installed.
27
18
 
28
19
  Run `make help` to see all the available actions!
29
20
 
30
21
  ## Tasks
31
22
 
32
- The entry-point to run commands and tasks is the `make` Python script, located in the `scripts` directory. Try running `make` to show the available commands and tasks. The *commands* do not need the Python dependencies to be installed,
33
- while the *tasks* do. The cross-platform tasks are written in Python, thanks to [duty](https://github.com/pawamoy/duty).
23
+ The entry-point to run commands and tasks is the `make` Python script, located in the `scripts` directory. Try running `make` to show the available commands and tasks. The *commands* do not need the Python dependencies to be installed, while the *tasks* do. The cross-platform tasks are written in Python, thanks to [duty](https://github.com/pawamoy/duty).
34
24
 
35
25
  If you work in VSCode, we provide [an action to configure VSCode](https://pawamoy.github.io/copier-uv/work/#vscode-setup) for the project.
36
26
 
@@ -1,6 +1,6 @@
1
1
  ISC License
2
2
 
3
- Copyright (c) 2022, Timothée Mazzucotelli
3
+ Copyright (c) 2022, Timothée Mazzucotelli and contributors
4
4
 
5
5
  Permission to use, copy, modify, and/or distribute this software for any
6
6
  purpose with or without fee is hereby granted, provided that the above
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: markdown-exec
3
- Version: 1.12.1
3
+ Version: 1.12.3
4
4
  Summary: Utilities to execute code blocks in Markdown files.
5
5
  Keywords: markdown,python,exec,shell,bash,mkdocs
6
6
  Author-Email: =?utf-8?q?Timoth=C3=A9e_Mazzucotelli?= <dev@pawamoy.fr>
@@ -37,15 +37,14 @@ Description-Content-Type: text/markdown
37
37
  # Markdown Exec
38
38
 
39
39
  [![ci](https://github.com/pawamoy/markdown-exec/workflows/ci/badge.svg)](https://github.com/pawamoy/markdown-exec/actions?query=workflow%3Aci)
40
- [![documentation](https://img.shields.io/badge/docs-mkdocs-708FCC.svg?style=flat)](https://pawamoy.github.io/markdown-exec/)
40
+ [![documentation](https://img.shields.io/badge/docs-zensical-FF9100.svg?style=flat)](https://pawamoy.github.io/markdown-exec/)
41
41
  [![pypi version](https://img.shields.io/pypi/v/markdown-exec.svg)](https://pypi.org/project/markdown-exec/)
42
42
  [![gitter](https://img.shields.io/badge/matrix-chat-4DB798.svg?style=flat)](https://app.gitter.im/#/room/#markdown-exec:gitter.im)
43
43
  [![radicle](https://img.shields.io/badge/rad-clone-6666FF.svg?style=flat)](https://app.radicle.at/nodes/seed.radicle.at/rad:z77aiLJkzYXtuNpZuvizfGkDuZbQ)
44
44
 
45
45
  Utilities to execute code blocks in Markdown files.
46
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.
47
+ For example, you write a Python code block that computes some HTML, and this HTML is injected in place of the code block.
49
48
 
50
49
  ## Installation
51
50
 
@@ -118,13 +117,19 @@ markdown_extensions:
118
117
  - pymdownx.superfences
119
118
  ```
120
119
 
120
+ ...or in Zensical configuration file, as a legacy plugin:
121
+
122
+ ```toml
123
+ [project.plugins.markdown-exec]
124
+ ```
125
+
121
126
  TIP: We recommend enabling Markdown Exec with the MkDocs plugin
122
- if you are using MkDocs: it will take care of adding relevant
127
+ if you are using MkDocs/Zensical: it will take care of adding relevant
123
128
  assets (CSS/JS) to the final site when needed.
124
129
 
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.
130
+ WARNING: **Limitation of configuration through Markdown/PyMDown for MkDocs.**
131
+ Configuration through `pymdownx.superfences` directly is not well supported within MkDocs for fences that require assets inclusion, like `pyodide`.
132
+ For these you will have to include the assets manually. In the future we will provide ways to include them automatically. In Zensical these assets are provided natively.
128
133
 
129
134
  ## Usage
130
135
 
@@ -157,9 +162,7 @@ and the [gallery](https://pawamoy.github.io/markdown-exec/gallery/) for more exa
157
162
  <div id="premium-sponsors" style="text-align: center;">
158
163
 
159
164
  <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
165
  <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
166
  </p></div>
164
167
 
165
168
  <div id="bronze-sponsors"><b>Bronze sponsors</b><p>
@@ -181,23 +184,18 @@ and the [gallery](https://pawamoy.github.io/markdown-exec/gallery/) for more exa
181
184
  <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
185
  <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
186
  <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
187
  <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
188
  <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
189
  <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
190
  <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
191
  <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
192
  <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
193
  <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
194
  <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
195
  <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
196
  <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
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
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
199
  <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
200
  <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
201
  <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>
@@ -206,9 +204,10 @@ and the [gallery](https://pawamoy.github.io/markdown-exec/gallery/) for more exa
206
204
  <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
205
  <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
206
  <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>
207
+ <a href="https://github.com/Cusp-AI"><img alt="Cusp-AI" src="https://avatars.githubusercontent.com/u/178170649?v=4" style="height: 32px; border-radius: 100%;"></a>
209
208
  </p></div>
210
209
 
211
210
 
212
- *And 8 more private sponsor(s).*
211
+ *And 7 more private sponsor(s).*
213
212
 
214
213
  <!-- sponsors-end -->
@@ -1,15 +1,14 @@
1
1
  # Markdown Exec
2
2
 
3
3
  [![ci](https://github.com/pawamoy/markdown-exec/workflows/ci/badge.svg)](https://github.com/pawamoy/markdown-exec/actions?query=workflow%3Aci)
4
- [![documentation](https://img.shields.io/badge/docs-mkdocs-708FCC.svg?style=flat)](https://pawamoy.github.io/markdown-exec/)
4
+ [![documentation](https://img.shields.io/badge/docs-zensical-FF9100.svg?style=flat)](https://pawamoy.github.io/markdown-exec/)
5
5
  [![pypi version](https://img.shields.io/pypi/v/markdown-exec.svg)](https://pypi.org/project/markdown-exec/)
6
6
  [![gitter](https://img.shields.io/badge/matrix-chat-4DB798.svg?style=flat)](https://app.gitter.im/#/room/#markdown-exec:gitter.im)
7
7
  [![radicle](https://img.shields.io/badge/rad-clone-6666FF.svg?style=flat)](https://app.radicle.at/nodes/seed.radicle.at/rad:z77aiLJkzYXtuNpZuvizfGkDuZbQ)
8
8
 
9
9
  Utilities to execute code blocks in Markdown files.
10
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.
11
+ For example, you write a Python code block that computes some HTML, and this HTML is injected in place of the code block.
13
12
 
14
13
  ## Installation
15
14
 
@@ -82,13 +81,19 @@ markdown_extensions:
82
81
  - pymdownx.superfences
83
82
  ```
84
83
 
84
+ ...or in Zensical configuration file, as a legacy plugin:
85
+
86
+ ```toml
87
+ [project.plugins.markdown-exec]
88
+ ```
89
+
85
90
  TIP: We recommend enabling Markdown Exec with the MkDocs plugin
86
- if you are using MkDocs: it will take care of adding relevant
91
+ if you are using MkDocs/Zensical: it will take care of adding relevant
87
92
  assets (CSS/JS) to the final site when needed.
88
93
 
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.
94
+ WARNING: **Limitation of configuration through Markdown/PyMDown for MkDocs.**
95
+ Configuration through `pymdownx.superfences` directly is not well supported within MkDocs for fences that require assets inclusion, like `pyodide`.
96
+ For these you will have to include the assets manually. In the future we will provide ways to include them automatically. In Zensical these assets are provided natively.
92
97
 
93
98
  ## Usage
94
99
 
@@ -121,9 +126,7 @@ and the [gallery](https://pawamoy.github.io/markdown-exec/gallery/) for more exa
121
126
  <div id="premium-sponsors" style="text-align: center;">
122
127
 
123
128
  <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
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>
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
130
  </p></div>
128
131
 
129
132
  <div id="bronze-sponsors"><b>Bronze sponsors</b><p>
@@ -145,23 +148,18 @@ and the [gallery](https://pawamoy.github.io/markdown-exec/gallery/) for more exa
145
148
  <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
149
  <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
150
  <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
151
  <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
152
  <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
153
  <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
154
  <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
155
  <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
156
  <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
157
  <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
158
  <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
159
  <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
160
  <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
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
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
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>
166
164
  <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
165
  <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>
@@ -170,9 +168,10 @@ and the [gallery](https://pawamoy.github.io/markdown-exec/gallery/) for more exa
170
168
  <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
169
  <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
170
  <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>
171
+ <a href="https://github.com/Cusp-AI"><img alt="Cusp-AI" src="https://avatars.githubusercontent.com/u/178170649?v=4" style="height: 32px; border-radius: 100%;"></a>
173
172
  </p></div>
174
173
 
175
174
 
176
- *And 8 more private sponsor(s).*
175
+ *And 7 more private sponsor(s).*
177
176
 
178
177
  <!-- sponsors-end -->
@@ -1,34 +1,14 @@
1
- target-version = "py39"
1
+ target-version = "py310"
2
2
  line-length = 120
3
+ output-format = "concise"
3
4
 
4
5
  [lint]
5
6
  exclude = [
6
7
  "tests/fixtures/*.py",
7
8
  ]
8
- select = [
9
- "A", "ANN", "ARG",
10
- "B", "BLE",
11
- "C", "C4",
12
- "COM",
13
- "D", "DTZ",
14
- "E", "ERA", "EXE",
15
- "F", "FBT",
16
- "G",
17
- "I", "ICN", "INP", "ISC",
18
- "N",
19
- "PGH", "PIE", "PL", "PLC", "PLE", "PLR", "PLW", "PT", "PYI",
20
- "Q",
21
- "RUF", "RSE", "RET",
22
- "S", "SIM", "SLF",
23
- "T", "T10", "T20", "TCH", "TID", "TRY",
24
- "UP",
25
- "W",
26
- "YTT",
27
- ]
9
+ select = ["ALL"]
28
10
  ignore = [
29
11
  "A001", # Variable is shadowing a Python builtin
30
- "ANN101", # Missing type annotation for self
31
- "ANN102", # Missing type annotation for cls
32
12
  "ANN204", # Missing return type annotation for special method __str__
33
13
  "ANN401", # Dynamically typed expressions (typing.Any) are disallowed
34
14
  "ARG005", # Unused lambda argument
@@ -36,13 +16,18 @@ ignore = [
36
16
  "D105", # Missing docstring in magic method
37
17
  "D417", # Missing argument description in the docstring
38
18
  "E501", # Line too long
19
+ "EM101", # String literal when raising exception
20
+ "EM102", # f-string when raising exception
39
21
  "ERA001", # Commented out code
22
+ "FIX", # TODO, FIXME, etc.
40
23
  "G004", # Logging statement uses f-string
41
24
  "PLR0911", # Too many return statements
42
25
  "PLR0912", # Too many branches
43
26
  "PLR0913", # Too many arguments to function call
44
27
  "PLR0915", # Too many statements
45
- "SLF001", # Private member accessed
28
+ "SLF001", # Private member accessed
29
+ "TD002", # Missing author in TODO
30
+ "TD003", # Missing issue link for TODO
46
31
  "TRY003", # Avoid specifying long messages outside the exception class
47
32
  ]
48
33
 
@@ -0,0 +1,6 @@
1
+ [src]
2
+ exclude = ["tests/fixtures"]
3
+
4
+ [terminal]
5
+ error-on-warning = true
6
+ output-format = "concise"
@@ -23,11 +23,10 @@
23
23
  "name": "docs",
24
24
  "type": "debugpy",
25
25
  "request": "launch",
26
- "module": "mkdocs",
26
+ "module": "zensical",
27
27
  "justMyCode": false,
28
28
  "args": [
29
29
  "serve",
30
- "-v"
31
30
  ]
32
31
  },
33
32
  {
@@ -4,9 +4,6 @@
4
4
  "**/.venvs*/**": true,
5
5
  "**/venv*/**": true
6
6
  },
7
- "mypy-type-checker.args": [
8
- "--config-file=config/mypy.ini"
9
- ],
10
7
  "python.testing.unittestEnabled": false,
11
8
  "python.testing.pytestEnabled": true,
12
9
  "python.testing.pytestArgs": [
@@ -19,6 +16,7 @@
19
16
  "ruff.lint.args": [
20
17
  "--config=config/ruff.toml"
21
18
  ],
19
+ "ty.configurationFile": "config/ty.toml",
22
20
  "yaml.schemas": {
23
21
  "https://squidfunk.github.io/mkdocs-material/schema.json": "mkdocs.yml"
24
22
  },
@@ -1,5 +1,5 @@
1
1
  <!-- Giscus -->
2
- <!-- https://squidfunk.github.io/mkdocs-material/setup/adding-a-comment-system/#giscus-integration -->
2
+ <!-- https://zensical.org/docs/setup/comment-system/#giscus-integration -->
3
3
  <div id="feedback" style="display: none;">
4
4
  <h2 id="__comments">Feedback</h2>
5
5
  <script src="https://giscus.app/client.js"
@@ -0,0 +1,21 @@
1
+ /* Mark external links as such. */
2
+ a.external::after,
3
+ a.autorefs-external::after {
4
+ /* https://primer.style/octicons/arrow-up-right-24 */
5
+ mask-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.25 15.5a.75.75 0 00.75-.75v-9a.75.75 0 00-.75-.75h-9a.75.75 0 000 1.5h7.19L6.22 16.72a.75.75 0 101.06 1.06L17.5 7.56v7.19c0 .414.336.75.75.75z"></path></svg>');
6
+ -webkit-mask-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.25 15.5a.75.75 0 00.75-.75v-9a.75.75 0 00-.75-.75h-9a.75.75 0 000 1.5h7.19L6.22 16.72a.75.75 0 101.06 1.06L17.5 7.56v7.19c0 .414.336.75.75.75z"></path></svg>');
7
+ content: ' ';
8
+
9
+ display: inline-block;
10
+ vertical-align: middle;
11
+ position: relative;
12
+
13
+ height: 1em;
14
+ width: 1em;
15
+ background-color: currentColor;
16
+ }
17
+
18
+ a.external:hover::after,
19
+ a.autorefs-external:hover::after {
20
+ background-color: var(--md-accent-fg-color);
21
+ }
@@ -14,7 +14,7 @@ Welcome to our gallery of examples!
14
14
  > Diagram as Code for prototyping cloud system architectures.
15
15
 
16
16
  ````md exec="1" source="tabbed-right"
17
- ```python exec="true" html="true"
17
+ ```python exec="true" html="true" id="diagrams"
18
18
  --8<-- "gallery/diagrams.py"
19
19
  ```
20
20
  ````
@@ -24,7 +24,7 @@ Welcome to our gallery of examples!
24
24
  > A modern diagram scripting language that turns text to diagrams.
25
25
 
26
26
  ````md exec="1" source="tabbed-right"
27
- ```python exec="true" html="true"
27
+ ```python exec="true" html="true" id="d2"
28
28
  --8<-- "gallery/d2.py"
29
29
  ```
30
30
  ````
@@ -34,7 +34,7 @@ Welcome to our gallery of examples!
34
34
  > Matplotlib is a comprehensive library for creating static, animated, and interactive visualizations in Python.
35
35
 
36
36
  ````md exec="1" source="tabbed-right"
37
- ```python exec="1" html="1"
37
+ ```python exec="1" html="1" id="matplotlib"
38
38
  --8<-- "gallery/matplotlib.py"
39
39
  ```
40
40
  ````
@@ -46,7 +46,7 @@ Welcome to our gallery of examples!
46
46
  We call `pipdeptree` with its `--mermaid` option to generate a [Mermaid](https://mermaid.js.org/) diagram.
47
47
 
48
48
  ````md exec="1" source="tabbed-right"
49
- ```bash exec="1" result="mermaid"
49
+ ```bash exec="1" result="mermaid" id="pipdeptree1"
50
50
  # Change the direction of the graph from top-down to left-right,
51
51
  # and remove local version identifiers from our own package.
52
52
  pipdeptree -p markdown-exec --mermaid 2>/dev/null |
@@ -57,7 +57,7 @@ pipdeptree -p markdown-exec --mermaid 2>/dev/null |
57
57
  Another example with more dependencies:
58
58
 
59
59
  ````md exec="1" source="tabbed-right"
60
- ```bash exec="1" result="mermaid"
60
+ ```bash exec="1" result="mermaid" id="pipdeptree2"
61
61
  pipdeptree -p mkdocstrings-python --mermaid 2>/dev/null |
62
62
  sed 's/flowchart TD/flowchart LR/'
63
63
  ```
@@ -68,7 +68,7 @@ pipdeptree -p mkdocstrings-python --mermaid 2>/dev/null |
68
68
  > The interactive graphing library for Python ✨
69
69
 
70
70
  ````md exec="1" source="tabbed-right"
71
- ```python exec="true" html="true"
71
+ ```python exec="true" html="true" id="plotly"
72
72
  --8<-- "gallery/plotly.py"
73
73
  ```
74
74
  ````
@@ -80,7 +80,7 @@ pipdeptree -p mkdocstrings-python --mermaid 2>/dev/null |
80
80
  pydeps uses [Graphviz](https://graphviz.org/) under the hood to generate graphs. In this example we add links to the code reference in related nodes. Try clicking on the `markdown_exec` nodes!
81
81
 
82
82
  ````md exec="1" source="tabbed-right"
83
- ```python exec="true" html="true"
83
+ ```python exec="true" html="true" id="pydeps"
84
84
  --8<-- "gallery/pydeps.py"
85
85
  ```
86
86
  ````
@@ -92,7 +92,7 @@ pydeps uses [Graphviz](https://graphviz.org/) under the hood to generate graphs.
92
92
  > Rich is a Python library for rich text and beautiful formatting in the terminal.
93
93
 
94
94
  ````md exec="1" source="tabbed-right"
95
- ```python exec="true" html="true"
95
+ ```python exec="true" html="true" id="rich"
96
96
  --8<-- "gallery/rich.py"
97
97
  ```
98
98
  ````
@@ -102,7 +102,7 @@ pydeps uses [Graphviz](https://graphviz.org/) under the hood to generate graphs.
102
102
  If you installed Markdown Exec with the `ansi` extra (`pip install markdown-exec[ansi]`), the ANSI colors in the output of shell commands will be translated to HTML/CSS, allowing to render them naturally in your documentation pages. For this to happen, use the [`result="ansi"` option](http://localhost:8000/markdown-exec/usage/#wrap-result-in-a-code-block).
103
103
 
104
104
  ````md exec="1" source="tabbed-right"
105
- ```bash exec="true" result="ansi"
105
+ ```bash exec="true" result="ansi" id="ansi"
106
106
  --8<-- "gallery/ansi.sh"
107
107
  ```
108
108
  ````
@@ -112,7 +112,7 @@ If you installed Markdown Exec with the `ansi` extra (`pip install markdown-exec
112
112
  > Rich is a Python library for rich text and beautiful formatting in the terminal.
113
113
 
114
114
  ````md exec="1" source="tabbed-right"
115
- ```python exec="true" html="true"
115
+ ```python exec="true" html="true" id="richterminal"
116
116
  --8<-- "gallery/rich_terminal.py"
117
117
  ```
118
118
  ````
@@ -124,7 +124,7 @@ If you installed Markdown Exec with the `ansi` extra (`pip install markdown-exec
124
124
  > A declarative drawing API in Python.
125
125
 
126
126
  ````md exec="1" source="tabbed-right"
127
- ```python exec="true" html="true"
127
+ ```python exec="true" html="true" id="chalk"
128
128
  --8<-- "gallery/chalk.py"
129
129
  ```
130
130
  ````
@@ -133,7 +133,7 @@ If you installed Markdown Exec with the `ansi` extra (`pip install markdown-exec
133
133
  > Programmatically generate SVG (vector) images, animations, and interactive Jupyter widgets.
134
134
 
135
135
  ````md exec="1" source="tabbed-right"
136
- ```python exec="true" html="true"
136
+ ```python exec="true" html="true" id="drawsvg2"
137
137
  --8<-- "gallery/drawsvg.py"
138
138
  ```
139
139
  ````
@@ -143,7 +143,7 @@ If you installed Markdown Exec with the `ansi` extra (`pip install markdown-exec
143
143
  > A Python 3 library for constructing and drawing hyperbolic geometry.
144
144
 
145
145
  ````md exec="1" source="tabbed-right"
146
- ```python exec="true" html="true"
146
+ ```python exec="true" html="true" id="hyperbolic"
147
147
  --8<-- "gallery/hyperbolic.py"
148
148
  ```
149
149
  ````
@@ -155,7 +155,7 @@ If you installed Markdown Exec with the `ansi` extra (`pip install markdown-exec
155
155
  > Python QR Code image generator.
156
156
 
157
157
  ````md exec="1" source="tabbed-right"
158
- ```python exec="true" html="true"
158
+ ```python exec="true" html="true" id="qrcode"
159
159
  --8<-- "gallery/qrcode.py"
160
160
  ```
161
161
  ````
@@ -167,21 +167,21 @@ If you installed Markdown Exec with the `ansi` extra (`pip install markdown-exec
167
167
  > Textual is a *Rapid Application Development* framework for Python, built by [Textualize.io](https://www.textualize.io/).
168
168
 
169
169
  ````md exec="1" source="tabbed-right"
170
- ```python exec="1" html="true"
170
+ ```python exec="1" html="true" id="textual"
171
171
  --8<-- "gallery/textual.py"
172
172
  ```
173
173
  ````
174
174
 
175
175
  ## File-trees
176
176
 
177
- This example displays a file-tree of the current project, in which you can descend thanks to Material for MkDocs' [code annotations](https://squidfunk.github.io/mkdocs-material/reference/code-blocks/#code-annotations). It uses a recursive Python function which accept a code block session name as parameter 🤯:
177
+ This example displays a file-tree of the current project, in which you can descend thanks to Material for MkDocs' [code annotations](https://squidfunk.github.io/mkdocs-material/reference/code-blocks/#code-annotations) (and [Zensical's](https://zensical.org/docs/authoring/code-blocks/#code-annotations)). It uses a recursive Python function which accept a code block session name as parameter 🤯:
178
178
 
179
179
  ````md exec="1" source="tabbed-right"
180
- ```python exec="1" session="filetree"
180
+ ```python exec="1" session="filetree" id="filetree-def"
181
181
  --8<-- "gallery/expandable_filetree.py"
182
182
  ```
183
183
 
184
- ```python exec="1" session="filetree"
184
+ ```python exec="1" session="filetree" id="filetree-run"
185
185
  exptree(".", "filetree")
186
186
  ```
187
187
  ````
@@ -1,4 +1,5 @@
1
1
  # https://matplotlib.org/stable/gallery/lines_bars_and_markers/scatter_demo2.html
2
+ import warnings
2
3
  from io import StringIO
3
4
 
4
5
  import matplotlib.cbook as cbook
@@ -17,9 +18,11 @@ delta1 = np.diff(price_data["adj_close"]) / price_data["adj_close"][:-1]
17
18
  volume = (15 * price_data["volume"][:-2] / price_data["volume"][0])**2
18
19
  close = 0.003 * price_data["close"][:-2] / 0.003 * price_data["open"][:-2]
19
20
 
20
- fig, ax = plt.subplots()
21
- ax.scatter(delta1[:-1], delta1[1:], c=close, s=volume, alpha=0.5)
21
+ with warnings.catch_warnings():
22
+ warnings.simplefilter("ignore")
23
+ fig, ax = plt.subplots()
22
24
 
25
+ ax.scatter(delta1[:-1], delta1[1:], c=close, s=volume, alpha=0.5)
23
26
  ax.set_xlabel(r"$\Delta_i$", fontsize=15)
24
27
  ax.set_ylabel(r"$\Delta_{i+1}$", fontsize=15)
25
28
  ax.set_title("Volume and percent change")
@@ -0,0 +1,19 @@
1
+ from pydeps import cli, colors, dot, py2depgraph
2
+ from pydeps.pydeps import depgraph_to_dotsrc
3
+ from pydeps.target import Target
4
+
5
+ # Note: pydeps wasn't designed to be used in such a programatic way, so the code is a bit convoluted,
6
+ # but you could make a function of it, put it in an importable script/module,
7
+ # and reuse it cleanly in your executed code blocks.
8
+
9
+ cli.verbose = cli._not_verbose
10
+ options = cli.parse_args(["src/markdown_exec", "--noshow"])
11
+ colors.START_COLOR = options["start_color"]
12
+ target = Target(options["fname"])
13
+ with target.chdir_work():
14
+ dep_graph = py2depgraph.py2dep(target, **options)
15
+ dot_src = depgraph_to_dotsrc(target, dep_graph, **options)
16
+ svg = dot.call_graphviz_dot(dot_src, "svg").decode()
17
+ svg = "".join(svg.splitlines()[6:])
18
+ svg = svg.replace('fill="white"', 'fill="transparent"')
19
+ print(svg)