Skip to content

Commit adec09d

Browse files
committed
Remove Python path prefix from the menu docs
My first experience with Claude Code!
1 parent ae99aaa commit adec09d

File tree

4 files changed

+107
-1
lines changed

4 files changed

+107
-1
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{%- if objname.split('.')[-1] == objname %}
2+
{{ objname | escape | underline }}
3+
{%- else %}
4+
{{ objname.split('.')[-1] | escape | underline }}
5+
{%- endif %}
6+
7+
.. currentmodule:: {{ module }}
8+
9+
.. auto{{ objtype }}:: {{ objname }}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{%- if objname.split('.')[-1] == objname %}
2+
{{ objname | escape | underline }}
3+
{%- else %}
4+
{{ objname.split('.')[-1] | escape | underline }}
5+
{%- endif %}
6+
7+
.. currentmodule:: {{ module }}
8+
9+
.. autoclass:: {{ objname }}
10+
11+
{% block methods %}
12+
.. automethod:: __init__
13+
14+
{% if methods %}
15+
.. rubric:: {{ _('Methods') }}
16+
17+
.. autosummary::
18+
{% for item in methods %}
19+
~{{ name }}.{{ item }}
20+
{%- endfor %}
21+
{% endif %}
22+
{% endblock %}
23+
24+
{% block attributes %}
25+
{% if attributes %}
26+
.. rubric:: {{ _('Attributes') }}
27+
28+
.. autosummary::
29+
{% for item in attributes %}
30+
~{{ name }}.{{ item }}
31+
{%- endfor %}
32+
{% endif %}
33+
{% endblock %}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{{ fullname | escape | underline}}
2+
3+
.. automodule:: {{ fullname }}
4+
5+
{% block attributes %}
6+
{%- if attributes %}
7+
.. rubric:: {{ _('Module Attributes') }}
8+
9+
.. autosummary::
10+
{% for item in attributes %}
11+
{{ item }}
12+
{%- endfor %}
13+
{% endif %}
14+
{%- endblock %}
15+
16+
{%- block functions %}
17+
{%- if functions %}
18+
.. rubric:: {{ _('Functions') }}
19+
20+
.. autosummary::
21+
{% for item in functions %}
22+
{{ item }}
23+
{%- endfor %}
24+
{% endif %}
25+
{%- endblock %}
26+
27+
{%- block classes %}
28+
{%- if classes %}
29+
.. rubric:: {{ _('Classes') }}
30+
31+
.. autosummary::
32+
{% for item in classes %}
33+
{{ item }}
34+
{%- endfor %}
35+
{% endif %}
36+
{%- endblock %}
37+
38+
{%- block exceptions %}
39+
{%- if exceptions %}
40+
.. rubric:: {{ _('Exceptions') }}
41+
42+
.. autosummary::
43+
{% for item in exceptions %}
44+
{{ item }}
45+
{%- endfor %}
46+
{% endif %}
47+
{%- endblock %}
48+
49+
{%- block modules %}
50+
{%- if modules %}
51+
.. rubric:: Modules
52+
53+
.. autosummary::
54+
:toctree:
55+
:recursive:
56+
{% for item in modules %}
57+
{{ item }}
58+
{%- endfor %}
59+
{% endif %}
60+
{%- endblock %}

docs/conf.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
## lets us suppress the copy button on select code blocks.
3939
copybutton_selector = "div:not(.no-copybutton) > div.highlight > pre"
4040

41-
templates_path = []
41+
templates_path = ["_templates"]
4242
exclude_patterns = ["_build", "**.ipynb_checkpoints"]
4343

4444
# This assumes that sphinx-build is called from the root directory
@@ -47,6 +47,10 @@
4747
html_show_sourcelink = False
4848
# Remove namespaces from class/method signatures
4949
add_module_names = False
50+
# Hide full module path in navigation
51+
modindex_common_prefix = ["nested_pandas."]
52+
# Customize display of autosummary entries
53+
autosummary_imported_members = True
5054

5155
html_theme = "sphinx_book_theme"
5256

0 commit comments

Comments
 (0)