sphinxnotes-render 1.0b4__tar.gz → 1.0b6__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 (94) hide show
  1. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/.cruft.json +5 -3
  2. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/.github/workflows/lint.yml +3 -1
  3. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/.github/workflows/pages.yml +2 -0
  4. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/.github/workflows/pypi.yml +4 -2
  5. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/.github/workflows/release.yml +3 -1
  6. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/.github/workflows/test.yml +8 -5
  7. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/.gitignore +3 -0
  8. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/.pre-commit-config.yaml +2 -0
  9. sphinxnotes_render-1.0b6/AGENTS.md +40 -0
  10. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/MANIFEST.in +0 -1
  11. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/Makefile +0 -1
  12. {sphinxnotes_render-1.0b4/src/sphinxnotes_render.egg-info → sphinxnotes_render-1.0b6}/PKG-INFO +1 -13
  13. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/README.rst +0 -1
  14. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/docs/Makefile +0 -1
  15. sphinxnotes_render-1.0b6/docs/_images/.gitkeep +1 -0
  16. sphinxnotes_render-1.0b6/docs/_static/.gitkeep +1 -0
  17. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/docs/api.rst +28 -24
  18. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/docs/changelog.rst +0 -1
  19. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/docs/conf.py +6 -2
  20. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/docs/conf.rst +0 -2
  21. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/docs/ext.rst +23 -6
  22. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/docs/index.rst +3 -4
  23. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/docs/make.bat +38 -37
  24. sphinxnotes_render-1.0b6/docs/requirements.txt +20 -0
  25. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/docs/tmpl.rst +45 -45
  26. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/docs/usage.rst +0 -6
  27. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/pyproject.toml +0 -18
  28. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/ruff.toml +0 -1
  29. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/src/sphinxnotes/render/__init__.py +23 -12
  30. sphinxnotes_render-1.0b6/src/sphinxnotes/render/ctx.py +26 -0
  31. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/src/sphinxnotes/render/ctxnodes.py +106 -81
  32. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/src/sphinxnotes/render/data.py +8 -9
  33. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/src/sphinxnotes/render/ext/adhoc.py +2 -11
  34. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/src/sphinxnotes/render/ext/derive.py +0 -2
  35. sphinxnotes_render-1.0b6/src/sphinxnotes/render/ext/extractx.py +85 -0
  36. sphinxnotes_render-1.0b6/src/sphinxnotes/render/extractx.py +105 -0
  37. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/src/sphinxnotes/render/jinja.py +60 -44
  38. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/src/sphinxnotes/render/markup.py +25 -5
  39. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/src/sphinxnotes/render/meta.py +1 -1
  40. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/src/sphinxnotes/render/pipeline.py +13 -29
  41. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/src/sphinxnotes/render/sources.py +9 -6
  42. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/src/sphinxnotes/render/template.py +6 -9
  43. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/src/sphinxnotes/render/utils/__init__.py +44 -18
  44. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6/src/sphinxnotes_render.egg-info}/PKG-INFO +1 -13
  45. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/src/sphinxnotes_render.egg-info/SOURCES.txt +9 -0
  46. sphinxnotes_render-1.0b6/src/sphinxnotes_render.egg-info/requires.txt +16 -0
  47. sphinxnotes_render-1.0b6/tests/__init__.py +1 -0
  48. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/tests/conftest.py +3 -0
  49. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/tests/roots/test-extra-context/conf.py +6 -4
  50. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/tests/roots/test-extra-context/index.rst +0 -1
  51. sphinxnotes_render-1.0b6/tests/roots/test-extra-context-params/conf.py +23 -0
  52. sphinxnotes_render-1.0b6/tests/roots/test-extra-context-params/index.rst +8 -0
  53. sphinxnotes_render-1.0b6/tests/roots/test-extra-context-rebuild/conf.py +1 -0
  54. sphinxnotes_render-1.0b6/tests/roots/test-extra-context-rebuild/index.rst +11 -0
  55. sphinxnotes_render-1.0b6/tests/test_ctx.py +24 -0
  56. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/tests/test_e2e.py +20 -0
  57. sphinxnotes_render-1.0b6/tests/test_extractx.py +57 -0
  58. sphinxnotes_render-1.0b6/tests/test_jinja.py +12 -0
  59. sphinxnotes_render-1.0b4/docs/_images/.gitkeep +0 -0
  60. sphinxnotes_render-1.0b4/docs/_static/.gitkeep +0 -0
  61. sphinxnotes_render-1.0b4/src/sphinxnotes/render/ctx.py +0 -69
  62. sphinxnotes_render-1.0b4/src/sphinxnotes/render/ext/extractx.py +0 -81
  63. sphinxnotes_render-1.0b4/src/sphinxnotes/render/extractx.py +0 -208
  64. sphinxnotes_render-1.0b4/src/sphinxnotes_render.egg-info/requires.txt +0 -28
  65. sphinxnotes_render-1.0b4/tests/__init__.py +0 -0
  66. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/LICENSE +0 -0
  67. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/docs/_static/custom.css +0 -0
  68. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/docs/_static/sphinx-notes.png +0 -0
  69. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/docs/dsl.rst +0 -0
  70. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/setup.cfg +0 -0
  71. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/src/sphinxnotes/render/ext/__init__.py +0 -0
  72. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/src/sphinxnotes/render/ext/filters.py +0 -0
  73. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/src/sphinxnotes/render/py.typed +0 -0
  74. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/src/sphinxnotes/render/utils/ctxproxy.py +0 -0
  75. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/src/sphinxnotes/render/utils/freestyle.py +0 -0
  76. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/src/sphinxnotes_render.egg-info/dependency_links.txt +0 -0
  77. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/src/sphinxnotes_render.egg-info/top_level.txt +0 -0
  78. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/tests/roots/test-base-context-directive-example/conf.py +0 -0
  79. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/tests/roots/test-base-context-directive-example/index.rst +0 -0
  80. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/tests/roots/test-base-data-define-directive-example/conf.py +0 -0
  81. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/tests/roots/test-base-data-define-directive-example/index.rst +0 -0
  82. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/tests/roots/test-data-define/conf.py +0 -0
  83. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/tests/roots/test-data-define/index.rst +0 -0
  84. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/tests/roots/test-derive/conf.py +0 -0
  85. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/tests/roots/test-derive/index.rst +0 -0
  86. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/tests/roots/test-extra-context/cat.json +0 -0
  87. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/tests/roots/test-filter-example/conf.py +0 -0
  88. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/tests/roots/test-filter-example/index.rst +0 -0
  89. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/tests/roots/test-strict-data-define-directive-example/conf.py +0 -0
  90. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/tests/roots/test-strict-data-define-directive-example/index.rst +0 -0
  91. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/tests/roots/test-strictdir-card/conf.py +0 -0
  92. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/tests/roots/test-strictdir-card/index.rst +0 -0
  93. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/tests/test_always_pass.py +0 -0
  94. {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/tests/test_data.py +0 -0
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "template": "https://github.com/sphinx-notes/cookiecutter",
3
- "commit": "4c6b17aec1a4b8ddca95c4882c6bed2bc230d595",
3
+ "commit": "463b120aec3391878cf9453ca26280bf5258c08d",
4
4
  "checkout": null,
5
5
  "context": {
6
6
  "cookiecutter": {
@@ -9,9 +9,11 @@
9
9
  "full_name": "sphinxnotes-render",
10
10
  "author": "Shengyu Zhang",
11
11
  "description": "Define, constrain, and render data in Sphinx documentation",
12
- "version": "1.0a0",
12
+ "version": "1.0b4",
13
13
  "github_owner": "sphinx-notes",
14
14
  "github_repo": "data",
15
+ "generated_file_header": "This file is generated from sphinx-notes/cookiecutter.",
16
+ "dont_edit_header": "DO NOT EDIT.",
15
17
  "pypi_name": "sphinxnotes-render",
16
18
  "pypi_owner": "SilverRainZ",
17
19
  "is_python_project": true,
@@ -20,7 +22,7 @@
20
22
  "sphinx_version": "7.0",
21
23
  "development_status": "3 - Alpha",
22
24
  "_template": "https://github.com/sphinx-notes/cookiecutter",
23
- "_commit": "4c6b17aec1a4b8ddca95c4882c6bed2bc230d595"
25
+ "_commit": "233a8daa4e276a9559975a51178f29e7079dcafd"
24
26
  }
25
27
  },
26
28
  "directory": null
@@ -1,3 +1,5 @@
1
+ # This file is generated from sphinx-notes/cookiecutter.
2
+
1
3
  name: Ruff
2
4
  on: [ push, pull_request ]
3
5
 
@@ -5,5 +7,5 @@ jobs:
5
7
  ruff:
6
8
  runs-on: ubuntu-latest
7
9
  steps:
8
- - uses: actions/checkout@v4
10
+ - uses: actions/checkout@v6
9
11
  - uses: chartboost/ruff-action@v1
@@ -1,3 +1,5 @@
1
+ # This file is generated from sphinx-notes/cookiecutter.
2
+
1
3
  name: Deploy Sphinx documentation to Pages
2
4
 
3
5
  # Runs on pushes targeting the default branch
@@ -1,3 +1,5 @@
1
+ # This file is generated from sphinx-notes/cookiecutter.
2
+
1
3
  name: Publish package distributions to PyPI
2
4
 
3
5
  on:
@@ -14,8 +16,8 @@ jobs:
14
16
  permissions:
15
17
  id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
16
18
  steps:
17
- - uses: actions/checkout@v4
18
- - uses: actions/setup-python@v5
19
+ - uses: actions/checkout@v6
20
+ - uses: actions/setup-python@v6
19
21
  - run: pip install build twine && make dist
20
22
  - uses: pypa/gh-action-pypi-publish@release/v1
21
23
  with:
@@ -1,3 +1,5 @@
1
+ # This file is generated from sphinx-notes/cookiecutter.
2
+
1
3
  name: Publish Github Release
2
4
 
3
5
  on:
@@ -11,7 +13,7 @@ jobs:
11
13
  permissions:
12
14
  contents: write
13
15
  steps:
14
- - uses: actions/checkout@v4
16
+ - uses: actions/checkout@v6
15
17
  - uses: ncipollo/release-action@v1
16
18
  with:
17
19
  body: |
@@ -1,3 +1,5 @@
1
+ # This file is generated from sphinx-notes/cookiecutter.
2
+
1
3
  name: Test
2
4
  on:
3
5
  push:
@@ -8,8 +10,8 @@ jobs:
8
10
  test:
9
11
  runs-on: ubuntu-latest
10
12
  steps:
11
- - uses: actions/checkout@v2
12
- - uses: actions/setup-python@v5
13
+ - uses: actions/checkout@v6
14
+ - uses: actions/setup-python@v6
13
15
  with:
14
16
  python-version-file: 'pyproject.toml'
15
17
  - run: python3 -m pip install .[test]
@@ -17,9 +19,10 @@ jobs:
17
19
  doctest:
18
20
  runs-on: ubuntu-latest
19
21
  steps:
20
- - uses: actions/checkout@v2
21
- - uses: actions/setup-python@v5
22
+ - uses: actions/checkout@v6
23
+ - uses: actions/setup-python@v6
22
24
  with:
23
25
  python-version-file: 'pyproject.toml'
24
- - run: python3 -m pip install .[docs]
26
+ - run: python3 -m pip install .[test]
27
+ - run: python3 -m pip install -r docs/requirements.txt
25
28
  - run: make doctest
@@ -1,3 +1,5 @@
1
+ # This file is generated from sphinx-notes/cookiecutter.
2
+
1
3
  # Byte-compiled / optimized / DLL files
2
4
  __pycache__/
3
5
  *.py[cod]
@@ -135,3 +137,4 @@ poetry.lock
135
137
  docs/_build/
136
138
  # sphinxnotes-any >= 2.5
137
139
  docs/.any*
140
+ .worktrees/
@@ -1,3 +1,5 @@
1
+ # This file is generated from sphinx-notes/cookiecutter.
2
+
1
3
  repos:
2
4
  - repo: https://github.com/astral-sh/ruff-pre-commit
3
5
  rev: v0.14.11
@@ -0,0 +1,40 @@
1
+ <!-- This file is generated from sphinx-notes/cookiecutter. -->
2
+
3
+ ## 基本说明
4
+
5
+ 这是一个由 SphinxNotes 开发的 Sphinx Extension,由 `sphinxnotes/cookiecutter` 生成,很多基础文件来自模板。
6
+
7
+ ## 首先阅读
8
+
9
+ - 开始了解项目时,优先阅读 `docs/index.rst`。
10
+ - 如果任务和文档、Sphinx 配置或示例有关,继续阅读 `docs/` 下的其他文件
11
+
12
+ ## 通用知识
13
+
14
+ - 使用 `make` 会构建 `docs/` 下的文档,文档自依赖当前项目,因此文档构建成功也意味着项目基本能正常构建
15
+ - `docs/_build` 存放构建好的文档,`make clean` 清除所有构建结果
16
+ - `make test` 运行测试,测试位于 `tests/`,可能的 e2e 测试位于 `tests/test_e2e.py`
17
+ - `make doctest` 运行 Sphinx 文档测试
18
+ - `make install` 使用 `pip install --user` 将项目安装到本地,跨项目测试时常用
19
+ - `make tmpl-*` 用于模板同步,参看 "模板同步" 小节
20
+
21
+ ## 关于 SphinxNotes 项目
22
+
23
+ - 同为 `sphinxnotes` 项目的其他仓库通常位于当前项目的上一级目录
24
+ - 如果你在阅读代码时遇到本地依赖、模板来源或跨仓库复用关系,可以直接读取这些本地仓库文件,不必先猜测实现,也不必优先去远程搜索。
25
+ - 当我提到 "所有项目" 的时候,请从当前项目的上一级目录的 `cookiecutter/project-list.txt` 获取项目列表
26
+ - `docs/conf.py` 往往会直接从源码树导入当前项目,因此排查文档构建问题时,要同时检查运行时依赖和文档依赖。
27
+
28
+ ## 模板同步
29
+
30
+ - 先确认任务是当前项目问题,还是模板问题;如果是模板问题,优先在 `sphinxnotes/cookiecutter` 中修复。
31
+ - 模板变更完成后,优先使用 `make tmpl-update` 把改动同步回项目,而不是手工重复修改生成文件。
32
+ - 如果 `make tmpl-update` 产生 `.rej`、冲突或三方合并失败,优先尝试 `make tmpl-apply-rej`,再手工解决冲突。
33
+ - 手工解决冲突时,重点检查 `README.rst`、`pyproject.toml`、`.github/workflows/`、`docs/conf.py`、`docs/requirements.txt` 这些常见受影响文件。
34
+ - 当模板同步结果确认无误后,优先使用 `make tmpl-update-done` 完成后续收尾步骤。
35
+
36
+ ### 修改约定
37
+
38
+ - 修改模板生成文件时,保留原有注释,除非模板本身已经统一移除了这些注释。
39
+ - 遇到 `CUSTOM ... START` / `END` 这类用户自定义区块时,必须保留这些锚点,并尽量保留区块中的用户内容。
40
+ - 如果模板更新和项目内手工修改发生冲突,优先保护用户自定义内容,再整理模板变更。
@@ -1,5 +1,4 @@
1
1
  # This file is generated from sphinx-notes/cookiecutter.
2
- # You need to consider modifying the TEMPLATE or modifying THIS FILE.
3
2
 
4
3
  include LICENSE
5
4
  include README.rst
@@ -1,5 +1,4 @@
1
1
  # This file is generated from sphinx-notes/cookiecutter.
2
- # You need to consider modifying the TEMPLATE or modifying THIS FILE.
3
2
 
4
3
  LANG = en_US.UTF-8
5
4
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sphinxnotes-render
3
- Version: 1.0b4
3
+ Version: 1.0b6
4
4
  Summary: Define, constrain, and render data in Sphinx documentation
5
5
  Author: Shengyu Zhang
6
6
  Maintainer: Shengyu Zhang
@@ -34,23 +34,11 @@ Requires-Dist: pre-commit; extra == "dev"
34
34
  Provides-Extra: test
35
35
  Requires-Dist: pytest; extra == "test"
36
36
  Requires-Dist: schema; extra == "test"
37
- Provides-Extra: docs
38
- Requires-Dist: furo; extra == "docs"
39
- Requires-Dist: sphinx_design; extra == "docs"
40
- Requires-Dist: sphinx_copybutton; extra == "docs"
41
- Requires-Dist: sphinxcontrib-gtagjs; extra == "docs"
42
- Requires-Dist: sphinx-sitemap; extra == "docs"
43
- Requires-Dist: sphinxext-opengraph; extra == "docs"
44
- Requires-Dist: sphinx-last-updated-by-git; extra == "docs"
45
- Requires-Dist: sphinxnotes-project; extra == "docs"
46
- Requires-Dist: sphinxnotes-comboroles; extra == "docs"
47
- Requires-Dist: schema; extra == "docs"
48
37
  Provides-Extra: ext
49
38
  Requires-Dist: schema; extra == "ext"
50
39
  Dynamic: license-file
51
40
 
52
41
  .. This file is generated from sphinx-notes/cookiecutter.
53
- You need to consider modifying the TEMPLATE or modifying THIS FILE.
54
42
 
55
43
  ==================
56
44
  sphinxnotes-render
@@ -1,5 +1,4 @@
1
1
  .. This file is generated from sphinx-notes/cookiecutter.
2
- You need to consider modifying the TEMPLATE or modifying THIS FILE.
3
2
 
4
3
  ==================
5
4
  sphinxnotes-render
@@ -1,5 +1,4 @@
1
1
  # This file is generated from sphinx-notes/cookiecutter.
2
- # You need to consider modifying the TEMPLATE or modifying THIS FILE.
3
2
 
4
3
  # Minimal makefile for Sphinx documentation
5
4
 
@@ -0,0 +1 @@
1
+ # This file is generated from sphinx-notes/cookiecutter.
@@ -0,0 +1 @@
1
+ # This file is generated from sphinx-notes/cookiecutter.
@@ -18,22 +18,22 @@ Base Role Classes
18
18
 
19
19
  .. autoclass:: sphinxnotes.render.BaseContextRole
20
20
  :show-inheritance:
21
- :members: process_pending_node, queue_pending_node, queue_context, current_context, current_template
21
+ :members: process_pending_node, queue_pending_node, current_context, current_template
22
22
 
23
23
  .. autoclass:: sphinxnotes.render.BaseDataDefineRole
24
24
  :show-inheritance:
25
- :members: process_pending_node, queue_pending_node, queue_context, current_schema, current_template
25
+ :members: process_pending_node, queue_pending_node, current_schema, current_template
26
26
 
27
27
  Base Directive Classes
28
28
  ----------------------
29
29
 
30
30
  .. autoclass:: sphinxnotes.render.BaseContextDirective
31
31
  :show-inheritance:
32
- :members: process_pending_node, queue_pending_node, queue_context, current_raw_data, current_context, current_template
32
+ :members: process_pending_node, queue_pending_node, current_context, current_template
33
33
 
34
34
  .. autoclass:: sphinxnotes.render.BaseDataDefineDirective
35
35
  :show-inheritance:
36
- :members: process_pending_node, queue_pending_node, queue_context, current_raw_data, current_schema, current_template
36
+ :members: process_pending_node, queue_pending_node, current_raw_data, current_schema, current_template
37
37
 
38
38
  .. autoclass:: sphinxnotes.render.StrictDataDefineDirective
39
39
  :show-inheritance:
@@ -55,22 +55,22 @@ Context refers to the dynamic content of a Jinja template. It can be:
55
55
  Our dedicated data type (:py:class:`sphinxnotes.render.ParsedData`), or any
56
56
  Python ``dict``.
57
57
 
58
- :py:class:`~sphinxnotes.render.PendingContext`:
58
+ :py:class:`~sphinxnotes.render.UnresolvedContext`:
59
59
  Context that is not yet available. For example, it may contain
60
60
  :py:class:`unparsed data <sphinxnotes.render.RawData>`,
61
61
  remote data, and more.
62
62
 
63
- :py:class:`PendingContext` can be resolved to
63
+ :py:class:`UnresolvedContext` can be resolved to
64
64
  :py:class:`~sphinxnotes.render.ResolvedContext` by calling
65
- :py:meth:`~sphinxnotes.render.PendingContext.resolve`.
65
+ :py:meth:`~sphinxnotes.render.UnresolvedContext.resolve`.
66
66
 
67
67
  .. autotype:: sphinxnotes.render.ResolvedContext
68
68
 
69
- .. autoclass:: sphinxnotes.render.PendingContext
69
+ .. autoclass:: sphinxnotes.render.UnresolvedContext
70
70
  :members: resolve
71
71
 
72
- ``PendingContext`` Implementations
73
- ----------------------------------
72
+ ``UnresolvedContext`` Implementations
73
+ -------------------------------------
74
74
 
75
75
  .. autoclass:: sphinxnotes.render.UnparsedData
76
76
  :show-inheritance:
@@ -92,31 +92,33 @@ Extra Context
92
92
  =============
93
93
 
94
94
  See :doc:`tmpl` for built-in extra-context names such as ``doc`` and
95
- ``sphinx``, plus usage examples.
95
+ ``env``, plus usage examples.
96
96
 
97
97
  .. autodecorator:: sphinxnotes.render.extra_context
98
98
 
99
- .. autoclass:: sphinxnotes.render.ParsingPhaseExtraContext
100
- :members: phase, generate
99
+ .. autoclass:: sphinxnotes.render.ExtraContext
100
+ :members: generate
101
101
  :undoc-members:
102
102
 
103
- .. autoclass:: sphinxnotes.render.ParsedPhaseExtraContext
104
- :members: phase, generate
105
- :undoc-members:
106
-
107
- .. autoclass:: sphinxnotes.render.ResolvingPhaseExtraContext
108
- :members: phase, generate
103
+ .. autoclass:: sphinxnotes.render.ExtraContextRequest
104
+ :members:
109
105
  :undoc-members:
110
106
 
111
- .. autoclass:: sphinxnotes.render.GlobalExtraContext
112
- :members: phase, generate
107
+ .. autoclass:: sphinxnotes.render.ExtraContextRegistry
108
+ :members:
109
+ :inherited-members:
113
110
  :undoc-members:
111
+ :class-doc-from: both
114
112
 
115
113
  Filters
116
114
  =======
117
115
 
118
116
  .. autodecorator:: sphinxnotes.render.filter
119
117
 
118
+ .. autoclass:: sphinxnotes.render.JinjaRegistry
119
+ :members:
120
+ :undoc-members:
121
+
120
122
  Data, Field and Schema
121
123
  ======================
122
124
 
@@ -139,11 +141,9 @@ Data, Field and Schema
139
141
  :members: name, attrs, content
140
142
  :undoc-members:
141
143
 
142
- .. autoclass:: sphinxnotes.render.data.Registry
144
+ .. autoclass:: sphinxnotes.render.DataRegistry
143
145
  :members:
144
146
 
145
- .. autotype:: sphinxnotes.render.data.ByOptionStore
146
-
147
147
  Registry
148
148
  ========
149
149
 
@@ -156,3 +156,7 @@ or add new extra context) by adding new items to
156
156
  .. autoclass:: sphinxnotes.render.Registry
