diff --git a/docs/_overrides/base.html b/docs/_overrides/base.html deleted file mode 100644 index 0af326a..0000000 --- a/docs/_overrides/base.html +++ /dev/null @@ -1,8 +0,0 @@ -{% extends "base.html" %} - -{% block outdated %} - You're not viewing the latest version. - - Click here to go to latest. - -{% endblock %} diff --git a/docs/_templates/python/material/docstring/admonition.html b/docs/_templates/python/material/docstring/admonition.html deleted file mode 100644 index 2105eab..0000000 --- a/docs/_templates/python/material/docstring/admonition.html +++ /dev/null @@ -1,5 +0,0 @@ -{{ log.debug("Rendering admonition") }} -
- {{ section.title|convert_markdown(heading_level, html_id, strip_paragraph=True) }} - {{ section.value.contents|convert_markdown(heading_level, html_id) }} -
diff --git a/docs/_templates/python/material/function.html b/docs/_templates/python/material/function.html deleted file mode 100644 index 04f9fbd..0000000 --- a/docs/_templates/python/material/function.html +++ /dev/null @@ -1,74 +0,0 @@ -{{ log.debug("Rendering " + function.path) }} - -
-{% with html_id = function.path %} - - {% if root %} - {% set show_full_path = config.show_root_full_path %} - {% set root_members = True %} - {% elif root_members %} - {% set show_full_path = config.show_root_members_full_path or config.show_object_full_path %} - {% set root_members = False %} - {% else %} - {% set show_full_path = config.show_object_full_path %} - {% endif %} - - {% if not root or config.show_root_heading %} - - {% filter heading(heading_level, - role="function", - id=html_id, - class="doc doc-heading", - toc_label=function.name ~ "()") %} - - {% if config.separate_signature %} - {% if show_full_path %}{{ function.path }}{% else %}{{ function.name }}{% endif %}() - {% else %} - {% filter highlight(language="python", inline=True) %} - {% if show_full_path %}{{ function.path }}{% else %}{{ function.name }}{% endif %}() - {% include "signature.html" with context %} - {% endfilter %} - {% endif %} - - {% with labels = function.labels %} - {% include "labels.html" with context %} - {% endwith %} - - {% endfilter %} - - {% if config.separate_signature %} - {% filter highlight(language="python", inline=False) %} - {% filter format_signature(function, config.line_length, crossrefs=config.signature_crossrefs) %} - {% if show_full_path %}{{ function.path }}{% else %}{{ function.name }}{% endif %} - {% include "signature.html" with context %} - {% endfilter %} - {% endfilter %} - {% endif %} - - {% else %} - {% if config.show_root_toc_entry %} - {% filter heading(heading_level, - role="function", - id=html_id, - toc_label=function.path if config.show_root_full_path else function.name, - hidden=True) %} - {% endfilter %} - {% endif %} - {% set heading_level = heading_level - 1 %} - {% endif %} - -
- {% with docstring_sections = function.docstring.parsed %} - {% include "docstring.html" with context %} - {% endwith %} - - {% if config.show_source and function.source %} -
- Source code in {{ function.relative_filepath }} - {{ function.source|highlight(language="python", linestart=function.lineno, linenums=True) }} -
- {% endif %} -
- -{% endwith %} -
diff --git a/docs/_templates/python/material/module.html b/docs/_templates/python/material/module.html deleted file mode 100644 index 682cf0b..0000000 --- a/docs/_templates/python/material/module.html +++ /dev/null @@ -1,67 +0,0 @@ -{{ log.debug("Rendering " + module.path) }} - -
-{% with html_id = module.path %} - - {% if root %} - {% set show_full_path = config.show_root_full_path %} - {% set root_members = True %} - {% elif root_members %} - {% set show_full_path = config.show_root_members_full_path or config.show_object_full_path %} - {% set root_members = False %} - {% else %} - {% set show_full_path = config.show_object_full_path %} - {% endif %} - - {% if not root or config.show_root_heading %} - - {% filter heading(heading_level, - role="module", - id=html_id, - class="doc doc-heading", - toc_label=module.name) %} - - {% with module_name = module.path if show_full_path else module.name %} - {% if config.separate_signature %} - {{ module_name }} - {% else %} - {{ module_name }} - {% endif %} - {% endwith %} - - {% with labels = module.labels %} - {% include "labels.html" with context %} - {% endwith %} - - {% endfilter %} - - {% else %} - {% if config.show_root_toc_entry %} - {% filter heading(heading_level, - role="module", - id=html_id, - toc_label=module.path if config.show_root_full_path else module.name, - hidden=True) %} - {% endfilter %} - {% endif %} - {% set heading_level = heading_level - 1 %} - {% endif %} - -

