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.
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/.cruft.json +5 -3
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/.github/workflows/lint.yml +3 -1
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/.github/workflows/pages.yml +2 -0
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/.github/workflows/pypi.yml +4 -2
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/.github/workflows/release.yml +3 -1
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/.github/workflows/test.yml +8 -5
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/.gitignore +3 -0
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/.pre-commit-config.yaml +2 -0
- sphinxnotes_render-1.0b6/AGENTS.md +40 -0
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/MANIFEST.in +0 -1
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/Makefile +0 -1
- {sphinxnotes_render-1.0b4/src/sphinxnotes_render.egg-info → sphinxnotes_render-1.0b6}/PKG-INFO +1 -13
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/README.rst +0 -1
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/docs/Makefile +0 -1
- sphinxnotes_render-1.0b6/docs/_images/.gitkeep +1 -0
- sphinxnotes_render-1.0b6/docs/_static/.gitkeep +1 -0
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/docs/api.rst +28 -24
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/docs/changelog.rst +0 -1
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/docs/conf.py +6 -2
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/docs/conf.rst +0 -2
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/docs/ext.rst +23 -6
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/docs/index.rst +3 -4
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/docs/make.bat +38 -37
- sphinxnotes_render-1.0b6/docs/requirements.txt +20 -0
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/docs/tmpl.rst +45 -45
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/docs/usage.rst +0 -6
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/pyproject.toml +0 -18
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/ruff.toml +0 -1
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/src/sphinxnotes/render/__init__.py +23 -12
- sphinxnotes_render-1.0b6/src/sphinxnotes/render/ctx.py +26 -0
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/src/sphinxnotes/render/ctxnodes.py +106 -81
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/src/sphinxnotes/render/data.py +8 -9
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/src/sphinxnotes/render/ext/adhoc.py +2 -11
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/src/sphinxnotes/render/ext/derive.py +0 -2
- sphinxnotes_render-1.0b6/src/sphinxnotes/render/ext/extractx.py +85 -0
- sphinxnotes_render-1.0b6/src/sphinxnotes/render/extractx.py +105 -0
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/src/sphinxnotes/render/jinja.py +60 -44
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/src/sphinxnotes/render/markup.py +25 -5
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/src/sphinxnotes/render/meta.py +1 -1
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/src/sphinxnotes/render/pipeline.py +13 -29
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/src/sphinxnotes/render/sources.py +9 -6
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/src/sphinxnotes/render/template.py +6 -9
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/src/sphinxnotes/render/utils/__init__.py +44 -18
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6/src/sphinxnotes_render.egg-info}/PKG-INFO +1 -13
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/src/sphinxnotes_render.egg-info/SOURCES.txt +9 -0
- sphinxnotes_render-1.0b6/src/sphinxnotes_render.egg-info/requires.txt +16 -0
- sphinxnotes_render-1.0b6/tests/__init__.py +1 -0
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/tests/conftest.py +3 -0
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/tests/roots/test-extra-context/conf.py +6 -4
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/tests/roots/test-extra-context/index.rst +0 -1
- sphinxnotes_render-1.0b6/tests/roots/test-extra-context-params/conf.py +23 -0
- sphinxnotes_render-1.0b6/tests/roots/test-extra-context-params/index.rst +8 -0
- sphinxnotes_render-1.0b6/tests/roots/test-extra-context-rebuild/conf.py +1 -0
- sphinxnotes_render-1.0b6/tests/roots/test-extra-context-rebuild/index.rst +11 -0
- sphinxnotes_render-1.0b6/tests/test_ctx.py +24 -0
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/tests/test_e2e.py +20 -0
- sphinxnotes_render-1.0b6/tests/test_extractx.py +57 -0
- sphinxnotes_render-1.0b6/tests/test_jinja.py +12 -0
- sphinxnotes_render-1.0b4/docs/_images/.gitkeep +0 -0
- sphinxnotes_render-1.0b4/docs/_static/.gitkeep +0 -0
- sphinxnotes_render-1.0b4/src/sphinxnotes/render/ctx.py +0 -69
- sphinxnotes_render-1.0b4/src/sphinxnotes/render/ext/extractx.py +0 -81
- sphinxnotes_render-1.0b4/src/sphinxnotes/render/extractx.py +0 -208
- sphinxnotes_render-1.0b4/src/sphinxnotes_render.egg-info/requires.txt +0 -28
- sphinxnotes_render-1.0b4/tests/__init__.py +0 -0
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/LICENSE +0 -0
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/docs/_static/custom.css +0 -0
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/docs/_static/sphinx-notes.png +0 -0
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/docs/dsl.rst +0 -0
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/setup.cfg +0 -0
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/src/sphinxnotes/render/ext/__init__.py +0 -0
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/src/sphinxnotes/render/ext/filters.py +0 -0
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/src/sphinxnotes/render/py.typed +0 -0
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/src/sphinxnotes/render/utils/ctxproxy.py +0 -0
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/src/sphinxnotes/render/utils/freestyle.py +0 -0
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/src/sphinxnotes_render.egg-info/dependency_links.txt +0 -0
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/src/sphinxnotes_render.egg-info/top_level.txt +0 -0
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/tests/roots/test-base-context-directive-example/conf.py +0 -0
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/tests/roots/test-base-context-directive-example/index.rst +0 -0
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/tests/roots/test-base-data-define-directive-example/conf.py +0 -0
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/tests/roots/test-base-data-define-directive-example/index.rst +0 -0
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/tests/roots/test-data-define/conf.py +0 -0
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/tests/roots/test-data-define/index.rst +0 -0
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/tests/roots/test-derive/conf.py +0 -0
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/tests/roots/test-derive/index.rst +0 -0
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/tests/roots/test-extra-context/cat.json +0 -0
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/tests/roots/test-filter-example/conf.py +0 -0
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/tests/roots/test-filter-example/index.rst +0 -0
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/tests/roots/test-strict-data-define-directive-example/conf.py +0 -0
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/tests/roots/test-strict-data-define-directive-example/index.rst +0 -0
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/tests/roots/test-strictdir-card/conf.py +0 -0
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/tests/roots/test-strictdir-card/index.rst +0 -0
- {sphinxnotes_render-1.0b4 → sphinxnotes_render-1.0b6}/tests/test_always_pass.py +0 -0
- {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": "
|
|
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.
|
|
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": "
|
|
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@
|
|
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: 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@
|
|
18
|
-
- uses: actions/setup-python@
|
|
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@
|
|
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@
|
|
12
|
-
- uses: actions/setup-python@
|
|
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@
|
|
21
|
-
- uses: actions/setup-python@
|
|
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 .[
|
|
26
|
+
- run: python3 -m pip install .[test]
|
|
27
|
+
- run: python3 -m pip install -r docs/requirements.txt
|
|
25
28
|
- run: make doctest
|
|
@@ -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
|
+
- 如果模板更新和项目内手工修改发生冲突,优先保护用户自定义内容,再整理模板变更。
|
{sphinxnotes_render-1.0b4/src/sphinxnotes_render.egg-info → sphinxnotes_render-1.0b6}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sphinxnotes-render
|
|
3
|
-
Version: 1.
|
|
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
|
|
@@ -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,
|
|
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,
|
|
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,
|
|
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,
|
|
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.
|
|
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:`
|
|
63
|
+
:py:class:`UnresolvedContext` can be resolved to
|
|
64
64
|
:py:class:`~sphinxnotes.render.ResolvedContext` by calling
|
|
65
|
-
:py:meth:`~sphinxnotes.render.
|
|
65
|
+
:py:meth:`~sphinxnotes.render.UnresolvedContext.resolve`.
|
|
66
66
|
|
|
67
67
|
.. autotype:: sphinxnotes.render.ResolvedContext
|
|
68
68
|
|
|
69
|
-
.. autoclass:: sphinxnotes.render.
|
|
69
|
+
.. autoclass:: sphinxnotes.render.UnresolvedContext
|
|
70
70
|
:members: resolve
|
|
71
71
|
|
|
72
|
-
``
|
|
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
|
-
``
|
|
95
|
+
``env``, plus usage examples.
|
|
96
96
|
|
|
97
97
|
.. autodecorator:: sphinxnotes.render.extra_context
|
|
98
98
|
|
|
99
|
-
.. autoclass:: sphinxnotes.render.
|
|
100
|
-
:members:
|
|
99
|
+
.. autoclass:: sphinxnotes.render.ExtraContext
|
|
100
|
+
:members: generate
|
|
101
101
|
:undoc-members:
|
|
102
102
|
|
|
103
|
-
.. autoclass:: sphinxnotes.render.
|
|
104
|
-
:members:
|
|
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.
|
|
112
|
-
:members:
|
|
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.
|
|
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
|
# 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.
|
|
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
|
|
73
|
-
:py:class:`~sphinxnotes.render.
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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.
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
set
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
echo.
|
|
21
|
-
echo.
|
|
22
|
-
echo.
|
|
23
|
-
echo.
|
|
24
|
-
echo.
|
|
25
|
-
echo.
|
|
26
|
-
echo.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|