sphinx-examples-as-code 0.3.3__tar.gz → 0.4.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_examples_as_code-0.3.3 → sphinx_examples_as_code-0.4.1}/PKG-INFO +19 -7
- {sphinx_examples_as_code-0.3.3 → sphinx_examples_as_code-0.4.1}/README.md +18 -6
- {sphinx_examples_as_code-0.3.3 → sphinx_examples_as_code-0.4.1}/sphinx_examples_as_code/__init__.py +245 -169
- {sphinx_examples_as_code-0.3.3 → sphinx_examples_as_code-0.4.1}/sphinx_examples_as_code/_version.py +3 -3
- {sphinx_examples_as_code-0.3.3 → sphinx_examples_as_code-0.4.1}/sphinx_examples_as_code.egg-info/PKG-INFO +19 -7
- {sphinx_examples_as_code-0.3.3 → sphinx_examples_as_code-0.4.1}/sphinx_examples_as_code.egg-info/scm_file_list.json +21 -21
- sphinx_examples_as_code-0.4.1/sphinx_examples_as_code.egg-info/scm_version.json +8 -0
- {sphinx_examples_as_code-0.3.3 → sphinx_examples_as_code-0.4.1}/tests/single_function_fixture/conf.py +12 -15
- {sphinx_examples_as_code-0.3.3 → sphinx_examples_as_code-0.4.1}/tests/single_function_fixture/mymodule.py +4 -0
- {sphinx_examples_as_code-0.3.3 → sphinx_examples_as_code-0.4.1}/tests/test_single_function_page.py +34 -0
- {sphinx_examples_as_code-0.3.3 → sphinx_examples_as_code-0.4.1}/tests/test_sphinx_examples_as_code.py +427 -27
- {sphinx_examples_as_code-0.3.3 → sphinx_examples_as_code-0.4.1}/tests/test_tinypages.py +90 -19
- {sphinx_examples_as_code-0.3.3 → sphinx_examples_as_code-0.4.1}/tests/tinypages/docstring_cases.py +27 -0
- {sphinx_examples_as_code-0.3.3 → sphinx_examples_as_code-0.4.1}/tests/tinypages/docstring_cases.rst +2 -0
- sphinx_examples_as_code-0.3.3/sphinx_examples_as_code.egg-info/scm_version.json +0 -8
- {sphinx_examples_as_code-0.3.3 → sphinx_examples_as_code-0.4.1}/.github/dependabot.yml +0 -0
- {sphinx_examples_as_code-0.3.3 → sphinx_examples_as_code-0.4.1}/.github/release.yml +0 -0
- {sphinx_examples_as_code-0.3.3 → sphinx_examples_as_code-0.4.1}/.github/workflows/ci.yml +0 -0
- {sphinx_examples_as_code-0.3.3 → sphinx_examples_as_code-0.4.1}/.gitignore +0 -0
- {sphinx_examples_as_code-0.3.3 → sphinx_examples_as_code-0.4.1}/.pre-commit-config.yaml +0 -0
- {sphinx_examples_as_code-0.3.3 → sphinx_examples_as_code-0.4.1}/LICENSE +0 -0
- {sphinx_examples_as_code-0.3.3 → sphinx_examples_as_code-0.4.1}/pyproject.toml +0 -0
- {sphinx_examples_as_code-0.3.3 → sphinx_examples_as_code-0.4.1}/setup.cfg +0 -0
- {sphinx_examples_as_code-0.3.3 → sphinx_examples_as_code-0.4.1}/sphinx_examples_as_code.egg-info/SOURCES.txt +0 -0
- {sphinx_examples_as_code-0.3.3 → sphinx_examples_as_code-0.4.1}/sphinx_examples_as_code.egg-info/dependency_links.txt +0 -0
- {sphinx_examples_as_code-0.3.3 → sphinx_examples_as_code-0.4.1}/sphinx_examples_as_code.egg-info/requires.txt +0 -0
- {sphinx_examples_as_code-0.3.3 → sphinx_examples_as_code-0.4.1}/sphinx_examples_as_code.egg-info/top_level.txt +0 -0
- {sphinx_examples_as_code-0.3.3 → sphinx_examples_as_code-0.4.1}/tests/gallery_fixture/conf.py +0 -0
- {sphinx_examples_as_code-0.3.3 → sphinx_examples_as_code-0.4.1}/tests/gallery_fixture/examples/GALLERY_HEADER.rst +0 -0
- {sphinx_examples_as_code-0.3.3 → sphinx_examples_as_code-0.4.1}/tests/gallery_fixture/examples/plot_minimal.py +0 -0
- {sphinx_examples_as_code-0.3.3 → sphinx_examples_as_code-0.4.1}/tests/gallery_fixture/index.rst +0 -0
- {sphinx_examples_as_code-0.3.3 → sphinx_examples_as_code-0.4.1}/tests/heading_level_fixture/conf.py +0 -0
- {sphinx_examples_as_code-0.3.3 → sphinx_examples_as_code-0.4.1}/tests/heading_level_fixture/examples/GALLERY_HEADER.rst +0 -0
- {sphinx_examples_as_code-0.3.3 → sphinx_examples_as_code-0.4.1}/tests/heading_level_fixture/examples/plot_reused_level.py +0 -0
- {sphinx_examples_as_code-0.3.3 → sphinx_examples_as_code-0.4.1}/tests/heading_level_fixture/examples/plot_three_levels.py +0 -0
- {sphinx_examples_as_code-0.3.3 → sphinx_examples_as_code-0.4.1}/tests/heading_level_fixture/index.rst +0 -0
- {sphinx_examples_as_code-0.3.3 → sphinx_examples_as_code-0.4.1}/tests/single_function_fixture/index.rst +0 -0
- {sphinx_examples_as_code-0.3.3 → sphinx_examples_as_code-0.4.1}/tests/test_gallery_downloads.py +0 -0
- {sphinx_examples_as_code-0.3.3 → sphinx_examples_as_code-0.4.1}/tests/test_heading_level_reuse.py +0 -0
- {sphinx_examples_as_code-0.3.3 → sphinx_examples_as_code-0.4.1}/tests/tinypages/conf.py +0 -0
- {sphinx_examples_as_code-0.3.3 → sphinx_examples_as_code-0.4.1}/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.1
|
|
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
|
|
@@ -108,10 +116,15 @@ What happens to the content of an Examples section:
|
|
|
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
118
|
comment followed by their content as comments, indented one level under the label in
|
|
111
|
-
`.py`
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
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 bare `#` instead of a real blank line when
|
|
124
|
+
that falls inside an admonition or a definition's own body in `.py`, so the whole
|
|
125
|
+
thing still reads as one unbroken comment block. A definition list's term stays at
|
|
126
|
+
the surrounding indent; its definition (the body nested under it) is indented one
|
|
127
|
+
level further in `.py`, same as an admonition's own content.
|
|
115
128
|
- Cross-references and inline code (`:class:`, `:meth:`, `:func:`, `:attr:`,
|
|
116
129
|
double-backtick literals, ...) keep their display text, wrapped in backticks (e.g.
|
|
117
130
|
``:class:`pyvista.Plotter` `` -> `` `pyvista.Plotter` ``). If `html_baseurl` is set and
|
|
@@ -169,8 +182,7 @@ styles:
|
|
|
169
182
|
- `.py` uses an RST-style title + underline, one character per level -- the same
|
|
170
183
|
sequence Sphinx's own documentation uses for sections through sub-paragraphs: `=`, `-`,
|
|
171
184
|
`~`, `^`, `"`, `'` for levels 1 through 6.
|
|
172
|
-
- `.ipynb` always uses ATX syntax (`#`, `##`, `###`, ...)
|
|
173
|
-
heading at any level, whereas an underline only reads as one for the first two.
|
|
185
|
+
- `.ipynb` always uses ATX syntax (`#`, `##`, `###`, ...) at every level.
|
|
174
186
|
|
|
175
187
|
Two things worth knowing before turning this on:
|
|
176
188
|
|
|
@@ -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
|
|
@@ -81,10 +89,15 @@ What happens to the content of an Examples section:
|
|
|
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
91
|
comment followed by their content as comments, indented one level under the label in
|
|
84
|
-
`.py`
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
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 bare `#` instead of a real blank line when
|
|
97
|
+
that falls inside an admonition or a definition's own body in `.py`, so the whole
|
|
98
|
+
thing still reads as one unbroken comment block. A definition list's term stays at
|
|
99
|
+
the surrounding indent; its definition (the body nested under it) is indented one
|
|
100
|
+
level further in `.py`, same as an admonition's own content.
|
|
88
101
|
- Cross-references and inline code (`:class:`, `:meth:`, `:func:`, `:attr:`,
|
|
89
102
|
double-backtick literals, ...) keep their display text, wrapped in backticks (e.g.
|
|
90
103
|
``:class:`pyvista.Plotter` `` -> `` `pyvista.Plotter` ``). If `html_baseurl` is set and
|
|
@@ -142,8 +155,7 @@ styles:
|
|
|
142
155
|
- `.py` uses an RST-style title + underline, one character per level -- the same
|
|
143
156
|
sequence Sphinx's own documentation uses for sections through sub-paragraphs: `=`, `-`,
|
|
144
157
|
`~`, `^`, `"`, `'` for levels 1 through 6.
|
|
145
|
-
- `.ipynb` always uses ATX syntax (`#`, `##`, `###`, ...)
|
|
146
|
-
heading at any level, whereas an underline only reads as one for the first two.
|
|
158
|
+
- `.ipynb` always uses ATX syntax (`#`, `##`, `###`, ...) at every level.
|
|
147
159
|
|
|
148
160
|
Two things worth knowing before turning this on:
|
|
149
161
|
|