Skip to content

Update doc dependencies and templates #128

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions docs/_overrides/base.html

This file was deleted.

5 changes: 0 additions & 5 deletions docs/_templates/python/material/docstring/admonition.html

This file was deleted.

74 changes: 0 additions & 74 deletions docs/_templates/python/material/function.html

This file was deleted.

67 changes: 0 additions & 67 deletions docs/_templates/python/material/module.html

This file was deleted.

68 changes: 18 additions & 50 deletions docs/css/mkdocstrings.css
Original file line number Diff line number Diff line change
@@ -1,65 +1,33 @@
/* 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);
}

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);
}
*/
12 changes: 12 additions & 0 deletions docs/templates/python/material/module.html.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{% extends "_base/module.html.jinja" %}
{% block contents scoped %}
<div style="display:flex; align-items: center">
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor" class="bi bi-github" viewBox="0 0 16 16" style="padding-right: 8px">
<path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8"/>
</svg>
<a target="_blank" href="https://github.com/foo-author/foo/blob/main/{{ module.relative_package_filepath }}">
<code>{{ module.relative_package_filepath }}</code>
</a>
</div>
{{ super() }}
{% endblock contents %}
8 changes: 6 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
17 changes: 9 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down