diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e4449d1..2c5647dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,23 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [1.8.0](https://github.com/mkdocstrings/python/releases/tag/1.8.0) - 2024-01-08 + +[Compare with 1.7.5](https://github.com/mkdocstrings/python/compare/1.7.5...1.8.0) + +### Features + +- Release Insiders features of the $500/month funding goal ([bd30106](https://github.com/mkdocstrings/python/commit/bd301061fe9c647f9b91c2c9b4baa784c304eca7) by Timothée Mazzucotelli). + The features and projects related to *mkdocstrings-python* are: + + - [Cross-references for type annotations in signatures](https://mkdocstrings.github.io/python/usage/configuration/signatures/#signature_crossrefs) + - [Symbol types in headings and table of contents](https://mkdocstrings.github.io/python/usage/configuration/headings/#show_symbol_type_toc) + - [`griffe-inherited-docstrings`](https://mkdocstrings.github.io/griffe-inherited-docstrings/), a Griffe extension for inheriting docstrings + - [`griffe2md`](https://mkdocstrings.github.io/griffe2md/), a tool to output API docs to Markdown using Griffe + + See the complete list of features and projects here: + https://pawamoy.github.io/insiders/#500-plasmavac-user-guide. + ## [1.7.5](https://github.com/mkdocstrings/python/releases/tag/1.7.5) - 2023-11-21 [Compare with 1.7.4](https://github.com/mkdocstrings/python/compare/1.7.4...1.7.5) diff --git a/docs/insiders/changelog.md b/docs/insiders/changelog.md index eead3a6a..3c8ac843 100644 --- a/docs/insiders/changelog.md +++ b/docs/insiders/changelog.md @@ -1,3 +1,51 @@ # Changelog ## mkdocstrings-python Insiders + +### 1.5.1 September 12, 2023 { id="1.5.1" } + +- Prevent empty auto-summarized Methods section. + +### 1.5.0 September 05, 2023 { id="1.5.0" } + +- Render function signature overloads. + +### 1.4.0 August 27, 2023 { id="1.4.0" } + +- Render cross-references in attribute signatures. + +### 1.3.0 August 24, 2023 { id="1.3.0" } + +- Add "method" symbol type. + +### 1.2.0 August 20, 2023 { id="1.2.0" } + +- Add [member auto-summaries](../usage/configuration/members.md#summary). + +### 1.1.4 July 17, 2023 { id="1.1.4" } + +- Fix heading level increment for class members. + +### 1.1.3 July 17, 2023 { id="1.1.3" } + +- Fix heading level (avoid with clause preventing to decrease it). + +### 1.1.2 July 15, 2023 { id="1.1.2" } + +- Use non-breaking spaces after symbol types. + +### 1.1.1 June 27, 2023 { id="1.1.1" } + +- Correctly escape expressions in signatures and other rendered types. + +### 1.1.0 June 4, 2023 { id="1.1.0" } + +- Add [Symbol types in headings and table of contents](../usage/configuration/headings.md#show_symbol_type_toc). + +### 1.0.0 May 10, 2023 { id="1.0.0" } + +- Add [cross-references for type annotations in signatures](../usage/configuration/signatures.md#signature_crossrefs). + Make sure to update your local templates as the signature of the + [`format_signature` filter][mkdocstrings_handlers.python.rendering.do_format_signature] + has changed. The templates that must be updated: + `class.html`, `expression.html`, `function.html` and `signature.html`. diff --git a/docs/insiders/goals.yml b/docs/insiders/goals.yml index a96ac51b..8b6cb2b0 100644 --- a/docs/insiders/goals.yml +++ b/docs/insiders/goals.yml @@ -1 +1,18 @@ -goals: {} \ No newline at end of file +goals: + 500: + name: PlasmaVac User Guide + features: + - name: Cross-references for type annotations in signatures + ref: /usage/configuration/signatures/#signature_crossrefs + since: 2023/05/10 + - name: Symbol types in headings and table of contents + ref: /usage/configuration/headings/#show_symbol_type_toc + since: 2023/06/04 + 1000: + name: GraviFridge User Manual + features: + - name: Auto-summary of object members + ref: /usage/configuration/members/#summary + since: 2023/08/20 + - name: Automatic rendering of function signature overloads + since: 2023/09/05 diff --git a/docs/insiders/index.md b/docs/insiders/index.md index 7c69b590..ceb3c59c 100644 --- a/docs/insiders/index.md +++ b/docs/insiders/index.md @@ -33,7 +33,6 @@ Sponsorships start as low as [**$10 a month**][sponsors].[^2] technical reasons. Such contributions are still very much welcome as they help ensuring the project's sustainability. - ## What sponsorships achieve Sponsorships make this project sustainable, as they buy the maintainers of this @@ -48,15 +47,21 @@ The biggest bottleneck in Open Source is time.[^3] you can be sure that bugs are fixed quickly and new features are added regularly. - +were developed with the help of sponsorships. + ## What's in it for me? ```python exec="1" session="insiders" -data_source = "docs/insiders/goals.yml" +data_source = [ + "docs/insiders/goals.yml", + ("griffe-inherited-docstrings", "https://mkdocstrings.github.io/griffe-inherited-docstrings/", "insiders/goals.yml"), + ("griffe-pydantic", "https://mkdocstrings.github.io/griffe-pydantic/", "insiders/goals.yml"), + ("griffe-typing-deprecated", "https://mkdocstrings.github.io/griffe-typing-deprecated/", "insiders/goals.yml"), +] ``` diff --git a/docs/insiders/installation.md b/docs/insiders/installation.md index bb387d99..3d9d75d8 100644 --- a/docs/insiders/installation.md +++ b/docs/insiders/installation.md @@ -28,7 +28,7 @@ and [how to use it](https://pawamoy.github.io/pypi-insiders/#usage). *mkdocstrings-python Insiders* can be installed with `pip` [using SSH][using ssh]: ```bash -pip install git+ssh://git@github.com/pawamoy-insiders/python.git +pip install git+ssh://git@github.com/pawamoy-insiders/mkdocstrings-python.git ``` [using ssh]: https://docs.github.com/en/authentication/connecting-to-github-with-ssh @@ -36,7 +36,7 @@ pip install git+ssh://git@github.com/pawamoy-insiders/python.git Or using HTTPS: ```bash -pip install git+https://${GH_TOKEN}@github.com/pawamoy-insiders/python.git +pip install git+https://${GH_TOKEN}@github.com/pawamoy-insiders/mkdocstrings-python.git ``` >? NOTE: **How to get a GitHub personal access token** @@ -82,7 +82,7 @@ with [Twine]: [Artifactory]: https://jfrog.com/help/r/jfrog-artifactory-documentation/pypi-repositories [Google Cloud]: https://cloud.google.com/artifact-registry/docs/python [pypiserver]: https://pypi.org/project/pypiserver/ - [Github Releases]: https://github.com/pawamoy-insiders/python/releases + [Github Releases]: https://github.com/pawamoy-insiders/mkdocstrings-python/releases [Twine]: https://pypi.org/project/twine/ ```bash @@ -142,7 +142,7 @@ as it is against our [Terms of use](index.md#terms).** > > ```bash > # clone the repository -> git clone git@github.com:pawamoy-insiders/python +> git clone git@github.com:pawamoy-insiders/mkdocstrings-python > cd python > > # install build @@ -178,7 +178,7 @@ as it is against our [Terms of use](index.md#terms).** Of course, you can use *mkdocstrings-python Insiders* directly from `git`: ``` -git clone git@github.com:pawamoy-insiders/python +git clone git@github.com:pawamoy-insiders/mkdocstrings-python ``` When cloning from `git`, the package must be installed: diff --git a/docs/schema.json b/docs/schema.json index a34dc090..b4eca004 100644 --- a/docs/schema.json +++ b/docs/schema.json @@ -108,6 +108,18 @@ "type": "boolean", "default": false }, + "show_symbol_type_heading": { + "title": "Show the symbol type in headings (e.g. mod, class, func and attr).", + "markdownDescription": "https://mkdocstrings.github.io/python/usage/configuration/headings/#show_symbol_type_heading", + "type": "boolean", + "default": false + }, + "show_symbol_type_toc": { + "title": "Show the symbol type in the Table of Contents (e.g. mod, class, func and attr).", + "markdownDescription": "https://mkdocstrings.github.io/python/usage/configuration/headings/#show_symbol_type_toc", + "type": "boolean", + "default": false + }, "show_category_heading": { "title": "When grouped by categories, show a heading for each category.", "markdownDescription": "https://mkdocstrings.github.io/python/usage/configuration/headings/#show_category_heading", diff --git a/docs/usage/configuration/headings.md b/docs/usage/configuration/headings.md index e1c2e63a..a9b75e6d 100644 --- a/docs/usage/configuration/headings.md +++ b/docs/usage/configuration/headings.md @@ -387,3 +387,131 @@ plugins:
Docstring of the method.
//// /// + +## `show_symbol_type_heading` + +[:octicons-tag-24: Insiders 1.1.0](../../insiders/changelog.md#1.1.0) + +- **:octicons-package-24: Type [`bool`][] :material-equal: `False`{ title="default value" }** + + +Show the symbol type in headings. + +This option will prefix headings with +
,
+
,
+
,
+
or
+
types.
+See also [`show_symbol_type_toc`][show_symbol_type_toc].
+
+To customize symbols, see [Customizing symbol types](../customization.md/#symbol-types).
+
+```yaml title="in mkdocs.yml (global configuration)"
+plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ show_symbol_type_heading: true
+```
+
+```md title="or in docs/some_page.md (local configuration)"
+::: package.module
+ options:
+ show_symbol_type_heading: false
+```
+
+/// admonition | Preview
+ type: preview
+
+//// tab | With symbol type in headings
+
module
Docstring of the module.
+
attribute
Docstring of the module attribute.
+
function
Docstring of the function.
+
Class
Docstring of the class.
+
method
Docstring of the method.
+//// + +//// tab | Without symbol type in headings +module
Docstring of the module.
+attribute
Docstring of the module attribute.
+function
Docstring of the function.
+Class
Docstring of the class.
+method
Docstring of the method.
+//// +/// + +## `show_symbol_type_toc` + +[:octicons-tag-24: Insiders 1.1.0](../../insiders/changelog.md#1.1.0) + +- **:octicons-package-24: Type [`bool`][] :material-equal: `False`{ title="default value" }** + + +Show the symbol type in the Table of Contents. + +This option will prefix items in the ToC with +
,
+
,
+
,
+
or
+
types.
+See also [`show_symbol_type_heading`][show_symbol_type_heading].
+
+To customize symbols, see [Customizing symbol types](../customization.md/#symbol-types).
+
+```yaml title="in mkdocs.yml (global configuration)"
+plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ show_symbol_type_toc: true
+```
+
+```md title="or in docs/some_page.md (local configuration)"
+::: package.module
+ options:
+ show_symbol_type_toc: false
+```
+
+/// admonition | Preview
+ type: preview
+
+//// tab | With symbol type in ToC
+
module
attribute
function
Class
+
methodsubpackage_member
Member docstring.
//// -/// \ No newline at end of file +/// + +## `summary` + +[:octicons-heart-fill-24:{ .pulse } Sponsors only](../../insiders/index.md){ .insiders } — +[:octicons-tag-24: Insiders 1.2.0](../../insiders/changelog.md#1.2.0) + +- **:octicons-package-24: Typebool | dict[str, bool]
:material-equal: `False`{ title="default value" }**
+
+
+Whether to render summaries of modules, classes, functions (methods) and attributes.
+
+This option accepts a boolean (`yes`, `true`, `no`, `false` in YAML)
+or a dictionary with one or more of the following keys: `attributes`, `functions`, `classes`, `modules`,
+with booleans as values. Class methods summary is (de)activated with the `functions` key.
+By default, `summary` is false, and by extension all values are false.
+
+Examples:
+
+```yaml
+summary: true
+```
+
+```yaml
+summary: false
+```
+
+```yaml
+summary:
+ attributes: false
+ functions: true
+ modules: false
+```
+
+Summaries will be rendered as the corresponding docstring sections.
+For example, the summary for attributes will be rendered as an Attributes docstring section.
+The section will be rendered in accordance with the [`docstring_section_style`][] option.
+If the objects appearing in the summary are also rendered on the page
+(or somewhere else on the site), their name will automatically link to their rendered documentation.
+
+```yaml title="in mkdocs.yml (global configuration)"
+plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ summary: true
+```
+
+```md title="or in docs/some_page.md (local configuration)"
+::: path.to.module
+ options:
+ summary: false
+```
+
+/// admonition | Preview
+ type: preview
+
+//// tab | With all summaries
+```
+::: path.to.module.MyClass
+ options:
+ summary: true
+```
+Class docstring.
+Methods:
+Attributes:
+Class docstring.
+Methods:
+Function docstring.
+//// + +//// tab | Without signature cross-references +do_format_code(code: str, line_length: int) -> str
+
Function docstring.
+//// +/// ## `unwrap_annotated` diff --git a/docs/usage/customization.md b/docs/usage/customization.md index 7bbed955..9dedbf20 100644 --- a/docs/usage/customization.md +++ b/docs/usage/customization.md @@ -23,6 +23,10 @@ The following CSS classes are used in the generated HTML: - `doc-label`: on `small` elements containing a label - `doc-label-LABEL`: same, where `LABEL` is replaced by the actual label - `doc-md-description`: on `div`s containing HTML descriptions converted from Markdown docstrings +- `doc-symbol`: on `code` tags of symbol types + - `doc-symbol-heading`: on symbol types in headings + - `doc-symbol-toc`: on symbol types in the ToC + - `doc-symbol-KIND`: specific to the kind of object (`module`, `class`, `function`, `method`, `attribute`) /// admonition | Example with colorful labels type: example @@ -53,6 +57,173 @@ The following CSS classes are used in the generated HTML: /// +## Symbol types + +### Colors + +You can customize the colors of the symbol types +(see [`show_symbol_type_heading`][show_symbol_type_heading] and [`show_symbol_type_toc`][show_symbol_type_toc]) +by overriding the values of our CSS variables, for example: + +```css title="docs/css/mkdocstrings.css" +[data-md-color-scheme="default"] { + --doc-symbol-attribute-fg-color: #0079ff; + --doc-symbol-function-fg-color: #00dfa2; + --doc-symbol-method-fg-color: #00dfa2; + --doc-symbol-class-fg-color: #d1b619; + --doc-symbol-module-fg-color: #ff0060; + + --doc-symbol-attribute-bg-color: #0079ff1a; + --doc-symbol-function-bg-color: #00dfa21a; + --doc-symbol-method-bg-color: #00dfa21a; + --doc-symbol-class-bg-color: #d1b6191a; + --doc-symbol-module-bg-color: #ff00601a; +} + +[data-md-color-scheme="slate"] { + --doc-symbol-attribute-fg-color: #963fb8; + --doc-symbol-function-fg-color: #6d67e4; + --doc-symbol-method-fg-color: #6d67e4; + --doc-symbol-class-fg-color: #46c2cb; + --doc-symbol-module-fg-color: #f2f7a1; + + --doc-symbol-attribute-bg-color: #963fb81a; + --doc-symbol-function-bg-color: #6d67e41a; + --doc-symbol-method-bg-color: #6d67e41a; + --doc-symbol-class-bg-color: #46c2cb1a; + --doc-symbol-module-bg-color: #f2f7a11a; +} +``` + +The `[data-md-color-scheme="*"]` selectors work with the [Material for MkDocs] theme. +If you are using another theme, adapt the selectors to this theme +if it supports light and dark themes, +otherwise just override the variables at root level: + +```css title="docs/css/mkdocstrings.css" +:root { + --doc-symbol-attribute-fg-color: #0079ff; + --doc-symbol-function-fg-color: #00dfa2; + --doc-symbol-method-fg-color: #00dfa2; + --doc-symbol-class-fg-color: #d1b619; + --doc-symbol-module-fg-color: #ff0060; + + --doc-symbol-attribute-bg-color: #0079ff1a; + --doc-symbol-function-bg-color: #00dfa21a; + --doc-symbol-method-bg-color: #00dfa21a; + --doc-symbol-class-bg-color: #d1b6191a; + --doc-symbol-module-bg-color: #ff00601a; +} +``` + +/// admonition | Preview + type: preview + +
+ Try cycling through the themes to see the colors for each theme:
+
+
+
+
+
+
'|safe if config.show_symbol_type_toc else '') + attribute.name,
+ ) %}
{% block heading scoped %}
+ {% if config.show_symbol_type_heading %}
{% endif %}
{% if config.separate_signature %}
{{ attribute_name }}
{% else %}
@@ -51,12 +53,14 @@
{% endblock signature %}
{% else %}
+
{% if config.show_root_toc_entry %}
{% filter heading(heading_level,
role="data" if attribute.parent.kind.value == "module" else "attr",
id=html_id,
- toc_label=attribute.name,
- hidden=True) %}
+ toc_label=('
'|safe if config.show_symbol_type_toc else '') + attribute.name,
+ hidden=True,
+ ) %}
{% endfilter %}
{% endif %}
{% set heading_level = heading_level - 1 %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/class.html b/src/mkdocstrings_handlers/python/templates/material/_base/class.html
index ae8a2774..fb7ca764 100644
--- a/src/mkdocstrings_handlers/python/templates/material/_base/class.html
+++ b/src/mkdocstrings_handlers/python/templates/material/_base/class.html
@@ -16,14 +16,16 @@
{% set class_name = class.path if show_full_path else class.name %}
{% if not root or config.show_root_heading %}
-
- {% filter heading(heading_level,
+ {% filter heading(
+ heading_level,
role="class",
id=html_id,
class="doc doc-heading",
- toc_label=class.name) %}
+ toc_label=('
'|safe if config.show_symbol_type_toc else '') + class.name,
+ ) %}
{% block heading scoped %}
+ {% if config.show_symbol_type_heading %}
{% endif %}
{% if config.separate_signature %}
{{ class_name }}
{% elif config.merge_init_into_class and "__init__" in class.all_members %}
@@ -62,8 +64,9 @@
{% filter heading(heading_level,
role="class",
id=html_id,
- toc_label=class.name,
- hidden=True) %}
+ toc_label=('
'|safe if config.show_symbol_type_toc else '') + class.name,
+ hidden=True,
+ ) %}
{% endfilter %}
{% endif %}
{% set heading_level = heading_level - 1 %}
@@ -135,4 +138,5 @@
{% endwith %}
+
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/attributes.html b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/attributes.html
index 6dc82d66..0b291574 100644
--- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/attributes.html
+++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/attributes.html
@@ -16,7 +16,7 @@
{% for attribute in section.value %}
{{ attribute.name }}
{{ attribute.name }}
{{ attribute.name }}
+ {{ attribute.name }}
{% if attribute.annotation %}
{% with expression = attribute.annotation %}
({% include "expression.html" with context %}
)
@@ -66,7 +66,7 @@
{% for attribute in section.value %}
{{ attribute.name }}
{{ attribute.name }}
{{ class.name }}
{{ class.name }}
{{ class.name }}
+ {{ class.name }}
–
{{ class.name }}
{{ class.name }}
{{ function.name }}
{{ function.name }}
{{ function.name }}
+ {{ function.name }}
–
{{ function.name }}
{{ function.name }}
{{ module.name }}
{{ module.name }}
{{ module.name }}
+ {{ module.name }}
–
{{ module.name }}
{{ module.name }}
')|safe if config.show_symbol_type_toc else '') + function.name,
+ ) %}
{% block heading scoped %}
+ {% if config.show_symbol_type_heading %}
{% endif %}
{% if config.separate_signature %}
{{ function_name }}
{% else %}
@@ -52,12 +55,15 @@
{% endblock signature %}
{% else %}
+
{% if config.show_root_toc_entry %}
- {% filter heading(heading_level,
+ {% filter heading(
+ heading_level,
role="function",
id=html_id,
- toc_label=function.name,
- hidden=True) %}
+ toc_label=(('
')|safe if config.show_symbol_type_toc else '') + function.name,
+ hidden=True,
+ ) %}
{% endfilter %}
{% endif %}
{% set heading_level = heading_level - 1 %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/module.html b/src/mkdocstrings_handlers/python/templates/material/_base/module.html
index dc44142b..7d45e321 100644
--- a/src/mkdocstrings_handlers/python/templates/material/_base/module.html
+++ b/src/mkdocstrings_handlers/python/templates/material/_base/module.html
@@ -16,14 +16,16 @@
{% set module_name = module.path if show_full_path else module.name %}
{% if not root or config.show_root_heading %}
-
- {% filter heading(heading_level,
+ {% filter heading(
+ heading_level,
role="module",
id=html_id,
class="doc doc-heading",
- toc_label=module.name) %}
+ toc_label=('
'|safe if config.show_symbol_type_toc else '') + module.name,
+ ) %}
{% block heading scoped %}
+ {% if config.show_symbol_type_heading %}
{% endif %}
{% if config.separate_signature %}
{{ module_name }}
{% else %}
@@ -44,8 +46,9 @@
{% filter heading(heading_level,
role="module",
id=html_id,
- toc_label=module.name,
- hidden=True) %}
+ toc_label=('
'|safe if config.show_symbol_type_toc else '') + module.name,
+ hidden=True,
+ ) %}
{% endfilter %}
{% endif %}
{% set heading_level = heading_level - 1 %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/summary.html b/src/mkdocstrings_handlers/python/templates/material/_base/summary.html
new file mode 100644
index 00000000..e69de29b
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/summary/attributes.html b/src/mkdocstrings_handlers/python/templates/material/_base/summary/attributes.html
new file mode 100644
index 00000000..e69de29b
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/summary/classes.html b/src/mkdocstrings_handlers/python/templates/material/_base/summary/classes.html
new file mode 100644
index 00000000..e69de29b
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/summary/functions.html b/src/mkdocstrings_handlers/python/templates/material/_base/summary/functions.html
new file mode 100644
index 00000000..e69de29b
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/summary/modules.html b/src/mkdocstrings_handlers/python/templates/material/_base/summary/modules.html
new file mode 100644
index 00000000..e69de29b
diff --git a/src/mkdocstrings_handlers/python/templates/material/style.css b/src/mkdocstrings_handlers/python/templates/material/style.css
index f1da921a..82086b8f 100644
--- a/src/mkdocstrings_handlers/python/templates/material/style.css
+++ b/src/mkdocstrings_handlers/python/templates/material/style.css
@@ -25,39 +25,84 @@
float: right;
}
-/* Keep headings consistent. */
-h1.doc-heading,
-h2.doc-heading,
-h3.doc-heading,
-h4.doc-heading,
-h5.doc-heading,
-h6.doc-heading {
- font-weight: 400;
- line-height: 1.5;
- color: inherit;
- text-transform: none;
+/* Symbols in Navigation and ToC. */
+:root,
+[data-md-color-scheme="default"] {
+ --doc-symbol-attribute-fg-color: #953800;
+ --doc-symbol-function-fg-color: #8250df;
+ --doc-symbol-method-fg-color: #8250df;
+ --doc-symbol-class-fg-color: #0550ae;
+ --doc-symbol-module-fg-color: #5cad0f;
+
+ --doc-symbol-attribute-bg-color: #9538001a;
+ --doc-symbol-function-bg-color: #8250df1a;
+ --doc-symbol-method-bg-color: #8250df1a;
+ --doc-symbol-class-bg-color: #0550ae1a;
+ --doc-symbol-module-bg-color: #5cad0f1a;
+}
+
+[data-md-color-scheme="slate"] {
+ --doc-symbol-attribute-fg-color: #ffa657;
+ --doc-symbol-function-fg-color: #d2a8ff;
+ --doc-symbol-method-fg-color: #d2a8ff;
+ --doc-symbol-class-fg-color: #79c0ff;
+ --doc-symbol-module-fg-color: #baff79;
+
+ --doc-symbol-attribute-bg-color: #ffa6571a;
+ --doc-symbol-function-bg-color: #d2a8ff1a;
+ --doc-symbol-method-bg-color: #d2a8ff1a;
+ --doc-symbol-class-bg-color: #79c0ff1a;
+ --doc-symbol-module-bg-color: #baff791a;
+}
+
+code.doc-symbol {
+ border-radius: .1rem;
+ font-size: .85em;
+ padding: 0 .3em;
+ font-weight: bold;
+}
+
+code.doc-symbol-attribute {
+ color: var(--doc-symbol-attribute-fg-color);
+ background-color: var(--doc-symbol-attribute-bg-color);
+}
+
+code.doc-symbol-attribute::after {
+ content: "attr";
+}
+
+code.doc-symbol-function {
+ color: var(--doc-symbol-function-fg-color);
+ background-color: var(--doc-symbol-function-bg-color);
+}
+
+code.doc-symbol-function::after {
+ content: "func";
}
-h1.doc-heading {
- font-size: 1.6rem;
+code.doc-symbol-method {
+ color: var(--doc-symbol-method-fg-color);
+ background-color: var(--doc-symbol-method-bg-color);
}
-h2.doc-heading {
- font-size: 1.2rem;
+code.doc-symbol-method::after {
+ content: "meth";
}
-h3.doc-heading {
- font-size: 1.15rem;
+code.doc-symbol-class {
+ color: var(--doc-symbol-class-fg-color);
+ background-color: var(--doc-symbol-class-bg-color);
}
-h4.doc-heading {
- font-size: 1.10rem;
+code.doc-symbol-class::after {
+ content: "class";
}
-h5.doc-heading {
- font-size: 1.05rem;
+code.doc-symbol-module {
+ color: var(--doc-symbol-module-fg-color);
+ background-color: var(--doc-symbol-module-bg-color);
}
-h6.doc-heading {
- font-size: 1rem;
+code.doc-symbol-module::after {
+ content: "mod";
}
\ No newline at end of file
diff --git a/src/mkdocstrings_handlers/python/templates/material/summary.html b/src/mkdocstrings_handlers/python/templates/material/summary.html
new file mode 100644
index 00000000..6fccfa90
--- /dev/null
+++ b/src/mkdocstrings_handlers/python/templates/material/summary.html
@@ -0,0 +1 @@
+{% extends "_base/summary.html" %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/summary/attributes.html b/src/mkdocstrings_handlers/python/templates/material/summary/attributes.html
new file mode 100644
index 00000000..e088b5fc
--- /dev/null
+++ b/src/mkdocstrings_handlers/python/templates/material/summary/attributes.html
@@ -0,0 +1 @@
+{% extends "_base/summary/attributes.html" %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/summary/classes.html b/src/mkdocstrings_handlers/python/templates/material/summary/classes.html
new file mode 100644
index 00000000..ab845ed5
--- /dev/null
+++ b/src/mkdocstrings_handlers/python/templates/material/summary/classes.html
@@ -0,0 +1 @@
+{% extends "_base/summary/classes.html" %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/summary/functions.html b/src/mkdocstrings_handlers/python/templates/material/summary/functions.html
new file mode 100644
index 00000000..d5c6231b
--- /dev/null
+++ b/src/mkdocstrings_handlers/python/templates/material/summary/functions.html
@@ -0,0 +1 @@
+{% extends "_base/summary/functions.html" %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/summary/modules.html b/src/mkdocstrings_handlers/python/templates/material/summary/modules.html
new file mode 100644
index 00000000..4765400f
--- /dev/null
+++ b/src/mkdocstrings_handlers/python/templates/material/summary/modules.html
@@ -0,0 +1 @@
+{% extends "_base/summary/modules.html" %}