diff --git a/.gitignore b/.gitignore index 2e79367e..d3a2a533 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,7 @@ TODO # pro lidi, co programují v nástrojích od JetBrains .idea + +# dokumentace +docs/_build +docs/modules \ No newline at end of file diff --git a/docs/_templates/module.rst_t b/docs/_templates/module.rst_t new file mode 100644 index 00000000..8a0a3556 --- /dev/null +++ b/docs/_templates/module.rst_t @@ -0,0 +1,8 @@ +{%- if show_headings %} +{{- [basename, ".py"] | join('') | e | heading }} + +{% endif -%} +.. automodule:: {{ qualname }} +{%- for option in automodule_options %} + :{{ option }}: +{%- endfor %} diff --git a/docs/_templates/package.rst_t b/docs/_templates/package.rst_t new file mode 100644 index 00000000..809ced67 --- /dev/null +++ b/docs/_templates/package.rst_t @@ -0,0 +1,57 @@ +{%- macro automodule(modname, options) -%} +.. automodule:: {{ modname }} +{%- for option in options %} + :{{ option }}: +{%- endfor %} +{%- endmacro %} + +{%- macro toctree(docnames) -%} +.. toctree:: + :maxdepth: {{ maxdepth }} +{% for docname in docnames %} + {{ docname }} +{%- endfor %} +{%- endmacro %} + +{%- if is_namespace %} +{{- pkgname | e | heading }} +{% else %} +{{- pkgname | e | heading }} +{% endif %} + +{%- if is_namespace %} +.. py:module:: {{ pkgname }} +{% endif %} + +{%- if modulefirst and not is_namespace %} +{{ automodule(pkgname, automodule_options) }} +{% endif %} + +{%- if subpackages %} +{# Subpackages #} +{# ----------- #} + +{{ toctree(subpackages) }} +{% endif %} + +{%- if submodules %} +{# Submodules #} +{# ---------- #} +{% if separatemodules %} +{{ toctree(submodules) }} +{% else %} +{%- for submodule in submodules %} +{% if show_headings %} +{{- submodule | e | heading(2) }} +{% endif %} +{{ automodule(submodule, automodule_options) }} +{% endfor %} +{%- endif %} +{%- endif %} + +{%- if not modulefirst and not is_namespace %} +Module contents +--------------- + +{{ automodule(pkgname, automodule_options) }} +{% endif %} \ No newline at end of file diff --git a/docs/_templates/toc.rst_t b/docs/_templates/toc.rst_t new file mode 100644 index 00000000..611dc7fa --- /dev/null +++ b/docs/_templates/toc.rst_t @@ -0,0 +1,7 @@ +{{ "Aplikace:" | heading }} + +.. toctree:: + :maxdepth: {{ maxdepth }} +{% for docname in docnames %} + {{ docname }} +{%- endfor %} \ No newline at end of file diff --git a/docs/index.rst b/docs/index.rst index d60fc32b..beedfa09 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -7,8 +7,11 @@ Vítejte v dokumentaci M&Mího webu! =================================== .. toctree:: + :caption: M&M web :maxdepth: 2 - :caption: Contents: + + sphinx + modules/modules diff --git a/docs/sphinx.rst b/docs/sphinx.rst new file mode 100644 index 00000000..f19557a5 --- /dev/null +++ b/docs/sphinx.rst @@ -0,0 +1,12 @@ +Sphinx +====== + +```sphinx-apidoc --module-first -o modules .. ../*/migrations --templatedir _templates``` + +`Návod na syntaxi rst`_ + + + + + +.. _Návod na syntaxi rst: https://sphinx-tutorial.readthedocs.io/step-1/#sections