157
157
 
158
158
  .. autoproperty:: data
159
+
160
+ .. autoproperty:: extra_context
161
+
162
+ .. autoproperty:: jinja
@@ -1,5 +1,4 @@
1
1
  .. This file is generated from sphinx-notes/cookiecutter.
2
- You need to consider modifying the TEMPLATE or modifying THIS FILE.
3
2
 
4
3
  ==========
5
4
  Change Log
@@ -1,5 +1,4 @@
1
1
  # This file is generated from sphinx-notes/cookiecutter.
2
- # You need to consider modifying the TEMPLATE or modifying THIS FILE.
3
2
 
4
3
  # Configuration file for the Sphinx documentation builder.
5
4
  #
@@ -14,7 +13,7 @@ author = 'Shengyu Zhang'
14
13
  copyright = "2025, " + author
15
14
 
16
15
  # The full version, including alpha/beta/rc tags
17
- version = release = '1.0a0'
16
+ version = release = '1.0b4'
18
17
 
19
18
  # -- General configuration ---------------------------------------------------
20
19
 
@@ -91,6 +90,9 @@ gtagjs_ids = ['G-E4SNX0WZYV']
91
90
  extensions.append('sphinx.ext.autodoc')
92
91
  autoclass_content = 'init'
93
92
  autodoc_typehints = 'description'
