sphinx-rustdoc-postprocess 0.1.0__tar.gz → 0.1.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sphinx_rustdoc_postprocess-0.1.1/.github/workflows/publish.yml +29 -0
- sphinx_rustdoc_postprocess-0.1.1/CHANGELOG.md +11 -0
- {sphinx_rustdoc_postprocess-0.1.0 → sphinx_rustdoc_postprocess-0.1.1}/PKG-INFO +31 -14
- {sphinx_rustdoc_postprocess-0.1.0 → sphinx_rustdoc_postprocess-0.1.1}/README.md +12 -13
- {sphinx_rustdoc_postprocess-0.1.0 → sphinx_rustdoc_postprocess-0.1.1}/docs/orgmode/index.org +1 -1
- {sphinx_rustdoc_postprocess-0.1.0 → sphinx_rustdoc_postprocess-0.1.1}/docs/source/conf.py +1 -1
- {sphinx_rustdoc_postprocess-0.1.0 → sphinx_rustdoc_postprocess-0.1.1}/docs/source/index.rst +1 -1
- {sphinx_rustdoc_postprocess-0.1.0 → sphinx_rustdoc_postprocess-0.1.1}/pyproject.toml +22 -0
- {sphinx_rustdoc_postprocess-0.1.0 → sphinx_rustdoc_postprocess-0.1.1}/readme_src.org +1 -1
- {sphinx_rustdoc_postprocess-0.1.0 → sphinx_rustdoc_postprocess-0.1.1}/src/sphinx_rustdoc_postprocess/__init__.py +18 -1
- sphinx_rustdoc_postprocess-0.1.1/src/sphinx_rustdoc_postprocess/_version.py +24 -0
- {sphinx_rustdoc_postprocess-0.1.0 → sphinx_rustdoc_postprocess-0.1.1}/tests/test_convert_links.py +16 -0
- sphinx_rustdoc_postprocess-0.1.0/.claude/settings.local.json +0 -18
- sphinx_rustdoc_postprocess-0.1.0/CHANGELOG.md +0 -5
- sphinx_rustdoc_postprocess-0.1.0/src/sphinx_rustdoc_postprocess/_version.py +0 -34
- {sphinx_rustdoc_postprocess-0.1.0 → sphinx_rustdoc_postprocess-0.1.1}/.github/workflows/ci.yml +0 -0
- {sphinx_rustdoc_postprocess-0.1.0 → sphinx_rustdoc_postprocess-0.1.1}/.github/workflows/doc_commenter.yml +0 -0
- {sphinx_rustdoc_postprocess-0.1.0 → sphinx_rustdoc_postprocess-0.1.1}/.github/workflows/docs.yml +0 -0
- {sphinx_rustdoc_postprocess-0.1.0 → sphinx_rustdoc_postprocess-0.1.1}/.github/workflows/pre_commit.yml +0 -0
- {sphinx_rustdoc_postprocess-0.1.0 → sphinx_rustdoc_postprocess-0.1.1}/.gitignore +0 -0
- {sphinx_rustdoc_postprocess-0.1.0 → sphinx_rustdoc_postprocess-0.1.1}/.pre-commit-config.yaml +0 -0
- {sphinx_rustdoc_postprocess-0.1.0 → sphinx_rustdoc_postprocess-0.1.1}/.python-version +0 -0
- {sphinx_rustdoc_postprocess-0.1.0 → sphinx_rustdoc_postprocess-0.1.1}/CODEOWNERS +0 -0
- {sphinx_rustdoc_postprocess-0.1.0 → sphinx_rustdoc_postprocess-0.1.1}/CODE_OF_CONDUCT.md +0 -0
- {sphinx_rustdoc_postprocess-0.1.0 → sphinx_rustdoc_postprocess-0.1.1}/LICENSE +0 -0
- {sphinx_rustdoc_postprocess-0.1.0 → sphinx_rustdoc_postprocess-0.1.1}/docs/export.el +0 -0
- {sphinx_rustdoc_postprocess-0.1.0 → sphinx_rustdoc_postprocess-0.1.1}/docs/orgmode/usage.org +0 -0
- {sphinx_rustdoc_postprocess-0.1.0 → sphinx_rustdoc_postprocess-0.1.1}/docs/source/usage.rst +0 -0
- {sphinx_rustdoc_postprocess-0.1.0 → sphinx_rustdoc_postprocess-0.1.1}/news/.gitkeep +0 -0
- {sphinx_rustdoc_postprocess-0.1.0 → sphinx_rustdoc_postprocess-0.1.1}/pixi.lock +0 -0
- {sphinx_rustdoc_postprocess-0.1.0 → sphinx_rustdoc_postprocess-0.1.1}/pixi.toml +0 -0
- {sphinx_rustdoc_postprocess-0.1.0 → sphinx_rustdoc_postprocess-0.1.1}/src/sphinx_rustdoc_postprocess/py.typed +0 -0
- {sphinx_rustdoc_postprocess-0.1.0 → sphinx_rustdoc_postprocess-0.1.1}/tests/__init__.py +0 -0
- {sphinx_rustdoc_postprocess-0.1.0 → sphinx_rustdoc_postprocess-0.1.1}/tests/conftest.py +0 -0
- {sphinx_rustdoc_postprocess-0.1.0 → sphinx_rustdoc_postprocess-0.1.1}/tests/test_convert_fences.py +0 -0
- {sphinx_rustdoc_postprocess-0.1.0 → sphinx_rustdoc_postprocess-0.1.1}/tests/test_convert_headings.py +0 -0
- {sphinx_rustdoc_postprocess-0.1.0 → sphinx_rustdoc_postprocess-0.1.1}/tests/test_convert_tables.py +0 -0
- {sphinx_rustdoc_postprocess-0.1.0 → sphinx_rustdoc_postprocess-0.1.1}/tests/test_postprocess.py +0 -0
- {sphinx_rustdoc_postprocess-0.1.0 → sphinx_rustdoc_postprocess-0.1.1}/tests/test_setup.py +0 -0
- {sphinx_rustdoc_postprocess-0.1.0 → sphinx_rustdoc_postprocess-0.1.1}/uv.lock +0 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Trusted publisher on PyPI: HaoZeke/sphinx-rustdoc-postprocess, workflow publish.yml, env pypi
|
|
2
|
+
name: Publish to PyPI
|
|
3
|
+
|
|
4
|
+
on:
|
|
5
|
+
push:
|
|
6
|
+
tags: ["v*"]
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
publish:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
environment:
|
|
13
|
+
name: pypi
|
|
14
|
+
url: https://pypi.org/p/sphinx-rustdoc-postprocess
|
|
15
|
+
permissions:
|
|
16
|
+
id-token: write
|
|
17
|
+
contents: read
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v4
|
|
20
|
+
with:
|
|
21
|
+
fetch-depth: 0
|
|
22
|
+
|
|
23
|
+
- uses: astral-sh/setup-uv@v5
|
|
24
|
+
|
|
25
|
+
- name: Build
|
|
26
|
+
run: uv build
|
|
27
|
+
|
|
28
|
+
- name: Publish
|
|
29
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
<!-- towncrier release notes start -->
|
|
6
|
+
|
|
7
|
+
# sphinx_rustdoc_postprocess 0.1.1 (2026-07-09)
|
|
8
|
+
|
|
9
|
+
## Bugfixes
|
|
10
|
+
|
|
11
|
+
- Preserve Sphinx roles such as ``:rust:any:`path``` during inline-code conversion so sphinxcontrib-rust re-export lists stay valid. (#11)
|
|
@@ -1,10 +1,28 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sphinx-rustdoc-postprocess
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.1
|
|
4
4
|
Summary: Post-process sphinxcontrib-rust RST output, converting leftover markdown to proper RST via pandoc.
|
|
5
|
+
Project-URL: Homepage, https://github.com/HaoZeke/sphinx-rustdoc-postprocess
|
|
6
|
+
Project-URL: Repository, https://github.com/HaoZeke/sphinx-rustdoc-postprocess
|
|
7
|
+
Project-URL: Issues, https://github.com/HaoZeke/sphinx-rustdoc-postprocess/issues
|
|
8
|
+
Project-URL: Changelog, https://github.com/HaoZeke/sphinx-rustdoc-postprocess/blob/main/CHANGELOG.md
|
|
5
9
|
Author-email: Rohit Goswami <rgoswami@ieee.org>
|
|
6
10
|
License-Expression: MIT
|
|
7
11
|
License-File: LICENSE
|
|
12
|
+
Keywords: markdown,pandoc,rst,rustdoc,sphinx,sphinxcontrib-rust
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Framework :: Sphinx
|
|
15
|
+
Classifier: Framework :: Sphinx :: Extension
|
|
16
|
+
Classifier: Intended Audience :: Developers
|
|
17
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
+
Classifier: Topic :: Documentation
|
|
24
|
+
Classifier: Topic :: Documentation :: Sphinx
|
|
25
|
+
Classifier: Topic :: Software Development :: Documentation
|
|
8
26
|
Requires-Python: >=3.10
|
|
9
27
|
Requires-Dist: sphinx>=7
|
|
10
28
|
Description-Content-Type: text/markdown
|
|
@@ -25,7 +43,7 @@ doc-comments are written in markdown. The generated RST ends up with markdown
|
|
|
25
43
|
fragments embedded verbatim inside directive bodies, which Sphinx cannot render
|
|
26
44
|
correctly.
|
|
27
45
|
|
|
28
|
-
For a real-world example, see [rgpot](https://rgpot.rgoswami.me/) ([source](https://github.com/
|
|
46
|
+
For a real-world example, see [rgpot](https://rgpot.rgoswami.me/) ([source](https://github.com/OmniPotentRPC/rgpot)), which uses this extension to
|
|
29
47
|
document its Rust core library alongside C++ API docs.
|
|
30
48
|
|
|
31
49
|
|
|
@@ -44,9 +62,9 @@ sphinxcontrib-rust produces RST with the markdown still intact inside
|
|
|
44
62
|
directives:
|
|
45
63
|
|
|
46
64
|
.. py:module:: rgpot_core
|
|
47
|
-
|
|
65
|
+
|
|
48
66
|
## Module Overview
|
|
49
|
-
|
|
67
|
+
|
|
50
68
|
| Module | Purpose |
|
|
51
69
|
|--------|---------|
|
|
52
70
|
| [`types`] | `#[repr(C)]` data structures for force/energy I/O |
|
|
@@ -62,9 +80,9 @@ single-backtick code is not valid RST.
|
|
|
62
80
|
After this extension runs, the same file becomes:
|
|
63
81
|
|
|
64
82
|
.. py:module:: rgpot_core
|
|
65
|
-
|
|
83
|
+
|
|
66
84
|
**Module Overview**
|
|
67
|
-
|
|
85
|
+
|
|
68
86
|
+------------+----------------------------------------------------+
|
|
69
87
|
| Module | Purpose |
|
|
70
88
|
+============+====================================================+
|
|
@@ -85,7 +103,7 @@ Similarly, markdown code fences:
|
|
|
85
103
|
become proper RST code-block directives:
|
|
86
104
|
|
|
87
105
|
.. code-block:: c
|
|
88
|
-
|
|
106
|
+
|
|
89
107
|
rgpot_status_t s = rgpot_potential_calculate(pot, &input, &output);
|
|
90
108
|
if (s != RGPOT_SUCCESS) {
|
|
91
109
|
fprintf(stderr, "rgpot error: %s\n", rgpot_last_error());
|
|
@@ -163,29 +181,29 @@ RST files before Sphinx reads them.
|
|
|
163
181
|
|
|
164
182
|
# conf.py
|
|
165
183
|
import os
|
|
166
|
-
|
|
184
|
+
|
|
167
185
|
extensions = [
|
|
168
186
|
"sphinxcontrib_rust",
|
|
169
187
|
"sphinx_rustdoc_postprocess",
|
|
170
188
|
]
|
|
171
|
-
|
|
189
|
+
|
|
172
190
|
# sphinxcontrib-rust settings
|
|
173
191
|
rust_crates = {
|
|
174
192
|
"my_crate": os.path.abspath("../../my-crate/"),
|
|
175
193
|
}
|
|
176
194
|
rust_doc_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "crates")
|
|
177
195
|
rust_rustdoc_fmt = "rst"
|
|
178
|
-
|
|
196
|
+
|
|
179
197
|
# Inject a toctree entry for the Rust docs into an existing index page
|
|
180
198
|
rustdoc_postprocess_toctree_target = "api/index.rst"
|
|
181
199
|
rustdoc_postprocess_toctree_rst = """
|
|
182
|
-
|
|
200
|
+
|
|
183
201
|
Rust API
|
|
184
202
|
--------
|
|
185
|
-
|
|
203
|
+
|
|
186
204
|
.. toctree::
|
|
187
205
|
:maxdepth: 2
|
|
188
|
-
|
|
206
|
+
|
|
189
207
|
../crates/my_crate/lib
|
|
190
208
|
"""
|
|
191
209
|
|
|
@@ -255,4 +273,3 @@ to set it up locally as well (using [uvx](https://docs.astral.sh/uv/guides/tools
|
|
|
255
273
|
## License
|
|
256
274
|
|
|
257
275
|
MIT
|
|
258
|
-
|
|
@@ -14,7 +14,7 @@ doc-comments are written in markdown. The generated RST ends up with markdown
|
|
|
14
14
|
fragments embedded verbatim inside directive bodies, which Sphinx cannot render
|
|
15
15
|
correctly.
|
|
16
16
|
|
|
17
|
-
For a real-world example, see [rgpot](https://rgpot.rgoswami.me/) ([source](https://github.com/
|
|
17
|
+
For a real-world example, see [rgpot](https://rgpot.rgoswami.me/) ([source](https://github.com/OmniPotentRPC/rgpot)), which uses this extension to
|
|
18
18
|
document its Rust core library alongside C++ API docs.
|
|
19
19
|
|
|
20
20
|
|
|
@@ -33,9 +33,9 @@ sphinxcontrib-rust produces RST with the markdown still intact inside
|
|
|
33
33
|
directives:
|
|
34
34
|
|
|
35
35
|
.. py:module:: rgpot_core
|
|
36
|
-
|
|
36
|
+
|
|
37
37
|
## Module Overview
|
|
38
|
-
|
|
38
|
+
|
|
39
39
|
| Module | Purpose |
|
|
40
40
|
|--------|---------|
|
|
41
41
|
| [`types`] | `#[repr(C)]` data structures for force/energy I/O |
|
|
@@ -51,9 +51,9 @@ single-backtick code is not valid RST.
|
|
|
51
51
|
After this extension runs, the same file becomes:
|
|
52
52
|
|
|
53
53
|
.. py:module:: rgpot_core
|
|
54
|
-
|
|
54
|
+
|
|
55
55
|
**Module Overview**
|
|
56
|
-
|
|
56
|
+
|
|
57
57
|
+------------+----------------------------------------------------+
|
|
58
58
|
| Module | Purpose |
|
|
59
59
|
+============+====================================================+
|
|
@@ -74,7 +74,7 @@ Similarly, markdown code fences:
|
|
|
74
74
|
become proper RST code-block directives:
|
|
75
75
|
|
|
76
76
|
.. code-block:: c
|
|
77
|
-
|
|
77
|
+
|
|
78
78
|
rgpot_status_t s = rgpot_potential_calculate(pot, &input, &output);
|
|
79
79
|
if (s != RGPOT_SUCCESS) {
|
|
80
80
|
fprintf(stderr, "rgpot error: %s\n", rgpot_last_error());
|
|
@@ -152,29 +152,29 @@ RST files before Sphinx reads them.
|
|
|
152
152
|
|
|
153
153
|
# conf.py
|
|
154
154
|
import os
|
|
155
|
-
|
|
155
|
+
|
|
156
156
|
extensions = [
|
|
157
157
|
"sphinxcontrib_rust",
|
|
158
158
|
"sphinx_rustdoc_postprocess",
|
|
159
159
|
]
|
|
160
|
-
|
|
160
|
+
|
|
161
161
|
# sphinxcontrib-rust settings
|
|
162
162
|
rust_crates = {
|
|
163
163
|
"my_crate": os.path.abspath("../../my-crate/"),
|
|
164
164
|
}
|
|
165
165
|
rust_doc_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "crates")
|
|
166
166
|
rust_rustdoc_fmt = "rst"
|
|
167
|
-
|
|
167
|
+
|
|
168
168
|
# Inject a toctree entry for the Rust docs into an existing index page
|
|
169
169
|
rustdoc_postprocess_toctree_target = "api/index.rst"
|
|
170
170
|
rustdoc_postprocess_toctree_rst = """
|
|
171
|
-
|
|
171
|
+
|
|
172
172
|
Rust API
|
|
173
173
|
--------
|
|
174
|
-
|
|
174
|
+
|
|
175
175
|
.. toctree::
|
|
176
176
|
:maxdepth: 2
|
|
177
|
-
|
|
177
|
+
|
|
178
178
|
../crates/my_crate/lib
|
|
179
179
|
"""
|
|
180
180
|
|
|
@@ -244,4 +244,3 @@ to set it up locally as well (using [uvx](https://docs.astral.sh/uv/guides/tools
|
|
|
244
244
|
## License
|
|
245
245
|
|
|
246
246
|
MIT
|
|
247
|
-
|
{sphinx_rustdoc_postprocess-0.1.0 → sphinx_rustdoc_postprocess-0.1.1}/docs/orgmode/index.org
RENAMED
|
@@ -57,5 +57,5 @@ After this extension runs, the output becomes valid RST:
|
|
|
57
57
|
+----------+------------------------------+
|
|
58
58
|
#+end_src
|
|
59
59
|
|
|
60
|
-
For a real-world example, see [[https://rgpot.rgoswami.me/][rgpot]] ([[https://github.com/
|
|
60
|
+
For a real-world example, see [[https://rgpot.rgoswami.me/][rgpot]] ([[https://github.com/OmniPotentRPC/rgpot][source]]), which uses this extension to
|
|
61
61
|
document its Rust core library alongside C++ API docs.
|
|
@@ -19,7 +19,7 @@ intersphinx_mapping = {
|
|
|
19
19
|
|
|
20
20
|
html_theme = "shibuya"
|
|
21
21
|
html_theme_options = {
|
|
22
|
-
"github_url": "https://github.com/HaoZeke/
|
|
22
|
+
"github_url": "https://github.com/HaoZeke/sphinx-rustdoc-postprocess",
|
|
23
23
|
"nav_links": [
|
|
24
24
|
{
|
|
25
25
|
"title": "PyPI",
|
|
@@ -57,5 +57,5 @@ After this extension runs, the output becomes valid RST:
|
|
|
57
57
|
| ``types``| ``#[repr(C)]`` data structures|
|
|
58
58
|
+----------+------------------------------+
|
|
59
59
|
|
|
60
|
-
For a real-world example, see `rgpot <https://rgpot.rgoswami.me/>`_ (`source <https://github.com/
|
|
60
|
+
For a real-world example, see `rgpot <https://rgpot.rgoswami.me/>`_ (`source <https://github.com/OmniPotentRPC/rgpot>`_), which uses this extension to
|
|
61
61
|
document its Rust core library alongside C++ API docs.
|
|
@@ -8,8 +8,30 @@ authors = [
|
|
|
8
8
|
]
|
|
9
9
|
requires-python = ">=3.10"
|
|
10
10
|
license = "MIT"
|
|
11
|
+
keywords = ["sphinx", "rustdoc", "rst", "markdown", "pandoc", "sphinxcontrib-rust"]
|
|
12
|
+
classifiers = [
|
|
13
|
+
"Development Status :: 4 - Beta",
|
|
14
|
+
"Framework :: Sphinx",
|
|
15
|
+
"Framework :: Sphinx :: Extension",
|
|
16
|
+
"Intended Audience :: Developers",
|
|
17
|
+
"License :: OSI Approved :: MIT License",
|
|
18
|
+
"Programming Language :: Python :: 3",
|
|
19
|
+
"Programming Language :: Python :: 3.10",
|
|
20
|
+
"Programming Language :: Python :: 3.11",
|
|
21
|
+
"Programming Language :: Python :: 3.12",
|
|
22
|
+
"Programming Language :: Python :: 3.13",
|
|
23
|
+
"Topic :: Documentation",
|
|
24
|
+
"Topic :: Documentation :: Sphinx",
|
|
25
|
+
"Topic :: Software Development :: Documentation",
|
|
26
|
+
]
|
|
11
27
|
dependencies = ["sphinx>=7"]
|
|
12
28
|
|
|
29
|
+
[project.urls]
|
|
30
|
+
Homepage = "https://github.com/HaoZeke/sphinx-rustdoc-postprocess"
|
|
31
|
+
Repository = "https://github.com/HaoZeke/sphinx-rustdoc-postprocess"
|
|
32
|
+
Issues = "https://github.com/HaoZeke/sphinx-rustdoc-postprocess/issues"
|
|
33
|
+
Changelog = "https://github.com/HaoZeke/sphinx-rustdoc-postprocess/blob/main/CHANGELOG.md"
|
|
34
|
+
|
|
13
35
|
[build-system]
|
|
14
36
|
requires = ["hatchling", "hatch-vcs"]
|
|
15
37
|
build-backend = "hatchling.build"
|
|
@@ -19,7 +19,7 @@ doc-comments are written in markdown. The generated RST ends up with markdown
|
|
|
19
19
|
fragments embedded verbatim inside directive bodies, which Sphinx cannot render
|
|
20
20
|
correctly.
|
|
21
21
|
|
|
22
|
-
For a real-world example, see [[https://rgpot.rgoswami.me/][rgpot]] ([[https://github.com/
|
|
22
|
+
For a real-world example, see [[https://rgpot.rgoswami.me/][rgpot]] ([[https://github.com/OmniPotentRPC/rgpot][source]]), which uses this extension to
|
|
23
23
|
document its Rust core library alongside C++ API docs.
|
|
24
24
|
|
|
25
25
|
*** Before (raw sphinxcontrib-rust output)
|
|
@@ -56,6 +56,13 @@ _INLINE_CODE_RE = re.compile(
|
|
|
56
56
|
r"(?<!`)(`)((?!`)(?:[^`\n<>])+)\1(?!`)",
|
|
57
57
|
)
|
|
58
58
|
|
|
59
|
+
# Sphinx role prefix immediately before a backtick: :role:` or :domain:role:`
|
|
60
|
+
# (e.g. :rust:any:`path`, :class:`Foo`). Used so inline-code conversion does not
|
|
61
|
+
# turn valid roles into double-backtick literals.
|
|
62
|
+
_ROLE_PREFIX_RE = re.compile(
|
|
63
|
+
r":[a-zA-Z][\w.-]*(?::[a-zA-Z][\w.-]*)?:$",
|
|
64
|
+
)
|
|
65
|
+
|
|
59
66
|
# Matches markdown hyperlinks: [text](url)
|
|
60
67
|
_MD_LINK_RE = re.compile(
|
|
61
68
|
r"\[(?P<text>[^\[\]]+)\]\((?P<url>https?://[^)]+)\)",
|
|
@@ -184,6 +191,10 @@ def _convert_links(content: str) -> str:
|
|
|
184
191
|
def _convert_inline_code(content: str) -> str:
|
|
185
192
|
"""Convert markdown inline code to RST double-backtick literals.
|
|
186
193
|
|
|
194
|
+
Sphinx interpreted-text roles (``:role:`text```, ``:domain:role:`text```)
|
|
195
|
+
are left unchanged so sphinxcontrib-rust re-export lists like
|
|
196
|
+
``* :rust:any:`crate::mod::Item``` keep working.
|
|
197
|
+
|
|
187
198
|
Parameters
|
|
188
199
|
----------
|
|
189
200
|
content : str
|
|
@@ -195,11 +206,17 @@ def _convert_inline_code(content: str) -> str:
|
|
|
195
206
|
Content with single-backtick code converted to double-backtick literals.
|
|
196
207
|
"""
|
|
197
208
|
|
|
209
|
+
def _repl(m: re.Match[str]) -> str:
|
|
210
|
+
before = m.string[: m.start()]
|
|
211
|
+
if _ROLE_PREFIX_RE.search(before):
|
|
212
|
+
return m.group(0)
|
|
213
|
+
return f"``{m.group(2)}``"
|
|
214
|
+
|
|
198
215
|
def _process_line(line: str) -> str:
|
|
199
216
|
stripped = line.lstrip()
|
|
200
217
|
if stripped.startswith("..") or stripped.startswith(":"):
|
|
201
218
|
return line
|
|
202
|
-
return _INLINE_CODE_RE.sub(
|
|
219
|
+
return _INLINE_CODE_RE.sub(_repl, line)
|
|
203
220
|
|
|
204
221
|
return "\n".join(_process_line(line) for line in content.split("\n"))
|
|
205
222
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# file generated by vcs-versioning
|
|
2
|
+
# don't change, don't track in version control
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
__all__ = [
|
|
6
|
+
"__version__",
|
|
7
|
+
"__version_tuple__",
|
|
8
|
+
"version",
|
|
9
|
+
"version_tuple",
|
|
10
|
+
"__commit_id__",
|
|
11
|
+
"commit_id",
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
version: str
|
|
15
|
+
__version__: str
|
|
16
|
+
__version_tuple__: tuple[int | str, ...]
|
|
17
|
+
version_tuple: tuple[int | str, ...]
|
|
18
|
+
commit_id: str | None
|
|
19
|
+
__commit_id__: str | None
|
|
20
|
+
|
|
21
|
+
__version__ = version = '0.1.1'
|
|
22
|
+
__version_tuple__ = version_tuple = (0, 1, 1)
|
|
23
|
+
|
|
24
|
+
__commit_id__ = commit_id = None
|
{sphinx_rustdoc_postprocess-0.1.0 → sphinx_rustdoc_postprocess-0.1.1}/tests/test_convert_links.py
RENAMED
|
@@ -58,3 +58,19 @@ class TestConvertInlineCode:
|
|
|
58
58
|
content = " `text <https://url.com>`_"
|
|
59
59
|
result = _convert_inline_code(content)
|
|
60
60
|
assert result == content
|
|
61
|
+
|
|
62
|
+
def test_sphinx_role_preserved(self):
|
|
63
|
+
"""sphinxcontrib-rust re-export bullets must stay as :rust:any:`path`."""
|
|
64
|
+
content = " * :rust:any:`canonic::check::CheckReport`"
|
|
65
|
+
assert _convert_inline_code(content) == content
|
|
66
|
+
|
|
67
|
+
def test_domain_role_preserved_beside_md_code(self):
|
|
68
|
+
content = " See :rust:struct:`Foo` and use `bar`."
|
|
69
|
+
result = _convert_inline_code(content)
|
|
70
|
+
assert ":rust:struct:`Foo`" in result
|
|
71
|
+
assert "``bar``" in result
|
|
72
|
+
assert ":rust:struct:``Foo``" not in result
|
|
73
|
+
|
|
74
|
+
def test_simple_role_preserved(self):
|
|
75
|
+
content = " See :class:`MyClass` for details."
|
|
76
|
+
assert _convert_inline_code(content) == content
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"permissions": {
|
|
3
|
-
"allow": [
|
|
4
|
-
"WebFetch(domain:pydissem.rgoswami.me)",
|
|
5
|
-
"WebSearch",
|
|
6
|
-
"WebFetch(domain:www.sphinx-doc.org)",
|
|
7
|
-
"WebFetch(domain:github.com)",
|
|
8
|
-
"Bash(uv sync:*)",
|
|
9
|
-
"Bash(uv run pytest:*)",
|
|
10
|
-
"Bash(uv run ruff check:*)",
|
|
11
|
-
"Bash(uv run ruff format:*)",
|
|
12
|
-
"Bash(uv run python:*)",
|
|
13
|
-
"Bash(uv build:*)",
|
|
14
|
-
"WebFetch(domain:rgpot.rgoswami.me)",
|
|
15
|
-
"Bash(ls:*)"
|
|
16
|
-
]
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# file generated by setuptools-scm
|
|
2
|
-
# don't change, don't track in version control
|
|
3
|
-
|
|
4
|
-
__all__ = [
|
|
5
|
-
"__version__",
|
|
6
|
-
"__version_tuple__",
|
|
7
|
-
"version",
|
|
8
|
-
"version_tuple",
|
|
9
|
-
"__commit_id__",
|
|
10
|
-
"commit_id",
|
|
11
|
-
]
|
|
12
|
-
|
|
13
|
-
TYPE_CHECKING = False
|
|
14
|
-
if TYPE_CHECKING:
|
|
15
|
-
from typing import Tuple
|
|
16
|
-
from typing import Union
|
|
17
|
-
|
|
18
|
-
VERSION_TUPLE = Tuple[Union[int, str], ...]
|
|
19
|
-
COMMIT_ID = Union[str, None]
|
|
20
|
-
else:
|
|
21
|
-
VERSION_TUPLE = object
|
|
22
|
-
COMMIT_ID = object
|
|
23
|
-
|
|
24
|
-
version: str
|
|
25
|
-
__version__: str
|
|
26
|
-
__version_tuple__: VERSION_TUPLE
|
|
27
|
-
version_tuple: VERSION_TUPLE
|
|
28
|
-
commit_id: COMMIT_ID
|
|
29
|
-
__commit_id__: COMMIT_ID
|
|
30
|
-
|
|
31
|
-
__version__ = version = '0.1.0'
|
|
32
|
-
__version_tuple__ = version_tuple = (0, 1, 0)
|
|
33
|
-
|
|
34
|
-
__commit_id__ = commit_id = None
|
{sphinx_rustdoc_postprocess-0.1.0 → sphinx_rustdoc_postprocess-0.1.1}/.github/workflows/ci.yml
RENAMED
|
File without changes
|
|
File without changes
|
{sphinx_rustdoc_postprocess-0.1.0 → sphinx_rustdoc_postprocess-0.1.1}/.github/workflows/docs.yml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sphinx_rustdoc_postprocess-0.1.0 → sphinx_rustdoc_postprocess-0.1.1}/.pre-commit-config.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sphinx_rustdoc_postprocess-0.1.0 → sphinx_rustdoc_postprocess-0.1.1}/docs/orgmode/usage.org
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sphinx_rustdoc_postprocess-0.1.0 → sphinx_rustdoc_postprocess-0.1.1}/tests/test_convert_fences.py
RENAMED
|
File without changes
|
{sphinx_rustdoc_postprocess-0.1.0 → sphinx_rustdoc_postprocess-0.1.1}/tests/test_convert_headings.py
RENAMED
|
File without changes
|
{sphinx_rustdoc_postprocess-0.1.0 → sphinx_rustdoc_postprocess-0.1.1}/tests/test_convert_tables.py
RENAMED
|
File without changes
|
{sphinx_rustdoc_postprocess-0.1.0 → sphinx_rustdoc_postprocess-0.1.1}/tests/test_postprocess.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|