Skip to content

Commit c8c9190

Browse files
authored
Add remaining docstrings and flesh out API reference (#92)
1 parent 940ae7d commit c8c9190

File tree

54 files changed

+2244
-499
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+2244
-499
lines changed

docs/README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# PyShiny API reference
2+
3+
## Build locally
4+
5+
To build the PyShiny API reference locally, do:
6+
7+
```sh
8+
make clean && make html
9+
```
10+
11+
Note that `make clean` won't remove `source/reference` files, so you may periodically want to `rm -r source/reference` to truly have a clean build.
12+
13+
## Preview locally
14+
15+
Serve the contents of `build/html`
16+
17+
```sh
18+
cd build/html
19+
python3 -m http.server
20+
```
21+
22+
(Then open your browser to <http://localhost:8000>)
23+
24+
## Development
25+
26+
It's recommended to use VSCode's [reStructuredText extension](https://marketplace.visualstudio.com/items?itemName=lextudio.restructuredtext) (as well as it's recommended extensions) when contributing to these docs. **Just make sure you open VSCode from the docs folder**:
27+
28+
```sh
29+
code prism/docs
30+
```

docs/source/_templates/class.rst

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
..
2+
Derived from the sphinx v3.0.4 source code: sphinx/ext/autosummary/templates/autosummary/class.rst
3+
This slightly modified version is used to get methods to hyperlink to their own
4+
reference/ page (i.e., it adds toctree to autosummary) and hides the __init__ method
5+
6+
{{ fullname | escape | underline}}
7+
8+
.. currentmodule:: {{ module }}
9+
10+
.. autoclass:: {{ objname }}
11+
12+
{% block methods %}
13+
14+
{% if methods %}
15+
.. rubric:: Methods
16+
17+
.. autosummary::
18+
:toctree:
19+
{% for item in methods %}
20+
{%- if item not in ['__init__', 'call_pyodide'] %}
21+
~{{ name }}.{{ item }}
22+
{% endif %}
23+
{%- endfor %}
24+
{% endif %}
25+
{% endblock %}
26+
27+
{% block attributes %}
28+
{% if attributes %}
29+
.. rubric:: Attributes
30+
31+
.. autosummary::
32+
:toctree:
33+
{% for item in attributes %}
34+
~{{ name }}.{{ item }}
35+
{%- endfor %}
36+
{% endif %}
37+
{% endblock %}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
{{ fullname | escape | underline}}
3+
4+
.. currentmodule:: {{ module }}
5+
6+
.. autoclass:: {{ objname }}
7+
8+
{% block methods %}
9+
{% endblock %}
10+
11+
{% block attributes %}
12+
{% if attributes %}
13+
.. rubric:: Attributes
14+
15+
.. autosummary::
16+
{% for item in attributes %}
17+
~{{ name }}.{{ item }}
18+
{%- endfor %}
19+
{% endif %}
20+
{% endblock %}

docs/source/_templates/tag_func.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
..
2+
This essentially replaces the default behavior of .. autosummary::, which is
3+
https://raw.githubusercontent.com/sphinx-doc/sphinx/4.x/sphinx/ext/autosummary/templates/autosummary/base.rst
4+
For whatever reason, that default behavior doesn't work when applied to ui.tags
5+
6+
{{ fullname | escape | underline}}
7+
8+
.. auto{{ objtype }}:: {{ module }}.{{ objname }}

docs/source/_templates/tags.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{{ fullname | escape | underline}}
2+
3+
.. automodule:: {{fullname}}
4+
5+
.. autosummary::
6+
:toctree:
7+
:template: tag_func.rst
8+
9+
{% block functions %}
10+
{% for item in functions %}
11+
~{{ fullname }}.{{ item }}
12+
{%- endfor %}
13+
{% endblock %}

0 commit comments

Comments
 (0)