93
+ autodoc_default_options = {
94
+ 'member-order': 'bysource',
95
+ }
94
96
 
95
97
  extensions.append('sphinx.ext.intersphinx')
96
98
  intersphinx_mapping = {}
@@ -109,6 +111,7 @@ comboroles_roles = {
109
111
  'parsed_literal': (['literal'], True),
110
112
  }
111
113
 
114
+
112
115
  extensions.append('sphinxnotes.project')
113
116
  primary_domain = 'any'
114
117
 
@@ -161,6 +164,7 @@ def setup(app):
161
164
 
162
165
  sys.path.insert(0, test_roots)
163
166
  __import__('test-extra-context.conf').conf.setup(app)
167
+ __import__('test-extra-context-params.conf').conf.setup(app)
164
168
  __import__('test-base-context-directive-example.conf').conf.setup(app)
165
169
  __import__('test-base-data-define-directive-example.conf').conf.setup(app)
166
170
  __import__('test-strict-data-define-directive-example.conf').conf.setup(app)
@@ -25,7 +25,5 @@ The extension provides the following configuration:
25
25
  - ``text`` (str): the Jinja2 template text.
26
26
  - ``on`` (str, optional): same as :rst:dir:`data.template:on`
27
27
  - ``debug`` (bool, optional): same as :rst:dir:`data.template:debug`
