Skip to content

Commit c45e3de

Browse files
committed
docs: consolidate extensions into their own section
1 parent e6da568 commit c45e3de

23 files changed

+206
-223
lines changed

docs/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"colon_fence",
4848
"deflist",
4949
"fieldlist",
50+
"linkify",
5051
"substitution",
5152
]
5253
myst_heading_anchors = 3

docs/extensions/click-extra.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# click-extra
2+
3+
```{todo}
4+
Support this extension.
5+
```

docs/extensions/index.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
hide-sidebar-secondary: true
3+
---
4+
5+
# 🧩 Extensions
6+
7+
```{toctree}
8+
:titlesonly:
9+
:glob:
10+
11+
*
12+
```

docs/extensions/jupyter-sphinx.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# jupyter-sphinx
2+
3+
```{todo}
4+
Support this extension.
5+
```

docs/extensions/nbsphinx.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# nbsphinx
2+
3+
```{todo}
4+
Support this extension.
5+
```
Lines changed: 4 additions & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -1,130 +1,11 @@
11
# numpydoc
22

3-
## Example
4-
5-
### Source
6-
7-
```
8-
"""Docstring for the example.py module.
9-
10-
Modules names should have short, all-lowercase names. The module name may
11-
have underscores if this improves readability.
12-
13-
Every module should have a docstring at the very top of the file. The
14-
module's docstring may extend over multiple lines. If your docstring does
15-
extend over multiple lines, the closing three quotation marks must be on
16-
a line by itself, preferably preceded by a blank line.
17-
18-
"""
19-
20-
import os # standard library imports first
21-
22-
# Do NOT import using *, e.g. from numpy import *
23-
#
24-
# Import the module using
25-
#
26-
# import numpy
27-
#
28-
# instead or import individual functions as needed, e.g
29-
#
30-
# from numpy import array, zeros
31-
#
32-
# If you prefer the use of abbreviated module names, we suggest the
33-
# convention used by NumPy itself::
34-
35-
import numpy as np
36-
import matplotlib as mpl
37-
import matplotlib.pyplot as plt
38-
39-
# These abbreviated names are not to be used in docstrings; users must
40-
# be able to paste and execute docstrings after importing only the
41-
# numpy module itself, unabbreviated.
42-
3+
Sphinx extension that provides support for the Numpy docstring format in Sphinx.
434

44-
def foo(var1, var2, *args, long_var_name="hi", only_seldom_used_keyword=0, **kwargs):
45-
r"""Summarize the function in one line.
5+
- **Documentation**: https://numpydoc.readthedocs.io/
6+
- **Source Code**: https://github.com/numpy/numpydoc
467

47-
Several sentences providing an extended description. Refer to
48-
variables using back-ticks, e.g. `var`.
49-
50-
Parameters
51-
----------
52-
var1 : array_like
53-
Array_like means all those objects -- lists, nested lists, etc. --
54-
that can be converted to an array. We can also refer to
55-
variables like `var1`.
56-
var2 : int
57-
The type above can either refer to an actual Python type
58-
(e.g. ``int``), or describe the type of the variable in more
59-
detail, e.g. ``(N,) ndarray`` or ``array_like``.
60-
*args : iterable
61-
Other arguments.
62-
long_var_name : {'hi', 'ho'}, optional
63-
Choices in brackets, default first when optional.
64-
65-
Returns
66-
-------
67-
type
68-
Explanation of anonymous return value of type ``type``.
69-
describe : type
70-
Explanation of return value named `describe`.
71-
out : type
72-
Explanation of `out`.
73-
type_without_description
74-
75-
Other Parameters
76-
----------------
77-
only_seldom_used_keyword : int, optional
78-
Infrequently used parameters can be described under this optional
79-
section to prevent cluttering the Parameters section.
80-
**kwargs : dict
81-
Other infrequently used keyword arguments. Note that all keyword
82-
arguments appearing after the first parameter specified under the
83-
Other Parameters section, should also be described under this
84-
section.
85-
86-
Raises
87-
------
88-
BadException
89-
Because you shouldn't have done that.
90-
91-
See Also
92-
--------
93-
numpy.array : Relationship (optional).
94-
numpy.ndarray : Relationship (optional), which could be fairly long, in
95-
which case the line wraps here.
96-
numpy.dot, numpy.linalg.norm, numpy.eye
97-
98-
References
99-
----------
100-
Cite the relevant literature, e.g. [1]_. You may also cite these
101-
references in the notes section above.
102-
103-
.. [1] O. McNoleg, "The integration of GIS, remote sensing,
104-
expert systems and adaptive co-kriging for environmental habitat
105-
modelling of the Highland Haggis using object-oriented, fuzzy-logic
106-
and neural-network techniques," Computers & Geosciences, vol. 22,
107-
pp. 585-588, 1996.
108-
109-
Examples
110-
--------
111-
These are written in doctest format, and should illustrate how to
112-
use the function.
113-
114-
>>> a = [1, 2, 3]
115-
>>> print([x + 3 for x in a])
116-
[4, 5, 6]
117-
>>> print("a\nb")
118-
a
119-
b
120-
"""
121-
# After closing class docstring, there should be one blank line to
122-
# separate following codes (according to PEP257).
123-
# But for function, method and module, there should be no blank lines
124-
# after closing the docstring.
125-
```
126-
127-
### Rendered
8+
## Example
1289

12910
```{raw} html
13011
<p>Docstring for the example.py module.</p>

docs/extensions/sphinx-click.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# sphinx-click
2+
3+
```{todo}
4+
Support this extension.
5+
```

docs/kitchen-sink/extensions/sphinx-contributors.md renamed to docs/extensions/sphinx-contributors.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# sphinx-contributors
22

3+
Sphinx extension that helps you recognize the people who have contributed to an open-source project.
4+
5+
- **Documentation**: https://sphinx-contributors.readthedocs.io/
6+
- **Source Code**: https://github.com/dgarcia360/sphinx-contributors
37

48
## Example
59

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# sphinx-copybutton
2+
3+
Sphinx extension that adds a "copy" button to code blocks in Sphinx.
4+
5+
- **Documentation**: https://sphinx-copybutton.readthedocs.io/
6+
- **Source Code**: https://github.com/executablebooks/sphinx-copybutton
7+
8+
## Example
9+
10+
```{hint}
11+
Hover on the code block, to see the copy button.
12+
```
13+
14+
```py
15+
from typing import Iterator
16+
17+
# This is an example
18+
class Math:
19+
@staticmethod
20+
def fib(n: int) -> Iterator[int]:
21+
"""Fibonacci series up to n"""
22+
a, b = 0, 1
23+
while a < n:
24+
yield a
25+
a, b = b, a + b
26+
```
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# sphinx-datatables
2+
3+
```{todo}
4+
Support this extension.
5+
```

0 commit comments

Comments
 (0)