Skip to content

Commit afc84c2

Browse files
committed
Fix ulab, math and template.
1 parent b477c48 commit afc84c2

File tree

15 files changed

+719
-669
lines changed

15 files changed

+719
-669
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ _build
5252
# Generated rst files
5353
######################
5454
genrst/
55-
autoapi/
55+
/autoapi/
5656

5757
# ctags and similar
5858
###################

Makefile

+5-4
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ help:
6767

6868
clean:
6969
rm -rf $(BUILDDIR)/*
70+
rm -rf autoapi
7071
rm -rf $(STUBDIR) $(DISTDIR) *.egg-info
7172

7273
html: stubs
@@ -213,10 +214,10 @@ check-translate: locale/circuitpython.pot $(wildcard locale/*.po)
213214
$(PYTHON) tools/check_translations.py $^
214215

215216
stubs:
216-
mkdir -p circuitpython-stubs
217-
python tools/extract_pyi.py shared-bindings/ $(STUBDIR)
218-
python tools/extract_pyi.py ports/atmel-samd/bindings $(STUBDIR)
219-
python setup.py sdist
217+
@mkdir -p circuitpython-stubs
218+
@$(PYTHON) tools/extract_pyi.py shared-bindings/ $(STUBDIR)
219+
@$(PYTHON) tools/extract_pyi.py ports/atmel-samd/bindings $(STUBDIR)
220+
@$(PYTHON) setup.py -q sdist
220221

221222
update-frozen-libraries:
222223
@echo "Updating all frozen libraries to latest tagged version."

conf.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,13 @@
7171

7272
autoapi_type = 'python'
7373
# Uncomment this if debugging autoapi
74-
# autoapi_keep_files = True
75-
autoapi_dirs = ['circuitpython-stubs']
74+
autoapi_keep_files = True
75+
autoapi_dirs = [os.path.join('circuitpython-stubs', x) for x in os.listdir('circuitpython-stubs')]
76+
print(autoapi_dirs)
7677
autoapi_add_toctree_entry = False
7778
autoapi_options = ['members', 'undoc-members', 'private-members', 'show-inheritance', 'special-members', 'show-module-summary']
7879
autoapi_template_dir = 'docs/autoapi/templates'
80+
autoapi_python_use_implicit_namespaces = True
7981

8082
# The encoding of source files.
8183
#source_encoding = 'utf-8-sig'
+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
{% if not obj.display %}
2+
:orphan:
3+
4+
{% endif %}
5+
:mod:`{{ obj.name }}`
6+
======={{ "=" * obj.name|length }}
7+
8+
.. py:module:: {{ obj.name }}
9+
10+
{% if obj.docstring %}
11+
.. autoapi-nested-parse::
12+
13+
{{ obj.docstring|prepare_docstring|indent(3) }}
14+
15+
{% endif %}
16+
17+
{% block subpackages %}
18+
{% set visible_subpackages = obj.subpackages|selectattr("display")|list %}
19+
{% if visible_subpackages %}
20+
.. toctree::
21+
:titlesonly:
22+
:maxdepth: 3
23+
24+
{% for subpackage in visible_subpackages %}
25+
{{ subpackage.short_name }}/index.rst
26+
{% endfor %}
27+
28+
29+
{% endif %}
30+
{% endblock %}
31+
{% block submodules %}
32+
{% set visible_submodules = obj.submodules|selectattr("display")|list %}
33+
{% if visible_submodules %}
34+
35+
.. toctree::
36+
:titlesonly:
37+
:maxdepth: 1
38+
39+
{% for submodule in visible_submodules %}
40+
{{ submodule.short_name }}/index.rst
41+
{% endfor %}
42+
43+
44+
{% endif %}
45+
{% endblock %}
46+
{% block content %}
47+
{% if obj.all is not none %}
48+
{% set visible_children = obj.children|selectattr("short_name", "in", obj.all)|list %}
49+
{% elif obj.type is equalto("package") %}
50+
{% set visible_children = obj.children|selectattr("display")|list %}
51+
{% else %}
52+
{% set visible_children = obj.children|selectattr("display")|rejectattr("imported")|list %}
53+
{% endif %}
54+
{% if visible_children %}
55+
56+
{% set visible_classes = visible_children|selectattr("type", "equalto", "class")|list %}
57+
{% set visible_functions = visible_children|selectattr("type", "equalto", "function")|list %}
58+
{% if "show-module-summary" in autoapi_options and (visible_classes or visible_functions) %}
59+
{% block classes %}
60+
{% if visible_classes %}
61+
Classes
62+
~~~~~~~
63+
64+
.. autoapisummary::
65+
66+
{% for klass in visible_classes %}
67+
{{ klass.id }}
68+
{% endfor %}
69+
70+
71+
{% endif %}
72+
{% endblock %}
73+
74+
{% block functions %}
75+
{% if visible_functions %}
76+
Functions
77+
~~~~~~~~~
78+
79+
.. autoapisummary::
80+
81+
{% for function in visible_functions %}
82+
{{ function.id }}
83+
{% endfor %}
84+
85+
86+
{% endif %}
87+
{% endblock %}
88+
{% endif %}
89+
{% for obj_item in visible_children %}
90+
{{ obj_item.rendered|indent(0) }}
91+
{% endfor %}
92+
{% endif %}
93+
{% endblock %}

0 commit comments

Comments
 (0)