28
- - ``extra`` (list[str], optional): same as :rst:dir:`data.template:extra`
29
28
 
30
29
  See :ref:`usage-custom-directive` for example.
31
-
@@ -69,11 +69,11 @@ Extending Extra Contexts
69
69
  Extra contexts are registered by a
70
70
  :py:deco:`sphinxnotes.render.extra_context` class decorator.
71
71
 
72
- The decorated class must be one of the following classes:
73
- :py:class:`~sphinxnotes.render.ParsingPhaseExtraContext`,
74
- :py:class:`~sphinxnotes.render.ParsedPhaseExtraContext`,
75
- :py:class:`~sphinxnotes.render.ResolvingPhaseExtraContext`,
76
- :py:class:`~sphinxnotes.render.GlobalExtraContext`.
72
+ The decorated class must be a subclass of
73
+ :py:class:`~sphinxnotes.render.ExtraContext`. The ``generate()`` method
74
+ accepts the ``ExtraContextRequest`` as the first argument, plus any
75
+ positional and keyword arguments passed by the template via
76
+ ``load_extra()``.
77
77
 
78
78
  .. literalinclude:: ../tests/roots/test-extra-context/conf.py
79
79
  :language: python
@@ -88,10 +88,27 @@ The decorated class must be one of the following classes:
88
88
  :style: grid
