sphinx-examples-as-code 0.3.2__tar.gz → 0.4.0__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_examples_as_code-0.3.2 → sphinx_examples_as_code-0.4.0}/PKG-INFO +18 -6
- {sphinx_examples_as_code-0.3.2 → sphinx_examples_as_code-0.4.0}/README.md +17 -5
- {sphinx_examples_as_code-0.3.2 → sphinx_examples_as_code-0.4.0}/sphinx_examples_as_code/__init__.py +242 -163
- {sphinx_examples_as_code-0.3.2 → sphinx_examples_as_code-0.4.0}/sphinx_examples_as_code/_version.py +3 -3
- {sphinx_examples_as_code-0.3.2 → sphinx_examples_as_code-0.4.0}/sphinx_examples_as_code.egg-info/PKG-INFO +18 -6
- {sphinx_examples_as_code-0.3.2 → sphinx_examples_as_code-0.4.0}/sphinx_examples_as_code.egg-info/scm_file_list.json +21 -21
- sphinx_examples_as_code-0.4.0/sphinx_examples_as_code.egg-info/scm_version.json +8 -0
- {sphinx_examples_as_code-0.3.2 → sphinx_examples_as_code-0.4.0}/tests/single_function_fixture/conf.py +12 -15
- {sphinx_examples_as_code-0.3.2 → sphinx_examples_as_code-0.4.0}/tests/single_function_fixture/mymodule.py +4 -0
- {sphinx_examples_as_code-0.3.2 → sphinx_examples_as_code-0.4.0}/tests/test_single_function_page.py +34 -0
- {sphinx_examples_as_code-0.3.2 → sphinx_examples_as_code-0.4.0}/tests/test_sphinx_examples_as_code.py +423 -36
- {sphinx_examples_as_code-0.3.2 → sphinx_examples_as_code-0.4.0}/tests/test_tinypages.py +96 -26
- {sphinx_examples_as_code-0.3.2 → sphinx_examples_as_code-0.4.0}/tests/tinypages/docstring_cases.py +27 -0
- {sphinx_examples_as_code-0.3.2 → sphinx_examples_as_code-0.4.0}/tests/tinypages/docstring_cases.rst +2 -0
- sphinx_examples_as_code-0.3.2/sphinx_examples_as_code.egg-info/scm_version.json +0 -8
- {sphinx_examples_as_code-0.3.2 → sphinx_examples_as_code-0.4.0}/.github/dependabot.yml +0 -0
- {sphinx_examples_as_code-0.3.2 → sphinx_examples_as_code-0.4.0}/.github/release.yml +0 -0
- {sphinx_examples_as_code-0.3.2 → sphinx_examples_as_code-0.4.0}/.github/workflows/ci.yml +0 -0
- {sphinx_examples_as_code-0.3.2 → sphinx_examples_as_code-0.4.0}/.gitignore +0 -0
- {sphinx_examples_as_code-0.3.2 → sphinx_examples_as_code-0.4.0}/.pre-commit-config.yaml +0 -0
- {sphinx_examples_as_code-0.3.2 → sphinx_examples_as_code-0.4.0}/LICENSE +0 -0
- {sphinx_examples_as_code-0.3.2 → sphinx_examples_as_code-0.4.0}/pyproject.toml +0 -0
- {sphinx_examples_as_code-0.3.2 → sphinx_examples_as_code-0.4.0}/setup.cfg +0 -0
- {sphinx_examples_as_code-0.3.2 → sphinx_examples_as_code-0.4.0}/sphinx_examples_as_code.egg-info/SOURCES.txt +0 -0
- {sphinx_examples_as_code-0.3.2 → sphinx_examples_as_code-0.4.0}/sphinx_examples_as_code.egg-info/dependency_links.txt +0 -0
- {sphinx_examples_as_code-0.3.2 → sphinx_examples_as_code-0.4.0}/sphinx_examples_as_code.egg-info/requires.txt +0 -0
- {sphinx_examples_as_code-0.3.2 → sphinx_examples_as_code-0.4.0}/sphinx_examples_as_code.egg-info/top_level.txt +0 -0
- {sphinx_examples_as_code-0.3.2 → sphinx_examples_as_code-0.4.0}/tests/gallery_fixture/conf.py +0 -0
- {sphinx_examples_as_code-0.3.2 → sphinx_examples_as_code-0.4.0}/tests/gallery_fixture/examples/GALLERY_HEADER.rst +0 -0
- {sphinx_examples_as_code-0.3.2 → sphinx_examples_as_code-0.4.0}/tests/gallery_fixture/examples/plot_minimal.py +0 -0
- {sphinx_examples_as_code-0.3.2 → sphinx_examples_as_code-0.4.0}/tests/gallery_fixture/index.rst +0 -0
- {sphinx_examples_as_code-0.3.2 → sphinx_examples_as_code-0.4.0}/tests/heading_level_fixture/conf.py +0 -0
- {sphinx_examples_as_code-0.3.2 → sphinx_examples_as_code-0.4.0}/tests/heading_level_fixture/examples/GALLERY_HEADER.rst +0 -0
- {sphinx_examples_as_code-0.3.2 → sphinx_examples_as_code-0.4.0}/tests/heading_level_fixture/examples/plot_reused_level.py +0 -0
- {sphinx_examples_as_code-0.3.2 → sphinx_examples_as_code-0.4.0}/tests/heading_level_fixture/examples/plot_three_levels.py +0 -0
- {sphinx_examples_as_code-0.3.2 → sphinx_examples_as_code-0.4.0}/tests/heading_level_fixture/index.rst +0 -0
- {sphinx_examples_as_code-0.3.2 → sphinx_examples_as_code-0.4.0}/tests/single_function_fixture/index.rst +0 -0
- {sphinx_examples_as_code-0.3.2 → sphinx_examples_as_code-0.4.0}/tests/test_gallery_downloads.py +0 -0
- {sphinx_examples_as_code-0.3.2 → sphinx_examples_as_code-0.4.0}/tests/test_heading_level_reuse.py +0 -0
- {sphinx_examples_as_code-0.3.2 → sphinx_examples_as_code-0.4.0}/tests/tinypages/conf.py +0 -0
- {sphinx_examples_as_code-0.3.2 → sphinx_examples_as_code-0.4.0}/tests/tinypages/index.rst +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sphinx-examples-as-code
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Summary: Sphinx extension for converting docstring examples into downloadable code.
|
|
5
5
|
Author-email: The PyVista Developers <info@pyvista.org>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -66,6 +66,7 @@ sphinx_examples_as_code_conf = {
|
|
|
66
66
|
'py': 'Download Python source code',
|
|
67
67
|
'ipynb': 'Download Jupyter notebook',
|
|
68
68
|
},
|
|
69
|
+
'include_see_also': True,
|
|
69
70
|
}
|
|
70
71
|
```
|
|
71
72
|
|
|
@@ -75,6 +76,13 @@ sphinx_examples_as_code_conf = {
|
|
|
75
76
|
(default). Always offered in that order regardless of how the list is written.
|
|
76
77
|
- `link_labels`: the text of the download link(s) themselves, per format. Set only the
|
|
77
78
|
format(s) you want to change; any left unset keep reading their own default shown above.
|
|
79
|
+
- `include_see_also`: whether "See Also" content is included in the generated file.
|
|
80
|
+
`True` (default) includes it, in any of its forms: a `.. seealso::` admonition, a bare
|
|
81
|
+
`.. rubric:: See Also`, a hand-written `See Also` heading, or numpydoc's own "See Also"
|
|
82
|
+
field (including when it's been reordered outside the Examples section itself, or the
|
|
83
|
+
Examples section has been hoisted to a heading of its own — a setup some projects use to
|
|
84
|
+
get "Examples" listed in the page's own navigation). `False` excludes "See Also" content
|
|
85
|
+
in every one of those forms.
|
|
78
86
|
- `gallery_downloads`: opt-in takeover of
|
|
79
87
|
[sphinx-gallery](https://sphinx-gallery.github.io)'s own per-example downloads.
|
|
80
88
|
`False` (default) leaves sphinx-gallery pages untouched. See
|
|
@@ -107,9 +115,14 @@ What happens to the content of an Examples section:
|
|
|
107
115
|
- `.. code-block:: python` (or `py`) blocks are kept as-is; other languages become
|
|
108
116
|
comments, set off with blank lines on both sides like any other directive.
|
|
109
117
|
- Admonitions (`.. note::`, `.. warning::`, `.. seealso::`, ...) become a `# LABEL:`
|
|
110
|
-
comment followed by their content as comments
|
|
111
|
-
three forms (`.. seealso::`, a bare
|
|
112
|
-
Also` heading) and always renders the
|
|
118
|
+
comment followed by their content as comments, indented one level under the label in
|
|
119
|
+
`.py` only. "See Also" is recognized in any of its three forms (`.. seealso::`, a bare
|
|
120
|
+
`.. rubric:: See Also`, or a hand-written `See Also` heading) and always renders the
|
|
121
|
+
same way.
|
|
122
|
+
- A bullet/numbered list becomes a `-`/`N.`-marked line per item, set off with a blank
|
|
123
|
+
line on both sides in either format. A definition list's term stays at the surrounding
|
|
124
|
+
indent; its definition (the body nested under it) is indented one level further in
|
|
125
|
+
`.py`, same as an admonition's own content.
|
|
113
126
|
- Cross-references and inline code (`:class:`, `:meth:`, `:func:`, `:attr:`,
|
|
114
127
|
double-backtick literals, ...) keep their display text, wrapped in backticks (e.g.
|
|
115
128
|
``:class:`pyvista.Plotter` `` -> `` `pyvista.Plotter` ``). If `html_baseurl` is set and
|
|
@@ -167,8 +180,7 @@ styles:
|
|
|
167
180
|
- `.py` uses an RST-style title + underline, one character per level -- the same
|
|
168
181
|
sequence Sphinx's own documentation uses for sections through sub-paragraphs: `=`, `-`,
|
|
169
182
|
`~`, `^`, `"`, `'` for levels 1 through 6.
|
|
170
|
-
- `.ipynb` always uses ATX syntax (`#`, `##`, `###`, ...)
|
|
171
|
-
heading at any level, whereas an underline only reads as one for the first two.
|
|
183
|
+
- `.ipynb` always uses ATX syntax (`#`, `##`, `###`, ...) at every level.
|
|
172
184
|
|
|
173
185
|
Two things worth knowing before turning this on:
|
|
174
186
|
|
|
@@ -39,6 +39,7 @@ sphinx_examples_as_code_conf = {
|
|
|
39
39
|
'py': 'Download Python source code',
|
|
40
40
|
'ipynb': 'Download Jupyter notebook',
|
|
41
41
|
},
|
|
42
|
+
'include_see_also': True,
|
|
42
43
|
}
|
|
43
44
|
```
|
|
44
45
|
|
|
@@ -48,6 +49,13 @@ sphinx_examples_as_code_conf = {
|
|
|
48
49
|
(default). Always offered in that order regardless of how the list is written.
|
|
49
50
|
- `link_labels`: the text of the download link(s) themselves, per format. Set only the
|
|
50
51
|
format(s) you want to change; any left unset keep reading their own default shown above.
|
|
52
|
+
- `include_see_also`: whether "See Also" content is included in the generated file.
|
|
53
|
+
`True` (default) includes it, in any of its forms: a `.. seealso::` admonition, a bare
|
|
54
|
+
`.. rubric:: See Also`, a hand-written `See Also` heading, or numpydoc's own "See Also"
|
|
55
|
+
field (including when it's been reordered outside the Examples section itself, or the
|
|
56
|
+
Examples section has been hoisted to a heading of its own — a setup some projects use to
|
|
57
|
+
get "Examples" listed in the page's own navigation). `False` excludes "See Also" content
|
|
58
|
+
in every one of those forms.
|
|
51
59
|
- `gallery_downloads`: opt-in takeover of
|
|
52
60
|
[sphinx-gallery](https://sphinx-gallery.github.io)'s own per-example downloads.
|
|
53
61
|
`False` (default) leaves sphinx-gallery pages untouched. See
|
|
@@ -80,9 +88,14 @@ What happens to the content of an Examples section:
|
|
|
80
88
|
- `.. code-block:: python` (or `py`) blocks are kept as-is; other languages become
|
|
81
89
|
comments, set off with blank lines on both sides like any other directive.
|
|
82
90
|
- Admonitions (`.. note::`, `.. warning::`, `.. seealso::`, ...) become a `# LABEL:`
|
|
83
|
-
comment followed by their content as comments
|
|
84
|
-
three forms (`.. seealso::`, a bare
|
|
85
|
-
Also` heading) and always renders the
|
|
91
|
+
comment followed by their content as comments, indented one level under the label in
|
|
92
|
+
`.py` only. "See Also" is recognized in any of its three forms (`.. seealso::`, a bare
|
|
93
|
+
`.. rubric:: See Also`, or a hand-written `See Also` heading) and always renders the
|
|
94
|
+
same way.
|
|
95
|
+
- A bullet/numbered list becomes a `-`/`N.`-marked line per item, set off with a blank
|
|
96
|
+
line on both sides in either format. A definition list's term stays at the surrounding
|
|
97
|
+
indent; its definition (the body nested under it) is indented one level further in
|
|
98
|
+
`.py`, same as an admonition's own content.
|
|
86
99
|
- Cross-references and inline code (`:class:`, `:meth:`, `:func:`, `:attr:`,
|
|
87
100
|
double-backtick literals, ...) keep their display text, wrapped in backticks (e.g.
|
|
88
101
|
``:class:`pyvista.Plotter` `` -> `` `pyvista.Plotter` ``). If `html_baseurl` is set and
|
|
@@ -140,8 +153,7 @@ styles:
|
|
|
140
153
|
- `.py` uses an RST-style title + underline, one character per level -- the same
|
|
141
154
|
sequence Sphinx's own documentation uses for sections through sub-paragraphs: `=`, `-`,
|
|
142
155
|
`~`, `^`, `"`, `'` for levels 1 through 6.
|
|
143
|
-
- `.ipynb` always uses ATX syntax (`#`, `##`, `###`, ...)
|
|
144
|
-
heading at any level, whereas an underline only reads as one for the first two.
|
|
156
|
+
- `.ipynb` always uses ATX syntax (`#`, `##`, `###`, ...) at every level.
|
|
145
157
|
|
|
146
158
|
Two things worth knowing before turning this on:
|
|
147
159
|
|