From e85ed1c0bbb4ee848b2d18f11b0a5f0e6cd1bf63 Mon Sep 17 00:00:00 2001 From: JessikaSmith Date: Wed, 5 Jul 2023 17:37:50 +0300 Subject: [PATCH] Add static and templates --- docs/_static/style.css | 13 +++++++ docs/_templates/autosummary/class.rst | 14 ++++++++ docs/_templates/autosummary/module.rst | 48 ++++++++++++++++++++++++++ docs/_templates/classtemplate.rst | 14 ++++++++ docs/_templates/functiontemplate.rst | 11 ++++++ docs/conf.py | 6 +++- 6 files changed, 105 insertions(+), 1 deletion(-) create mode 100644 docs/_static/style.css create mode 100644 docs/_templates/autosummary/class.rst create mode 100644 docs/_templates/autosummary/module.rst create mode 100644 docs/_templates/classtemplate.rst create mode 100644 docs/_templates/functiontemplate.rst diff --git a/docs/_static/style.css b/docs/_static/style.css new file mode 100644 index 0000000..95af63c --- /dev/null +++ b/docs/_static/style.css @@ -0,0 +1,13 @@ +.wy-nav-content { + max-width: none; +} + +.rst-content code.xref { + /* !important prevents the common CSS stylesheets from overriding + this as on RTD they are loaded after this stylesheet */ + color: #E74C3C +} + +html.writer-html4 .rst-content dl:not(.docutils) dl:not(.field-list)>dt, html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) dl:not(.field-list)>dt { + border-left-color: rgb(9, 183, 14) +} diff --git a/docs/_templates/autosummary/class.rst b/docs/_templates/autosummary/class.rst new file mode 100644 index 0000000..f8463cb --- /dev/null +++ b/docs/_templates/autosummary/class.rst @@ -0,0 +1,14 @@ +.. role:: hidden + :class: hidden-section +.. currentmodule:: {{ module }} + + +{{ name | underline}} + +.. autoclass:: {{ name }} + :members: + + +.. + autogenerated from source/_templates/autosummary/class.rst + note it does not have :inherited-members: diff --git a/docs/_templates/autosummary/module.rst b/docs/_templates/autosummary/module.rst new file mode 100644 index 0000000..014cfb8 --- /dev/null +++ b/docs/_templates/autosummary/module.rst @@ -0,0 +1,48 @@ +.. role:: hidden + :class: hidden-section + +{{ name | underline }} + +.. automodule:: {{ fullname }} + + {% block classes %} + {% if classes %} + .. rubric:: {{ _('Classes') }} + + .. autosummary:: + :toctree: generated + :nosignatures: + :template: classtemplate.rst + {% for item in classes %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + {% block functions %} + {% if functions %} + .. rubric:: {{ _('Functions') }} + + .. autosummary:: + :toctree: generated + :nosignatures: + :template: functiontemplate.rst + {% for item in functions %} + {{ item }} + {%- endfor %} + {% endif %} + {% endblock %} + + +{% block modules %} +{% if modules %} +.. rubric:: {{ _('Modules') }} + +.. autosummary:: + :toctree: + :recursive: +{% for item in modules %} + {{ item }} +{%- endfor %} +{% endif %} +{% endblock %} diff --git a/docs/_templates/classtemplate.rst b/docs/_templates/classtemplate.rst new file mode 100644 index 0000000..398a0ec --- /dev/null +++ b/docs/_templates/classtemplate.rst @@ -0,0 +1,14 @@ +.. role:: hidden + :class: hidden-section +.. currentmodule:: {{ module }} + + +{{ name | underline }} + +.. autoclass:: {{ name }} + :members: + + +.. + autogenerated from source/_templates/classtemplate.rst + note it does not have :inherited-members: diff --git a/docs/_templates/functiontemplate.rst b/docs/_templates/functiontemplate.rst new file mode 100644 index 0000000..429e901 --- /dev/null +++ b/docs/_templates/functiontemplate.rst @@ -0,0 +1,11 @@ +.. role:: hidden + :class: hidden-section +.. currentmodule:: {{ module }} + +{{ name | underline }} + +.. autofunction:: {{ fullname }} + +.. + autogenerated from source/_templates/functiontemplate.rst + note it does not have :inherited-members: diff --git a/docs/conf.py b/docs/conf.py index d02089e..5b0b4b9 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -10,7 +10,8 @@ import sys -LIB_PATH = os.path.join(os.path.dirname(__file__)) +CURR_PATH = os.path.abspath(os.path.dirname(__file__)) +LIB_PATH = os.path.join(CURR_PATH, os.path.pardir) print(LIB_PATH) sys.path.insert(0, LIB_PATH) @@ -50,4 +51,7 @@ html_static_path = ['_static'] +# Autosummary true if you want to generate it from very beginning autosummary_generate = True + +set_type_checking_flag = True