89
89
 
90
90
  .. data.render::
91
- :extra: cat
92
91
 
93
92
  {{ load_extra('cat').name }}
94
93
 
94
+ To accept custom parameters in your extra context, add ``*args`` and
95
+ ``**kwargs`` to the ``generate()`` method signature:
96
+
97
+ .. literalinclude:: ../tests/roots/test-extra-context-params/conf.py
98
+ :language: python
99
+ :start-after: [literalinclude start]
100
+ :end-before: [literalinclude end]
101
+
102
+ .. example::
103
+ :style: grid
104
+
105
+ .. data.render::
106
+
107
+ {% set docs = load_extra('all_docs', 3) %}
108
+ {% for doc in docs %}
109
+ - :doc:`{{ doc }}`
110
+ {% endfor %}
111
+
95
112
  .. _ext-filters:
96
113
 
97
114
  Extending ilters
@@ -1,5 +1,4 @@
1
1
  .. This file is generated from sphinx-notes/cookiecutter.
2
- You need to consider modifying the TEMPLATE or modifying THIS FILE.
3
2
 
4
3
  ==================
5
4
  sphinxnotes-render
@@ -30,14 +29,14 @@ Introduction
30
29
 
31
30
  This extension mainly consists of two parts:
32
31
 
32
+ :parsed_literal:`:ref:\`sphinxnotes.render <framework>\``
33
+ A framework to define, constrain, and render data in Sphinx documentation.
34
+
33
35
  :parsed_literal:`:ref:\`sphinxnotes.render.ext <extension>\``
