-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve sphinx documentation structure
Put classes in separate files and use autosummary to generate them.
- Loading branch information
Showing
44 changed files
with
460 additions
and
177 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{{ name | escape | underline}} | ||
|
||
.. currentmodule:: {{ module }} | ||
|
||
.. auto{{ objtype }}:: {{ objname }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{{ name | escape | underline}} | ||
|
||
.. currentmodule:: {{ module }} | ||
|
||
.. autoclass:: {{ objname }} | ||
:show-inheritance: | ||
:members: | ||
|
||
.. automethod:: __init__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{{ name | escape | underline}} | ||
|
||
.. automodule:: {{ fullname }} | ||
:show-inheritance: | ||
|
||
{% block functions %} | ||
{% if functions %} | ||
.. rubric:: Functions | ||
|
||
.. autosummary:: | ||
:toctree: functions | ||
{% for item in functions %} | ||
{{ item }} | ||
{%- endfor %} | ||
{% endif %} | ||
{% endblock %} | ||
|
||
{% block classes %} | ||
{% if classes %} | ||
.. rubric:: Classes | ||
|
||
.. autosummary:: | ||
:toctree: classes | ||
{% for item in classes %} | ||
{{ item }} | ||
{%- endfor %} | ||
{% endif %} | ||
{% endblock %} | ||
|
||
{% block exceptions %} | ||
{% if exceptions %} | ||
.. rubric:: Exceptions | ||
|
||
.. autosummary:: | ||
:toctree: exceptions | ||
{% for item in exceptions %} | ||
{{ item }} | ||
{%- endfor %} | ||
{% endif %} | ||
{% endblock %} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,30 @@ | ||
Documentation | ||
============= | ||
.. currentmodule:: ttkwidgets | ||
|
||
Submodules | ||
~~~~~~~~~~ | ||
.. toctree:: | ||
:hidden: | ||
:glob: | ||
:maxdepth: 1 | ||
|
||
autocomplete | ||
color | ||
font | ||
frames | ||
:Caption: Packages | ||
|
||
Widgets | ||
~~~~~~~ | ||
ttkwidgets/* | ||
|
||
AutoHideScrollbar | ||
----------------- | ||
.. autoclass:: AutoHideScrollbar | ||
:members: | ||
|
||
Calendar | ||
-------- | ||
.. autoclass:: Calendar | ||
:members: | ||
|
||
CheckboxTreeview | ||
---------------- | ||
.. autoclass:: CheckboxTreeview | ||
:members: | ||
|
||
DebugWindow | ||
----------- | ||
.. autoclass:: DebugWindow | ||
:members: | ||
|
||
ItemsCanvas | ||
----------- | ||
.. autoclass:: ItemsCanvas | ||
:members: | ||
Package structure | ||
|
||
LinkLabel | ||
--------- | ||
.. autoclass:: LinkLabel | ||
:members: | ||
:: | ||
|
||
ScaleEntry | ||
---------- | ||
.. autoclass:: ScaleEntry | ||
:members: | ||
ttkwidgets | ||
├── autocomplete | ||
├── color | ||
├── font | ||
└── frames | ||
|
||
ScrolledListbox | ||
--------------- | ||
.. autoclass:: ScrolledListbox | ||
:members: | ||
|
||
Table | ||
----- | ||
.. autoclass:: Table | ||
:members: | ||
|
||
TickScale | ||
--------- | ||
.. autoclass:: TickScale | ||
:members: | ||
|
||
TimeLine | ||
-------- | ||
.. autoclass:: TimeLine | ||
:members: | ||
=================== ======================= | ||
Package Content | ||
=================== ======================= | ||
:ref:`ttkwidgets` Miscellanous widgets. | ||
:ref:`autocomplete` Autocompletion widgets. | ||
:ref:`color` Color choosing widgets. | ||
:ref:`font` Font choosing widgets. | ||
:ref:`frames` Frame based widgets. | ||
=================== ======================= |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Index | ||
===== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
.. _autocomplete: | ||
|
||
ttkwidgets.autocomplete | ||
======================= | ||
|
||
.. currentmodule:: ttkwidgets.autocomplete | ||
|
||
.. autosummary:: | ||
:nosignatures: | ||
:toctree: ttkwidgets.autocomplete | ||
|
||
AutocompleteCombobox | ||
AutocompleteEntry |
10 changes: 10 additions & 0 deletions
10
...idgets/ttkwidgets.autocomplete/ttkwidgets.autocomplete.AutocompleteCombobox.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
AutocompleteCombobox | ||
==================== | ||
|
||
.. currentmodule:: ttkwidgets.autocomplete | ||
|
||
.. autoclass:: AutocompleteCombobox | ||
:show-inheritance: | ||
:members: | ||
|
||
.. automethod:: __init__ |
10 changes: 10 additions & 0 deletions
10
...tkwidgets/ttkwidgets.autocomplete/ttkwidgets.autocomplete.AutocompleteEntry.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
AutocompleteEntry | ||
================= | ||
|
||
.. currentmodule:: ttkwidgets.autocomplete | ||
|
||
.. autoclass:: AutocompleteEntry | ||
:show-inheritance: | ||
:members: | ||
|
||
.. automethod:: __init__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
.. _color: | ||
|
||
ttkwidgets.color | ||
================ | ||
|
||
.. currentmodule:: ttkwidgets.color | ||
|
||
.. rubric:: Functions | ||
|
||
.. autofunction:: askcolor | ||
|
||
.. rubric:: Classes | ||
|
||
.. autosummary:: | ||
:nosignatures: | ||
:toctree: ttkwidgets.color | ||
|
||
AlphaBar | ||
ColorPicker | ||
ColorSquare | ||
GradientBar |
Oops, something went wrong.
05b33e1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have put the different classes in separate files (they are automatically generated with the autosummary extension). @RedFantom Let me know what you think about the general structure of the documentation, then I can work on standardizing the docstrings.
05b33e1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking really good! I'm certainly going to look into doing something similar for
ttkthemes
as well. I do get a lot of warnings while runningmake html
though, and the autoclasses don't work if I do not enter a full path for them, so instead of:.. autoclass:: AlphaBar
, I have to enter.. autoclass:: ttkwidgets.color.AlphaBar
. Are you experiencing the same thing, or is it building fine for you? If it does, then I am probably doing something very simple wrong.05b33e1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RedFantom I do get a lot of warnings too and this is because of formatting issues in the docstrings that I plan to fix later. However the
autoclass:: Alphabar
works fine for me because the.. currentmodule:: ttkwidgets.color
directive tells sphinx where to look for the class. I don't know why it does not work for you. Maybe you can try to delete the folders insidedocs/source/ttkwidgets
so thatmake html
will regenerate the files.05b33e1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That indeed does fix the problem. I wrote some documentation for
ttkthemes
just now, as it is a lot smaller and thus easier to figure out, and that helped a lot in figuring out what is going on.The
frames
andautocomplete
packages are not properly indexed yet, and clickingdocumentation
doesn't get me the index of the documentation (I have to open the HTML-files manually), so there must still be some things going wrong.Because you took the initiative on this: Would you prefer to add
ttkwidgets
to your own ReadTheDocs account or should I add it to mine?05b33e1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure I have enough permissions on the Github repo to add it to my account so it would be easier if you add it to yours.
When I delete all the auto-generated files and the build folder, one run of
make html
regenerates everything fine with all the indexing and links. I don't know if the difference comes from the OS or the version (I use sphinx 1.8.0).