- Source file: {{ module.relative_package_filepath }} -

- -
- {% with docstring_sections = module.docstring.parsed %} - {% include "docstring.html" with context %} - {% endwith %} - - {% with obj = module %} - {% set root = False %} - {% set heading_level = heading_level + 1 %} - {% include "children.html" with context %} - {% endwith %} -
- -{% endwith %} -
diff --git a/docs/css/mkdocstrings.css b/docs/css/mkdocstrings.css index eef576e..ab1aa58 100644 --- a/docs/css/mkdocstrings.css +++ b/docs/css/mkdocstrings.css @@ -1,39 +1,4 @@ -/* Don't capitalize names. */ -h5.doc-heading { - text-transform: none !important; -} - -/* Avoid breaking parameters name, etc. in table cells. */ -.doc-contents td code { - word-break: normal !important; -} - -/* For pieces of Markdown rendered in table cells. */ -.doc-contents td p { - margin-top: 0 !important; - margin-bottom: 0 !important; -} - -/* Max width for docstring sections tables. */ -.doc .md-typeset__table, -.doc .md-typeset__table table { - display: table !important; - width: 100%; -} -.doc .md-typeset__table tr { - display: table-row; -} - -/* Avoid line breaks in rendered fields. */ -.field-body p { - display: inline; -} - -/* Defaults in Spacy table style. */ -.doc-param-default { - float: right; -} - +/* Make docstring objects code font */ span.doc.doc-object-name { font-weight: 400; font-family: var(--md-code-font-family); @@ -41,25 +6,28 @@ span.doc.doc-object-name { h2.doc.doc-heading { border-bottom-style: solid; - border-color: var(--md-default-fg-color--lighter); - border-width: 2px; + border-color: var(--md-typeset-table-color); + border-width: .05rem; } h3.doc.doc-heading { - border-bottom-style: dashed; - border-color: var(--md-default-fg-color--lighter); - border-width: 1px; + border-bottom-style: solid; + border-color: var(--md-typeset-table-color); + border-width: .05rem; } -span.doc.doc-object-name.doc-function-name { - font-style: normal; +/* Object level indentation and vertical border */ +div.doc-contents:not(.first) { + padding-left: 25px; + border-left: .05rem solid var(--md-typeset-table-color); } -/* -div.doc.doc-object.doc-class { - border-bottom-style: solid; - border-top-style: solid; - border-color: var(--md-code-bg-color); - border-width: 1px; +/* Fancier color for operators such as * and |. */ +.doc-signature .o { + color: var(--md-code-hl-special-color); +} + +/* Fancier color for constants such as None, True, and False. */ +.doc-signature .kc { + color: var(--md-code-hl-constant-color); } -*/ diff --git a/docs/templates/python/material/module.html.jinja b/docs/templates/python/material/module.html.jinja new file mode 100644 index 0000000..78a24ec --- /dev/null +++ b/docs/templates/python/material/module.html.jinja @@ -0,0 +1,12 @@ +{% extends "_base/module.html.jinja" %} +{% block contents scoped %} +
+ + + + + {{ module.relative_package_filepath }} + +
+ {{ super() }} +{% endblock contents %} diff --git a/mkdocs.yml b/mkdocs.yml index d182bef..1138491 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -130,7 +130,7 @@ plugins: - literate-nav: nav_file: SUMMARY.md - mkdocstrings: - custom_templates: docs/_templates + custom_templates: docs/templates enable_inventory: true handlers: python: @@ -148,11 +148,15 @@ plugins: members_order: source merge_init_into_class: yes separate_signature: yes - show_root_members_full_path: no show_object_full_path: no show_root_full_path: yes + show_root_heading: no + show_root_members_full_path: no + show_root_toc_entry: yes show_signature_annotations: yes show_submodules: no + show_symbol_type_heading: yes + show_symbol_type_toc: yes signature_crossrefs: yes - search - section-index diff --git a/pyproject.toml b/pyproject.toml index a9e5aea..55c52db 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,14 +41,15 @@ dev = [ "virtualenv", ] docs = [ - "black", - "mkdocs-gen-files", - "mkdocs-literate-nav", - "mkdocs-material==9.4.7", - "mkdocs-section-index", - "mkdocstrings==0.23.0", - "mkdocstrings-python==1.8.0", - "mike", + "black==24.4.2", + "mkdocs-click==0.8.1", + "mkdocs-gen-files==0.5.0", + "mkdocs-literate-nav==0.6.1", + "mkdocs-material==9.5.32", + "mkdocs-section-index==0.3.9", + "mkdocstrings==0.25.2", + "mkdocstrings-python==1.10.8", + "mike==2.1.3", ] [tool.codespell]