Skip to content

Commit

Permalink
Merge pull request #12 from kas-lab/docs
Browse files Browse the repository at this point in the history
Add documentation
  • Loading branch information
Rezenders committed Jan 10, 2024
2 parents 3a3dfda + 3fbf562 commit 289a099
Show file tree
Hide file tree
Showing 12 changed files with 887 additions and 307 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
skip-tests: true
- name: Install dependencies
run: |
pip install sphinx sphinx_rtd_theme myst_parser sphinx-autopackagesummary typedb-driver
pip install sphinx sphinx_rtd_theme myst_parser sphinx-autopackagesummary sphinx-autodoc-typehints typedb-driver
- name: Sphinx build
run: |
source ${{ steps.action_ros_ci_step.outputs.ros-workspace-directory-name }}/install/setup.bash && sphinx-build docs/source docs/build
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
docs/source/_autosummary/
docs/source/generated/

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
58 changes: 25 additions & 33 deletions docs/source/_templates/autosummary/class.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,28 @@
.. currentmodule:: {{ module }}

.. autoclass:: {{ objname }}

{% block methods %}

{% for item in methods %}
{%- if item not in inherited_members %}
.. automethod:: {{ item }}
{%- endif %}
{%- endfor %}

{% if methods %}
.. rubric:: {{ _('Methods') }}

.. autosummary::
{% for item in methods %}
{%- if item not in inherited_members %}
~{{ name }}.{{ item }}
{%- endif %}
{%- endfor %}
{% endif %}
{% endblock %}

{% block attributes %}
{% if attributes %}
.. rubric:: {{ _('Attributes') }}

.. autosummary::
{% for item in attributes %}
{%- if item not in inherited_members %}
~{{ name }}.{{ item }}
{%- endif %}
{%- endfor %}
{% endif %}
{% endblock %}
:members:
:undoc-members:
:special-members: __init__

{% if methods %}
.. rubric:: {{ _('Methods') }}

.. autosummary::
{% for item in methods %}
{%- if item not in inherited_members %}
~{{ name }}.{{ item }}
{%- endif %}
{%- endfor %}
{% endif %}

{% if attributes %}
.. rubric:: {{ _('Attributes') }}

.. autosummary::
{% for item in attributes %}
{%- if item not in inherited_members %}
~{{ name }}.{{ item }}
{%- endif %}
{%- endfor %}
{% endif %}
64 changes: 64 additions & 0 deletions docs/source/_templates/autosummary/module.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{{ fullname | escape | underline}}

.. automodule:: {{ fullname }}

{% block attributes %}
{% if attributes %}
.. rubric:: Module Attributes

.. autosummary::
:toctree:
{% for item in attributes %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block functions %}
{% if functions %}
.. rubric:: {{ _('Functions') }}

.. autosummary::
:toctree:
{% for item in functions %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block classes %}
{% if classes %}
.. rubric:: {{ _('Classes') }}

.. autosummary::
:toctree:
{% for item in classes %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block exceptions %}
{% if exceptions %}
.. rubric:: {{ _('Exceptions') }}

.. autosummary::
:toctree:
{% for item in exceptions %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block modules %}
{% if modules %}
.. rubric:: Modules

.. autosummary::
:toctree:
:recursive:
{% for item in modules %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}
8 changes: 5 additions & 3 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
API
=====


.. autosummary::
:toctree: generated
:toctree: _autosummary
:recursive:

ros_typedb.typedb_interface.TypeDBInterface
ros_typedb.ros_typedb_interface.ROSTypeDBInterface
ros_typedb.typedb_interface
ros_typedb.ros_typedb_interface
4 changes: 4 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.intersphinx",
"sphinx_autodoc_typehints",
]
autosummary_generate = True

autoclass_content = 'both'

intersphinx_mapping = {
"rtd": ("https://docs.readthedocs.io/en/stable/", None),
Expand Down

This file was deleted.

This file was deleted.

1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ This package was tested in Ubuntu 22.04 with ROS Humble and typedb v2.24.17.
installation
usage
api
:maxdepth: 1


Contribute
Expand Down
Loading

0 comments on commit 289a099

Please sign in to comment.