Browse Source

Pár prvních pokusů

okenkove_obalky
Jonas Havelka 3 years ago
parent
commit
6b3fb8f19c
  1. 4
      .gitignore
  2. 8
      docs/_templates/module.rst_t
  3. 57
      docs/_templates/package.rst_t
  4. 7
      docs/_templates/toc.rst_t
  5. 5
      docs/index.rst
  6. 12
      docs/sphinx.rst

4
.gitignore

@ -33,3 +33,7 @@ TODO
# pro lidi, co programují v nástrojích od JetBrains
.idea
# dokumentace
docs/_build
docs/modules

8
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 %}

57
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 %}

7
docs/_templates/toc.rst_t

@ -0,0 +1,7 @@
{{ "Aplikace:" | heading }}
.. toctree::
:maxdepth: {{ maxdepth }}
{% for docname in docnames %}
{{ docname }}
{%- endfor %}

5
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

12
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
Loading…
Cancel
Save