-
Notifications
You must be signed in to change notification settings - Fork 12
feat(docs): generate doc #823
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Laure-di
wants to merge
13
commits into
scaleway:main
Choose a base branch
from
Laure-di:sphinx-by-read-the-doc
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
4443196
feat(docs): generate documentation
Laure-di a79d96f
chore(deps-dev): update python 3.10 (#821)
Laure-di e899006
add poetry.lock
Laure-di 891fd08
sphinx init and templates
Laure-di 92ebd73
update workflows
Laure-di 17f941f
update
Laure-di 469d63d
update dependencies and clean conf.py
Laure-di c1c121e
conf.py
Laure-di 490e7aa
add module.rst
Laure-di 8a94e83
rename modules.rst
Laure-di 388926a
final update
Laure-di ee99d77
Merge branch 'main' into sphinx-by-read-the-doc
Laure-di 1442efc
Merge branch 'main' into sphinx-by-read-the-doc
remyleone File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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 was deleted.
Oops, something went wrong.
Empty file.
Empty file.
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 @@ | ||
API Reference | ||
============= | ||
|
||
This page contains auto-generated API reference documentation [#f1]_. | ||
|
||
.. toctree:: | ||
:titlesonly: | ||
|
||
{% for page in pages|selectattr("is_top_level_object") %} | ||
{{ page.include_path }} | ||
{% endfor %} | ||
|
||
.. [#f1] Created with `sphinx-autoapi <https://github.com/readthedocs/sphinx-autoapi>`_ |
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,12 @@ | ||
{% import 'macros.rst' as macros %} | ||
{% macro auto_summary(objs, title='') -%} | ||
|
||
.. list-table:: {{ title }} | ||
:header-rows: 0 | ||
:widths: auto | ||
|
||
{% for obj in objs %} | ||
* - obj.name | ||
- obj.summary | ||
{% endfor %} | ||
{% endmacro %} |
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 @@ | ||
{% extends "python/data.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,104 @@ | ||
{% if obj.display %} | ||
{% if is_own_page %} | ||
{{ obj.id }} | ||
{{ "=" * obj.id | length }} | ||
|
||
{% endif %} | ||
{% set visible_children = obj.children|selectattr("display")|list %} | ||
{% set own_page_children = visible_children|selectattr("type", "in", own_page_types)|list %} | ||
{% if is_own_page and own_page_children %} | ||
.. toctree:: | ||
:hidden: | ||
|
||
{% for child in own_page_children %} | ||
{{ child.include_path }} | ||
{% endfor %} | ||
|
||
{% endif %} | ||
.. py:{{ obj.type }}:: {% if is_own_page %}{{ obj.id }}{% else %}{{ obj.short_name }}{% endif %}{% if obj.args %}({{ obj.args }}){% endif %} | ||
|
||
{% for (args, return_annotation) in obj.overloads %} | ||
{{ " " * (obj.type | length) }} {{ obj.short_name }}{% if args %}({{ args }}){% endif %} | ||
|
||
{% endfor %} | ||
{% if obj.bases %} | ||
{% if "show-inheritance" in autoapi_options %} | ||
|
||
Bases: {% for base in obj.bases %}{{ base|link_objs }}{% if not loop.last %}, {% endif %}{% endfor %} | ||
{% endif %} | ||
|
||
|
||
{% if "show-inheritance-diagram" in autoapi_options and obj.bases != ["object"] %} | ||
.. autoapi-inheritance-diagram:: {{ obj.obj["full_name"] }} | ||
:parts: 1 | ||
{% if "private-members" in autoapi_options %} | ||
:private-bases: | ||
{% endif %} | ||
|
||
{% endif %} | ||
{% endif %} | ||
{% if obj.docstring %} | ||
|
||
{{ obj.docstring|indent(3) }} | ||
{% endif %} | ||
{% for obj_item in visible_children %} | ||
{% if obj_item.type not in own_page_types %} | ||
|
||
{{ obj_item.render()|indent(3) }} | ||
{% endif %} | ||
{% endfor %} | ||
{% if is_own_page and own_page_children %} | ||
{% set visible_attributes = own_page_children|selectattr("type", "equalto", "attribute")|list %} | ||
{% if visible_attributes %} | ||
Attributes | ||
---------- | ||
|
||
.. autoapisummary:: | ||
|
||
{% for attribute in visible_attributes %} | ||
{{ attribute.id }} | ||
{% endfor %} | ||
|
||
|
||
{% endif %} | ||
{% set visible_exceptions = own_page_children|selectattr("type", "equalto", "exception")|list %} | ||
{% if visible_exceptions %} | ||
Exceptions | ||
---------- | ||
|
||
.. autoapisummary:: | ||
|
||
{% for exception in visible_exceptions %} | ||
{{ exception.id }} | ||
{% endfor %} | ||
|
||
|
||
{% endif %} | ||
{% set visible_classes = own_page_children|selectattr("type", "equalto", "class")|list %} | ||
{% if visible_classes %} | ||
Classes | ||
------- | ||
|
||
.. autoapisummary:: | ||
|
||
{% for klass in visible_classes %} | ||
{{ klass.id }} | ||
{% endfor %} | ||
|
||
|
||
{% endif %} | ||
{% set visible_methods = own_page_children|selectattr("type", "equalto", "method")|list %} | ||
{% if visible_methods %} | ||
Methods | ||
------- | ||
|
||
.. autoapisummary:: | ||
|
||
{% for method in visible_methods %} | ||
{{ method.id }} | ||
{% endfor %} | ||
|
||
|
||
{% endif %} | ||
{% endif %} | ||
{% endif %} |
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,38 @@ | ||
{% if obj.display %} | ||
{% if is_own_page %} | ||
{{ obj.id }} | ||
{{ "=" * obj.id | length }} | ||
|
||
{% endif %} | ||
.. py:{{ obj.type }}:: {% if is_own_page %}{{ obj.id }}{% else %}{{ obj.name }}{% endif %} | ||
{% if obj.annotation is not none %} | ||
|
||
:type: {% if obj.annotation %} {{ obj.annotation }}{% endif %} | ||
{% endif %} | ||
{% if obj.value is not none %} | ||
|
||
{% if obj.value.splitlines()|count > 1 %} | ||
:value: Multiline-String | ||
|
||
.. raw:: html | ||
|
||
<details><summary>Show Value</summary> | ||
|
||
.. code-block:: python | ||
|
||
{{ obj.value|indent(width=6,blank=true) }} | ||
|
||
.. raw:: html | ||
|
||
</details> | ||
|
||
{% else %} | ||
:value: {{ obj.value|truncate(100) }} | ||
{% endif %} | ||
{% endif %} | ||
|
||
{% if obj.docstring %} | ||
|
||
{{ obj.docstring|indent(3) }} | ||
{% endif %} | ||
{% endif %} |
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 @@ | ||
{% extends "python/class.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,21 @@ | ||
{% if obj.display %} | ||
{% if is_own_page %} | ||
{{ obj.id }} | ||
{{ "=" * obj.id | length }} | ||
|
||
{% endif %} | ||
.. py:function:: {% if is_own_page %}{{ obj.id }}{% else %}{{ obj.short_name }}{% endif %}({{ obj.args }}){% if obj.return_annotation is not none %} -> {{ obj.return_annotation }}{% endif %} | ||
{% for (args, return_annotation) in obj.overloads %} | ||
|
||
{%+ if is_own_page %}{{ obj.id }}{% else %}{{ obj.short_name }}{% endif %}({{ args }}){% if return_annotation is not none %} -> {{ return_annotation }}{% endif %} | ||
{% endfor %} | ||
{% for property in obj.properties %} | ||
|
||
:{{ property }}: | ||
{% endfor %} | ||
|
||
{% if obj.docstring %} | ||
|
||
{{ obj.docstring|indent(3) }} | ||
{% endif %} | ||
{% endif %} |
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 @@ | ||
{% if obj.display %} | ||
{% if is_own_page %} | ||
{{ obj.id }} | ||
{{ "=" * obj.id | length }} | ||
|
||
{% endif %} | ||
.. py:method:: {% if is_own_page %}{{ obj.id }}{% else %}{{ obj.short_name }}{% endif %}({{ obj.args }}){% if obj.return_annotation is not none %} -> {{ obj.return_annotation }}{% endif %} | ||
{% for (args, return_annotation) in obj.overloads %} | ||
|
||
{%+ if is_own_page %}{{ obj.id }}{% else %}{{ obj.short_name }}{% endif %}({{ args }}){% if return_annotation is not none %} -> {{ return_annotation }}{% endif %} | ||
{% endfor %} | ||
{% for property in obj.properties %} | ||
|
||
:{{ property }}: | ||
{% endfor %} | ||
|
||
{% if obj.docstring %} | ||
|
||
{{ obj.docstring|indent(3) }} | ||
{% endif %} | ||
{% endif %} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
please add a
-j auto
flag to sphinx-docs build because it is really slow otherwise