34
36
  An extension built on top of this framework, allowing user to
35
37
  :rst:dir:`define <data.define>`, :rst:dir:`constrain <data.schema>` and
36
38
  :rst:dir:`render <data.template>` data entirely through the markup language.
37
39
 
38
- :parsed_literal:`:ref:\`sphinxnotes.render <framework>\``
39
- A framework to define, constrain, and render data in Sphinx documentation.
40
-
41
40
  .. INTRODUCTION END
42
41
 
43
42
  Getting Started
@@ -1,37 +1,38 @@
1
- REM This file is generated from sphinx-notes/cookiecutter. DO NOT EDIT.
2
-
3
- @ECHO OFF
4
-
5
- pushd %~dp0
6
-
7
- REM Command file for Sphinx documentation
8
-
9
- if "%SPHINXBUILD%" == "" (
10
- set SPHINXBUILD=python -msphinx
11
- )
12
- set SOURCEDIR=.
13
- set BUILDDIR=_build
14
-
15
- if "%1" == "" goto help
16
-
17
- %SPHINXBUILD% >NUL 2>NUL
18
- if errorlevel 9009 (
19
- echo.
20
- echo.The Sphinx module was not found. Make sure you have Sphinx installed,
21
- echo.then set the SPHINXBUILD environment variable to point to the full
22
- echo.path of the 'sphinx-build' executable. Alternatively you may add the
23
- echo.Sphinx directory to PATH.
24
- echo.
25
- echo.If you don't have Sphinx installed, grab it from
26
- echo.http://sphinx-doc.org/
27
- exit /b 1
28
- )
29
-
30
- %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
31
- goto end
32
-
33
- :help
34
- %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
35
-
36
- :end
37
- popd
1
+ REM This file is generated from sphinx-notes/cookiecutter.
2
+ REM DO NOT EDIT.
3
+
4
+ @ECHO OFF
5
+
6
+ pushd %~dp0
7
+
8
+ REM Command file for Sphinx documentation
9
+
10
+ if "%SPHINXBUILD%" == "" (
11
+ set SPHINXBUILD=python -msphinx
12
+ )
13
+ set SOURCEDIR=.
14
+ set BUILDDIR=_build
15
+
16
+ if "%1" == "" goto help
17
+
18
+ %SPHINXBUILD% >NUL 2>NUL
19
+ if errorlevel 9009 (
20
+ echo.
21
+ echo.The Sphinx module was not found. Make sure you have Sphinx installed,
22
+ echo.then set the SPHINXBUILD environment variable to point to the full
23
+ echo.path of the 'sphinx-build' executable. Alternatively you may add the
24
+ echo.Sphinx directory to PATH.
25
+ echo.
26
+ echo.If you don't have Sphinx installed, grab it from
27
+ echo.http://sphinx-doc.org/
28
+ exit /b 1
29
+ )
30
+
31
+ %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
32
+ goto end
33
+
34
+ :help
35
+ %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
36
+
37
+ :end
38
+ popd
@@ -0,0 +1,20 @@
1
+ # This file is generated from sphinx-notes/cookiecutter.
2
+
3
+ # Documentation build dependencies.
4
+ # Keep these out of pyproject optional-dependencies to avoid resolver issues.
5
+ furo
6
+ sphinx_copybutton
7
+ sphinxcontrib-gtagjs
8
+ sphinx-sitemap
9
+ sphinxext-opengraph
10
+ sphinx-last-updated-by-git
11
+ sphinxnotes-project
12
+ sphinxnotes-comboroles
13
+
14
+ # NOTE: Not used by docs (docs import extension from ../src),
15
+ # only to resolve its optional dependencies.
16
+ sphinxnotes-render
17
+
18
+ # CUSTOM DOCS DEPENDENCIES START
19
+ schema # python dict schema validation
20
+ # CUSTOM DOCS DEPENDENCIES END