diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 00000000..e69de29b diff --git a/404.html b/404.html new file mode 100644 index 00000000..e2cef60b --- /dev/null +++ b/404.html @@ -0,0 +1 @@ +
{"use strict";var fs=/["'&<>]/;di.exports=us;function us(e){var t=""+e,r=fs.exec(t);if(!r)return t;var o,n="",i=0,s=0;for(i=r.index;i All notable changes to this project will be documented in this file. The format is based on Keep a Changelog and this project adheres to Semantic Versioning. Release Insiders features of the $500/month funding goal (bd30106 by Timothée Mazzucotelli). The features and projects related to mkdocstrings-python are: See the complete list of features and projects here: https://pawamoy.github.io/insiders/#500-plasmavac-user-guide. The signature of the You can see how to use the filter in this commit's changes: f686f4e4. We take this as an opportunity to go out of beta and bump the version to 1.0.0. This will allow users to rely on semantic versioning. We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation. We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. Examples of behavior that contributes to a positive environment for our community include: Examples of unacceptable behavior include: Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at dev@pawamoy.fr. All complaints will be reviewed and investigated promptly and fairly. All community leaders are obligated to respect the privacy and security of the reporter of any incident. Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: Community Impact: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. Consequence: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. Community Impact: A violation through a single incident or series of actions. Consequence: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban. Community Impact: A serious violation of community standards, including sustained inappropriate behavior. Consequence: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. Community Impact: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. Consequence: A permanent ban from any sort of public interaction within the community. This Code of Conduct is adapted from the Contributor Covenant, version 2.1, available at https://www.contributor-covenant.org/version/2/1/code_of_conduct.html. Community Impact Guidelines were inspired by Mozilla's code of conduct enforcement ladder. For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations. Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given. Nothing easier! Fork and clone the repository, then: Note If it fails for some reason, you'll need to install uv manually. You can install it with: Now you can try running You now have the dependencies installed. Run This project uses duty to run tasks. A Makefile is also provided. The Makefile will try to run certain tasks on multiple Python versions. If for some reason you don't want to run the task on multiple Python versions, you run the task directly with The Makefile detects if a virtual environment is activated, so If you work in VSCode, we provide an action to configure VSCode for the project. As usual: Before committing: If you are unsure about how to fix or ignore a warning, just let the continuous integration fail, and we will help you during review. Don't bother updating the changelog, we will take care of this. Commit messages must follow our convention based on the Angular style or the Karma convention: Subject and body must be valid Markdown. Subject must have proper casing (uppercase for first letter if it makes sense), but no dot at the end, and no punctuation in general. Scope and body are optional. Type can be: If you write a body, please add trailers at the end (for example issues and PR references, or co-authors), without relying on GitHub's flavored Markdown: These "trailers" must appear at the end of the body, without any blank lines between them. The trailer title can contain any character except colons We do not enforce a line length on commit messages summary and body, but please avoid very long summaries, and very long lines in the body, unless they are part of code blocks that must not be wrapped. Link to any related issue in the Pull Request message. During the review, we recommend using fixups: Once all the changes are approved, you can squash your commits: And force-push: If this seems all too complicated, you can push or force-push each new commit, and we will squash them ourselves if needed, before merging. These projects were used to build mkdocstrings-python. Thank you! A Python handler for mkdocstrings. The Python handler uses Griffe to collect documentation from Python source code. The word "griffe" can sometimes be used instead of "signature" in French. Griffe is able to visit the Abstract Syntax Tree (AST) of the source code to extract useful information. It is also able to execute the code (by importing it) and introspect objects in memory when source code is not available. Finally, it can parse docstrings following different styles. You can install this handler as a mkdocstrings extra: You can also explicitly depend on the handler: Data collection from source code: collection of the object-tree and the docstrings is done thanks to Griffe. Support for type annotations: Griffe collects your type annotations and mkdocstrings uses them to display parameter types or return types. It is even able to automatically add cross-references to other objects from your API, from the standard library or third-party libraries! See how to load inventories to enable it. Recursive documentation of Python objects: just use the module dotted-path as an identifier, and you get the full module docs. You don't need to inject documentation for each class, function, etc. Support for documented attributes: attributes (variables) followed by a docstring (triple-quoted string) will be recognized by Griffe in modules, classes and even in Multiple docstring-styles support: common support for Google-style, Numpydoc-style, and Sphinx-style docstrings. See Griffe's documentation on docstrings support. Admonition support in Google docstrings: blocks like Every object has a TOC entry: we render a heading for each object, meaning MkDocs picks them into the Table of Contents, which is nicely displayed by the Material theme. Thanks to mkdocstrings cross-reference ability, you can reference other objects within your docstrings, with the classic Markdown syntax: Source code display: mkdocstrings can add a collapsible div containing the highlighted source code of the Python object. mkdocstrings-python follows the sponsorware release strategy, which means that new features are first exclusively released to sponsors as part of Insiders. Read on to learn what sponsorships achieve, how to become a sponsor to get access to Insiders, and what's in it for you! mkdocstrings-python Insiders is a private fork of mkdocstrings-python, hosted as a private GitHub repository. Almost1 all new features are developed as part of this fork, which means that they are immediately available to all eligible sponsors, as they are made collaborators of this repository. Every feature is tied to a funding goal in monthly subscriptions. When a funding goal is hit, the features that are tied to it are merged back into mkdocstrings-python and released for general availability, making them available to all users. Bugfixes are always released in tandem. Sponsorships start as low as $10 a month.2 Sponsorships make this project sustainable, as they buy the maintainers of this project time – a very scarce resource – which is spent on the development of new features, bug fixing, stability improvement, issue triage and general support. The biggest bottleneck in Open Source is time.3 If you're unsure if you should sponsor this project, check out the list of completed funding goals to learn whether you're already using features that were developed with the help of sponsorships. You're most likely using at least a handful of them, thanks to our awesome sponsors! The moment you become a sponsor, you'll get immediate access to 9 additional features that you can start using right away, and which are currently exclusively available to sponsors: These are just the features related to this project. See the complete feature list on the author's main Insiders page. Thanks for your interest in sponsoring! In order to become an eligible sponsor with your GitHub account, visit pawamoy's sponsor profile, and complete a sponsorship of $10 a month or more. You can use your individual or organization GitHub account for sponsoring. Important: If you're sponsoring @pawamoy through a GitHub organization, please send a short email to insiders@pawamoy.fr with the name of your organization and the GitHub account of the individual that should be added as a collaborator.4 You can cancel your sponsorship anytime.5 If you sponsor publicly, you're automatically added here with a link to your profile and avatar to show your support for mkdocstrings-python. Alternatively, if you wish to keep your sponsorship private, you'll be a silent +1. You can select visibility during checkout and change it afterwards. The following section lists all funding goals. Each goal contains a list of features prefixed with a checkmark symbol, denoting whether a feature is already available or planned, but not yet implemented. When the funding goal is hit, the features are released for general availability. There are no features in this goal for this project. This section lists all funding goals that were previously completed, which means that those features were part of Insiders, but are now generally available and can be used by all users. We're building an open source project and want to allow outside collaborators to use mkdocstrings-python locally without having access to Insiders. Is this still possible? Yes. Insiders is compatible with mkdocstrings-python. Almost all new features and configuration options are either backward-compatible or implemented behind feature flags. Most Insiders features enhance the overall experience, though while these features add value for the users of your project, they shouldn't be necessary for previewing when making changes to content. We don't want to pay for sponsorship every month. Are there any other options? Yes. You can sponsor on a yearly basis by switching your GitHub account to a yearly billing cycle. If for some reason you cannot do that, you could also create a dedicated GitHub account with a yearly billing cycle, which you only use for sponsoring (some sponsors already do that). If you have any problems or further questions, please reach out to insiders@pawamoy.fr. Are we allowed to use Insiders under the same terms and conditions as mkdocstrings-python? Yes. Whether you're an individual or a company, you may use mkdocstrings-python Insiders precisely under the same terms as mkdocstrings-python, which are given by the ISC License. However, we kindly ask you to respect our fair use policy: Please don't distribute the source code of Insiders. You may freely use it for public, private or commercial projects, privately fork or mirror it, but please don't make the source code public, as it would counteract the sponsorware strategy. If you cancel your subscription, you're automatically removed as a collaborator and will miss out on all future updates of Insiders. However, you may use the latest version that's available to you as long as you like. Just remember that GitHub deletes private forks. In general, every new feature is first exclusively released to sponsors, but sometimes upstream dependencies enhance existing features that must be supported by mkdocstrings-python. ↩ Note that $10 a month is the minimum amount to become eligible for Insiders. While GitHub Sponsors also allows to sponsor lower amounts or one-time amounts, those can't be granted access to Insiders due to technical reasons. Such contributions are still very much welcome as they help ensuring the project's sustainability. ↩ Making an Open Source project sustainable is exceptionally hard: maintainers burn out, projects are abandoned. That's not great and very unpredictable. The sponsorware model ensures that if you decide to use mkdocstrings-python, you can be sure that bugs are fixed quickly and new features are added regularly. ↩ It's currently not possible to grant access to each member of an organization, as GitHub only allows for adding users. Thus, after sponsoring, please send an email to insiders@pawamoy.fr, stating which account should become a collaborator of the Insiders repository. We're working on a solution which will make access to organizations much simpler. To ensure that access is not tied to a particular individual GitHub account, create a bot account (i.e. a GitHub account that is not tied to a specific individual), and use this account for the sponsoring. After being added to the list of collaborators, the bot account can create a private fork of the private Insiders GitHub repository, and grant access to all members of the organizations. ↩ If you cancel your sponsorship, GitHub schedules a cancellation request which will become effective at the end of the billing cycle. This means that even though you cancel your sponsorship, you will keep your access to Insiders as long as your cancellation isn't effective. All charges are processed by GitHub through Stripe. As we don't receive any information regarding your payment, and GitHub doesn't offer refunds, sponsorships are non-refundable. ↩ mkdocstrings-python Insiders is a compatible drop-in replacement for mkdocstrings-python, and can be installed similarly using PyPI Insiders is a tool that helps you keep up-to-date versions of Insiders projects in the PyPI index of your choice (self-hosted, Google registry, Artifactory, etc.). See how to install it and how to use it. mkdocstrings-python Insiders can be installed with Or using HTTPS: The Note that the personal access token must be kept secret at all times, as it allows the owner to access your private repositories. Self-hosting the Insiders package makes it possible to depend on mkdocstrings-python normally, while transparently downloading and installing the Insiders version locally. It means that you can specify your dependencies normally, and your contributors without access to Insiders will get the public version, while you get the Insiders version on your machine. Limitation With this method, there is no way to force the installation of an Insiders version rather than a public version. If there is a public version that is more recent than your self-hosted Insiders version, the public version will take precedence. Remember to regularly update your self-hosted versions by uploading latest distributions. You can build the distributions for Insiders yourself, by cloning the repository and using build to build the distributions, or you can download them from our GitHub Releases. You can upload these distributions to a private PyPI-like registry (Artifactory, Google Cloud, pypiserver, etc.) with Twine: You might also need to provide a username and password/token to authenticate against the registry. Please check Twine's documentation. You can then configure pip (or other tools) to look for packages into your package index. For example, with pip: Note that the URL might differ depending on whether your are uploading a package (with Twine) or installing a package (with pip), and depending on the registry you are using (Artifactory, Google Cloud, etc.). Please check the documentation of your registry to learn how to configure your environment. We kindly ask that you do not upload the distributions to public registries, as it is against our Terms of use. In this example we use pypiserver to serve a local PyPI index. We can configure the credentials to access the server in We then clone the Insiders repository, build distributions and upload them to our local server: Finally, we configure pip, and for example PDM, to use our local index to find packages: Now when running Of course, you can use mkdocstrings-python Insiders directly from When cloning from When upgrading Insiders, you should always check the version of mkdocstrings-python which makes up the first part of the version qualifier. For example, a version like If the major version increased, it's a good idea to consult the changelog and go through the steps to ensure your configuration is up to date and all necessary changes have been made. `
+ sponsors.forEach(function (sponsor) {
+ html += `
+
+ Debugging utilities. Classes: Dataclass to store environment information. Dataclass describing a Python package. Dataclass describing an environment variable. Functions: Get debug/environment information. Get version of the given distribution. Print debug/environment information. Dataclass to store environment information. Attributes: Python interpreter name. Path to Python executable. Python interpreter version. Installed packages. Operating System. Environment variables. This module implements a handler for the Python language. Classes: The Python handler class. Functions: Simply return an instance of The Python handler class. Parameters: Handler name, theme and custom templates. The MkDocs configuration file path. A list of paths to use as Griffe search paths. The locale to use when rendering content. Load external modules when resolving aliases. Same thing, but with keyword arguments. Methods: Render Markdown text; for use inside templates. Render an HTML heading and register it for the table of contents. For use inside templates. Load template extensions for the given handler, return their templates directories. Return and clear the headings gathered so far. Return the path to the handler's templates directory. Yield items and their URLs from an inventory file streamed from Resolve extension paths relative to config file. Teardown the handler. Update the Jinja environment with custom filters and tests. Attributes: Default handler configuration. The cross-documentation domain/language for this handler. Whether this handler is interested in enabling the creation of the Extra CSS. The configuration used to collect item during autorefs fallback. The fallback theme. The handler's name. Default handler configuration. General options: Whether to load stubs package (package-stubs) when extracting docstrings. Default Whether to allow inspecting modules when visiting them is not possible. Default: Show the base classes of a class. Default: Show the inheritance diagram of a class using Mermaid. Default: Show the source code of this object. Default: Pre-load modules that are not specified directly in autodoc instructions ( For an imported member to be rendered, you need to add it to the The modules must be listed as an array of strings. Default: Headings options: The initial heading level to use. Default: Whether to render headings for parameters (therefore showing parameters in the ToC). Default: Show the heading of the object at the root of the documentation tree (i.e. the object referenced by the identifier after If the root heading is not shown, at least add a ToC entry for it. Default: Show the full Python path for the root object heading. Default: Show the full Python path of the root members. Default: Show the full Python path of every object. Default: When grouped by categories, show a heading for each category. Default: Show the symbol type in headings (e.g. mod, class, meth, func and attr). Default: Show the symbol type in the Table of Contents (e.g. mod, class, methd, func and attr). Default: Members options: A boolean, or an explicit list of inherited members to render. If true, select all inherited members, which can then be filtered with A boolean, or an explicit list of members to render. If true, select all members without further filtering. If false or empty list, do not render members. If none, select all members and apply further filtering with filters and docstrings. Default: The members ordering to use. Options: A list of filters applied to filter objects based on their name. A filter starting with Group the object's children by categories: attributes, classes, functions, and modules. Default: When rendering a module, show its submodules recursively. Default: Whether to render summaries of modules, classes, functions (methods) and attributes. Whether to show labels of the members. Default: Docstrings options: The docstring style to use: The options for the docstring parser. See parsers under The style used to render docstring sections. Options: Whether to merge the Show the object heading even if it has no docstring or children with docstrings. Default: Whether to display the "Attributes" section in the object's docstring. Default: Whether to display the "Functions" or "Methods" sections in the object's docstring. Default: Whether to display the "Classes" section in the object's docstring. Default: Whether to display the "Modules" section in the object's docstring. Default: Whether to display the textual block (including admonitions) in the object's docstring. Default: Whether to display the "Examples" section in the object's docstring. Default: Whether to display the "Other Parameters" section in the object's docstring. Default: Whether to display the "Parameters" section in the object's docstring. Default: Whether to display the "Raises" section in the object's docstring. Default: Whether to display the "Receives" section in the object's docstring. Default: Whether to display the "Returns" section in the object's docstring. Default: Whether to display the "Warns" section in the object's docstring. Default: Whether to display the "Yields" section in the object's docstring. Default: Signatures/annotations options: The verbosity for annotations path: Maximum line length when formatting code/signatures. Default: Show methods and functions signatures. Default: Show the type annotations in methods and functions signatures. Default: Whether to render cross-references for type annotations in signatures. Default: Whether to put the whole signature in a code block below the heading. If Black is installed, the signature is also formatted using it. Default: Whether to unwrap Whether to modernize annotations, for example The cross-documentation domain/language for this handler. Whether this handler is interested in enabling the creation of the The configuration used to collect item during autorefs fallback. The fallback theme. Render Markdown text; for use inside templates. Parameters: The text to convert. The base heading level to start all Markdown headings from. The HTML id of the element that's considered the parent of this element. Whether to exclude the tag from around the whole output. Returns: An HTML string. Render an HTML heading and register it for the table of contents. For use inside templates. Parameters: The HTML within the heading. The level of heading (e.g. 3 -> An optional role for the object bound to this heading. If True, only register it for the table of contents, don't render anything. The title to use in the table of contents ('data-toc-label' attribute). Any extra HTML attributes of the heading. Returns: An HTML string. Return the path to the handler's templates directory. Override to customize how the templates directory is found. Parameters: Raises: When no such handler is installed. When the templates directory cannot be found. Returns: The templates directory path. Yield items and their URLs from an inventory file streamed from This implements mkdocstrings' Parameters: The binary file-like object to read the inventory from. The URL that this file is being streamed from (used to guess The URL that this inventory's sub-paths are relative to. A list of domain strings to filter the inventory by, when not passed, "py" will be used. Ignore additional arguments passed from the config. Yields: Tuples of (item identifier, item URL). Resolve extension paths relative to config file. Teardown the handler. This method should be implemented to, for example, terminate a subprocess that was started when creating the handler instance. Simply return an instance of Parameters: The theme to use when rendering contents. Directory containing custom templates. The MkDocs configuration file path. A list of paths to use as Griffe search paths. The locale to use when rendering content. Load external modules when resolving aliases. Configuration passed to the handler. Returns: An instance of Python handler for mkdocstrings. Modules: Debugging utilities. This module implements a handler for the Python language. This module implements rendering utilities. Functions: Simply return an instance of Simply return an instance of Parameters: The theme to use when rendering contents. Directory containing custom templates. The MkDocs configuration file path. A list of paths to use as Griffe search paths. The locale to use when rendering content. Load external modules when resolving aliases. Configuration passed to the handler. Returns: An instance of This module implements rendering utilities. Classes: Enumeration for the possible members ordering. Functions: Build an attributes section from a list of attributes. Build a classes section from a list of classes. Build a functions section from a list of functions. Build a modules section from a list of modules. Deprecated. Filter to create cross-references. Filter a dictionary of objects based on their docstrings. Format an attribute using Black. Format code using Black. Format a signature using Black. Get the template name used to render an object. Deprecated. Filter to create cross-references. Order members given an ordering method. Split object paths for building cross-references. Enumeration for the possible members ordering. Attributes: Alphabetical order. Source code order. Build an attributes section from a list of attributes. Parameters: The attributes to build the section from. Whether to check if the attribute is public. Returns: An attributes docstring section. Filter a dictionary of objects based on their docstrings. Parameters: The dictionary of objects. Filters to apply, based on members' names. Each element is a tuple: a pattern, and a boolean indicating whether to reject the object if the pattern matches. An optional, explicit list of members to keep. When given and empty, return an empty list. When given and not empty, ignore filters and docstrings presence/absence. Whether to keep inherited members or exclude them. Whether to keep objects with no/empty docstrings (recursive check). Returns: Format an attribute using Black. Parameters: Jinja context, passed automatically. The path of the callable we render the signature of. The attribute we render the signature of. The line length to give to Black. Whether to cross-reference types in the signature. Returns: The same code, formatted. Format a signature using Black. Parameters: Jinja context, passed automatically. The path of the callable we render the signature of. The function we render the signature of. The line length to give to Black. Whether to show type annotations. Whether to cross-reference types in the signature. Returns: The same code, formatted. A Python handler for mkdocstrings. The Python handler uses Griffe to collect documentation from Python source code. The word \"griffe\" can sometimes be used instead of \"signature\" in French. Griffe is able to visit the Abstract Syntax Tree (AST) of the source code to extract useful information. It is also able to execute the code (by importing it) and introspect objects in memory when source code is not available. Finally, it can parse docstrings following different styles. You can install this handler as a mkdocstrings extra: You can also explicitly depend on the handler: Data collection from source code: collection of the object-tree and the docstrings is done thanks to Griffe. Support for type annotations: Griffe collects your type annotations and mkdocstrings uses them to display parameter types or return types. It is even able to automatically add cross-references to other objects from your API, from the standard library or third-party libraries! See how to load inventories to enable it. Recursive documentation of Python objects: just use the module dotted-path as an identifier, and you get the full module docs. You don't need to inject documentation for each class, function, etc. Support for documented attributes: attributes (variables) followed by a docstring (triple-quoted string) will be recognized by Griffe in modules, classes and even in Multiple docstring-styles support: common support for Google-style, Numpydoc-style, and Sphinx-style docstrings. See Griffe's documentation on docstrings support. Admonition support in Google docstrings: blocks like Every object has a TOC entry: we render a heading for each object, meaning MkDocs picks them into the Table of Contents, which is nicely displayed by the Material theme. Thanks to mkdocstrings cross-reference ability, you can reference other objects within your docstrings, with the classic Markdown syntax: Source code display: mkdocstrings can add a collapsible div containing the highlighted source code of the Python object. All notable changes to this project will be documented in this file. The format is based on Keep a Changelog and this project adheres to Semantic Versioning. Compare with 1.10.0 Compare with 1.9.2 Compare with 1.9.1 Compare with 1.9.0 Compare with 1.8.0 Compare with 1.7.5 Release Insiders features of the $500/month funding goal (bd30106 by Timoth\u00e9e Mazzucotelli). The features and projects related to mkdocstrings-python are: See the complete list of features and projects here: https://pawamoy.github.io/insiders/#500-plasmavac-user-guide. Compare with 1.7.4 Compare with 1.7.3 Compare with 1.7.2 Compare with 1.7.1 Compare with 1.7.0 Compare with 1.6.3 Compare with 1.6.2 Compare with 1.6.1 Compare with 1.6.0 Compare with 1.5.2 Compare with 1.5.1 Compare with 1.5.0 Compare with 1.4.0 Compare with 1.3.0 Compare with 1.2.1 Compare with 1.2.0 Compare with 1.1.2 Compare with 1.1.1 Compare with 1.1.0 Compare with 1.0.0 Compare with 0.10.1 The signature of the You can see how to use the filter in this commit's changes: f686f4e4. We take this as an opportunity to go out of beta and bump the version to 1.0.0. This will allow users to rely on semantic versioning. Compare with 0.10.0 Compare with 0.9.0 Compare with 0.8.3 Compare with 0.8.2 Compare with 0.8.1 Compare with 0.8.0 Compare with 0.7.1 Compare with 0.7.0 Compare with 0.6.6 Compare with 0.6.5 Compare with 0.6.4 Compare with 0.6.3 Compare with 0.6.2 Compare with 0.6.1 Compare with 0.6.0 Compare with 0.5.4 Compare with 0.5.3 Compare with 0.5.2 Compare with 0.5.1 Compare with 0.5.0 Compare with 0.4.1 Compare with 0.4.0 Compare with 0.3.0 Compare with 0.2.0 Compare with 0.1.0 Compare with first commit We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation. We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. Examples of behavior that contributes to a positive environment for our community include: Examples of unacceptable behavior include: Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at dev@pawamoy.fr. All complaints will be reviewed and investigated promptly and fairly. All community leaders are obligated to respect the privacy and security of the reporter of any incident. Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: Community Impact: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. Consequence: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. Community Impact: A violation through a single incident or series of actions. Consequence: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban. Community Impact: A serious violation of community standards, including sustained inappropriate behavior. Consequence: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. Community Impact: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. Consequence: A permanent ban from any sort of public interaction within the community. This Code of Conduct is adapted from the Contributor Covenant, version 2.1, available at https://www.contributor-covenant.org/version/2/1/code_of_conduct.html. Community Impact Guidelines were inspired by Mozilla's code of conduct enforcement ladder. For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations. Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given. Nothing easier! Fork and clone the repository, then: Note If it fails for some reason, you'll need to install uv manually. You can install it with: Now you can try running You now have the dependencies installed. Run This project uses duty to run tasks. A Makefile is also provided. The Makefile will try to run certain tasks on multiple Python versions. If for some reason you don't want to run the task on multiple Python versions, you run the task directly with The Makefile detects if a virtual environment is activated, so If you work in VSCode, we provide an action to configure VSCode for the project. As usual: Before committing: If you are unsure about how to fix or ignore a warning, just let the continuous integration fail, and we will help you during review. Don't bother updating the changelog, we will take care of this. Commit messages must follow our convention based on the Angular style or the Karma convention: Subject and body must be valid Markdown. Subject must have proper casing (uppercase for first letter if it makes sense), but no dot at the end, and no punctuation in general. Scope and body are optional. Type can be: If you write a body, please add trailers at the end (for example issues and PR references, or co-authors), without relying on GitHub's flavored Markdown: These \"trailers\" must appear at the end of the body, without any blank lines between them. The trailer title can contain any character except colons We do not enforce a line length on commit messages summary and body, but please avoid very long summaries, and very long lines in the body, unless they are part of code blocks that must not be wrapped. Link to any related issue in the Pull Request message. During the review, we recommend using fixups: Once all the changes are approved, you can squash your commits: And force-push: If this seems all too complicated, you can push or force-push each new commit, and we will squash them ourselves if needed, before merging. These projects were used to build mkdocstrings-python. Thank you! Python | uv | copier-uv More credits from the author mkdocstrings-python follows the sponsorware release strategy, which means that new features are first exclusively released to sponsors as part of Insiders. Read on to learn what sponsorships achieve, how to become a sponsor to get access to Insiders, and what's in it for you! mkdocstrings-python Insiders is a private fork of mkdocstrings-python, hosted as a private GitHub repository. Almost1 all new features are developed as part of this fork, which means that they are immediately available to all eligible sponsors, as they are made collaborators of this repository. Every feature is tied to a funding goal in monthly subscriptions. When a funding goal is hit, the features that are tied to it are merged back into mkdocstrings-python and released for general availability, making them available to all users. Bugfixes are always released in tandem. Sponsorships start as low as $10 a month.2 Sponsorships make this project sustainable, as they buy the maintainers of this project time \u2013 a very scarce resource \u2013 which is spent on the development of new features, bug fixing, stability improvement, issue triage and general support. The biggest bottleneck in Open Source is time.3 If you're unsure if you should sponsor this project, check out the list of completed funding goals to learn whether you're already using features that were developed with the help of sponsorships. You're most likely using at least a handful of them, thanks to our awesome sponsors! The moment you become a sponsor, you'll get immediate access to 9 additional features that you can start using right away, and which are currently exclusively available to sponsors: These are just the features related to this project. See the complete feature list on the author's main Insiders page. Thanks for your interest in sponsoring! In order to become an eligible sponsor with your GitHub account, visit pawamoy's sponsor profile, and complete a sponsorship of $10 a month or more. You can use your individual or organization GitHub account for sponsoring. Important: If you're sponsoring @pawamoy through a GitHub organization, please send a short email to insiders@pawamoy.fr with the name of your organization and the GitHub account of the individual that should be added as a collaborator.4 You can cancel your sponsorship anytime.5 \u00a0 Join our awesome sponsors If you sponsor publicly, you're automatically added here with a link to your profile and avatar to show your support for mkdocstrings-python. Alternatively, if you wish to keep your sponsorship private, you'll be a silent +1. You can select visibility during checkout and change it afterwards. The following section lists all funding goals. Each goal contains a list of features prefixed with a checkmark symbol, denoting whether a feature is already available or planned, but not yet implemented. When the funding goal is hit, the features are released for general availability. There are no features in this goal for this project. See the features in this goal for all Insiders projects. This section lists all funding goals that were previously completed, which means that those features were part of Insiders, but are now generally available and can be used by all users. We're building an open source project and want to allow outside collaborators to use mkdocstrings-python locally without having access to Insiders. Is this still possible? Yes. Insiders is compatible with mkdocstrings-python. Almost all new features and configuration options are either backward-compatible or implemented behind feature flags. Most Insiders features enhance the overall experience, though while these features add value for the users of your project, they shouldn't be necessary for previewing when making changes to content. We don't want to pay for sponsorship every month. Are there any other options? Yes. You can sponsor on a yearly basis by switching your GitHub account to a yearly billing cycle. If for some reason you cannot do that, you could also create a dedicated GitHub account with a yearly billing cycle, which you only use for sponsoring (some sponsors already do that). If you have any problems or further questions, please reach out to insiders@pawamoy.fr. Are we allowed to use Insiders under the same terms and conditions as mkdocstrings-python? Yes. Whether you're an individual or a company, you may use mkdocstrings-python Insiders precisely under the same terms as mkdocstrings-python, which are given by the ISC License. However, we kindly ask you to respect our fair use policy: Please don't distribute the source code of Insiders. You may freely use it for public, private or commercial projects, privately fork or mirror it, but please don't make the source code public, as it would counteract the sponsorware strategy. If you cancel your subscription, you're automatically removed as a collaborator and will miss out on all future updates of Insiders. However, you may use the latest version that's available to you as long as you like. Just remember that GitHub deletes private forks. In general, every new feature is first exclusively released to sponsors, but sometimes upstream dependencies enhance existing features that must be supported by mkdocstrings-python.\u00a0\u21a9 Note that $10 a month is the minimum amount to become eligible for Insiders. While GitHub Sponsors also allows to sponsor lower amounts or one-time amounts, those can't be granted access to Insiders due to technical reasons. Such contributions are still very much welcome as they help ensuring the project's sustainability.\u00a0\u21a9 Making an Open Source project sustainable is exceptionally hard: maintainers burn out, projects are abandoned. That's not great and very unpredictable. The sponsorware model ensures that if you decide to use mkdocstrings-python, you can be sure that bugs are fixed quickly and new features are added regularly.\u00a0\u21a9 It's currently not possible to grant access to each member of an organization, as GitHub only allows for adding users. Thus, after sponsoring, please send an email to insiders@pawamoy.fr, stating which account should become a collaborator of the Insiders repository. We're working on a solution which will make access to organizations much simpler. To ensure that access is not tied to a particular individual GitHub account, create a bot account (i.e. a GitHub account that is not tied to a specific individual), and use this account for the sponsoring. After being added to the list of collaborators, the bot account can create a private fork of the private Insiders GitHub repository, and grant access to all members of the organizations.\u00a0\u21a9 If you cancel your sponsorship, GitHub schedules a cancellation request which will become effective at the end of the billing cycle. This means that even though you cancel your sponsorship, you will keep your access to Insiders as long as your cancellation isn't effective. All charges are processed by GitHub through Stripe. As we don't receive any information regarding your payment, and GitHub doesn't offer refunds, sponsorships are non-refundable.\u00a0\u21a9 mkdocstrings-python Insiders is a compatible drop-in replacement for mkdocstrings-python, and can be installed similarly using PyPI Insiders is a tool that helps you keep up-to-date versions of Insiders projects in the PyPI index of your choice (self-hosted, Google registry, Artifactory, etc.). See how to install it and how to use it. mkdocstrings-python Insiders can be installed with Or using HTTPS: The Note that the personal access token must be kept secret at all times, as it allows the owner to access your private repositories. Self-hosting the Insiders package makes it possible to depend on mkdocstrings-python normally, while transparently downloading and installing the Insiders version locally. It means that you can specify your dependencies normally, and your contributors without access to Insiders will get the public version, while you get the Insiders version on your machine. Limitation With this method, there is no way to force the installation of an Insiders version rather than a public version. If there is a public version that is more recent than your self-hosted Insiders version, the public version will take precedence. Remember to regularly update your self-hosted versions by uploading latest distributions. You can build the distributions for Insiders yourself, by cloning the repository and using build to build the distributions, or you can download them from our GitHub Releases. You can upload these distributions to a private PyPI-like registry (Artifactory, Google Cloud, pypiserver, etc.) with Twine: You might also need to provide a username and password/token to authenticate against the registry. Please check Twine's documentation. You can then configure pip (or other tools) to look for packages into your package index. For example, with pip: Note that the URL might differ depending on whether your are uploading a package (with Twine) or installing a package (with pip), and depending on the registry you are using (Artifactory, Google Cloud, etc.). Please check the documentation of your registry to learn how to configure your environment. We kindly ask that you do not upload the distributions to public registries, as it is against our Terms of use. In this example we use pypiserver to serve a local PyPI index. We can configure the credentials to access the server in We then clone the Insiders repository, build distributions and upload them to our local server: Finally, we configure pip, and for example PDM, to use our local index to find packages: Now when running Of course, you can use mkdocstrings-python Insiders directly from When cloning from When upgrading Insiders, you should always check the version of mkdocstrings-python which makes up the first part of the version qualifier. For example, a version like If the major version increased, it's a good idea to consult the changelog and go through the steps to ensure your configuration is up to date and all necessary changes have been made. Python handler for mkdocstrings. Modules: Debugging utilities. This module implements a handler for the Python language. This module implements rendering utilities. Functions: Simply return an instance of Simply return an instance of Parameters: Returns: An instance of The theme to use when rendering contents. Directory containing custom templates. The MkDocs configuration file path. A list of paths to use as Griffe search paths. The locale to use when rendering content. Load external modules when resolving aliases. Configuration passed to the handler. Debugging utilities. Classes: Dataclass to store environment information. Dataclass describing a Python package. Dataclass describing an environment variable. Functions: Get debug/environment information. Get version of the given distribution. Print debug/environment information. Dataclass to store environment information. Attributes: Python interpreter name. Path to Python executable. Python interpreter version. Installed packages. Operating System. Environment variables. Python interpreter name. Path to Python executable. Python interpreter version. Installed packages. Operating System. Environment variables. Dataclass describing a Python package. Attributes: Package name. Package version. Package name. Package version. Dataclass describing an environment variable. Attributes: Variable name. Variable value. Variable name. Variable value. Get debug/environment information. Returns: Environment information. Get version of the given distribution. Parameters: Returns: A version number. A distribution name. Print debug/environment information. This module implements a handler for the Python language. Classes: The Python handler class. Functions: Simply return an instance of The Python handler class. Parameters: Methods: Render Markdown text; for use inside templates. Render an HTML heading and register it for the table of contents. For use inside templates. Load template extensions for the given handler, return their templates directories. Return and clear the headings gathered so far. Return the path to the handler's templates directory. Yield items and their URLs from an inventory file streamed from Resolve extension paths relative to config file. Teardown the handler. Update the Jinja environment with custom filters and tests. Attributes: Default handler configuration. The cross-documentation domain/language for this handler. Whether this handler is interested in enabling the creation of the Extra CSS. The configuration used to collect item during autorefs fallback. The fallback theme. The handler's name. Handler name, theme and custom templates. The MkDocs configuration file path. A list of paths to use as Griffe search paths. The locale to use when rendering content. Load external modules when resolving aliases. Same thing, but with keyword arguments. Default handler configuration. General options: Whether to load stubs package (package-stubs) when extracting docstrings. Default Whether to allow inspecting modules when visiting them is not possible. Default: Show the base classes of a class. Default: Show the inheritance diagram of a class using Mermaid. Default: Show the source code of this object. Default: Pre-load modules that are not specified directly in autodoc instructions ( For an imported member to be rendered, you need to add it to the The modules must be listed as an array of strings. Default: Headings options: The initial heading level to use. Default: Whether to render headings for parameters (therefore showing parameters in the ToC). Default: Show the heading of the object at the root of the documentation tree (i.e. the object referenced by the identifier after If the root heading is not shown, at least add a ToC entry for it. Default: Show the full Python path for the root object heading. Default: Show the full Python path of the root members. Default: Show the full Python path of every object. Default: When grouped by categories, show a heading for each category. Default: Show the symbol type in headings (e.g. mod, class, meth, func and attr). Default: Show the symbol type in the Table of Contents (e.g. mod, class, methd, func and attr). Default: Members options: A boolean, or an explicit list of inherited members to render. If true, select all inherited members, which can then be filtered with A boolean, or an explicit list of members to render. If true, select all members without further filtering. If false or empty list, do not render members. If none, select all members and apply further filtering with filters and docstrings. Default: The members ordering to use. Options: A list of filters applied to filter objects based on their name. A filter starting with Group the object's children by categories: attributes, classes, functions, and modules. Default: When rendering a module, show its submodules recursively. Default: Whether to render summaries of modules, classes, functions (methods) and attributes. Whether to show labels of the members. Default: Docstrings options: The docstring style to use: The options for the docstring parser. See parsers under The style used to render docstring sections. Options: Whether to merge the Show the object heading even if it has no docstring or children with docstrings. Default: Whether to display the \"Attributes\" section in the object's docstring. Default: Whether to display the \"Functions\" or \"Methods\" sections in the object's docstring. Default: Whether to display the \"Classes\" section in the object's docstring. Default: Whether to display the \"Modules\" section in the object's docstring. Default: Whether to display the textual block (including admonitions) in the object's docstring. Default: Whether to display the \"Examples\" section in the object's docstring. Default: Whether to display the \"Other Parameters\" section in the object's docstring. Default: Whether to display the \"Parameters\" section in the object's docstring. Default: Whether to display the \"Raises\" section in the object's docstring. Default: Whether to display the \"Receives\" section in the object's docstring. Default: Whether to display the \"Returns\" section in the object's docstring. Default: Whether to display the \"Warns\" section in the object's docstring. Default: Whether to display the \"Yields\" section in the object's docstring. Default: Signatures/annotations options: The verbosity for annotations path: Maximum line length when formatting code/signatures. Default: Show methods and functions signatures. Default: Show the type annotations in methods and functions signatures. Default: Whether to render cross-references for type annotations in signatures. Default: Whether to put the whole signature in a code block below the heading. If Black is installed, the signature is also formatted using it. Default: Whether to unwrap Whether to modernize annotations, for example The cross-documentation domain/language for this handler. Whether this handler is interested in enabling the creation of the Extra CSS. The configuration used to collect item during autorefs fallback. The fallback theme. The handler's name. Render Markdown text; for use inside templates. Parameters: The text to convert. The base heading level to start all Markdown headings from. The HTML id of the element that's considered the parent of this element. Whether to exclude the tag from around the whole output. Returns: An HTML string. Render an HTML heading and register it for the table of contents. For use inside templates. Parameters: Returns: An HTML string. The HTML within the heading. The level of heading (e.g. 3 -> An optional role for the object bound to this heading. If True, only register it for the table of contents, don't render anything. The title to use in the table of contents ('data-toc-label' attribute). Any extra HTML attributes of the heading. Load template extensions for the given handler, return their templates directories. Parameters: Returns: The extensions templates directories. The name of the handler to get the extended templates directory of. Return and clear the headings gathered so far. Returns: A list of HTML elements. Return the path to the handler's templates directory. Override to customize how the templates directory is found. Parameters: Raises: When no such handler is installed. When the templates directory cannot be found. Returns: The templates directory path. The name of the handler to get the templates directory of. Yield items and their URLs from an inventory file streamed from This implements mkdocstrings' Parameters: Yields: Tuples of (item identifier, item URL). The binary file-like object to read the inventory from. The URL that this file is being streamed from (used to guess The URL that this inventory's sub-paths are relative to. A list of domain strings to filter the inventory by, when not passed, \"py\" will be used. Ignore additional arguments passed from the config. Resolve extension paths relative to config file. Teardown the handler. This method should be implemented to, for example, terminate a subprocess that was started when creating the handler instance. Update the Jinja environment with custom filters and tests. Parameters: The Markdown instance. The configuration dictionary. Simply return an instance of Parameters: Returns: An instance of The theme to use when rendering contents. Directory containing custom templates. The MkDocs configuration file path. A list of paths to use as Griffe search paths. The locale to use when rendering content. Load external modules when resolving aliases. Configuration passed to the handler. This module implements rendering utilities. Classes: Enumeration for the possible members ordering. Functions: Build an attributes section from a list of attributes. Build a classes section from a list of classes. Build a functions section from a list of functions. Build a modules section from a list of modules. Deprecated. Filter to create cross-references. Filter a dictionary of objects based on their docstrings. Format an attribute using Black. Format code using Black. Format a signature using Black. Get the template name used to render an object. Deprecated. Filter to create cross-references. Order members given an ordering method. Split object paths for building cross-references. Enumeration for the possible members ordering. Attributes: Alphabetical order. Source code order. Alphabetical order. Source code order. Build an attributes section from a list of attributes. Parameters: Returns: An attributes docstring section. The attributes to build the section from. Whether to check if the attribute is public. Build a classes section from a list of classes. Parameters: Returns: A classes docstring section. The classes to build the section from. Whether to check if the class is public. Build a functions section from a list of functions. Parameters: Returns: A functions docstring section. The functions to build the section from. Whether to check if the function is public. Build a modules section from a list of modules. Parameters: Returns: A modules docstring section. The modules to build the section from. Whether to check if the module is public. Deprecated. Filter to create cross-references. Parameters: Returns: Markup text. The path to link to. Show only the last part of the path, add full path as hover. Filter a dictionary of objects based on their docstrings. Parameters: Returns: A list of objects. The dictionary of objects. Filters to apply, based on members' names. Each element is a tuple: a pattern, and a boolean indicating whether to reject the object if the pattern matches. An optional, explicit list of members to keep. When given and empty, return an empty list. When given and not empty, ignore filters and docstrings presence/absence. Whether to keep inherited members or exclude them. Whether to keep objects with no/empty docstrings (recursive check). Format an attribute using Black. Parameters: Returns: The same code, formatted. Jinja context, passed automatically. The path of the callable we render the signature of. The attribute we render the signature of. The line length to give to Black. Whether to cross-reference types in the signature. Format code using Black. Parameters: Returns: The same code, formatted. The code to format. The line length to give to Black. Format a signature using Black. Parameters: Returns: The same code, formatted. Jinja context, passed automatically. The path of the callable we render the signature of. The function we render the signature of. The line length to give to Black. Whether to show type annotations. Whether to cross-reference types in the signature. Get the template name used to render an object. Parameters: Returns: A template name. The Jinja environment, passed automatically. A Griffe object, or a template name. Deprecated. Filter to create cross-references. Parameters: Returns: Markup text. The text to scan. Whether to wrap the result in a code tag. Order members given an ordering method. Parameters: Returns: The same members, ordered. The members to order. The ordering method. An optional member list (manual ordering). Split object paths for building cross-references. Parameters: Returns: A list of pairs (title, full path). The path to split. This is the documentation for the NEW Python handler. To read the documentation for the LEGACY handler, go to the legacy handler documentation. You can install this handler as a mkdocstrings extra: You can also explicitly depend on the handler: The Python handler is the default mkdocstrings handler. You can change the default handler, or explicitely set the Python handler as default by defining the With the Python handler installed and configured as default handler, you can inject documentation for a module, class, function, or any other Python object with mkdocstrings' autodoc syntax, in your Markdown pages: If another handler was defined as default handler, you can explicitely ask for the Python handler to be used when injecting documentation with the When installed, the Python handler becomes the default mkdocstrings handler. You can configure it in Some options are global only, and go directly under the handler's name. This option is used to import Sphinx-compatible objects inventories from other documentation sites. For example, you can import the standard library objects inventory like this: When importing an inventory, you enable automatic cross-references to other documentation sites like the standard library docs or any third-party package docs. Typically, you want to import the inventories of your project's dependencies, at least those that are used in the public API. See mkdocstrings' documentation on inventories for more details. Additionally, the Python handler accepts a Note The This option is used to provide filesystem paths in which to search for Python modules. Non-absolute paths are computed as relative to MkDocs configuration file. Example: More details at Finding modules. This option allows resolving aliases (imports) to any external module. Modules are considered external when they are not part of the package your are injecting documentation for. Enabling this option will tell the handler to resolve aliases recursively when they are made public through the Use with caution This can load a lot of modules through Griffe, slowing down your build or triggering errors that Griffe does not yet handle. We recommend using the Example: The other options can be used both globally and locally, under the ...and locally, overriding the global configuration: These options affect how the documentation is collected from sources and rendered. See the following tables summarizing the options, and get more details for each option in the following pages: Default handler configuration. General options: Whether to load stubs package (package-stubs) when extracting docstrings. Default Whether to allow inspecting modules when visiting them is not possible. Default: Show the base classes of a class. Default: Show the inheritance diagram of a class using Mermaid. Default: Show the source code of this object. Default: Pre-load modules that are not specified directly in autodoc instructions ( For an imported member to be rendered, you need to add it to the The modules must be listed as an array of strings. Default: Headings options: The initial heading level to use. Default: Whether to render headings for parameters (therefore showing parameters in the ToC). Default: Show the heading of the object at the root of the documentation tree (i.e. the object referenced by the identifier after If the root heading is not shown, at least add a ToC entry for it. Default: Show the full Python path for the root object heading. Default: Show the full Python path of the root members. Default: Show the full Python path of every object. Default: When grouped by categories, show a heading for each category. Default: Show the symbol type in headings (e.g. mod, class, meth, func and attr). Default: Show the symbol type in the Table of Contents (e.g. mod, class, methd, func and attr). Default: Members options: A boolean, or an explicit list of inherited members to render. If true, select all inherited members, which can then be filtered with A boolean, or an explicit list of members to render. If true, select all members without further filtering. If false or empty list, do not render members. If none, select all members and apply further filtering with filters and docstrings. Default: The members ordering to use. Options: A list of filters applied to filter objects based on their name. A filter starting with Group the object's children by categories: attributes, classes, functions, and modules. Default: When rendering a module, show its submodules recursively. Default: Whether to render summaries of modules, classes, functions (methods) and attributes. Whether to show labels of the members. Default: Docstrings options: The docstring style to use: The options for the docstring parser. See parsers under The style used to render docstring sections. Options: Whether to merge the Show the object heading even if it has no docstring or children with docstrings. Default: Whether to display the \"Attributes\" section in the object's docstring. Default: Whether to display the \"Functions\" or \"Methods\" sections in the object's docstring. Default: Whether to display the \"Classes\" section in the object's docstring. Default: Whether to display the \"Modules\" section in the object's docstring. Default: Whether to display the textual block (including admonitions) in the object's docstring. Default: Whether to display the \"Examples\" section in the object's docstring. Default: Whether to display the \"Other Parameters\" section in the object's docstring. Default: Whether to display the \"Parameters\" section in the object's docstring. Default: Whether to display the \"Raises\" section in the object's docstring. Default: Whether to display the \"Receives\" section in the object's docstring. Default: Whether to display the \"Returns\" section in the object's docstring. Default: Whether to display the \"Warns\" section in the object's docstring. Default: Whether to display the \"Yields\" section in the object's docstring. Default: Signatures/annotations options: The verbosity for annotations path: Maximum line length when formatting code/signatures. Default: Show methods and functions signatures. Default: Show the type annotations in methods and functions signatures. Default: Whether to render cross-references for type annotations in signatures. Default: Whether to put the whole signature in a code block below the heading. If Black is installed, the signature is also formatted using it. Default: Whether to unwrap Whether to modernize annotations, for example There are multiple ways to tell the handler where to find your packages/modules. The recommended method is to use the This is the recommended method. mkdocs.yml in root, package in root =q){if(s=W.limit_backward,W.limit_backward=q,W.ket=W.cursor,e=W.find_among_b(P,7))switch(W.bra=W.cursor,e){case 1:if(l()){if(i=W.limit-W.cursor,!W.eq_s_b(1,"s")&&(W.cursor=W.limit-i,!W.eq_s_b(1,"t")))break;W.slice_del()}break;case 2:W.slice_from("i");break;case 3:W.slice_del();break;case 4:W.eq_s_b(2,"gu")&&W.slice_del()}W.limit_backward=s}}function b(){var e=W.limit-W.cursor;W.find_among_b(U,5)&&(W.cursor=W.limit-e,W.ket=W.cursor,W.cursor>W.limit_backward&&(W.cursor--,W.bra=W.cursor,W.slice_del()))}function d(){for(var e,r=1;W.out_grouping_b(F,97,251);)r--;if(r<=0){if(W.ket=W.cursor,e=W.limit-W.cursor,!W.eq_s_b(1,"é")&&(W.cursor=W.limit-e,!W.eq_s_b(1,"è")))return;W.bra=W.cursor,W.slice_from("e")}}function k(){if(!w()&&(W.cursor=W.limit,!f()&&(W.cursor=W.limit,!m())))return W.cursor=W.limit,void _();W.cursor=W.limit,W.ket=W.cursor,W.eq_s_b(1,"Y")?(W.bra=W.cursor,W.slice_from("i")):(W.cursor=W.limit,W.eq_s_b(1,"ç")&&(W.bra=W.cursor,W.slice_from("c")))}var p,g,q,v=[new r("col",-1,-1),new r("par",-1,-1),new r("tap",-1,-1)],h=[new r("",-1,4),new r("I",0,1),new r("U",0,2),new r("Y",0,3)],z=[new r("iqU",-1,3),new r("abl",-1,3),new r("Ièr",-1,4),new r("ièr",-1,4),new r("eus",-1,2),new r("iv",-1,1)],y=[new r("ic",-1,2),new r("abil",-1,1),new r("iv",-1,3)],C=[new r("iqUe",-1,1),new r("atrice",-1,2),new r("ance",-1,1),new r("ence",-1,5),new r("logie",-1,3),new r("able",-1,1),new r("isme",-1,1),new r("euse",-1,11),new r("iste",-1,1),new r("ive",-1,8),new r("if",-1,8),new r("usion",-1,4),new r("ation",-1,2),new r("ution",-1,4),new r("ateur",-1,2),new r("iqUes",-1,1),new r("atrices",-1,2),new r("ances",-1,1),new r("ences",-1,5),new r("logies",-1,3),new r("ables",-1,1),new r("ismes",-1,1),new r("euses",-1,11),new r("istes",-1,1),new r("ives",-1,8),new r("ifs",-1,8),new r("usions",-1,4),new r("ations",-1,2),new r("utions",-1,4),new r("ateurs",-1,2),new r("ments",-1,15),new r("ements",30,6),new r("issements",31,12),new r("ités",-1,7),new r("ment",-1,15),new r("ement",34,6),new r("issement",35,12),new r("amment",34,13),new r("emment",34,14),new r("aux",-1,10),new r("eaux",39,9),new r("eux",-1,1),new r("ité",-1,7)],x=[new r("ira",-1,1),new r("ie",-1,1),new r("isse",-1,1),new r("issante",-1,1),new r("i",-1,1),new r("irai",4,1),new r("ir",-1,1),new r("iras",-1,1),new r("ies",-1,1),new r("îmes",-1,1),new r("isses",-1,1),new r("issantes",-1,1),new r("îtes",-1,1),new r("is",-1,1),new r("irais",13,1),new r("issais",13,1),new r("irions",-1,1),new r("issions",-1,1),new r("irons",-1,1),new r("issons",-1,1),new r("issants",-1,1),new r("it",-1,1),new r("irait",21,1),new r("issait",21,1),new r("issant",-1,1),new r("iraIent",-1,1),new r("issaIent",-1,1),new r("irent",-1,1),new r("issent",-1,1),new r("iront",-1,1),new r("ît",-1,1),new r("iriez",-1,1),new r("issiez",-1,1),new r("irez",-1,1),new r("issez",-1,1)],I=[new r("a",-1,3),new r("era",0,2),new r("asse",-1,3),new r("ante",-1,3),new r("ée",-1,2),new r("ai",-1,3),new r("erai",5,2),new r("er",-1,2),new r("as",-1,3),new r("eras",8,2),new r("âmes",-1,3),new r("asses",-1,3),new r("antes",-1,3),new r("âtes",-1,3),new r("ées",-1,2),new r("ais",-1,3),new r("erais",15,2),new r("ions",-1,1),new r("erions",17,2),new r("assions",17,3),new r("erons",-1,2),new r("ants",-1,3),new r("és",-1,2),new r("ait",-1,3),new r("erait",23,2),new r("ant",-1,3),new r("aIent",-1,3),new r("eraIent",26,2),new r("èrent",-1,2),new r("assent",-1,3),new r("eront",-1,2),new r("ât",-1,3),new r("ez",-1,2),new r("iez",32,2),new r("eriez",33,2),new r("assiez",33,3),new r("erez",32,2),new r("é",-1,2)],P=[new r("e",-1,3),new r("Ière",0,2),new r("ière",0,2),new r("ion",-1,1),new r("Ier",-1,2),new r("ier",-1,2),new r("ë",-1,4)],U=[new r("ell",-1,-1),new r("eill",-1,-1),new r("enn",-1,-1),new r("onn",-1,-1),new r("ett",-1,-1)],F=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,128,130,103,8,5],S=[1,65,20,0,0,0,0,0,0,0,0,0,0,0,0,0,128],W=new s;this.setCurrent=function(e){W.setCurrent(e)},this.getCurrent=function(){return W.getCurrent()},this.stem=function(){var e=W.cursor;return n(),W.cursor=e,u(),W.limit_backward=e,W.cursor=W.limit,k(),W.cursor=W.limit,b(),W.cursor=W.limit,d(),W.cursor=W.limit_backward,o(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return i.setCurrent(e),i.stem(),i.getCurrent()}):(i.setCurrent(e),i.stem(),i.getCurrent())}}(),e.Pipeline.registerFunction(e.fr.stemmer,"stemmer-fr"),e.fr.stopWordFilter=e.generateStopWordFilter("ai aie aient aies ait as au aura aurai auraient aurais aurait auras aurez auriez aurions aurons auront aux avaient avais avait avec avez aviez avions avons ayant ayez ayons c ce ceci celà ces cet cette d dans de des du elle en es est et eu eue eues eurent eus eusse eussent eusses eussiez eussions eut eux eûmes eût eûtes furent fus fusse fussent fusses fussiez fussions fut fûmes fût fûtes ici il ils j je l la le les leur leurs lui m ma mais me mes moi mon même n ne nos notre nous on ont ou par pas pour qu que quel quelle quelles quels qui s sa sans se sera serai seraient serais serait seras serez seriez serions serons seront ses soi soient sois soit sommes son sont soyez soyons suis sur t ta te tes toi ton tu un une vos votre vous y à étaient étais était étant étiez étions été étée étées étés êtes".split(" ")),e.Pipeline.registerFunction(e.fr.stopWordFilter,"stopWordFilter-fr")}});
\ No newline at end of file
diff --git a/assets/javascripts/lunr/min/lunr.he.min.js b/assets/javascripts/lunr/min/lunr.he.min.js
new file mode 100644
index 00000000..b863d3ea
--- /dev/null
+++ b/assets/javascripts/lunr/min/lunr.he.min.js
@@ -0,0 +1 @@
+!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.he=function(){this.pipeline.reset(),this.pipeline.add(e.he.trimmer,e.he.stopWordFilter,e.he.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.he.stemmer))},e.he.wordCharacters="֑-״א-תa-zA-Za-zA-Z0-90-9",e.he.trimmer=e.trimmerSupport.generateTrimmer(e.he.wordCharacters),e.Pipeline.registerFunction(e.he.trimmer,"trimmer-he"),e.he.stemmer=function(){var e=this;return e.result=!1,e.preRemoved=!1,e.sufRemoved=!1,e.pre={pre1:"ה ו י ת",pre2:"ב כ ל מ ש כש",pre3:"הב הכ הל המ הש בש לכ",pre4:"וב וכ ול ומ וש",pre5:"מה שה כל",pre6:"מב מכ מל ממ מש",pre7:"בה בו בי בת כה כו כי כת לה לו לי לת",pre8:"ובה ובו ובי ובת וכה וכו וכי וכת ולה ולו ולי ולת"},e.suf={suf1:"ך כ ם ן נ",suf2:"ים ות וך וכ ום ון ונ הם הן יכ יך ינ ים",suf3:"תי תך תכ תם תן תנ",suf4:"ותי ותך ותכ ותם ותן ותנ",suf5:"נו כם כן הם הן",suf6:"ונו וכם וכן והם והן",suf7:"תכם תכן תנו תהם תהן",suf8:"הוא היא הם הן אני אתה את אנו אתם אתן",suf9:"ני נו כי כו כם כן תי תך תכ תם תן",suf10:"י ך כ ם ן נ ת"},e.patterns=JSON.parse('{"hebrewPatterns": [{"pt1": [{"c": "ה", "l": 0}]}, {"pt2": [{"c": "ו", "l": 0}]}, {"pt3": [{"c": "י", "l": 0}]}, {"pt4": [{"c": "ת", "l": 0}]}, {"pt5": [{"c": "מ", "l": 0}]}, {"pt6": [{"c": "ל", "l": 0}]}, {"pt7": [{"c": "ב", "l": 0}]}, {"pt8": [{"c": "כ", "l": 0}]}, {"pt9": [{"c": "ש", "l": 0}]}, {"pt10": [{"c": "כש", "l": 0}]}, {"pt11": [{"c": "בה", "l": 0}]}, {"pt12": [{"c": "וב", "l": 0}]}, {"pt13": [{"c": "וכ", "l": 0}]}, {"pt14": [{"c": "ול", "l": 0}]}, {"pt15": [{"c": "ומ", "l": 0}]}, {"pt16": [{"c": "וש", "l": 0}]}, {"pt17": [{"c": "הב", "l": 0}]}, {"pt18": [{"c": "הכ", "l": 0}]}, {"pt19": [{"c": "הל", "l": 0}]}, {"pt20": [{"c": "המ", "l": 0}]}, {"pt21": [{"c": "הש", "l": 0}]}, {"pt22": [{"c": "מה", "l": 0}]}, {"pt23": [{"c": "שה", "l": 0}]}, {"pt24": [{"c": "כל", "l": 0}]}]}'),e.execArray=["cleanWord","removeDiacritics","removeStopWords","normalizeHebrewCharacters"],e.stem=function(){var r=0;for(e.result=!1,e.preRemoved=!1,e.sufRemoved=!1;r
=a&&(r=w.limit_backward,w.limit_backward=a,w.ket=w.cursor,e=w.find_among_b(m,29),w.limit_backward=r,e))switch(w.bra=w.cursor,e){case 1:w.slice_del();break;case 2:n=w.limit-w.cursor,w.in_grouping_b(c,98,122)?w.slice_del():(w.cursor=w.limit-n,w.eq_s_b(1,"k")&&w.out_grouping_b(d,97,248)&&w.slice_del());break;case 3:w.slice_from("er")}}function t(){var e,r=w.limit-w.cursor;w.cursor>=a&&(e=w.limit_backward,w.limit_backward=a,w.ket=w.cursor,w.find_among_b(u,2)?(w.bra=w.cursor,w.limit_backward=e,w.cursor=w.limit-r,w.cursor>w.limit_backward&&(w.cursor--,w.bra=w.cursor,w.slice_del())):w.limit_backward=e)}function o(){var e,r;w.cursor>=a&&(r=w.limit_backward,w.limit_backward=a,w.ket=w.cursor,e=w.find_among_b(l,11),e?(w.bra=w.cursor,w.limit_backward=r,1==e&&w.slice_del()):w.limit_backward=r)}var s,a,m=[new r("a",-1,1),new r("e",-1,1),new r("ede",1,1),new r("ande",1,1),new r("ende",1,1),new r("ane",1,1),new r("ene",1,1),new r("hetene",6,1),new r("erte",1,3),new r("en",-1,1),new r("heten",9,1),new r("ar",-1,1),new r("er",-1,1),new r("heter",12,1),new r("s",-1,2),new r("as",14,1),new r("es",14,1),new r("edes",16,1),new r("endes",16,1),new r("enes",16,1),new r("hetenes",19,1),new r("ens",14,1),new r("hetens",21,1),new r("ers",14,1),new r("ets",14,1),new r("et",-1,1),new r("het",25,1),new r("ert",-1,3),new r("ast",-1,1)],u=[new r("dt",-1,-1),new r("vt",-1,-1)],l=[new r("leg",-1,1),new r("eleg",0,1),new r("ig",-1,1),new r("eig",2,1),new r("lig",2,1),new r("elig",4,1),new r("els",-1,1),new r("lov",-1,1),new r("elov",7,1),new r("slov",7,1),new r("hetslov",9,1)],d=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,48,0,128],c=[119,125,149,1],w=new n;this.setCurrent=function(e){w.setCurrent(e)},this.getCurrent=function(){return w.getCurrent()},this.stem=function(){var r=w.cursor;return e(),w.limit_backward=r,w.cursor=w.limit,i(),w.cursor=w.limit,t(),w.cursor=w.limit,o(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return i.setCurrent(e),i.stem(),i.getCurrent()}):(i.setCurrent(e),i.stem(),i.getCurrent())}}(),e.Pipeline.registerFunction(e.no.stemmer,"stemmer-no"),e.no.stopWordFilter=e.generateStopWordFilter("alle at av bare begge ble blei bli blir blitt både båe da de deg dei deim deira deires dem den denne der dere deres det dette di din disse ditt du dykk dykkar då eg ein eit eitt eller elles en enn er et ett etter for fordi fra før ha hadde han hans har hennar henne hennes her hjå ho hoe honom hoss hossen hun hva hvem hver hvilke hvilken hvis hvor hvordan hvorfor i ikke ikkje ikkje ingen ingi inkje inn inni ja jeg kan kom korleis korso kun kunne kva kvar kvarhelst kven kvi kvifor man mange me med medan meg meget mellom men mi min mine mitt mot mykje ned no noe noen noka noko nokon nokor nokre nå når og også om opp oss over på samme seg selv si si sia sidan siden sin sine sitt sjøl skal skulle slik so som som somme somt så sånn til um upp ut uten var vart varte ved vere verte vi vil ville vore vors vort vår være være vært å".split(" ")),e.Pipeline.registerFunction(e.no.stopWordFilter,"stopWordFilter-no")}});
\ No newline at end of file
diff --git a/assets/javascripts/lunr/min/lunr.pt.min.js b/assets/javascripts/lunr/min/lunr.pt.min.js
new file mode 100644
index 00000000..6c16996d
--- /dev/null
+++ b/assets/javascripts/lunr/min/lunr.pt.min.js
@@ -0,0 +1,18 @@
+/*!
+ * Lunr languages, `Portuguese` language
+ * https://github.com/MihaiValentin/lunr-languages
+ *
+ * Copyright 2014, Mihai Valentin
+ * http://www.mozilla.org/MPL/
+ */
+/*!
+ * based on
+ * Snowball JavaScript Library v0.3
+ * http://code.google.com/p/urim/
+ * http://snowball.tartarus.org/
+ *
+ * Copyright 2010, Oleg Mazko
+ * http://www.mozilla.org/MPL/
+ */
+
+!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.pt=function(){this.pipeline.reset(),this.pipeline.add(e.pt.trimmer,e.pt.stopWordFilter,e.pt.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.pt.stemmer))},e.pt.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.pt.trimmer=e.trimmerSupport.generateTrimmer(e.pt.wordCharacters),e.Pipeline.registerFunction(e.pt.trimmer,"trimmer-pt"),e.pt.stemmer=function(){var r=e.stemmerSupport.Among,s=e.stemmerSupport.SnowballProgram,n=new function(){function e(){for(var e;;){if(z.bra=z.cursor,e=z.find_among(k,3))switch(z.ket=z.cursor,e){case 1:z.slice_from("a~");continue;case 2:z.slice_from("o~");continue;case 3:if(z.cursor>=z.limit)break;z.cursor++;continue}break}}function n(){if(z.out_grouping(y,97,250)){for(;!z.in_grouping(y,97,250);){if(z.cursor>=z.limit)return!0;z.cursor++}return!1}return!0}function i(){if(z.in_grouping(y,97,250))for(;!z.out_grouping(y,97,250);){if(z.cursor>=z.limit)return!1;z.cursor++}return g=z.cursor,!0}function o(){var e,r,s=z.cursor;if(z.in_grouping(y,97,250))if(e=z.cursor,n()){if(z.cursor=e,i())return}else g=z.cursor;if(z.cursor=s,z.out_grouping(y,97,250)){if(r=z.cursor,n()){if(z.cursor=r,!z.in_grouping(y,97,250)||z.cursor>=z.limit)return;z.cursor++}g=z.cursor}}function t(){for(;!z.in_grouping(y,97,250);){if(z.cursor>=z.limit)return!1;z.cursor++}for(;!z.out_grouping(y,97,250);){if(z.cursor>=z.limit)return!1;z.cursor++}return!0}function a(){var e=z.cursor;g=z.limit,b=g,h=g,o(),z.cursor=e,t()&&(b=z.cursor,t()&&(h=z.cursor))}function u(){for(var e;;){if(z.bra=z.cursor,e=z.find_among(q,3))switch(z.ket=z.cursor,e){case 1:z.slice_from("ã");continue;case 2:z.slice_from("õ");continue;case 3:if(z.cursor>=z.limit)break;z.cursor++;continue}break}}function w(){return g<=z.cursor}function m(){return b<=z.cursor}function c(){return h<=z.cursor}function l(){var e;if(z.ket=z.cursor,!(e=z.find_among_b(F,45)))return!1;switch(z.bra=z.cursor,e){case 1:if(!c())return!1;z.slice_del();break;case 2:if(!c())return!1;z.slice_from("log");break;case 3:if(!c())return!1;z.slice_from("u");break;case 4:if(!c())return!1;z.slice_from("ente");break;case 5:if(!m())return!1;z.slice_del(),z.ket=z.cursor,e=z.find_among_b(j,4),e&&(z.bra=z.cursor,c()&&(z.slice_del(),1==e&&(z.ket=z.cursor,z.eq_s_b(2,"at")&&(z.bra=z.cursor,c()&&z.slice_del()))));break;case 6:if(!c())return!1;z.slice_del(),z.ket=z.cursor,e=z.find_among_b(C,3),e&&(z.bra=z.cursor,1==e&&c()&&z.slice_del());break;case 7:if(!c())return!1;z.slice_del(),z.ket=z.cursor,e=z.find_among_b(P,3),e&&(z.bra=z.cursor,1==e&&c()&&z.slice_del());break;case 8:if(!c())return!1;z.slice_del(),z.ket=z.cursor,z.eq_s_b(2,"at")&&(z.bra=z.cursor,c()&&z.slice_del());break;case 9:if(!w()||!z.eq_s_b(1,"e"))return!1;z.slice_from("ir")}return!0}function f(){var e,r;if(z.cursor>=g){if(r=z.limit_backward,z.limit_backward=g,z.ket=z.cursor,e=z.find_among_b(S,120))return z.bra=z.cursor,1==e&&z.slice_del(),z.limit_backward=r,!0;z.limit_backward=r}return!1}function d(){var e;z.ket=z.cursor,(e=z.find_among_b(W,7))&&(z.bra=z.cursor,1==e&&w()&&z.slice_del())}function v(e,r){if(z.eq_s_b(1,e)){z.bra=z.cursor;var s=z.limit-z.cursor;if(z.eq_s_b(1,r))return z.cursor=z.limit-s,w()&&z.slice_del(),!1}return!0}function p(){var e;if(z.ket=z.cursor,e=z.find_among_b(L,4))switch(z.bra=z.cursor,e){case 1:w()&&(z.slice_del(),z.ket=z.cursor,z.limit-z.cursor,v("u","g")&&v("i","c"));break;case 2:z.slice_from("c")}}function _(){if(!l()&&(z.cursor=z.limit,!f()))return z.cursor=z.limit,void d();z.cursor=z.limit,z.ket=z.cursor,z.eq_s_b(1,"i")&&(z.bra=z.cursor,z.eq_s_b(1,"c")&&(z.cursor=z.limit,w()&&z.slice_del()))}var h,b,g,k=[new r("",-1,3),new r("ã",0,1),new r("õ",0,2)],q=[new r("",-1,3),new r("a~",0,1),new r("o~",0,2)],j=[new r("ic",-1,-1),new r("ad",-1,-1),new r("os",-1,-1),new r("iv",-1,1)],C=[new r("ante",-1,1),new r("avel",-1,1),new r("ível",-1,1)],P=[new r("ic",-1,1),new r("abil",-1,1),new r("iv",-1,1)],F=[new r("ica",-1,1),new r("ância",-1,1),new r("ência",-1,4),new r("ira",-1,9),new r("adora",-1,1),new r("osa",-1,1),new r("ista",-1,1),new r("iva",-1,8),new r("eza",-1,1),new r("logía",-1,2),new r("idade",-1,7),new r("ante",-1,1),new r("mente",-1,6),new r("amente",12,5),new r("ável",-1,1),new r("ível",-1,1),new r("ución",-1,3),new r("ico",-1,1),new r("ismo",-1,1),new r("oso",-1,1),new r("amento",-1,1),new r("imento",-1,1),new r("ivo",-1,8),new r("aça~o",-1,1),new r("ador",-1,1),new r("icas",-1,1),new r("ências",-1,4),new r("iras",-1,9),new r("adoras",-1,1),new r("osas",-1,1),new r("istas",-1,1),new r("ivas",-1,8),new r("ezas",-1,1),new r("logías",-1,2),new r("idades",-1,7),new r("uciones",-1,3),new r("adores",-1,1),new r("antes",-1,1),new r("aço~es",-1,1),new r("icos",-1,1),new r("ismos",-1,1),new r("osos",-1,1),new r("amentos",-1,1),new r("imentos",-1,1),new r("ivos",-1,8)],S=[new r("ada",-1,1),new r("ida",-1,1),new r("ia",-1,1),new r("aria",2,1),new r("eria",2,1),new r("iria",2,1),new r("ara",-1,1),new r("era",-1,1),new r("ira",-1,1),new r("ava",-1,1),new r("asse",-1,1),new r("esse",-1,1),new r("isse",-1,1),new r("aste",-1,1),new r("este",-1,1),new r("iste",-1,1),new r("ei",-1,1),new r("arei",16,1),new r("erei",16,1),new r("irei",16,1),new r("am",-1,1),new r("iam",20,1),new r("ariam",21,1),new r("eriam",21,1),new r("iriam",21,1),new r("aram",20,1),new r("eram",20,1),new r("iram",20,1),new r("avam",20,1),new r("em",-1,1),new r("arem",29,1),new r("erem",29,1),new r("irem",29,1),new r("assem",29,1),new r("essem",29,1),new r("issem",29,1),new r("ado",-1,1),new r("ido",-1,1),new r("ando",-1,1),new r("endo",-1,1),new r("indo",-1,1),new r("ara~o",-1,1),new r("era~o",-1,1),new r("ira~o",-1,1),new r("ar",-1,1),new r("er",-1,1),new r("ir",-1,1),new r("as",-1,1),new r("adas",47,1),new r("idas",47,1),new r("ias",47,1),new r("arias",50,1),new r("erias",50,1),new r("irias",50,1),new r("aras",47,1),new r("eras",47,1),new r("iras",47,1),new r("avas",47,1),new r("es",-1,1),new r("ardes",58,1),new r("erdes",58,1),new r("irdes",58,1),new r("ares",58,1),new r("eres",58,1),new r("ires",58,1),new r("asses",58,1),new r("esses",58,1),new r("isses",58,1),new r("astes",58,1),new r("estes",58,1),new r("istes",58,1),new r("is",-1,1),new r("ais",71,1),new r("eis",71,1),new r("areis",73,1),new r("ereis",73,1),new r("ireis",73,1),new r("áreis",73,1),new r("éreis",73,1),new r("íreis",73,1),new r("ásseis",73,1),new r("ésseis",73,1),new r("ísseis",73,1),new r("áveis",73,1),new r("íeis",73,1),new r("aríeis",84,1),new r("eríeis",84,1),new r("iríeis",84,1),new r("ados",-1,1),new r("idos",-1,1),new r("amos",-1,1),new r("áramos",90,1),new r("éramos",90,1),new r("íramos",90,1),new r("ávamos",90,1),new r("íamos",90,1),new r("aríamos",95,1),new r("eríamos",95,1),new r("iríamos",95,1),new r("emos",-1,1),new r("aremos",99,1),new r("eremos",99,1),new r("iremos",99,1),new r("ássemos",99,1),new r("êssemos",99,1),new r("íssemos",99,1),new r("imos",-1,1),new r("armos",-1,1),new r("ermos",-1,1),new r("irmos",-1,1),new r("ámos",-1,1),new r("arás",-1,1),new r("erás",-1,1),new r("irás",-1,1),new r("eu",-1,1),new r("iu",-1,1),new r("ou",-1,1),new r("ará",-1,1),new r("erá",-1,1),new r("irá",-1,1)],W=[new r("a",-1,1),new r("i",-1,1),new r("o",-1,1),new r("os",-1,1),new r("á",-1,1),new r("í",-1,1),new r("ó",-1,1)],L=[new r("e",-1,1),new r("ç",-1,2),new r("é",-1,1),new r("ê",-1,1)],y=[17,65,16,0,0,0,0,0,0,0,0,0,0,0,0,0,3,19,12,2],z=new s;this.setCurrent=function(e){z.setCurrent(e)},this.getCurrent=function(){return z.getCurrent()},this.stem=function(){var r=z.cursor;return e(),z.cursor=r,a(),z.limit_backward=r,z.cursor=z.limit,_(),z.cursor=z.limit,p(),z.cursor=z.limit_backward,u(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return n.setCurrent(e),n.stem(),n.getCurrent()}):(n.setCurrent(e),n.stem(),n.getCurrent())}}(),e.Pipeline.registerFunction(e.pt.stemmer,"stemmer-pt"),e.pt.stopWordFilter=e.generateStopWordFilter("a ao aos aquela aquelas aquele aqueles aquilo as até com como da das de dela delas dele deles depois do dos e ela elas ele eles em entre era eram essa essas esse esses esta estamos estas estava estavam este esteja estejam estejamos estes esteve estive estivemos estiver estivera estiveram estiverem estivermos estivesse estivessem estivéramos estivéssemos estou está estávamos estão eu foi fomos for fora foram forem formos fosse fossem fui fôramos fôssemos haja hajam hajamos havemos hei houve houvemos houver houvera houveram houverei houverem houveremos houveria houveriam houvermos houverá houverão houveríamos houvesse houvessem houvéramos houvéssemos há hão isso isto já lhe lhes mais mas me mesmo meu meus minha minhas muito na nas nem no nos nossa nossas nosso nossos num numa não nós o os ou para pela pelas pelo pelos por qual quando que quem se seja sejam sejamos sem serei seremos seria seriam será serão seríamos seu seus somos sou sua suas são só também te tem temos tenha tenham tenhamos tenho terei teremos teria teriam terá terão teríamos teu teus teve tinha tinham tive tivemos tiver tivera tiveram tiverem tivermos tivesse tivessem tivéramos tivéssemos tu tua tuas tém tínhamos um uma você vocês vos à às éramos".split(" ")),e.Pipeline.registerFunction(e.pt.stopWordFilter,"stopWordFilter-pt")}});
\ No newline at end of file
diff --git a/assets/javascripts/lunr/min/lunr.ro.min.js b/assets/javascripts/lunr/min/lunr.ro.min.js
new file mode 100644
index 00000000..72771401
--- /dev/null
+++ b/assets/javascripts/lunr/min/lunr.ro.min.js
@@ -0,0 +1,18 @@
+/*!
+ * Lunr languages, `Romanian` language
+ * https://github.com/MihaiValentin/lunr-languages
+ *
+ * Copyright 2014, Mihai Valentin
+ * http://www.mozilla.org/MPL/
+ */
+/*!
+ * based on
+ * Snowball JavaScript Library v0.3
+ * http://code.google.com/p/urim/
+ * http://snowball.tartarus.org/
+ *
+ * Copyright 2010, Oleg Mazko
+ * http://www.mozilla.org/MPL/
+ */
+
+!function(e,i){"function"==typeof define&&define.amd?define(i):"object"==typeof exports?module.exports=i():i()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.ro=function(){this.pipeline.reset(),this.pipeline.add(e.ro.trimmer,e.ro.stopWordFilter,e.ro.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.ro.stemmer))},e.ro.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.ro.trimmer=e.trimmerSupport.generateTrimmer(e.ro.wordCharacters),e.Pipeline.registerFunction(e.ro.trimmer,"trimmer-ro"),e.ro.stemmer=function(){var i=e.stemmerSupport.Among,r=e.stemmerSupport.SnowballProgram,n=new function(){function e(e,i){L.eq_s(1,e)&&(L.ket=L.cursor,L.in_grouping(W,97,259)&&L.slice_from(i))}function n(){for(var i,r;;){if(i=L.cursor,L.in_grouping(W,97,259)&&(r=L.cursor,L.bra=r,e("u","U"),L.cursor=r,e("i","I")),L.cursor=i,L.cursor>=L.limit)break;L.cursor++}}function t(){if(L.out_grouping(W,97,259)){for(;!L.in_grouping(W,97,259);){if(L.cursor>=L.limit)return!0;L.cursor++}return!1}return!0}function a(){if(L.in_grouping(W,97,259))for(;!L.out_grouping(W,97,259);){if(L.cursor>=L.limit)return!0;L.cursor++}return!1}function o(){var e,i,r=L.cursor;if(L.in_grouping(W,97,259)){if(e=L.cursor,!t())return void(h=L.cursor);if(L.cursor=e,!a())return void(h=L.cursor)}L.cursor=r,L.out_grouping(W,97,259)&&(i=L.cursor,t()&&(L.cursor=i,L.in_grouping(W,97,259)&&L.cursor=e;r--){var n=this.uncheckedNodes[r],i=n.child.toString();i in this.minimizedNodes?n.parent.edges[n.char]=this.minimizedNodes[i]:(n.child._str=i,this.minimizedNodes[i]=n.child),this.uncheckedNodes.pop()}};t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(r){var n=new t.QueryParser(e,r);n.parse()})},t.Index.prototype.query=function(e){for(var r=new t.Query(this.fields),n=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),u=0;u
Changelog¤
1.10.1 - 2024-05-14¤
Build¤
once
when logging messages (2bc156b by Timothée Mazzucotelli).Code Refactoring¤
*.html
top-level templates to extend the *.html.jinja
base templates (a8c540e by Timothée Mazzucotelli). Issue-151*.html
base templates to extend their *.html.jinja
counterpart, while overriding the logs
block to issue a logging message (info) stating that extending *.html
templates is deprecated (e6f1b9c by Timothée Mazzucotelli). Issue-151*.html.jinja
top-level (overridable) templates, extending their base counterpart (7c14924 by Timothée Mazzucotelli). Issue-151*.html.jinja
base templates, which are copies of *.html
templates, with an additional logs
block, and using the updated get_template
filter (eced9a5 by Timothée Mazzucotelli). Issue-151get_template
filter to support both *.html
and *.html.jinja
templates, logging a message (info) when *.html
templates are overridden by users (3546fd7 by Timothée Mazzucotelli). Issue-1511.10.0 - 2024-04-19¤
Features¤
doc-section-title
and doc-section-item
in docstring sections (d6e1d68 by Timothée Mazzucotelli). Issue-17Bug Fixes¤
1.9.2 - 2024-04-02¤
Dependencies¤
1.9.1 - 2024-04-02¤
Bug Fixes¤
Code Refactoring¤
1.9.0 - 2024-03-13¤
Dependencies¤
Features¤
show_labels
option to show/hide labels (eaf9b82 by Viicos). Issue #120, PR #130Code Refactoring¤
1.8.0 - 2024-01-08¤
Features¤
griffe-inherited-docstrings
, a Griffe extension for inheriting docstringsgriffe2md
, a tool to output API docs to Markdown using Griffe1.7.5 - 2023-11-21¤
Bug Fixes¤
1.7.4 - 2023-11-12¤
Bug Fixes¤
Code Refactoring¤
1.7.3 - 2023-10-09¤
Bug Fixes¤
1.7.2 - 2023-10-05¤
Bug Fixes¤
Code Refactoring¤
1.7.1 - 2023-09-28¤
Bug Fixes¤
Code Refactoring¤
__init__
methods when merging docstrings (b97d51f by Timothée Mazzucotelli). Issue #1061.7.0 - 2023-09-14¤
Features¤
Annotated
types (53db04b by Timothée Mazzucotelli).1.6.3 - 2023-09-11¤
Bug Fixes¤
load_external_modules
a global-only option (266f41f by Timothée Mazzucotelli). Issue #87Code Refactoring¤
1.6.2 - 2023-09-05¤
Bug Fixes¤
1.6.1 - 2023-09-04¤
Bug Fixes¤
1.6.0 - 2023-08-27¤
Features¤
doc-signature
CSS class to separate signature code blocks (b6c648f by Timothée Mazzucotelli).Code Refactoring¤
format_attribute
filter, preparing for cross-refs in attribute signatures (8f0ade2 by Timothée Mazzucotelli).1.5.2 - 2023-08-25¤
Bug Fixes¤
Code Refactoring¤
1.5.1 - 2023-08-24¤
Code Refactoring¤
1.5.0 - 2023-08-20¤
Features¤
1.4.0 - 2023-08-18¤
Features¤
Code Refactoring¤
crossref
and multi_crossref
filters (4fe3d20 by Timothée Mazzucotelli).1.3.0 - 2023-08-06¤
Dependencies¤
Features¤
1.2.1 - 2023-07-20¤
Bug Fixes¤
1.2.0 - 2023-07-14¤
Features¤
Bug Fixes¤
None
as return annotation of class signatures (3d8724e by Timothée Mazzucotelli). Issue #851.1.2 - 2023-06-04¤
Code Refactoring¤
1.1.1 - 2023-06-04¤
Bug Fixes¤
Code Refactoring¤
1.1.0 - 2023-05-25¤
Features¤
1.0.0 - 2023-05-11¤
Breaking changes¤
format_signature
filter has changed. If you override templates in your project to customize the output, make sure to update the following templates so that they use the new filter signature:
class.html
expression.html
function.html
signature.html
Bug Fixes¤
0.10.1 - 2023-05-07¤
Bug Fixes¤
0.10.0 - 2023-05-07¤
Features¤
Bug Fixes¤
Code Refactoring¤
0.9.0 - 2023-04-03¤
Features¤
Bug Fixes¤
Code Refactoring¤
0.8.3 - 2023-01-04¤
Code Refactoring¤
0.8.2 - 2022-11-19¤
Bug Fixes¤
0.8.1 - 2022-11-19¤
Bug Fixes¤
0.8.0 - 2022-11-13¤
Features¤
Code Refactoring¤
0.7.1 - 2022-06-12¤
Bug Fixes¤
0.7.0 - 2022-05-28¤
Packaging / Dependencies¤
Features¤
Bug Fixes¤
Code Refactoring¤
show_submodules
by default (480d0c3 by Timothée Mazzucotelli).show_root_full_path
for ToC entries (hidden headings) (8f4c853 by Timothée Mazzucotelli).0.6.6 - 2022-03-06¤
Code Refactoring¤
self
and cls
parameters (7f579d1 by Timothée Mazzucotelli). Issue #7pycon
for examples code blocks (6545900 by Timothée Mazzucotelli).0.6.5 - 2022-02-24¤
Bug Fixes¤
0.6.4 - 2022-02-22¤
Bug Fixes¤
0.6.3 - 2022-02-20¤
Bug Fixes¤
0.6.2 - 2022-02-17¤
Bug Fixes¤
0.6.1 - 2022-02-17¤
Bug Fixes¤
0.6.0 - 2022-02-13¤
Features¤
__init__
methods' docstrings into their classes' docstrings (1b4d1c0 by Timothée Mazzucotelli).Bug Fixes¤
Code Refactoring¤
0.5.4 - 2022-02-13¤
Bug Fixes¤
0.5.3 - 2022-02-08¤
Bug Fixes¤
0.5.2 - 2022-02-05¤
Dependencies¤
0.5.1 - 2022-02-03¤
Dependencies¤
Code Refactoring¤
0.5.0 - 2022-02-03¤
Features¤
Bug Fixes¤
docstring_section_style
option (774988e by Timothée Mazzucotelli).Code Refactoring¤
0.4.1 - 2022-02-01¤
Bug Fixes¤
0.4.0 - 2022-02-01¤
Code Refactoring¤
mkdocstrings_handlers
namespace (23c9023 by Timothée Mazzucotelli).0.3.0 - 2022-01-14¤
Features¤
Dependencies¤
Code Refactoring¤
0.2.0 - 2021-12-28¤
Dependencies¤
Features¤
show_signature
rendering option (0f07c2e by Will Da Silva).Bug Fixes¤
0.1.0 - 2021-12-19¤
Features¤
Bug Fixes¤
Code Refactoring¤
Contributor Covenant Code of Conduct¤
Our Pledge¤
Our Standards¤
Enforcement Responsibilities¤
Scope¤
Enforcement¤
Enforcement Guidelines¤
1. Correction¤
2. Warning¤
3. Temporary Ban¤
4. Permanent Ban¤
Attribution¤
Contributing¤
Environment setup¤
cd python
+make setup
+
python3 -m pip install --user pipx
+pipx install uv
+
make setup
again, or simply uv install
.make help
to see all the available actions!Tasks¤
make run duty TASK
.make
will work the same with the virtualenv activated or not.Development¤
git switch -c feature-or-bugfix-name
make format
to auto-format the codemake check
to check everything (fix any warning)make test
to run the tests (fix any issue)
make docs
Commit message convention¤
<type>[(scope)]: Subject
+
+[Body]
+
build
: About packaging, building wheels, etc.chore
: About packaging or repo/files management.ci
: About Continuous Integration.deps
: Dependencies update.docs
: About documentation.feat
: New feature.fix
: Bug fix.perf
: About performance.refactor
: Changes that are not features or bug fixes.style
: A change in code style/format.tests
: About tests.Body.
+
+Issue #10: https://github.com/namespace/project/issues/10
+Related to PR namespace/other-project#15: https://github.com/namespace/other-project/pull/15
+
:
. We expect a full URI for each trailer, not just GitHub autolinks (for example, full GitHub URLs for commits and issues, not the hash or the #issue-number).Pull requests guidelines¤
# SHA is the SHA of the commit you want to fix
+git commit --fixup=SHA
+
git rebase -i --autosquash main
+
git push -f
+
Credits¤
Runtime dependencies¤
Project Summary Version (accepted) Version (last resolved) License Jinja2 A very fast and expressive template engine. >=2.11.1
3.1.4
BSD License Markdown Python implementation of John Gruber's Markdown. >=3.3.6, >=3.3
3.6
BSD License MarkupSafe Safely add untrusted strings to HTML/XML markup. >=2.0.1, >=1.1
2.1.5
BSD-3-Clause PyYAML YAML parser and emitter for Python >=5.1
6.0.1
MIT click Composable command line interface toolkit >=7.0
8.1.7
BSD-3-Clause colorama Cross-platform colored terminal text. >=0.4
0.4.6
BSD License editables Editable installations 0.5
MIT License ghp-import Copy your docs directly to the gh-pages branch. >=1.0
2.1.0
Apache Software License griffe Signatures for entire Python programs. Extract the structure, the frame, the skeleton of your project, to generate API documentation or find breaking changes in your API. >=0.44
0.45.0
ISC importlib_metadata Read metadata from Python packages >=4.6, >=4.4
7.1.0
Apache Software License mergedeep A deep merge function for 🐍. >=1.3.4
1.3.4
MIT License mkdocs Project documentation with Markdown. >=1.5, >=1.4
1.6.0
BSD-2-Clause mkdocs-autorefs Automatically link across pages in MkDocs. >=0.3.1
1.0.2.dev2+gfe3c22f
ISC mkdocs-get-deps MkDocs extension that lists all dependencies according to a mkdocs.yml file >=0.2.0
0.2.0
MIT mkdocstrings Automatic documentation from sources, for MkDocs. >=0.25, >=0.23
0.25.2.dev1+g59715db
ISC packaging Core utilities for Python packages >=20.5
24.0
Apache Software License + BSD License pathspec Utility library for gitignore style pattern matching of file paths. >=0.11.1
0.12.1
Mozilla Public License 2.0 (MPL 2.0) platformdirs A small Python package for determining appropriate platform-specific dirs, e.g. a user data dir
.>=2.2.0
4.2.1
MIT pymdown-extensions Extension pack for Python Markdown. ~=10.2, >=6.3
10.8.1
MIT python-dateutil Extensions to the standard Python datetime module >=2.8.1
2.9.0.post0
BSD License + Apache Software License pyyaml_env_tag A custom YAML tag for referencing environment variables in YAML files. >=0.1
0.1
MIT License six Python 2 and 3 compatibility utilities >=1.5
1.16.0
MIT typing_extensions Backported and Experimental Type Hints for Python 3.8+ >=4.1, >=3.6.4
4.11.0
Python Software Foundation License watchdog Filesystem events monitoring >=2.0
4.0.0
Apache-2.0 zipp Backport of pathlib-compatible object wrapper for zip files >=0.5
3.18.1
MIT License Development dependencies¤
Project Summary Version (accepted) Version (last resolved) License Babel Internationalization utilities ~=2.10
2.15.0
BSD-3-Clause GitPython GitPython is a Python library used to interact with Git repositories 3.1.43
BSD-3-Clause Jinja2 A very fast and expressive template engine. >=2.11.1
3.1.4
BSD License Markdown Python implementation of John Gruber's Markdown. >=3.3.6, >=3.3
3.6
BSD License MarkupSafe Safely add untrusted strings to HTML/XML markup. >=2.0.1, >=1.1
2.1.5
BSD-3-Clause PyYAML YAML parser and emitter for Python >=5.1
6.0.1
MIT Pygments Pygments is a syntax highlighting package written in Python. ~=2.16
2.18.0
BSD-2-Clause SecretStorage Python bindings to FreeDesktop.org Secret Service API >=3.2
3.3.3
BSD 3-Clause License ansimarkup Produce colored terminal text with an xml-like markup ~=1.4
1.5.0
Revised BSD License appdirs A small Python module for determining appropriate platform-specific dirs, e.g. a "user data dir". >=1.4
1.4.4
MIT black The uncompromising code formatter. >=23.9
24.4.2
MIT blacken-docs Run Black on Python code blocks in documentation files. >=1.16
1.16.0
MIT build A simple, correct Python build frontend >=1.0
1.2.1
MIT License certifi Python package for providing Mozilla's CA Bundle. >=2017.4.17
2024.2.2
MPL-2.0 cffi Foreign Function Interface for Python calling C code. >=1.12
1.16.0
MIT charset-normalizer The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet. >=2, <4
3.3.2
MIT click Composable command line interface toolkit >=7.0
8.1.7
BSD-3-Clause colorama Cross-platform colored terminal text. >=0.4
0.4.6
BSD License coverage Code coverage measurement for Python >=5.2.1
7.5.1
Apache-2.0 cryptography cryptography is a package which provides cryptographic recipes and primitives to Python developers. >=2.0
42.0.7
Apache-2.0 OR BSD-3-Clause csscompressor A python port of YUI CSS Compressor >=0.9.5
0.9.5
BSD docutils Docutils -- Python Documentation Utilities >=0.13.1
0.21.2
Public Domain + Python Software Foundation License + BSD License + GNU General Public License (GPL) dparse A parser for Python dependency files >=0.6.2
0.6.3
MIT license duty A simple task runner. >=0.10
1.3.0
ISC editables Editable installations 0.5
MIT License execnet execnet: rapid multi-Python deployment >=2.1
2.1.1
MIT failprint Run a command, print its output only if it fails. >=0.11, !=1.0.0
1.0.2
ISC ghp-import Copy your docs directly to the gh-pages branch. >=1.0
2.1.0
Apache Software License git-changelog Automatic Changelog generator using Jinja2 templates. >=2.3
2.5.2
ISC gitdb Git Object Database >=4.0.1, <5
4.0.11
BSD License htmlmin2 An HTML Minifier >=0.1.13
0.1.13
BSD idna Internationalized Domain Names in Applications (IDNA) >=2.5, <4
3.7
BSD License importlib_metadata Read metadata from Python packages >=4.6, >=4.4
7.1.0
Apache Software License iniconfig brain-dead simple config-ini parsing 2.0.0
MIT jaraco.classes Utility functions for Python class constructs 3.4.0
MIT License jaraco.context Useful decorators and context managers 5.3.0
MIT License jaraco.functools Functools like those found in stdlib 4.0.1
MIT License jeepney Low-level, pure Python DBus protocol wrapper. >=0.4.2
0.8.0
MIT License jsmin JavaScript minifier. >=3.0.1
3.0.1
MIT License keyring Store and access your passwords safely. >=15.1
25.2.1
MIT License markdown-callouts Markdown extension: a classier syntax for admonitions >=0.3
0.4.0
MIT markdown-exec Utilities to execute code blocks in Markdown files. >=1.7
1.7.0.1.0.1
ISC markdown-it-py Python port of markdown-it. Markdown parsing, done right! >=2.2.0
3.0.0
MIT License mdurl Markdown URL utilities ~=0.1
0.1.2
MIT License mergedeep A deep merge function for 🐍. >=1.3.4
1.3.4
MIT License mkdocs Project documentation with Markdown. >=1.5, >=1.4
1.6.0
BSD-2-Clause mkdocs-autorefs Automatically link across pages in MkDocs. >=0.3.1
1.0.2.dev2+gfe3c22f
ISC mkdocs-coverage MkDocs plugin to integrate your coverage HTML report into your site. >=1.0
1.0.0
ISC mkdocs-gen-files MkDocs plugin to programmatically generate documentation pages during the build >=0.5
0.5.0
MIT mkdocs-get-deps MkDocs extension that lists all dependencies according to a mkdocs.yml file >=0.2.0
0.2.0
MIT mkdocs-git-committers-plugin-2 An MkDocs plugin to create a list of contributors on the page. The git-committers plugin will seed the template context with a list of GitHub or GitLab committers and other useful GIT info such as last modified date >=1.2
2.3.0
MIT mkdocs-literate-nav MkDocs plugin to specify the navigation in Markdown instead of YAML >=0.6
0.6.1
MIT mkdocs-material Documentation that simply works >=9.4
9.5.21+insiders.4.53.8
MIT mkdocs-material-extensions Extension pack for Python Markdown and MkDocs Material. ~=1.3
1.3.1
MIT mkdocs-minify-plugin An MkDocs plugin to minify HTML, JS or CSS files prior to being written to disk >=0.7
0.8.0
MIT mkdocstrings Automatic documentation from sources, for MkDocs. >=0.25, >=0.23
0.25.2.dev1+g59715db
ISC more-itertools More routines for operating on iterables, beyond itertools 10.2.0
MIT License mypy Optional static typing for Python >=1.5
1.10.0
MIT mypy-extensions Type system extensions for programs checked with the mypy type checker. >=1.0.0
1.0.0
MIT License nh3 Python bindings to the ammonia HTML sanitization library. >=0.2.14
0.2.17
MIT packaging Core utilities for Python packages >=20.5
24.0
Apache Software License + BSD License paginate Divides large result sets into pages for easier browsing ~=0.5
0.5.6
MIT pathspec Utility library for gitignore style pattern matching of file paths. >=0.11.1
0.12.1
Mozilla Public License 2.0 (MPL 2.0) pkginfo Query metadata from sdists / bdists / installed packages. >=1.8.1
1.10.0
MIT platformdirs A small Python package for determining appropriate platform-specific dirs, e.g. a user data dir
.>=2.2.0
4.2.1
MIT pluggy plugin and hook calling mechanisms for python >=1.5, <2.0
1.5.0
MIT ptyprocess Run a subprocess in a pseudo terminal ~=0.6
0.7.0
ISC License (ISCL) pycparser C parser in Python 2.22
BSD-3-Clause pymdown-extensions Extension pack for Python Markdown. ~=10.2, >=6.3
10.8.1
MIT pyproject_hooks Wrappers to call pyproject.toml-based build backend hooks. 1.1.0
MIT License pytest pytest: simple powerful testing with Python >=7.4
8.2.0
MIT pytest-cov Pytest plugin for measuring coverage. >=4.1
5.0.0
MIT pytest-randomly Pytest plugin to randomly order tests and control random.seed. >=3.15
3.15.0
MIT pytest-xdist pytest xdist plugin for distributed testing, most importantly across multiple CPUs >=3.3
3.6.1
MIT License python-dateutil Extensions to the standard Python datetime module >=2.8.1
2.9.0.post0
BSD License + Apache Software License pyyaml_env_tag A custom YAML tag for referencing environment variables in YAML files. >=0.1
0.1
MIT License readme_renderer readme_renderer is a library for rendering readme descriptions for Warehouse >=35.0
43.0
Apache License, Version 2.0 regex Alternative regular expression module, to replace re. >=2022.4
2024.5.10
Apache Software License requests Python HTTP for Humans. ~=2.26
2.31.0
Apache 2.0 requests-toolbelt A utility belt for advanced users of python-requests >=0.8.0, !=0.9.0
1.0.0
Apache 2.0 rfc3986 Validating URI References per RFC 3986 >=1.4.0
2.0.0
Apache 2.0 rich Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal >=12.0.0
13.7.1
MIT ruamel.yaml ruamel.yaml is a YAML parser/emitter that supports roundtrip preservation of comments, seq/map flow style, and map key order >=0.17.21
0.18.6
MIT license ruamel.yaml.clib C version of reader, parser and emitter for ruamel.yaml derived from libyaml >=0.2.7
0.2.8
MIT ruff An extremely fast Python linter and code formatter, written in Rust. >=0.0
0.4.4
MIT safety Checks installed dependencies for known vulnerabilities and licenses. >=2.3
2.3.4
MIT license semver Python helper for Semantic Versioning (https://semver.org) >=2.13
3.0.2
BSD setuptools Easily download, build, install, upgrade, and uninstall Python packages >=19.3
69.5.1
MIT License six Python 2 and 3 compatibility utilities >=1.5
1.16.0
MIT smmap A pure Python implementation of a sliding window memory map manager >=3.0.1, <6
5.0.1
BSD twine Collection of utilities for publishing packages on PyPI >=5.0
5.0.0
Apache Software License types-Markdown Typing stubs for Markdown >=3.5
3.6.0.20240316
Apache-2.0 license types-PyYAML Typing stubs for PyYAML >=6.0
6.0.12.20240311
Apache-2.0 license typing_extensions Backported and Experimental Type Hints for Python 3.8+ >=4.1, >=3.6.4
4.11.0
Python Software Foundation License urllib3 HTTP library with thread-safe connection pooling, file post, and more. >=1.26.0
2.2.1
MIT License watchdog Filesystem events monitoring >=2.0
4.0.0
Apache-2.0 zipp Backport of pathlib-compatible object wrapper for zip files >=0.5
3.18.1
MIT License
mkdocstrings-python
Installation¤
# PEP 621 dependencies declaration
+# adapt to your dependencies manager
+[project]
+dependencies = [
+ "mkdocstrings[python]>=0.18",
+]
+
# PEP 621 dependencies declaration
+# adapt to your dependencies manager
+[project]
+dependencies = [
+ "mkdocstrings-python",
+]
+
Preview¤
Features¤
__init__
methods.Note:
or Warning:
will be transformed to their admonition equivalent. We do not support nested admonitions in docstrings![this object][package.module.object]
or directly with [package.module.object][]
Changelog¤
mkdocstrings-python Insiders¤
1.8.2 May 09, 2024¤
1.8.1 April 19, 2024¤
1.8.0 March 24, 2024¤
1.7.0 March 24, 2024¤
1.6.0 January 30, 2024¤
parameter_headings
option to render headings for parameters (enabling permalinks and ToC/inventory entries).1.5.1 September 12, 2023¤
1.5.0 September 05, 2023¤
1.4.0 August 27, 2023¤
1.3.0 August 24, 2023¤
1.2.0 August 20, 2023¤
1.1.4 July 17, 2023¤
1.1.3 July 17, 2023¤
1.1.2 July 15, 2023¤
1.1.1 June 27, 2023¤
1.1.0 June 4, 2023¤
1.0.0 May 10, 2023¤
format_signature
filter has changed. The templates that must be updated: class.html
, expression.html
, function.html
and signature.html
.
Insiders¤
What is Insiders?¤
What sponsorships achieve¤
What's in it for me?¤
@warnings.deprecated
(PEP 702)How to become a sponsor¤
Funding ¤
Goals¤
$ 1,000 — GraviFridge Fluid Renewal¤
@warnings.deprecated
(PEP 702)$ 1,500 — HyperLamp Navigation Tips¤
$ 2,000 — FusionDrive Ejection Configuration¤
See the features in this goal for all Insiders projects.Goals completed¤
$ 500 — PlasmaVac User Guide¤
Frequently asked questions¤
Compatibility¤
Payment¤
Terms¤
Getting started with Insiders¤
pip
or git
. Note that in order to access the Insiders repository, you need to become an eligible sponsor of @pawamoy on GitHub.Installation¤
with PyPI Insiders¤
with pip (ssh/https)¤
pip
using SSH:pip install git+ssh://git@github.com/pawamoy-insiders/mkdocstrings-python.git
+
pip install git+https://${GH_TOKEN}@github.com/pawamoy-insiders/mkdocstrings-python.git
+
How to get a GitHub personal access token
GH_TOKEN
environment variable is a GitHub token. It can be obtained by creating a personal access token for your GitHub account. It will give you access to the Insiders repository, programmatically, from the command line or GitHub Actions workflows:
repo
scopewith pip (self-hosted)¤
# download distributions in ~/dists, then upload with:
+twine upload --repository-url https://your-private-index.com ~/dists/*
+
pip config set global.extra-index-url https://your-private-index.com/simple
+
Full example with
pypiserver
pip install --user pypiserver
+# or pipx install pypiserver
+
+# create a packages directory
+mkdir -p ~/.local/pypiserver/packages
+
+# run the pypi server without authentication
+pypi-server run -p 8080 -a . -P . ~/.local/pypiserver/packages &
+
~/.pypirc
:[distutils]
+index-servers =
+ local
+
+[local]
+repository: http://localhost:8080
+username:
+password:
+
# clone the repository
+git clone git@github.com:pawamoy-insiders/mkdocstrings-python
+cd mkdocstrings-python
+
+# install build
+pip install --user build
+# or pipx install build
+
+# checkout latest tag
+git checkout $(git describe --tags --abbrev=0)
+
+# build the distributions
+pyproject-build
+
+# upload them to our local server
+twine upload -r local dist/* --skip-existing
+
pip config set global.extra-index-url http://localhost:8080/simple
+pdm config pypi.extra.url http://localhost:8080/simple
+
pip install mkdocstrings-python
, or resolving dependencies with PDM, both tools will look into our local index and find the Insiders version. Remember to update your local index regularly!with git¤
git
:git clone git@github.com:pawamoy-insiders/mkdocstrings-python
+
git
, the package must be installed:pip install -e mkdocstrings-python
+
Upgrading¤
8.x.x.4.x.x
means that Insiders 4.x.x
is currently based on 8.x.x
.
+
+ `
+ });
+ html += '
+
+ `;
+ });
+ if (privateSponsors > 0) {
+ sponsorsElem.innerHTML += `
+
+ +${privateSponsors}
+
+ `;
+ }
+ });
+ });
+ updatePremiumSponsors(dataURL, "gold");
+ updatePremiumSponsors(dataURL, "silver");
+ updatePremiumSponsors(dataURL, "bronze");
+}
diff --git a/license/index.html b/license/index.html
new file mode 100644
index 00000000..84b1fa97
--- /dev/null
+++ b/license/index.html
@@ -0,0 +1,16 @@
+
License¤
ISC License
+
+Copyright (c) 2021, Timothée Mazzucotelli
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
debug ¤
Environment
– Package
– Variable
–
get_debug_info
– get_version
– print_debug_info
–
Environment
dataclass
¤Environment(
+ interpreter_name: str,
+ interpreter_version: str,
+ interpreter_path: str,
+ platform: str,
+ packages: list[Package],
+ variables: list[Variable],
+)
+
interpreter_name
(str
) – interpreter_path
(str
) – interpreter_version
(str
) – packages
(list[Package]
) – platform
(str
) – variables
(list[Variable]
) –
Package
dataclass
¤
Variable
dataclass
¤
get_debug_info ¤
get_debug_info() -> Environment
+
get_version ¤
handler ¤
PythonHandler
–
get_handler
– PythonHandler
.
PythonHandler ¤
PythonHandler(
+ *args: Any,
+ config_file_path: str | None = None,
+ paths: list[str] | None = None,
+ locale: str = "en",
+ load_external_modules: bool = False,
+ **kwargs: Any,
+)
+
+ flowchart TD
+ mkdocstrings_handlers.python.handler.PythonHandler[PythonHandler]
+ mkdocstrings.handlers.base.BaseHandler[BaseHandler]
+
+ mkdocstrings.handlers.base.BaseHandler --> mkdocstrings_handlers.python.handler.PythonHandler
+
+
+
+ click mkdocstrings_handlers.python.handler.PythonHandler href "" "mkdocstrings_handlers.python.handler.PythonHandler"
+ click mkdocstrings.handlers.base.BaseHandler href "" "mkdocstrings.handlers.base.BaseHandler"
+
(*args
¤Any
, default: ()
) –
(config_file_path
¤str | None
, default: None
) –
(paths
¤list[str] | None
, default: None
) –
(locale
¤str
, default: 'en'
) –
(load_external_modules
¤bool
, default: False
) –
(**kwargs
¤Any
, default: {}
) –
do_convert_markdown
– do_heading
– get_extended_templates_dirs
– get_headings
– get_templates_dir
– load_inventory
– in_file
.normalize_extension_paths
– teardown
– update_env
–
default_config
(dict
) – domain
(str
) – enable_inventory
(bool
) – objects.inv
Sphinx inventory file.extra_css
– fallback_config
(dict
) – fallback_theme
– name
–
default_config
class-attribute
¤default_config: dict = {
+ "find_stubs_package": False,
+ "docstring_style": "google",
+ "docstring_options": {},
+ "show_symbol_type_heading": False,
+ "show_symbol_type_toc": False,
+ "show_root_heading": False,
+ "show_root_toc_entry": True,
+ "show_root_full_path": True,
+ "show_root_members_full_path": False,
+ "show_object_full_path": False,
+ "show_category_heading": False,
+ "show_if_no_docstring": False,
+ "show_signature": True,
+ "show_signature_annotations": False,
+ "signature_crossrefs": False,
+ "separate_signature": False,
+ "line_length": 60,
+ "merge_init_into_class": False,
+ "show_docstring_attributes": True,
+ "show_docstring_functions": True,
+ "show_docstring_classes": True,
+ "show_docstring_modules": True,
+ "show_docstring_description": True,
+ "show_docstring_examples": True,
+ "show_docstring_other_parameters": True,
+ "show_docstring_parameters": True,
+ "show_docstring_raises": True,
+ "show_docstring_receives": True,
+ "show_docstring_returns": True,
+ "show_docstring_warns": True,
+ "show_docstring_yields": True,
+ "show_source": True,
+ "show_bases": True,
+ "show_inheritance_diagram": False,
+ "show_submodules": False,
+ "group_by_category": True,
+ "heading_level": 2,
+ "members_order": alphabetical.value,
+ "docstring_section_style": "table",
+ "members": None,
+ "inherited_members": False,
+ "filters": ["!^_[^_]"],
+ "annotations_path": "brief",
+ "preload_modules": None,
+ "allow_inspection": True,
+ "summary": False,
+ "show_labels": True,
+ "unwrap_annotated": False,
+ "parameter_headings": False,
+ "modernize_annotations": False,
+}
+
find_stubs_package
(bool
) – False
.allow_inspection
(bool
) – True
.show_bases
(bool
) – True
.show_inheritance_diagram
(bool
) – False
.show_source
(bool
) – True
.preload_modules
(list[str] | None
) – ::: identifier
). It is useful when you want to render documentation for a particular member of an object, and this member is imported from another package than its parent.__all__
attribute of the importing module.None
.
heading_level
(int
) – 2
.parameter_headings
(bool
) – False
.show_root_heading
(bool
) – :::
). Default: False
.show_root_toc_entry
(bool
) – True
.show_root_full_path
(bool
) – True
.show_root_members_full_path
(bool
) – False
.show_object_full_path
(bool
) – False
.show_category_heading
(bool
) – False
.show_symbol_type_heading
(bool
) – False
.show_symbol_type_toc
(bool
) – False
.
inherited_members
(list[str] | bool | None
) – members
. If false or empty list, do not select any inherited member. Default: False
.members
(list[str] | bool | None
) – None
.members_order
(str
) – alphabetical
- order by the members names, source
- order members as they appear in the source file. Default: "alphabetical"
.filters
(list[str] | None
) – !
will exclude matching objects instead of including them. The members
option takes precedence over filters
(filters will still be applied recursively to lower members in the hierarchy). Default: ["!^_[^_]"]
.group_by_category
(bool
) – True
.show_submodules
(bool
) – False
.summary
(bool | dict[str, bool]
) – show_labels
(bool
) – True
.
docstring_style
(str
) – google
, numpy
, sphinx
, or None
. Default: "google"
.docstring_options
(dict
) – griffe.docstrings
.docstring_section_style
(str
) – table
, list
, spacy
. Default: "table"
.merge_init_into_class
(bool
) – __init__
method into the class' signature and docstring. Default: False
.show_if_no_docstring
(bool
) – False
.show_docstring_attributes
(bool
) – True
.show_docstring_functions
(bool
) – True
.show_docstring_classes
(bool
) – True
.show_docstring_modules
(bool
) – True
.show_docstring_description
(bool
) – True
.show_docstring_examples
(bool
) – True
.show_docstring_other_parameters
(bool
) – True
.show_docstring_parameters
(bool
) – True
.show_docstring_raises
(bool
) – True
.show_docstring_receives
(bool
) – True
.show_docstring_returns
(bool
) – True
.show_docstring_warns
(bool
) – True
.show_docstring_yields
(bool
) – True
.
annotations_path
(str
) – brief
(recommended), or source
(as written in the source). Default: "brief"
.line_length
(int
) – 60
.show_signature
(bool
) – True
.show_signature_annotations
(bool
) – False
.signature_crossrefs
(bool
) – False
.separate_signature
(bool
) – False
.unwrap_annotated
(bool
) – Annotated
types to show only the type without the annotations. Default: False
.modernize_annotations
(bool
) – Optional[str]
into str | None
. Default: False
.
domain
class-attribute
instance-attribute
¤domain: str = 'py'
+
enable_inventory
class-attribute
instance-attribute
¤enable_inventory: bool = True
+
objects.inv
Sphinx inventory file.
fallback_config
class-attribute
¤fallback_config: dict = {'fallback': True}
+
fallback_theme
class-attribute
instance-attribute
¤fallback_theme = 'material'
+
do_convert_markdown ¤
do_convert_markdown(
+ text: str,
+ heading_level: int,
+ html_id: str = "",
+ *,
+ strip_paragraph: bool = False,
+ autoref_hook: AutoRefHookInterface | None = None
+) -> Markup
+
(text
¤str
) –
(heading_level
¤int
) –
(html_id
¤str
, default: ''
) –
(strip_paragraph
¤bool
, default: False
) –
Markup
–
do_heading ¤
do_heading(
+ content: Markup,
+ heading_level: int,
+ *,
+ role: str | None = None,
+ hidden: bool = False,
+ toc_label: str | None = None,
+ **attributes: str
+) -> Markup
+
(content
¤Markup
) –
(heading_level
¤int
) – h3
).
(role
¤str | None
, default: None
) –
(hidden
¤bool
, default: False
) –
(toc_label
¤str | None
, default: None
) –
(**attributes
¤str
, default: {}
) –
Markup
–
get_extended_templates_dirs ¤
get_headings ¤
get_templates_dir ¤
ModuleNotFoundError
– FileNotFoundError
–
Path
–
load_inventory
classmethod
¤load_inventory(
+ in_file: BinaryIO,
+ url: str,
+ base_url: str | None = None,
+ domains: list[str] | None = None,
+ **kwargs: Any,
+) -> Iterator[tuple[str, str]]
+
in_file
.load_inventory
"protocol" (see mkdocstrings.plugin
).
(in_file
¤BinaryIO
) –
(url
¤str
) – base_url
).
(base_url
¤str | None
, default: None
) –
(domains
¤list[str] | None
, default: None
) –
(**kwargs
¤Any
, default: {}
) –
str
–
normalize_extension_paths ¤
teardown ¤
teardown() -> None
+
get_handler ¤
get_handler(
+ *,
+ theme: str,
+ custom_templates: str | None = None,
+ config_file_path: str | None = None,
+ paths: list[str] | None = None,
+ locale: str = "en",
+ load_external_modules: bool = False,
+ **config: Any
+) -> PythonHandler
+
PythonHandler
.
(theme
¤str
) –
(custom_templates
¤str | None
, default: None
) –
(config_file_path
¤str | None
, default: None
) –
(paths
¤list[str] | None
, default: None
) –
(locale
¤str
, default: 'en'
) –
(load_external_modules
¤bool
, default: False
) –
(**config
¤Any
, default: {}
) –
PythonHandler
– PythonHandler
.
python ¤
debug
– handler
– rendering
–
get_handler
– PythonHandler
.
get_handler ¤
get_handler(
+ *,
+ theme: str,
+ custom_templates: str | None = None,
+ config_file_path: str | None = None,
+ paths: list[str] | None = None,
+ locale: str = "en",
+ load_external_modules: bool = False,
+ **config: Any
+) -> PythonHandler
+
PythonHandler
.
(theme
¤str
) –
(custom_templates
¤str | None
, default: None
) –
(config_file_path
¤str | None
, default: None
) –
(paths
¤list[str] | None
, default: None
) –
(locale
¤str
, default: 'en'
) –
(load_external_modules
¤bool
, default: False
) –
(**config
¤Any
, default: {}
) –
PythonHandler
– PythonHandler
.
rendering ¤
Order
–
do_as_attributes_section
– do_as_classes_section
– do_as_functions_section
– do_as_modules_section
– do_crossref
– do_filter_objects
– do_format_attribute
– do_format_code
– do_format_signature
– do_get_template
– do_multi_crossref
– do_order_members
– do_split_path
–
Order ¤
+ flowchart TD
+ mkdocstrings_handlers.python.rendering.Order[Order]
+
+
+
+ click mkdocstrings_handlers.python.rendering.Order href "" "mkdocstrings_handlers.python.rendering.Order"
+
alphabetical
– source
–
do_as_attributes_section ¤
do_as_attributes_section(
+ context: Context,
+ attributes: Sequence[Attribute],
+ *,
+ check_public: bool = True
+) -> DocstringSectionAttributes
+
(attributes
¤Sequence[Attribute]
) –
(check_public
¤bool
, default: True
) –
DocstringSectionAttributes
–
do_as_classes_section ¤
do_as_classes_section(
+ context: Context,
+ classes: Sequence[Class],
+ *,
+ check_public: bool = True
+) -> DocstringSectionClasses
+
do_as_functions_section ¤
do_as_functions_section(
+ context: Context,
+ functions: Sequence[Function],
+ *,
+ check_public: bool = True
+) -> DocstringSectionFunctions
+
do_as_modules_section ¤
do_as_modules_section(
+ context: Context,
+ modules: Sequence[Module],
+ *,
+ check_public: bool = True
+) -> DocstringSectionModules
+
do_crossref ¤
do_filter_objects ¤
do_filter_objects(
+ objects_dictionary: dict[str, Object | Alias],
+ *,
+ filters: Sequence[tuple[Pattern, bool]] | None = None,
+ members_list: bool | list[str] | None = None,
+ inherited_members: bool | list[str] = False,
+ keep_no_docstrings: bool = True
+) -> list[Object | Alias]
+
(objects_dictionary
¤dict[str, Object | Alias]
) –
(filters
¤Sequence[tuple[Pattern, bool]] | None
, default: None
) –
(members_list
¤bool | list[str] | None
, default: None
) –
(inherited_members
¤bool | list[str]
, default: False
) –
(keep_no_docstrings
¤bool
, default: True
) –
do_format_attribute ¤
do_format_attribute(
+ context: Context,
+ attribute_path: Markup,
+ attribute: Attribute,
+ line_length: int,
+ *,
+ crossrefs: bool = False
+) -> str
+
(context
¤Context
) –
(attribute_path
¤Markup
) –
(attribute
¤Attribute
) –
(line_length
¤int
) –
(crossrefs
¤bool
, default: False
) –
str
–
do_format_signature ¤
do_format_signature(
+ context: Context,
+ callable_path: Markup,
+ function: Function,
+ line_length: int,
+ *,
+ annotations: bool | None = None,
+ crossrefs: bool = False
+) -> str
+
(context
¤Context
) –
(callable_path
¤Markup
) –
(function
¤Function
) –
(line_length
¤int
) –
(annotations
¤bool | None
, default: None
) –
(crossrefs
¤bool
, default: False
) –
str
–
do_get_template ¤
do_multi_crossref ¤
do_order_members ¤
do_order_members(
+ members: Sequence[Object | Alias],
+ order: Order,
+ members_list: bool | list[str] | None,
+) -> Sequence[Object | Alias]
+
# PEP 621 dependencies declaration\n# adapt to your dependencies manager\n[project]\ndependencies = [\n \"mkdocstrings[python]>=0.18\",\n]\n
"},{"location":"#preview","title":"Preview","text":""},{"location":"#features","title":"Features","text":"# PEP 621 dependencies declaration\n# adapt to your dependencies manager\n[project]\ndependencies = [\n \"mkdocstrings-python\",\n]\n
"},{"location":"changelog/","title":"Changelog","text":"__init__
methods.Note:
or Warning:
will be transformed to their admonition equivalent. We do not support nested admonitions in docstrings![this object][package.module.object]
or directly with [package.module.object][]
"},{"location":"changelog/#code-refactoring","title":"Code Refactoring","text":"once
when logging messages (2bc156b by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#1100-2024-04-19","title":"1.10.0 - 2024-04-19","text":"*.html
top-level templates to extend the *.html.jinja
base templates (a8c540e by Timoth\u00e9e Mazzucotelli). Issue-151*.html
base templates to extend their *.html.jinja
counterpart, while overriding the logs
block to issue a logging message (info) stating that extending *.html
templates is deprecated (e6f1b9c by Timoth\u00e9e Mazzucotelli). Issue-151*.html.jinja
top-level (overridable) templates, extending their base counterpart (7c14924 by Timoth\u00e9e Mazzucotelli). Issue-151*.html.jinja
base templates, which are copies of *.html
templates, with an additional logs
block, and using the updated get_template
filter (eced9a5 by Timoth\u00e9e Mazzucotelli). Issue-151get_template
filter to support both *.html
and *.html.jinja
templates, logging a message (info) when *.html
templates are overridden by users (3546fd7 by Timoth\u00e9e Mazzucotelli). Issue-151
"},{"location":"changelog/#bug-fixes","title":"Bug Fixes","text":"doc-section-title
and doc-section-item
in docstring sections (d6e1d68 by Timoth\u00e9e Mazzucotelli). Issue-17
"},{"location":"changelog/#192-2024-04-02","title":"1.9.2 - 2024-04-02","text":"
"},{"location":"changelog/#191-2024-04-02","title":"1.9.1 - 2024-04-02","text":"
"},{"location":"changelog/#code-refactoring_1","title":"Code Refactoring","text":"
"},{"location":"changelog/#190-2024-03-13","title":"1.9.0 - 2024-03-13","text":"
"},{"location":"changelog/#features_1","title":"Features","text":"
"},{"location":"changelog/#code-refactoring_2","title":"Code Refactoring","text":"show_labels
option to show/hide labels (eaf9b82 by Viicos). Issue #120, PR #130
"},{"location":"changelog/#180-2024-01-08","title":"1.8.0 - 2024-01-08","text":"
"},{"location":"changelog/#175-2023-11-21","title":"1.7.5 - 2023-11-21","text":"
griffe-inherited-docstrings
, a Griffe extension for inheriting docstringsgriffe2md
, a tool to output API docs to Markdown using Griffe
"},{"location":"changelog/#174-2023-11-12","title":"1.7.4 - 2023-11-12","text":"
"},{"location":"changelog/#code-refactoring_3","title":"Code Refactoring","text":"
"},{"location":"changelog/#173-2023-10-09","title":"1.7.3 - 2023-10-09","text":"
"},{"location":"changelog/#172-2023-10-05","title":"1.7.2 - 2023-10-05","text":"
"},{"location":"changelog/#code-refactoring_4","title":"Code Refactoring","text":"
"},{"location":"changelog/#171-2023-09-28","title":"1.7.1 - 2023-09-28","text":"
"},{"location":"changelog/#code-refactoring_5","title":"Code Refactoring","text":"
"},{"location":"changelog/#170-2023-09-14","title":"1.7.0 - 2023-09-14","text":"__init__
methods when merging docstrings (b97d51f by Timoth\u00e9e Mazzucotelli). Issue #106
"},{"location":"changelog/#163-2023-09-11","title":"1.6.3 - 2023-09-11","text":"Annotated
types (53db04b by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#code-refactoring_6","title":"Code Refactoring","text":"load_external_modules
a global-only option (266f41f by Timoth\u00e9e Mazzucotelli). Issue #87
"},{"location":"changelog/#162-2023-09-05","title":"1.6.2 - 2023-09-05","text":"
"},{"location":"changelog/#161-2023-09-04","title":"1.6.1 - 2023-09-04","text":"
"},{"location":"changelog/#160-2023-08-27","title":"1.6.0 - 2023-08-27","text":"
"},{"location":"changelog/#code-refactoring_7","title":"Code Refactoring","text":"doc-signature
CSS class to separate signature code blocks (b6c648f by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#152-2023-08-25","title":"1.5.2 - 2023-08-25","text":"format_attribute
filter, preparing for cross-refs in attribute signatures (8f0ade2 by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#code-refactoring_8","title":"Code Refactoring","text":"
"},{"location":"changelog/#151-2023-08-24","title":"1.5.1 - 2023-08-24","text":"
"},{"location":"changelog/#150-2023-08-20","title":"1.5.0 - 2023-08-20","text":"
"},{"location":"changelog/#140-2023-08-18","title":"1.4.0 - 2023-08-18","text":"
"},{"location":"changelog/#code-refactoring_10","title":"Code Refactoring","text":"
"},{"location":"changelog/#130-2023-08-06","title":"1.3.0 - 2023-08-06","text":"crossref
and multi_crossref
filters (4fe3d20 by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#features_7","title":"Features","text":"
"},{"location":"changelog/#121-2023-07-20","title":"1.2.1 - 2023-07-20","text":"
"},{"location":"changelog/#120-2023-07-14","title":"1.2.0 - 2023-07-14","text":"
"},{"location":"changelog/#bug-fixes_12","title":"Bug Fixes","text":"
"},{"location":"changelog/#112-2023-06-04","title":"1.1.2 - 2023-06-04","text":"None
as return annotation of class signatures (3d8724e by Timoth\u00e9e Mazzucotelli). Issue #85
"},{"location":"changelog/#111-2023-06-04","title":"1.1.1 - 2023-06-04","text":"
"},{"location":"changelog/#code-refactoring_12","title":"Code Refactoring","text":"
"},{"location":"changelog/#110-2023-05-25","title":"1.1.0 - 2023-05-25","text":"
"},{"location":"changelog/#100-2023-05-11","title":"1.0.0 - 2023-05-11","text":"
format_signature
filter has changed. If you override templates in your project to customize the output, make sure to update the following templates so that they use the new filter signature:
class.html
expression.html
function.html
signature.html
"},{"location":"changelog/#0101-2023-05-07","title":"0.10.1 - 2023-05-07","text":"
"},{"location":"changelog/#0100-2023-05-07","title":"0.10.0 - 2023-05-07","text":"
"},{"location":"changelog/#bug-fixes_16","title":"Bug Fixes","text":"
"},{"location":"changelog/#code-refactoring_13","title":"Code Refactoring","text":"
"},{"location":"changelog/#090-2023-04-03","title":"0.9.0 - 2023-04-03","text":"
"},{"location":"changelog/#bug-fixes_17","title":"Bug Fixes","text":"
"},{"location":"changelog/#code-refactoring_14","title":"Code Refactoring","text":"
"},{"location":"changelog/#083-2023-01-04","title":"0.8.3 - 2023-01-04","text":"
"},{"location":"changelog/#082-2022-11-19","title":"0.8.2 - 2022-11-19","text":"
"},{"location":"changelog/#081-2022-11-19","title":"0.8.1 - 2022-11-19","text":"
"},{"location":"changelog/#080-2022-11-13","title":"0.8.0 - 2022-11-13","text":"
"},{"location":"changelog/#code-refactoring_16","title":"Code Refactoring","text":"
"},{"location":"changelog/#071-2022-06-12","title":"0.7.1 - 2022-06-12","text":"
"},{"location":"changelog/#070-2022-05-28","title":"0.7.0 - 2022-05-28","text":"/
in signatures (3e927e4 by Timoth\u00e9e Mazzucotelli). Issue #25
"},{"location":"changelog/#features_13","title":"Features","text":"
"},{"location":"changelog/#bug-fixes_21","title":"Bug Fixes","text":"
"},{"location":"changelog/#code-refactoring_17","title":"Code Refactoring","text":"
"},{"location":"changelog/#066-2022-03-06","title":"0.6.6 - 2022-03-06","text":"show_submodules
by default (480d0c3 by Timoth\u00e9e Mazzucotelli).show_root_full_path
for ToC entries (hidden headings) (8f4c853 by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#065-2022-02-24","title":"0.6.5 - 2022-02-24","text":"self
and cls
parameters (7f579d1 by Timoth\u00e9e Mazzucotelli). Issue #7pycon
for examples code blocks (6545900 by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#064-2022-02-22","title":"0.6.4 - 2022-02-22","text":"
"},{"location":"changelog/#063-2022-02-20","title":"0.6.3 - 2022-02-20","text":"
"},{"location":"changelog/#062-2022-02-17","title":"0.6.2 - 2022-02-17","text":"
"},{"location":"changelog/#061-2022-02-17","title":"0.6.1 - 2022-02-17","text":"
"},{"location":"changelog/#060-2022-02-13","title":"0.6.0 - 2022-02-13","text":"
"},{"location":"changelog/#bug-fixes_27","title":"Bug Fixes","text":"__init__
methods' docstrings into their classes' docstrings (1b4d1c0 by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#code-refactoring_19","title":"Code Refactoring","text":"
"},{"location":"changelog/#054-2022-02-13","title":"0.5.4 - 2022-02-13","text":"
"},{"location":"changelog/#053-2022-02-08","title":"0.5.3 - 2022-02-08","text":"
"},{"location":"changelog/#052-2022-02-05","title":"0.5.2 - 2022-02-05","text":"null
as docstring style (f526816 by Timoth\u00e9e Mazzucotelli). Issue #2
"},{"location":"changelog/#051-2022-02-03","title":"0.5.1 - 2022-02-03","text":"
"},{"location":"changelog/#code-refactoring_20","title":"Code Refactoring","text":"
"},{"location":"changelog/#050-2022-02-03","title":"0.5.0 - 2022-02-03","text":"
"},{"location":"changelog/#bug-fixes_30","title":"Bug Fixes","text":"
"},{"location":"changelog/#code-refactoring_21","title":"Code Refactoring","text":"docstring_section_style
option (774988e by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#041-2022-02-01","title":"0.4.1 - 2022-02-01","text":"
"},{"location":"changelog/#040-2022-02-01","title":"0.4.0 - 2022-02-01","text":"
"},{"location":"changelog/#030-2022-01-14","title":"0.3.0 - 2022-01-14","text":"mkdocstrings_handlers
namespace (23c9023 by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#dependencies_5","title":"Dependencies","text":"
"},{"location":"changelog/#code-refactoring_23","title":"Code Refactoring","text":"
"},{"location":"changelog/#020-2021-12-28","title":"0.2.0 - 2021-12-28","text":"
"},{"location":"changelog/#features_17","title":"Features","text":"
"},{"location":"changelog/#bug-fixes_32","title":"Bug Fixes","text":"show_signature
rendering option (0f07c2e by Will Da Silva).
"},{"location":"changelog/#010-2021-12-19","title":"0.1.0 - 2021-12-19","text":"
"},{"location":"changelog/#bug-fixes_33","title":"Bug Fixes","text":"
"},{"location":"changelog/#code-refactoring_24","title":"Code Refactoring","text":"
"},{"location":"code_of_conduct/","title":"Contributor Covenant Code of Conduct","text":""},{"location":"code_of_conduct/#our-pledge","title":"Our Pledge","text":"
"},{"location":"code_of_conduct/#enforcement-responsibilities","title":"Enforcement Responsibilities","text":"cd python\nmake setup\n
python3 -m pip install --user pipx\npipx install uv\n
make setup
again, or simply uv install
.make help
to see all the available actions!make run duty TASK
.make
will work the same with the virtualenv activated or not.
git switch -c feature-or-bugfix-name
make format
to auto-format the codemake check
to check everything (fix any warning)make test
to run the tests (fix any issue)
make docs
<type>[(scope)]: Subject\n\n[Body]\n
build
: About packaging, building wheels, etc.chore
: About packaging or repo/files management.ci
: About Continuous Integration.deps
: Dependencies update.docs
: About documentation.feat
: New feature.fix
: Bug fix.perf
: About performance.refactor
: Changes that are not features or bug fixes.style
: A change in code style/format.tests
: About tests.Body.\n\nIssue #10: https://github.com/namespace/project/issues/10\nRelated to PR namespace/other-project#15: https://github.com/namespace/other-project/pull/15\n
:
. We expect a full URI for each trailer, not just GitHub autolinks (for example, full GitHub URLs for commits and issues, not the hash or the #issue-number).# SHA is the SHA of the commit you want to fix\ngit commit --fixup=SHA\n
git rebase -i --autosquash main\n
git push -f\n
>=2.11.1
3.1.4
BSD License Markdown Python implementation of John Gruber's Markdown. >=3.3.6, >=3.3
3.6
BSD License MarkupSafe Safely add untrusted strings to HTML/XML markup. >=2.0.1, >=1.1
2.1.5
BSD-3-Clause PyYAML YAML parser and emitter for Python >=5.1
6.0.1
MIT click Composable command line interface toolkit >=7.0
8.1.7
BSD-3-Clause colorama Cross-platform colored terminal text. >=0.4
0.4.6
BSD License editables Editable installations 0.5
MIT License ghp-import Copy your docs directly to the gh-pages branch. >=1.0
2.1.0
Apache Software License griffe Signatures for entire Python programs. Extract the structure, the frame, the skeleton of your project, to generate API documentation or find breaking changes in your API. >=0.44
0.45.0
ISC importlib_metadata Read metadata from Python packages >=4.6, >=4.4
7.1.0
Apache Software License mergedeep A deep merge function for \ud83d\udc0d. >=1.3.4
1.3.4
MIT License mkdocs Project documentation with Markdown. >=1.5, >=1.4
1.6.0
BSD-2-Clause mkdocs-autorefs Automatically link across pages in MkDocs. >=0.3.1
1.0.2.dev2+gfe3c22f
ISC mkdocs-get-deps MkDocs extension that lists all dependencies according to a mkdocs.yml file >=0.2.0
0.2.0
MIT mkdocstrings Automatic documentation from sources, for MkDocs. >=0.25, >=0.23
0.25.2.dev1+g59715db
ISC packaging Core utilities for Python packages >=20.5
24.0
Apache Software License + BSD License pathspec Utility library for gitignore style pattern matching of file paths. >=0.11.1
0.12.1
Mozilla Public License 2.0 (MPL 2.0) platformdirs A small Python package for determining appropriate platform-specific dirs, e.g. a user data dir
. >=2.2.0
4.2.1
MIT pymdown-extensions Extension pack for Python Markdown. ~=10.2, >=6.3
10.8.1
MIT python-dateutil Extensions to the standard Python datetime module >=2.8.1
2.9.0.post0
BSD License + Apache Software License pyyaml_env_tag A custom YAML tag for referencing environment variables in YAML files. >=0.1
0.1
MIT License six Python 2 and 3 compatibility utilities >=1.5
1.16.0
MIT typing_extensions Backported and Experimental Type Hints for Python 3.8+ >=4.1, >=3.6.4
4.11.0
Python Software Foundation License watchdog Filesystem events monitoring >=2.0
4.0.0
Apache-2.0 zipp Backport of pathlib-compatible object wrapper for zip files >=0.5
3.18.1
MIT License"},{"location":"credits/#exec-1--development-dependencies","title":"Development dependencies","text":"Project Summary Version (accepted) Version (last resolved) License Babel Internationalization utilities ~=2.10
2.15.0
BSD-3-Clause GitPython GitPython is a Python library used to interact with Git repositories 3.1.43
BSD-3-Clause Jinja2 A very fast and expressive template engine. >=2.11.1
3.1.4
BSD License Markdown Python implementation of John Gruber's Markdown. >=3.3.6, >=3.3
3.6
BSD License MarkupSafe Safely add untrusted strings to HTML/XML markup. >=2.0.1, >=1.1
2.1.5
BSD-3-Clause PyYAML YAML parser and emitter for Python >=5.1
6.0.1
MIT Pygments Pygments is a syntax highlighting package written in Python. ~=2.16
2.18.0
BSD-2-Clause SecretStorage Python bindings to FreeDesktop.org Secret Service API >=3.2
3.3.3
BSD 3-Clause License ansimarkup Produce colored terminal text with an xml-like markup ~=1.4
1.5.0
Revised BSD License appdirs A small Python module for determining appropriate platform-specific dirs, e.g. a \"user data dir\". >=1.4
1.4.4
MIT black The uncompromising code formatter. >=23.9
24.4.2
MIT blacken-docs Run Black on Python code blocks in documentation files. >=1.16
1.16.0
MIT build A simple, correct Python build frontend >=1.0
1.2.1
MIT License certifi Python package for providing Mozilla's CA Bundle. >=2017.4.17
2024.2.2
MPL-2.0 cffi Foreign Function Interface for Python calling C code. >=1.12
1.16.0
MIT charset-normalizer The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet. >=2, <4
3.3.2
MIT click Composable command line interface toolkit >=7.0
8.1.7
BSD-3-Clause colorama Cross-platform colored terminal text. >=0.4
0.4.6
BSD License coverage Code coverage measurement for Python >=5.2.1
7.5.1
Apache-2.0 cryptography cryptography is a package which provides cryptographic recipes and primitives to Python developers. >=2.0
42.0.7
Apache-2.0 OR BSD-3-Clause csscompressor A python port of YUI CSS Compressor >=0.9.5
0.9.5
BSD docutils Docutils -- Python Documentation Utilities >=0.13.1
0.21.2
Public Domain + Python Software Foundation License + BSD License + GNU General Public License (GPL) dparse A parser for Python dependency files >=0.6.2
0.6.3
MIT license duty A simple task runner. >=0.10
1.3.0
ISC editables Editable installations 0.5
MIT License execnet execnet: rapid multi-Python deployment >=2.1
2.1.1
MIT failprint Run a command, print its output only if it fails. >=0.11, !=1.0.0
1.0.2
ISC ghp-import Copy your docs directly to the gh-pages branch. >=1.0
2.1.0
Apache Software License git-changelog Automatic Changelog generator using Jinja2 templates. >=2.3
2.5.2
ISC gitdb Git Object Database >=4.0.1, <5
4.0.11
BSD License htmlmin2 An HTML Minifier >=0.1.13
0.1.13
BSD idna Internationalized Domain Names in Applications (IDNA) >=2.5, <4
3.7
BSD License importlib_metadata Read metadata from Python packages >=4.6, >=4.4
7.1.0
Apache Software License iniconfig brain-dead simple config-ini parsing 2.0.0
MIT jaraco.classes Utility functions for Python class constructs 3.4.0
MIT License jaraco.context Useful decorators and context managers 5.3.0
MIT License jaraco.functools Functools like those found in stdlib 4.0.1
MIT License jeepney Low-level, pure Python DBus protocol wrapper. >=0.4.2
0.8.0
MIT License jsmin JavaScript minifier. >=3.0.1
3.0.1
MIT License keyring Store and access your passwords safely. >=15.1
25.2.1
MIT License markdown-callouts Markdown extension: a classier syntax for admonitions >=0.3
0.4.0
MIT markdown-exec Utilities to execute code blocks in Markdown files. >=1.7
1.7.0.1.0.1
ISC markdown-it-py Python port of markdown-it. Markdown parsing, done right! >=2.2.0
3.0.0
MIT License mdurl Markdown URL utilities ~=0.1
0.1.2
MIT License mergedeep A deep merge function for \ud83d\udc0d. >=1.3.4
1.3.4
MIT License mkdocs Project documentation with Markdown. >=1.5, >=1.4
1.6.0
BSD-2-Clause mkdocs-autorefs Automatically link across pages in MkDocs. >=0.3.1
1.0.2.dev2+gfe3c22f
ISC mkdocs-coverage MkDocs plugin to integrate your coverage HTML report into your site. >=1.0
1.0.0
ISC mkdocs-gen-files MkDocs plugin to programmatically generate documentation pages during the build >=0.5
0.5.0
MIT mkdocs-get-deps MkDocs extension that lists all dependencies according to a mkdocs.yml file >=0.2.0
0.2.0
MIT mkdocs-git-committers-plugin-2 An MkDocs plugin to create a list of contributors on the page. The git-committers plugin will seed the template context with a list of GitHub or GitLab committers and other useful GIT info such as last modified date >=1.2
2.3.0
MIT mkdocs-literate-nav MkDocs plugin to specify the navigation in Markdown instead of YAML >=0.6
0.6.1
MIT mkdocs-material Documentation that simply works >=9.4
9.5.21+insiders.4.53.8
MIT mkdocs-material-extensions Extension pack for Python Markdown and MkDocs Material. ~=1.3
1.3.1
MIT mkdocs-minify-plugin An MkDocs plugin to minify HTML, JS or CSS files prior to being written to disk >=0.7
0.8.0
MIT mkdocstrings Automatic documentation from sources, for MkDocs. >=0.25, >=0.23
0.25.2.dev1+g59715db
ISC more-itertools More routines for operating on iterables, beyond itertools 10.2.0
MIT License mypy Optional static typing for Python >=1.5
1.10.0
MIT mypy-extensions Type system extensions for programs checked with the mypy type checker. >=1.0.0
1.0.0
MIT License nh3 Python bindings to the ammonia HTML sanitization library. >=0.2.14
0.2.17
MIT packaging Core utilities for Python packages >=20.5
24.0
Apache Software License + BSD License paginate Divides large result sets into pages for easier browsing ~=0.5
0.5.6
MIT pathspec Utility library for gitignore style pattern matching of file paths. >=0.11.1
0.12.1
Mozilla Public License 2.0 (MPL 2.0) pkginfo Query metadata from sdists / bdists / installed packages. >=1.8.1
1.10.0
MIT platformdirs A small Python package for determining appropriate platform-specific dirs, e.g. a user data dir
. >=2.2.0
4.2.1
MIT pluggy plugin and hook calling mechanisms for python >=1.5, <2.0
1.5.0
MIT ptyprocess Run a subprocess in a pseudo terminal ~=0.6
0.7.0
ISC License (ISCL) pycparser C parser in Python 2.22
BSD-3-Clause pymdown-extensions Extension pack for Python Markdown. ~=10.2, >=6.3
10.8.1
MIT pyproject_hooks Wrappers to call pyproject.toml-based build backend hooks. 1.1.0
MIT License pytest pytest: simple powerful testing with Python >=7.4
8.2.0
MIT pytest-cov Pytest plugin for measuring coverage. >=4.1
5.0.0
MIT pytest-randomly Pytest plugin to randomly order tests and control random.seed. >=3.15
3.15.0
MIT pytest-xdist pytest xdist plugin for distributed testing, most importantly across multiple CPUs >=3.3
3.6.1
MIT License python-dateutil Extensions to the standard Python datetime module >=2.8.1
2.9.0.post0
BSD License + Apache Software License pyyaml_env_tag A custom YAML tag for referencing environment variables in YAML files. >=0.1
0.1
MIT License readme_renderer readme_renderer is a library for rendering readme descriptions for Warehouse >=35.0
43.0
Apache License, Version 2.0 regex Alternative regular expression module, to replace re. >=2022.4
2024.5.10
Apache Software License requests Python HTTP for Humans. ~=2.26
2.31.0
Apache 2.0 requests-toolbelt A utility belt for advanced users of python-requests >=0.8.0, !=0.9.0
1.0.0
Apache 2.0 rfc3986 Validating URI References per RFC 3986 >=1.4.0
2.0.0
Apache 2.0 rich Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal >=12.0.0
13.7.1
MIT ruamel.yaml ruamel.yaml is a YAML parser/emitter that supports roundtrip preservation of comments, seq/map flow style, and map key order >=0.17.21
0.18.6
MIT license ruamel.yaml.clib C version of reader, parser and emitter for ruamel.yaml derived from libyaml >=0.2.7
0.2.8
MIT ruff An extremely fast Python linter and code formatter, written in Rust. >=0.0
0.4.4
MIT safety Checks installed dependencies for known vulnerabilities and licenses. >=2.3
2.3.4
MIT license semver Python helper for Semantic Versioning (https://semver.org) >=2.13
3.0.2
BSD setuptools Easily download, build, install, upgrade, and uninstall Python packages >=19.3
69.5.1
MIT License six Python 2 and 3 compatibility utilities >=1.5
1.16.0
MIT smmap A pure Python implementation of a sliding window memory map manager >=3.0.1, <6
5.0.1
BSD twine Collection of utilities for publishing packages on PyPI >=5.0
5.0.0
Apache Software License types-Markdown Typing stubs for Markdown >=3.5
3.6.0.20240316
Apache-2.0 license types-PyYAML Typing stubs for PyYAML >=6.0
6.0.12.20240311
Apache-2.0 license typing_extensions Backported and Experimental Type Hints for Python 3.8+ >=4.1, >=3.6.4
4.11.0
Python Software Foundation License urllib3 HTTP library with thread-safe connection pooling, file post, and more. >=1.26.0
2.2.1
MIT License watchdog Filesystem events monitoring >=2.0
4.0.0
Apache-2.0 zipp Backport of pathlib-compatible object wrapper for zip files >=0.5
3.18.1
MIT License
"},{"location":"insiders/","title":"Insiders","text":"ISC License\n\nCopyright (c) 2021, Timoth\u00e9e Mazzucotelli\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted, provided that the above\ncopyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\nWITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\nANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\nWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\nACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\nOR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n
@warnings.deprecated
(PEP 702)
"},{"location":"insiders/#1500-hyperlamp-navigation-tips","title":"$ 1,500 \u2014 HyperLamp Navigation Tips","text":"@warnings.deprecated
(PEP 702)
"},{"location":"insiders/#2000-fusiondrive-ejection-configuration","title":"$ 2,000 \u2014 FusionDrive Ejection Configuration","text":"
"},{"location":"insiders/#frequently-asked-questions","title":"Frequently asked questions","text":""},{"location":"insiders/#compatibility","title":"Compatibility","text":"
"},{"location":"insiders/changelog/","title":"Changelog","text":""},{"location":"insiders/changelog/#mkdocstrings-python-insiders","title":"mkdocstrings-python Insiders","text":""},{"location":"insiders/changelog/#1.8.2","title":"1.8.2 May 09, 2024","text":"
"},{"location":"insiders/changelog/#1.8.1","title":"1.8.1 April 19, 2024","text":"
"},{"location":"insiders/changelog/#1.8.0","title":"1.8.0 March 24, 2024","text":"
"},{"location":"insiders/changelog/#1.7.0","title":"1.7.0 March 24, 2024","text":"
"},{"location":"insiders/changelog/#1.6.0","title":"1.6.0 January 30, 2024","text":"
"},{"location":"insiders/changelog/#1.5.1","title":"1.5.1 September 12, 2023","text":"parameter_headings
option to render headings for parameters (enabling permalinks and ToC/inventory entries).
"},{"location":"insiders/changelog/#1.5.0","title":"1.5.0 September 05, 2023","text":"
"},{"location":"insiders/changelog/#1.4.0","title":"1.4.0 August 27, 2023","text":"
"},{"location":"insiders/changelog/#1.3.0","title":"1.3.0 August 24, 2023","text":"
"},{"location":"insiders/changelog/#1.2.0","title":"1.2.0 August 20, 2023","text":"
"},{"location":"insiders/changelog/#1.1.4","title":"1.1.4 July 17, 2023","text":"
"},{"location":"insiders/changelog/#1.1.3","title":"1.1.3 July 17, 2023","text":"
"},{"location":"insiders/changelog/#1.1.2","title":"1.1.2 July 15, 2023","text":"
"},{"location":"insiders/changelog/#1.1.1","title":"1.1.1 June 27, 2023","text":"
"},{"location":"insiders/changelog/#1.1.0","title":"1.1.0 June 4, 2023","text":"
"},{"location":"insiders/changelog/#1.0.0","title":"1.0.0 May 10, 2023","text":"
"},{"location":"insiders/installation/","title":"Getting started with Insiders","text":"format_signature
filter has changed. The templates that must be updated: class.html
, expression.html
, function.html
and signature.html
.pip
or git
. Note that in order to access the Insiders repository, you need to become an eligible sponsor of @pawamoy on GitHub.pip
using SSH:pip install git+ssh://git@github.com/pawamoy-insiders/mkdocstrings-python.git\n
How to get a GitHub personal access token pip install git+https://${GH_TOKEN}@github.com/pawamoy-insiders/mkdocstrings-python.git\n
GH_TOKEN
environment variable is a GitHub token. It can be obtained by creating a personal access token for your GitHub account. It will give you access to the Insiders repository, programmatically, from the command line or GitHub Actions workflows:
repo
scope# download distributions in ~/dists, then upload with:\ntwine upload --repository-url https://your-private-index.com ~/dists/*\n
pip config set global.extra-index-url https://your-private-index.com/simple\n
pypiserver
pip install --user pypiserver\n# or pipx install pypiserver\n\n# create a packages directory\nmkdir -p ~/.local/pypiserver/packages\n\n# run the pypi server without authentication\npypi-server run -p 8080 -a . -P . ~/.local/pypiserver/packages &\n
~/.pypirc
:[distutils]\nindex-servers =\n local\n\n[local]\nrepository: http://localhost:8080\nusername:\npassword:\n
# clone the repository\ngit clone git@github.com:pawamoy-insiders/mkdocstrings-python\ncd mkdocstrings-python\n\n# install build\npip install --user build\n# or pipx install build\n\n# checkout latest tag\ngit checkout $(git describe --tags --abbrev=0)\n\n# build the distributions\npyproject-build\n\n# upload them to our local server\ntwine upload -r local dist/* --skip-existing\n
pip config set global.extra-index-url http://localhost:8080/simple\npdm config pypi.extra.url http://localhost:8080/simple\n
pip install mkdocstrings-python
, or resolving dependencies with PDM, both tools will look into our local index and find the Insiders version. Remember to update your local index regularly!git
:git clone git@github.com:pawamoy-insiders/mkdocstrings-python\n
git
, the package must be installed:
"},{"location":"insiders/installation/#upgrading","title":"Upgrading","text":"pip install -e mkdocstrings-python\n
8.x.x.4.x.x
means that Insiders 4.x.x
is currently based on 8.x.x
.
"},{"location":"reference/mkdocstrings_handlers/python/","title":"mkdocstrings_handlers.python","text":""},{"location":"reference/mkdocstrings_handlers/python/#mkdocstrings_handlers.python","title":"python","text":"
debug
\u2013 handler
\u2013 rendering
\u2013
"},{"location":"reference/mkdocstrings_handlers/python/#mkdocstrings_handlers.python.get_handler","title":"get_handler","text":"get_handler
\u2013 PythonHandler
.get_handler(\n *,\n theme: str,\n custom_templates: str | None = None,\n config_file_path: str | None = None,\n paths: list[str] | None = None,\n locale: str = \"en\",\n load_external_modules: bool = False,\n **config: Any\n) -> PythonHandler\n
PythonHandler
.
"},{"location":"reference/mkdocstrings_handlers/python/#mkdocstrings_handlers.python.get_handler(theme)","title":"PythonHandler
\u2013 PythonHandler
.theme
","text":"(str
) \u2013 custom_templates
","text":"(str | None
, default: None
) \u2013 config_file_path
","text":"(str | None
, default: None
) \u2013 paths
","text":"(list[str] | None
, default: None
) \u2013 locale
","text":"(str
, default: 'en'
) \u2013 load_external_modules
","text":"(bool
, default: False
) \u2013 **config
","text":"(Any
, default: {}
) \u2013
Environment
\u2013 Package
\u2013 Variable
\u2013
"},{"location":"reference/mkdocstrings_handlers/python/debug/#mkdocstrings_handlers.python.debug.Environment","title":"Environment get_debug_info
\u2013 get_version
\u2013 print_debug_info
\u2013 dataclass
","text":"Environment(\n interpreter_name: str,\n interpreter_version: str,\n interpreter_path: str,\n platform: str,\n packages: list[Package],\n variables: list[Variable],\n)\n
"},{"location":"reference/mkdocstrings_handlers/python/debug/#mkdocstrings_handlers.python.debug.Environment.interpreter_name","title":"interpreter_name interpreter_name
(str
) \u2013 interpreter_path
(str
) \u2013 interpreter_version
(str
) \u2013 packages
(list[Package]
) \u2013 platform
(str
) \u2013 variables
(list[Variable]
) \u2013 instance-attribute
","text":"interpreter_name: str\n
instance-attribute
","text":"interpreter_path: str\n
instance-attribute
","text":"interpreter_version: str\n
instance-attribute
","text":"packages: list[Package]\n
instance-attribute
","text":"platform: str\n
instance-attribute
","text":"variables: list[Variable]\n
dataclass
","text":"Package(name: str, version: str)\n
"},{"location":"reference/mkdocstrings_handlers/python/debug/#mkdocstrings_handlers.python.debug.Package.name","title":"name name
(str
) \u2013 version
(str
) \u2013 instance-attribute
","text":"name: str\n
instance-attribute
","text":"version: str\n
dataclass
","text":"Variable(name: str, value: str)\n
"},{"location":"reference/mkdocstrings_handlers/python/debug/#mkdocstrings_handlers.python.debug.Variable.name","title":"name name
(str
) \u2013 value
(str
) \u2013 instance-attribute
","text":"name: str\n
instance-attribute
","text":"value: str\n
get_debug_info() -> Environment\n
"},{"location":"reference/mkdocstrings_handlers/python/debug/#mkdocstrings_handlers.python.debug.get_version","title":"get_version","text":"Environment
\u2013 get_version(dist: str = 'mkdocstrings-python') -> str\n
"},{"location":"reference/mkdocstrings_handlers/python/debug/#mkdocstrings_handlers.python.debug.get_version(dist)","title":"str
\u2013 dist
","text":"(str
, default: 'mkdocstrings-python'
) \u2013 print_debug_info() -> None\n
PythonHandler
\u2013
"},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler","title":"PythonHandler","text":"get_handler
\u2013 PythonHandler
.PythonHandler(\n *args: Any,\n config_file_path: str | None = None,\n paths: list[str] | None = None,\n locale: str = \"en\",\n load_external_modules: bool = False,\n **kwargs: Any,\n)\n
\n flowchart TD\n mkdocstrings_handlers.python.handler.PythonHandler[PythonHandler]\n mkdocstrings.handlers.base.BaseHandler[BaseHandler]\n\n mkdocstrings.handlers.base.BaseHandler --> mkdocstrings_handlers.python.handler.PythonHandler\n \n\n\n click mkdocstrings_handlers.python.handler.PythonHandler href \"\" \"mkdocstrings_handlers.python.handler.PythonHandler\"\n click mkdocstrings.handlers.base.BaseHandler href \"\" \"mkdocstrings.handlers.base.BaseHandler\"\n
do_convert_markdown
\u2013 do_heading
\u2013 get_extended_templates_dirs
\u2013 get_headings
\u2013 get_templates_dir
\u2013 load_inventory
\u2013 in_file
.normalize_extension_paths
\u2013 teardown
\u2013 update_env
\u2013
"},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler(*args)","title":"default_config
(dict
) \u2013 domain
(str
) \u2013 enable_inventory
(bool
) \u2013 objects.inv
Sphinx inventory file.extra_css
\u2013 fallback_config
(dict
) \u2013 fallback_theme
\u2013 name
\u2013 *args
","text":"(Any
, default: ()
) \u2013 config_file_path
","text":"(str | None
, default: None
) \u2013 paths
","text":"(list[str] | None
, default: None
) \u2013 locale
","text":"(str
, default: 'en'
) \u2013 load_external_modules
","text":"(bool
, default: False
) \u2013 **kwargs
","text":"(Any
, default: {}
) \u2013 class-attribute
","text":"default_config: dict = {\n \"find_stubs_package\": False,\n \"docstring_style\": \"google\",\n \"docstring_options\": {},\n \"show_symbol_type_heading\": False,\n \"show_symbol_type_toc\": False,\n \"show_root_heading\": False,\n \"show_root_toc_entry\": True,\n \"show_root_full_path\": True,\n \"show_root_members_full_path\": False,\n \"show_object_full_path\": False,\n \"show_category_heading\": False,\n \"show_if_no_docstring\": False,\n \"show_signature\": True,\n \"show_signature_annotations\": False,\n \"signature_crossrefs\": False,\n \"separate_signature\": False,\n \"line_length\": 60,\n \"merge_init_into_class\": False,\n \"show_docstring_attributes\": True,\n \"show_docstring_functions\": True,\n \"show_docstring_classes\": True,\n \"show_docstring_modules\": True,\n \"show_docstring_description\": True,\n \"show_docstring_examples\": True,\n \"show_docstring_other_parameters\": True,\n \"show_docstring_parameters\": True,\n \"show_docstring_raises\": True,\n \"show_docstring_receives\": True,\n \"show_docstring_returns\": True,\n \"show_docstring_warns\": True,\n \"show_docstring_yields\": True,\n \"show_source\": True,\n \"show_bases\": True,\n \"show_inheritance_diagram\": False,\n \"show_submodules\": False,\n \"group_by_category\": True,\n \"heading_level\": 2,\n \"members_order\": alphabetical.value,\n \"docstring_section_style\": \"table\",\n \"members\": None,\n \"inherited_members\": False,\n \"filters\": [\"!^_[^_]\"],\n \"annotations_path\": \"brief\",\n \"preload_modules\": None,\n \"allow_inspection\": True,\n \"summary\": False,\n \"show_labels\": True,\n \"unwrap_annotated\": False,\n \"parameter_headings\": False,\n \"modernize_annotations\": False,\n}\n
find_stubs_package
(bool
) \u2013 False
.allow_inspection
(bool
) \u2013 True
.show_bases
(bool
) \u2013 True
.show_inheritance_diagram
(bool
) \u2013 False
.show_source
(bool
) \u2013 True
.preload_modules
(list[str] | None
) \u2013 ::: identifier
). It is useful when you want to render documentation for a particular member of an object, and this member is imported from another package than its parent.__all__
attribute of the importing module.None
.
heading_level
(int
) \u2013 2
.parameter_headings
(bool
) \u2013 False
.show_root_heading
(bool
) \u2013 :::
). Default: False
.show_root_toc_entry
(bool
) \u2013 True
.show_root_full_path
(bool
) \u2013 True
.show_root_members_full_path
(bool
) \u2013 False
.show_object_full_path
(bool
) \u2013 False
.show_category_heading
(bool
) \u2013 False
.show_symbol_type_heading
(bool
) \u2013 False
.show_symbol_type_toc
(bool
) \u2013 False
.
inherited_members
(list[str] | bool | None
) \u2013 members
. If false or empty list, do not select any inherited member. Default: False
.members
(list[str] | bool | None
) \u2013 None
.members_order
(str
) \u2013 alphabetical
- order by the members names, source
- order members as they appear in the source file. Default: \"alphabetical\"
.filters
(list[str] | None
) \u2013 !
will exclude matching objects instead of including them. The members
option takes precedence over filters
(filters will still be applied recursively to lower members in the hierarchy). Default: [\"!^_[^_]\"]
.group_by_category
(bool
) \u2013 True
.show_submodules
(bool
) \u2013 False
.summary
(bool | dict[str, bool]
) \u2013 show_labels
(bool
) \u2013 True
.
docstring_style
(str
) \u2013 google
, numpy
, sphinx
, or None
. Default: \"google\"
.docstring_options
(dict
) \u2013 griffe.docstrings
.docstring_section_style
(str
) \u2013 table
, list
, spacy
. Default: \"table\"
.merge_init_into_class
(bool
) \u2013 __init__
method into the class' signature and docstring. Default: False
.show_if_no_docstring
(bool
) \u2013 False
.show_docstring_attributes
(bool
) \u2013 True
.show_docstring_functions
(bool
) \u2013 True
.show_docstring_classes
(bool
) \u2013 True
.show_docstring_modules
(bool
) \u2013 True
.show_docstring_description
(bool
) \u2013 True
.show_docstring_examples
(bool
) \u2013 True
.show_docstring_other_parameters
(bool
) \u2013 True
.show_docstring_parameters
(bool
) \u2013 True
.show_docstring_raises
(bool
) \u2013 True
.show_docstring_receives
(bool
) \u2013 True
.show_docstring_returns
(bool
) \u2013 True
.show_docstring_warns
(bool
) \u2013 True
.show_docstring_yields
(bool
) \u2013 True
.
"},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.domain","title":"domain annotations_path
(str
) \u2013 brief
(recommended), or source
(as written in the source). Default: \"brief\"
.line_length
(int
) \u2013 60
.show_signature
(bool
) \u2013 True
.show_signature_annotations
(bool
) \u2013 False
.signature_crossrefs
(bool
) \u2013 False
.separate_signature
(bool
) \u2013 False
.unwrap_annotated
(bool
) \u2013 Annotated
types to show only the type without the annotations. Default: False
.modernize_annotations
(bool
) \u2013 Optional[str]
into str | None
. Default: False
.class-attribute
instance-attribute
","text":"domain: str = 'py'\n
class-attribute
instance-attribute
","text":"enable_inventory: bool = True\n
objects.inv
Sphinx inventory file.class-attribute
instance-attribute
","text":"extra_css = ''\n
class-attribute
","text":"fallback_config: dict = {'fallback': True}\n
class-attribute
instance-attribute
","text":"fallback_theme = 'material'\n
class-attribute
instance-attribute
","text":"name = 'python'\n
do_convert_markdown(\n text: str,\n heading_level: int,\n html_id: str = \"\",\n *,\n strip_paragraph: bool = False,\n autoref_hook: AutoRefHookInterface | None = None\n) -> Markup\n
text
","text":"(str
) \u2013 heading_level
","text":"(int
) \u2013 html_id
","text":"(str
, default: ''
) \u2013 strip_paragraph
","text":"(bool
, default: False
) \u2013
"},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.do_heading","title":"do_heading","text":"Markup
\u2013 do_heading(\n content: Markup,\n heading_level: int,\n *,\n role: str | None = None,\n hidden: bool = False,\n toc_label: str | None = None,\n **attributes: str\n) -> Markup\n
"},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.do_heading(content)","title":"Markup
\u2013 content
","text":"(Markup
) \u2013 heading_level
","text":"(int
) \u2013 h3
).role
","text":"(str | None
, default: None
) \u2013 hidden
","text":"(bool
, default: False
) \u2013 toc_label
","text":"(str | None
, default: None
) \u2013 **attributes
","text":"(str
, default: {}
) \u2013 get_extended_templates_dirs(handler: str) -> list[Path]\n
"},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.get_extended_templates_dirs(handler)","title":"list[Path]
\u2013 handler
","text":"(str
) \u2013 get_headings() -> Sequence[Element]\n
"},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.get_templates_dir","title":"get_templates_dir","text":"Sequence[Element]
\u2013 get_templates_dir(handler: str | None = None) -> Path\n
ModuleNotFoundError
\u2013 FileNotFoundError
\u2013
"},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.get_templates_dir(handler)","title":"Path
\u2013 handler
","text":"(str | None
, default: None
) \u2013 classmethod
","text":"load_inventory(\n in_file: BinaryIO,\n url: str,\n base_url: str | None = None,\n domains: list[str] | None = None,\n **kwargs: Any,\n) -> Iterator[tuple[str, str]]\n
in_file
.load_inventory
\"protocol\" (see mkdocstrings.plugin
).
"},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.load_inventory(in_file)","title":"str
\u2013 in_file
","text":"(BinaryIO
) \u2013 url
","text":"(str
) \u2013 base_url
).base_url
","text":"(str | None
, default: None
) \u2013 domains
","text":"(list[str] | None
, default: None
) \u2013 **kwargs
","text":"(Any
, default: {}
) \u2013 normalize_extension_paths(extensions: Sequence) -> Sequence\n
teardown() -> None\n
update_env(md: Markdown, config: dict) -> None\n
md
","text":"(Markdown
) \u2013 config
","text":"(dict
) \u2013 get_handler(\n *,\n theme: str,\n custom_templates: str | None = None,\n config_file_path: str | None = None,\n paths: list[str] | None = None,\n locale: str = \"en\",\n load_external_modules: bool = False,\n **config: Any\n) -> PythonHandler\n
PythonHandler
.
"},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.get_handler(theme)","title":"PythonHandler
\u2013 PythonHandler
.theme
","text":"(str
) \u2013 custom_templates
","text":"(str | None
, default: None
) \u2013 config_file_path
","text":"(str | None
, default: None
) \u2013 paths
","text":"(list[str] | None
, default: None
) \u2013 locale
","text":"(str
, default: 'en'
) \u2013 load_external_modules
","text":"(bool
, default: False
) \u2013 **config
","text":"(Any
, default: {}
) \u2013
Order
\u2013
"},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.Order","title":"Order","text":"do_as_attributes_section
\u2013 do_as_classes_section
\u2013 do_as_functions_section
\u2013 do_as_modules_section
\u2013 do_crossref
\u2013 do_filter_objects
\u2013 do_format_attribute
\u2013 do_format_code
\u2013 do_format_signature
\u2013 do_get_template
\u2013 do_multi_crossref
\u2013 do_order_members
\u2013 do_split_path
\u2013 \n flowchart TD\n mkdocstrings_handlers.python.rendering.Order[Order]\n\n \n\n click mkdocstrings_handlers.python.rendering.Order href \"\" \"mkdocstrings_handlers.python.rendering.Order\"\n
"},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.Order.alphabetical","title":"alphabetical alphabetical
\u2013 source
\u2013 class-attribute
instance-attribute
","text":"alphabetical = 'alphabetical'\n
class-attribute
instance-attribute
","text":"source = 'source'\n
do_as_attributes_section(\n context: Context,\n attributes: Sequence[Attribute],\n *,\n check_public: bool = True\n) -> DocstringSectionAttributes\n
"},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_as_attributes_section(attributes)","title":"DocstringSectionAttributes
\u2013 attributes
","text":"(Sequence[Attribute]
) \u2013 check_public
","text":"(bool
, default: True
) \u2013 do_as_classes_section(\n context: Context,\n classes: Sequence[Class],\n *,\n check_public: bool = True\n) -> DocstringSectionClasses\n
"},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_as_classes_section(classes)","title":"DocstringSectionClasses
\u2013 classes
","text":"(Sequence[Class]
) \u2013 check_public
","text":"(bool
, default: True
) \u2013 do_as_functions_section(\n context: Context,\n functions: Sequence[Function],\n *,\n check_public: bool = True\n) -> DocstringSectionFunctions\n
"},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_as_functions_section(functions)","title":"DocstringSectionFunctions
\u2013 functions
","text":"(Sequence[Function]
) \u2013 check_public
","text":"(bool
, default: True
) \u2013 do_as_modules_section(\n context: Context,\n modules: Sequence[Module],\n *,\n check_public: bool = True\n) -> DocstringSectionModules\n
"},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_as_modules_section(modules)","title":"DocstringSectionModules
\u2013 modules
","text":"(Sequence[Module]
) \u2013 check_public
","text":"(bool
, default: True
) \u2013 do_crossref(path: str, *, brief: bool = True) -> Markup\n
"},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_crossref(path)","title":"Markup
\u2013 path
","text":"(str
) \u2013 brief
","text":"(bool
, default: True
) \u2013 do_filter_objects(\n objects_dictionary: dict[str, Object | Alias],\n *,\n filters: Sequence[tuple[Pattern, bool]] | None = None,\n members_list: bool | list[str] | None = None,\n inherited_members: bool | list[str] = False,\n keep_no_docstrings: bool = True\n) -> list[Object | Alias]\n
"},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_filter_objects(objects_dictionary)","title":"list[Object | Alias]
\u2013 objects_dictionary
","text":"(dict[str, Object | Alias]
) \u2013 filters
","text":"(Sequence[tuple[Pattern, bool]] | None
, default: None
) \u2013 members_list
","text":"(bool | list[str] | None
, default: None
) \u2013 inherited_members
","text":"(bool | list[str]
, default: False
) \u2013 keep_no_docstrings
","text":"(bool
, default: True
) \u2013 do_format_attribute(\n context: Context,\n attribute_path: Markup,\n attribute: Attribute,\n line_length: int,\n *,\n crossrefs: bool = False\n) -> str\n
"},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_format_attribute(context)","title":"str
\u2013 context
","text":"(Context
) \u2013 attribute_path
","text":"(Markup
) \u2013 attribute
","text":"(Attribute
) \u2013 line_length
","text":"(int
) \u2013 crossrefs
","text":"(bool
, default: False
) \u2013 do_format_code(code: str, line_length: int) -> str\n
"},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_format_code(code)","title":"str
\u2013 code
","text":"(str
) \u2013 line_length
","text":"(int
) \u2013 do_format_signature(\n context: Context,\n callable_path: Markup,\n function: Function,\n line_length: int,\n *,\n annotations: bool | None = None,\n crossrefs: bool = False\n) -> str\n
"},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_format_signature(context)","title":"str
\u2013 context
","text":"(Context
) \u2013 callable_path
","text":"(Markup
) \u2013 function
","text":"(Function
) \u2013 line_length
","text":"(int
) \u2013 annotations
","text":"(bool | None
, default: None
) \u2013 crossrefs
","text":"(bool
, default: False
) \u2013 do_get_template(\n env: Environment, obj: str | Object\n) -> str | Template\n
"},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_get_template(env)","title":"str | Template
\u2013 env
","text":"(Environment
) \u2013 obj
","text":"(str | Object
) \u2013 do_multi_crossref(\n text: str, *, code: bool = True\n) -> Markup\n
"},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_multi_crossref(text)","title":"Markup
\u2013 text
","text":"(str
) \u2013 code
","text":"(bool
, default: True
) \u2013 do_order_members(\n members: Sequence[Object | Alias],\n order: Order,\n members_list: bool | list[str] | None,\n) -> Sequence[Object | Alias]\n
"},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_order_members(members)","title":"Sequence[Object | Alias]
\u2013 members
","text":"(Sequence[Object | Alias]
) \u2013 order
","text":"(Order
) \u2013 members_list
","text":"(bool | list[str] | None
) \u2013 do_split_path(\n path: str, full_path: str\n) -> list[tuple[str, str]]\n
"},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_split_path(path)","title":"list[tuple[str, str]]
\u2013 path
","text":"(str
) \u2013 # PEP 621 dependencies declaration\n# adapt to your dependencies manager\n[project]\ndependencies = [\n \"mkdocstrings[python]>=0.18\",\n]\n
# PEP 621 dependencies declaration\n# adapt to your dependencies manager\n[project]\ndependencies = [\n \"mkdocstrings-python\",\n]\n
default_handler
configuration option of mkdocstrings
in mkdocs.yml
:
"},{"location":"usage/#injecting-documentation","title":"Injecting documentation","text":"plugins:\n- mkdocstrings:\n default_handler: python\n
::: path.to.object\n
handler
option:
"},{"location":"usage/#configuration","title":"Configuration","text":"::: path.to.object\n handler: python\n
mkdocs.yml
:
"},{"location":"usage/#global-only-options","title":"Global-only options","text":"plugins:\n- mkdocstrings:\n handlers:\n python:\n ... # the Python handler configuration\n
import
","text":"plugins:\n- mkdocstrings:\n handlers:\n python:\n import:\n - https://docs.python-requests.org/en/master/objects.inv\n
domains
option in the import items, which allows to select the inventory domains to select. By default the Python handler only selects the py
domain (for Python objects). You might find useful to also enable the std
domain:plugins:\n- mkdocstrings:\n handlers:\n python:\n import:\n - url: https://docs.python-requests.org/en/master/objects.inv\n domains: [std, py]\n
import
option is common to all handlers, however they might implement it differently, or not even implement it.paths
","text":"plugins:\n- mkdocstrings:\n handlers:\n python:\n paths: [src] # search packages in the src folder\n
load_external_modules
","text":"__all__
variable.preload_modules
option instead, which acts as an include-list rather than as include-all.
"},{"location":"usage/#globallocal-options","title":"Global/local options","text":"plugins:\n- mkdocstrings:\n handlers:\n python:\n load_external_modules: true\n
options
key. For example, globally:plugins:\n- mkdocstrings:\n handlers:\n python:\n options:\n do_something: true\n
::: package.module.class\n options:\n do_something: false\n
"},{"location":"usage/#options-summary","title":"Options summary","text":"
find_stubs_package
(bool
) \u2013 False
.allow_inspection
(bool
) \u2013 True
.show_bases
(bool
) \u2013 True
.show_inheritance_diagram
(bool
) \u2013 False
.show_source
(bool
) \u2013 True
.preload_modules
(list[str] | None
) \u2013 ::: identifier
). It is useful when you want to render documentation for a particular member of an object, and this member is imported from another package than its parent.__all__
attribute of the importing module.None
.
heading_level
(int
) \u2013 2
.parameter_headings
(bool
) \u2013 False
.show_root_heading
(bool
) \u2013 :::
). Default: False
.show_root_toc_entry
(bool
) \u2013 True
.show_root_full_path
(bool
) \u2013 True
.show_root_members_full_path
(bool
) \u2013 False
.show_object_full_path
(bool
) \u2013 False
.show_category_heading
(bool
) \u2013 False
.show_symbol_type_heading
(bool
) \u2013 False
.show_symbol_type_toc
(bool
) \u2013 False
.
inherited_members
(list[str] | bool | None
) \u2013 members
. If false or empty list, do not select any inherited member. Default: False
.members
(list[str] | bool | None
) \u2013 None
.members_order
(str
) \u2013 alphabetical
- order by the members names, source
- order members as they appear in the source file. Default: \"alphabetical\"
.filters
(list[str] | None
) \u2013 !
will exclude matching objects instead of including them. The members
option takes precedence over filters
(filters will still be applied recursively to lower members in the hierarchy). Default: [\"!^_[^_]\"]
.group_by_category
(bool
) \u2013 True
.show_submodules
(bool
) \u2013 False
.summary
(bool | dict[str, bool]
) \u2013 show_labels
(bool
) \u2013 True
.
docstring_style
(str
) \u2013 google
, numpy
, sphinx
, or None
. Default: \"google\"
.docstring_options
(dict
) \u2013 griffe.docstrings
.docstring_section_style
(str
) \u2013 table
, list
, spacy
. Default: \"table\"
.merge_init_into_class
(bool
) \u2013 __init__
method into the class' signature and docstring. Default: False
.show_if_no_docstring
(bool
) \u2013 False
.show_docstring_attributes
(bool
) \u2013 True
.show_docstring_functions
(bool
) \u2013 True
.show_docstring_classes
(bool
) \u2013 True
.show_docstring_modules
(bool
) \u2013 True
.show_docstring_description
(bool
) \u2013 True
.show_docstring_examples
(bool
) \u2013 True
.show_docstring_other_parameters
(bool
) \u2013 True
.show_docstring_parameters
(bool
) \u2013 True
.show_docstring_raises
(bool
) \u2013 True
.show_docstring_receives
(bool
) \u2013 True
.show_docstring_returns
(bool
) \u2013 True
.show_docstring_warns
(bool
) \u2013 True
.show_docstring_yields
(bool
) \u2013 True
.
"},{"location":"usage/#finding-modules","title":"Finding modules","text":"annotations_path
(str
) \u2013 brief
(recommended), or source
(as written in the source). Default: \"brief\"
.line_length
(int
) \u2013 60
.show_signature
(bool
) \u2013 True
.show_signature_annotations
(bool
) \u2013 False
.signature_crossrefs
(bool
) \u2013 False
.separate_signature
(bool
) \u2013 False
.unwrap_annotated
(bool
) \u2013 Annotated
types to show only the type without the annotations. Default: False
.modernize_annotations
(bool
) \u2013 Optional[str]
into str | None
. Default: False
.paths
option, as it's the only one that works with the -f
option of MkDocs, allowing to build the documentation from any location on the file system. Indeed, the paths provided with the paths
option are computed as relative to the configuration file (mkdocs.yml), so that the current working directory has no impact on the build process: you can build the docs from any location on your filesystem.paths
option","text":"
\ud83d\udcc1 root/\n\u251c\u2500\u2500 \ud83d\udcc4 mkdocs.yml\n\u2514\u2500\u2500 \ud83d\udcc1 package/\n
plugins:\n- mkdocstrings:\n handlers:\n python:\n paths: [.] # actually not needed, default\n
mkdocs.yml in root, package in subfolder
\ud83d\udcc1 root/\n\u251c\u2500\u2500 \ud83d\udcc4 mkdocs.yml\n\u2514\u2500\u2500 \ud83d\udcc1 src/\n \u2514\u2500\u2500 \ud83d\udcc1 package/\n
mkdocs.ymlplugins:\n- mkdocstrings:\n handlers:\n python:\n paths: [src]\n
mkdocs.yml in subfolder, package in root
\ud83d\udcc1 root/\n\u251c\u2500\u2500 \ud83d\udcc1 docs/\n\u2502 \u2514\u2500\u2500 \ud83d\udcc4 mkdocs.yml\n\u2514\u2500\u2500 \ud83d\udcc1 package/\n
mkdocs.ymlplugins:\n- mkdocstrings:\n handlers:\n python:\n paths: [..]\n
mkdocs.yml in subfolder, package in subfolder
\ud83d\udcc1 root/\n\u251c\u2500\u2500 \ud83d\udcc1 docs/\n\u2502 \u2514\u2500\u2500 \ud83d\udcc4 mkdocs.yml\n\u2514\u2500\u2500 \ud83d\udcc1 src/\n \u2514\u2500\u2500 \ud83d\udcc1 package/\n
mkdocs.ymlplugins:\n- mkdocstrings:\n handlers:\n python:\n paths: [../src]\n
Except for case 1, which is supported by default, we strongly recommend setting the path to your packages using this option, even if it works without it (for example because your project manager automatically adds src
to PYTHONPATH), to make sure anyone can build your docs from any location on their filesystem.
This method has limitations.
This method might work for you, with your current setup, but not for others trying your build your docs with their own setup/environment. We recommend using the paths
method instead.
You can take advantage of the usual Python loading mechanisms. In Bash and other shells, you can run your command like this (note the prepended PYTHONPATH=...
):
mkdocs.yml in root, package in root
\ud83d\udcc1 root/\n\u251c\u2500\u2500 \ud83d\udcc4 mkdocs.yml\n\u2514\u2500\u2500 \ud83d\udcc1 package/\n
PYTHONPATH=. mkdocs build # actually not needed, default\n
mkdocs.yml in root, package in subfolder
\ud83d\udcc1 root/\n\u251c\u2500\u2500 \ud83d\udcc4 mkdocs.yml\n\u2514\u2500\u2500 \ud83d\udcc1 src/\n \u2514\u2500\u2500 \ud83d\udcc1 package/\n
PYTHONPATH=src mkdocs build\n
mkdocs.yml in subfolder, package in root
\ud83d\udcc1 root/\n\u251c\u2500\u2500 \ud83d\udcc1 docs/\n\u2502 \u2514\u2500\u2500 \ud83d\udcc4 mkdocs.yml\n\u2514\u2500\u2500 \ud83d\udcc1 package/\n
PYTHONPATH=. mkdocs build -f docs/mkdocs.yml\n
mkdocs.yml in subfolder, package in subfolder
\ud83d\udcc1 root/\n\u251c\u2500\u2500 \ud83d\udcc1 docs/\n\u2502 \u2514\u2500\u2500 \ud83d\udcc4 mkdocs.yml\n\u2514\u2500\u2500 \ud83d\udcc1 src/\n \u2514\u2500\u2500 \ud83d\udcc1 package/\n
PYTHONPATH=src mkdocs build -f docs/mkdocs.yml\n
This method has limitations.
This method might work for you, with your current setup, but not for others trying your build your docs with their own setup/environment. We recommend using the paths
method instead.
Install your package in the current environment, and run MkDocs:
pipPDMPoetry. venv/bin/activate\npip install -e .\nmkdocs build\n
pdm install\npdm run mkdocs build\n
poetry install\npoetry run mkdocs build\n
"},{"location":"usage/customization/","title":"Customization","text":"It is possible to customize the output of the generated documentation with CSS and/or by overriding templates.
"},{"location":"usage/customization/#css-classes","title":"CSS classes","text":"Our templates add CSS classes to many HTML elements to make it possible for users to customize the resulting look and feel.
To add CSS rules and style mkdocstrings' output, put them in a CSS file in your docs folder, for example in docs/css/mkdocstrings.css
, and reference this file in MkDocs' extra_css
configuration option:
extra_css:\n- css/mkdocstrings.css\n
Example:
docs/css/mkdocstrings.css.doc-section-title {\n font-weight: bold;\n}\n
The following CSS classes are used in the generated HTML:
doc
: on all the following elementsdoc-children
: on div
s containing the children of an objectdoc-object
: on div
s containing an objectdoc-attribute
: on div
s containing an attributedoc-class
: on div
s containing a classdoc-function
: on div
s containing a functiondoc-module
: on div
s containing a moduledoc-heading
: on objects headingsdoc-object-name
: on span
s wrapping objects names/paths in the headingdoc-KIND-name
: as above, specific to the kind of object (module, class, function, attribute)doc-contents
: on div
s wrapping the docstring then the children (if any)first
: same, but only on the root object's contents div
doc-labels
: on span
s wrapping the object's labelsdoc-label
: on small
elements containing a labeldoc-label-LABEL
: same, where LABEL
is replaced by the actual labeldoc-section-title
: on section titles (depend on the selected style for section rendering)doc-section-item
: on section items (depend on the selected style for section rendering)doc-md-description
: on div
s containing HTML descriptions converted from Markdown docstringsdoc-symbol
: on code
tags of symbol typesdoc-symbol-heading
: on symbol types in headingsdoc-symbol-toc
: on symbol types in the ToCdoc-symbol-KIND
: specific to the kind of object (module
, class
, function
, method
, attribute
)Example with colorful labels
CSSResult.doc-label { border-radius: 15px; padding: 2px 8px; font-weight: bold; }\n.doc-label-special { background-color: #3330E4; color: white; }\n.doc-label-private { background-color: #F637EC; color: white; }\n.doc-label-property { background-color: #FBB454; color: black; }\n.doc-label-read-only { background-color: #FAEA48; color: black; }\n
special private property read-only
"},{"location":"usage/customization/#symbol-types","title":"Symbol types","text":""},{"location":"usage/customization/#colors","title":"Colors","text":"You can customize the colors of the symbol types (see show_symbol_type_heading
and show_symbol_type_toc
) by overriding the values of our CSS variables, for example:
[data-md-color-scheme=\"default\"] {\n --doc-symbol-parameter-fg-color: #df50af;\n --doc-symbol-attribute-fg-color: #0079ff;\n --doc-symbol-function-fg-color: #00dfa2;\n --doc-symbol-method-fg-color: #00dfa2;\n --doc-symbol-class-fg-color: #d1b619;\n --doc-symbol-module-fg-color: #ff0060;\n\n --doc-symbol-parameter-bg-color: #df50af1a;\n --doc-symbol-attribute-bg-color: #0079ff1a;\n --doc-symbol-function-bg-color: #00dfa21a;\n --doc-symbol-method-bg-color: #00dfa21a;\n --doc-symbol-class-bg-color: #d1b6191a;\n --doc-symbol-module-bg-color: #ff00601a;\n}\n\n[data-md-color-scheme=\"slate\"] {\n --doc-symbol-parameter-fg-color: #ffa8cc;\n --doc-symbol-attribute-fg-color: #963fb8;\n --doc-symbol-function-fg-color: #6d67e4;\n --doc-symbol-method-fg-color: #6d67e4;\n --doc-symbol-class-fg-color: #46c2cb;\n --doc-symbol-module-fg-color: #f2f7a1;\n\n --doc-symbol-parameter-bg-color: #ffa8cc1a;\n --doc-symbol-attribute-bg-color: #963fb81a;\n --doc-symbol-function-bg-color: #6d67e41a;\n --doc-symbol-method-bg-color: #6d67e41a;\n --doc-symbol-class-bg-color: #46c2cb1a;\n --doc-symbol-module-bg-color: #f2f7a11a;\n}\n
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:
:root {\n --doc-symbol-parameter-fg-color: #df50af;\n --doc-symbol-attribute-fg-color: #0079ff;\n --doc-symbol-function-fg-color: #00dfa2;\n --doc-symbol-method-fg-color: #00dfa2;\n --doc-symbol-class-fg-color: #d1b619;\n --doc-symbol-module-fg-color: #ff0060;\n\n --doc-symbol-parameter-bg-color: #df50af1a;\n --doc-symbol-attribute-bg-color: #0079ff1a;\n --doc-symbol-function-bg-color: #00dfa21a;\n --doc-symbol-method-bg-color: #00dfa21a;\n --doc-symbol-class-bg-color: #d1b6191a;\n --doc-symbol-module-bg-color: #ff00601a;\n}\n
Preview
Try cycling through the themes to see the colors for each theme:
You can also change the actual symbol names. For example, to use single letters instead of truncated types:
docs/css/mkdocstrings.css.doc-symbol-parameter::after {\n content: \"P\";\n}\n\n.doc-symbol-attribute::after {\n content: \"A\";\n}\n\n.doc-symbol-function::after {\n content: \"F\";\n}\n\n.doc-symbol-method::after {\n content: \"M\";\n}\n\n.doc-symbol-class::after {\n content: \"C\";\n}\n\n.doc-symbol-module::after {\n content: \"M\";\n}\n
Preview
Templates are organized into the following tree:
\ud83d\udcc1 theme/\n\u251c\u2500\u2500 \ud83d\udcc4 attribute.html\n\u251c\u2500\u2500 \ud83d\udcc4 attribute.html.jinja\n\u251c\u2500\u2500 \ud83d\udcc4 children.html\n\u251c\u2500\u2500 \ud83d\udcc4 children.html.jinja\n\u251c\u2500\u2500 \ud83d\udcc4 class.html\n\u251c\u2500\u2500 \ud83d\udcc4 class.html.jinja\n\u251c\u2500\u2500 \ud83d\udcc1 docstring/\n\u2502 \u251c\u2500\u2500 \ud83d\udcc4 admonition.html\n\u2502 \u251c\u2500\u2500 \ud83d\udcc4 admonition.html.jinja\n\u2502 \u251c\u2500\u2500 \ud83d\udcc4 attributes.html\n\u2502 \u251c\u2500\u2500 \ud83d\udcc4 attributes.html.jinja\n\u2502 \u251c\u2500\u2500 \ud83d\udcc4 classes.html\n\u2502 \u251c\u2500\u2500 \ud83d\udcc4 classes.html.jinja\n\u2502 \u251c\u2500\u2500 \ud83d\udcc4 examples.html\n\u2502 \u251c\u2500\u2500 \ud83d\udcc4 examples.html.jinja\n\u2502 \u251c\u2500\u2500 \ud83d\udcc4 functions.html\n\u2502 \u251c\u2500\u2500 \ud83d\udcc4 functions.html.jinja\n\u2502 \u251c\u2500\u2500 \ud83d\udcc4 modules.html\n\u2502 \u251c\u2500\u2500 \ud83d\udcc4 modules.html.jinja\n\u2502 \u251c\u2500\u2500 \ud83d\udcc4 other_parameters.html\n\u2502 \u251c\u2500\u2500 \ud83d\udcc4 other_parameters.html.jinja\n\u2502 \u251c\u2500\u2500 \ud83d\udcc4 parameters.html\n\u2502 \u251c\u2500\u2500 \ud83d\udcc4 parameters.html.jinja\n\u2502 \u251c\u2500\u2500 \ud83d\udcc4 raises.html\n\u2502 \u251c\u2500\u2500 \ud83d\udcc4 raises.html.jinja\n\u2502 \u251c\u2500\u2500 \ud83d\udcc4 receives.html\n\u2502 \u251c\u2500\u2500 \ud83d\udcc4 receives.html.jinja\n\u2502 \u251c\u2500\u2500 \ud83d\udcc4 returns.html\n\u2502 \u251c\u2500\u2500 \ud83d\udcc4 returns.html.jinja\n\u2502 \u251c\u2500\u2500 \ud83d\udcc4 warns.html\n\u2502 \u251c\u2500\u2500 \ud83d\udcc4 warns.html.jinja\n\u2502 \u251c\u2500\u2500 \ud83d\udcc4 yields.html\n\u2502 \u2514\u2500\u2500 \ud83d\udcc4 yields.html.jinja\n\u251c\u2500\u2500 \ud83d\udcc4 docstring.html\n\u251c\u2500\u2500 \ud83d\udcc4 docstring.html.jinja\n\u251c\u2500\u2500 \ud83d\udcc4 expression.html\n\u251c\u2500\u2500 \ud83d\udcc4 expression.html.jinja\n\u251c\u2500\u2500 \ud83d\udcc4 function.html\n\u251c\u2500\u2500 \ud83d\udcc4 function.html.jinja\n\u251c\u2500\u2500 \ud83d\udcc4 labels.html\n\u251c\u2500\u2500 \ud83d\udcc4 labels.html.jinja\n\u251c\u2500\u2500 \ud83d\udcc4 language.html\n\u251c\u2500\u2500 \ud83d\udcc4 language.html.jinja\n\u251c\u2500\u2500 \ud83d\udcc1 languages/\n\u2502 \u251c\u2500\u2500 \ud83d\udcc4 en.html\n\u2502 \u251c\u2500\u2500 \ud83d\udcc4 en.html.jinja\n\u2502 \u251c\u2500\u2500 \ud83d\udcc4 ja.html\n\u2502 \u251c\u2500\u2500 \ud83d\udcc4 ja.html.jinja\n\u2502 \u251c\u2500\u2500 \ud83d\udcc4 zh.html\n\u2502 \u2514\u2500\u2500 \ud83d\udcc4 zh.html.jinja\n\u251c\u2500\u2500 \ud83d\udcc4 module.html\n\u251c\u2500\u2500 \ud83d\udcc4 module.html.jinja\n\u251c\u2500\u2500 \ud83d\udcc4 signature.html\n\u251c\u2500\u2500 \ud83d\udcc4 signature.html.jinja\n\u251c\u2500\u2500 \ud83d\udcc1 summary/\n\u2502 \u251c\u2500\u2500 \ud83d\udcc4 attributes.html\n\u2502 \u251c\u2500\u2500 \ud83d\udcc4 attributes.html.jinja\n\u2502 \u251c\u2500\u2500 \ud83d\udcc4 classes.html\n\u2502 \u251c\u2500\u2500 \ud83d\udcc4 classes.html.jinja\n\u2502 \u251c\u2500\u2500 \ud83d\udcc4 functions.html\n\u2502 \u251c\u2500\u2500 \ud83d\udcc4 functions.html.jinja\n\u2502 \u251c\u2500\u2500 \ud83d\udcc4 modules.html\n\u2502 \u2514\u2500\u2500 \ud83d\udcc4 modules.html.jinja\n\u251c\u2500\u2500 \ud83d\udcc4 summary.html\n\u2514\u2500\u2500 \ud83d\udcc4 summary.html.jinja\n
See them in the repository. See the general mkdocstrings documentation to learn how to override them: https://mkdocstrings.github.io/theming/#templates.
Each one of these templates extends a base version in theme/_base
. Example:
{% extends \"_base/class.html\" %}\n
Some of these templates define Jinja blocks. allowing to customize only parts of a template without having to fully copy-paste it into your project:
templates/theme/class.html{% extends \"_base/class.html\" %}\n{% block contents %}\n {{ block.super }}\n Additional contents\n{% endblock contents %}\n
"},{"location":"usage/customization/#available-blocks","title":"Available blocks","text":"Only the templates for the Material for MkDocs provide Jinja blocks. The following tables show the block names, description, and the Jinja context available in their scope.
"},{"location":"usage/customization/#modulehtml","title":"module.html
","text":"heading
: The module heading.labels
: The module labels.contents
: The module contents: docstring and children blocks.docstring
: The module docstring.summary
: The automatic summaries of members.children
: The module children.Available context:
config
: The handler configuration (dictionary).module
: The Module instance.class.html
","text":"heading
: The class heading.labels
: The class labels.signature
: The class signature.contents
: The class contents: bases, docstring, source and children blocks.bases
: The class bases.docstring
: The class docstring.summary
: The automatic summaries of members.source
: The class source code.children
: The class children.Available context:
config
: The handler configuration (dictionary).class
: The Class instance.function.html
","text":"heading
: The function heading.labels
: The function labels.signature
: The function signature.contents
: The function contents: docstring and source blocks.docstring
: The function docstring.source
: The function source code.Available context:
config
: The handler configuration (dictionary).function
: The Function instance.attribute.html
","text":"heading
: The attribute heading.labels
: The attribute labels.signature
: The attribute signature.contents
: The attribute contents: docstring block.docstring
: The attribute docstring.Available context:
config
: The handler configuration (dictionary).attribute
: The Attribute instance.In docstring/attributes.html
, docstring/functions.html
, docstring/classes.html
, docstring/modules.html
, docstring/other_parameters.html
, docstring/parameters.html
, docstring/raises.html
, docstring/receives.html
, docstring/returns.html
, docstring/warns.html
, and docstring/yields.html
:
table_style
: The section as a table.list_style
: The section as a list.spacy_style
: The section as a Spacy table.Available context:
section
: The DocstringSection instance (see DocstringSection*
subclasses).You can customize the colors in syntax highlighted signatures. If you are using the Material for MkDocs theme, here are some customization examples:
/* Fancier color for operators such as * and |. */\n.doc-signature .o {\n color: var(--md-code-hl-special-color);\n}\n\n/* Fancier color for constants such as None, True, and False. */\n.doc-signature .kc {\n color: var(--md-code-hl-constant-color);\n}\n\n/* Fancier color for built-in types (only useful when cross-references are used). */\n.doc-signature .n > a[href^=\"https://docs.python.org/\"][href*=\"/functions.html#\"],\n.doc-signature .n > a[href^=\"https://docs.python.org/\"][href*=\"/stdtypes.html#\"] {\n color: var(--md-code-hl-constant-color);\n}\n
For other themes, use their own CSS variables, or use plain colors such as violet
or #2987f2
.
Here are some CSS rules for the Material for MkDocs theme:
/* Indentation. */\ndiv.doc-contents:not(.first) {\n padding-left: 25px;\n border-left: .05rem solid var(--md-typeset-table-color);\n}\n\n/* Mark external links as such. */\na.external::after,\na.autorefs-external::after {\n /* https://primer.style/octicons/arrow-up-right-24 */\n mask-image: url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M18.25 15.5a.75.75 0 00.75-.75v-9a.75.75 0 00-.75-.75h-9a.75.75 0 000 1.5h7.19L6.22 16.72a.75.75 0 101.06 1.06L17.5 7.56v7.19c0 .414.336.75.75.75z\"></path></svg>');\n -webkit-mask-image: url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M18.25 15.5a.75.75 0 00.75-.75v-9a.75.75 0 00-.75-.75h-9a.75.75 0 000 1.5h7.19L6.22 16.72a.75.75 0 101.06 1.06L17.5 7.56v7.19c0 .414.336.75.75.75z\"></path></svg>');\n content: ' ';\n\n display: inline-block;\n vertical-align: middle;\n position: relative;\n\n height: 1em;\n width: 1em;\n background-color: currentColor;\n}\n\na.external:hover::after,\na.autorefs-external:hover::after {\n background-color: var(--md-accent-fg-color);\n}\n
"},{"location":"usage/customization/#readthedocs","title":"ReadTheDocs","text":"Here are some CSS rules for the built-in ReadTheDocs theme:
/* Indentation. */\ndiv.doc-contents:not(.first) {\n padding-left: 25px;\n border-left: .05rem solid rgba(200, 200, 200, 0.2);\n}\n
"},{"location":"usage/extensions/","title":"Extensions","text":""},{"location":"usage/extensions/#work-in-progress","title":"Work in Progress!","text":"The Python handler supports extensions through mkdocstrings' handler extensions.
Specifically, additional templates can be added to the handler, and Griffe extensions can instruct the handler to use a particular template for a particular object by setting a value in the Griffe object's extra
dictionary:
obj = ... # get a reference to a Griffe object\nif \"mkdocstrings\" not in obj.extra:\n obj.extra[\"mkdocstrings\"] = {}\nobj.extra[\"mkdocstrings\"][\"template\"] = \"template_name.html\"\n
"},{"location":"usage/configuration/docstrings/","title":"Docstrings options","text":""},{"location":"usage/configuration/docstrings/#docstring_style","title":"docstring_style
","text":"str
\"google\"
The docstring style to expect when parsing docstrings.
Possible values:
\"google\"
: see Google style.\"numpy\"
: see Numpy style.\"sphinx\"
: see Sphinx style.None
(null
or ~
in YAML): no style at all, parse as regular text.plugins:\n- mkdocstrings:\n handlers:\n python:\n options:\n docstring_style: google\n
or in docs/some_page.md (local configuration)::: path.to.module\n options:\n docstring_style: numpy\n
Preview
Every style gets rendered the same way. Here are some docstring examples.
GoogleNumpySphinxdef greet(name: str) -> str:\n \"\"\"Greet someone.\n\n Parameters:\n name: The name of the person to greet.\n\n Returns:\n A greeting message.\n \"\"\"\n return f\"Hello {name}!\"\n
def greet(name: str) -> str:\n \"\"\"Greet someone.\n\n Parameters\n ----------\n name\n The name of the person to greet.\n\n Returns\n -------\n A greeting message.\n \"\"\"\n return f\"Hello {name}!\"\n
def greet(name: str) -> str:\n \"\"\"Greet someone.\n\n :param name: The name of the person to greet.\n :return: A greeting message.\n \"\"\"\n return f\"Hello {name}!\"\n
"},{"location":"usage/configuration/docstrings/#docstring_options","title":"docstring_options
PrintOK
PrintOK
","text":"dict
{}
The options for the docstring parser.
The Sphinx style does not offer any option.
in mkdocs.yml (global configuration)plugins:\n- mkdocstrings:\n handlers:\n python:\n options:\n docstring_options:\n ignore_init_summary: false\n trim_doctest_flags: true\n
or in docs/some_page.md (local configuration)::: path.to.module\n options:\n docstring_options:\n ignore_init_summary: true\n trim_doctest_flags: false\n
class PrintOK:\n \"\"\"Class docstring.\"\"\"\n\n def __init__(self):\n \"\"\"Initialize the instance.\n\n Examples:\n >>> PrintOK() # doctest: +NORMALIZE_WHITESPACE\n ok\n \"\"\"\n print(\"ok\")\n
Preview
Ignore init summary, trim doctest flagsKeep init summary and doctest flagsClass docstring.
__init__
Examples:
>>> PrintOK()\nok\n
Class docstring.
__init__
Initialize the instance.
Examples:
>>> PrintOK() # doctest: +NORMALIZE_WHITESPACE\nok\n
"},{"location":"usage/configuration/docstrings/#docstring_section_style","title":"docstring_section_style
","text":"str
\"table\"
The style used to render docstring sections.
A section is a block of text that has a special meaning in a docstring. There are sections for documenting attributes of an object, parameters of a function, exceptions raised by a function, the return value of a function, etc.
Sections are parsed as structured data and can therefore be rendered in different ways. Possible values:
\"table\"
: a simple table, usually with type, name and description columns\"list\"
: a simple list, akin to what you get with the ReadTheDocs Sphinx theme\"spacy\"
: a poor implementation of the amazing tables in Spacy's documentationplugins:\n- mkdocstrings:\n handlers:\n python:\n options:\n docstring_section_style: table\n
or in docs/some_page.md (local configuration)::: path.to.module\n options:\n docstring_section_style: list\n
Preview
TableListSpacyTables work well when you have lots of items with short names, type annotations, descriptions, etc.. With longer strings, the columns risk getting squished horizontally. In that case, the Spacy tables can help.
Parameters:
Type Name Description Defaultint
threshold
Threshold for something. required bool
flag
Enable something. False
Other Parameters:
Type Name Description Defaultlist[int | float]
gravity_forces
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. required VacuumType | Literal[\"regular\"]
vacuum_type
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. VacuumType.PLASMA
Lists work well whatever the length of names, type annotations, descriptions, etc.
Parameters:
threshold
(int
) \u2014 Threshold for something.flag
(bool
) \u2014 Enable something.Other Parameters:
gravity_forces
(list[int | float]
) \u2014 Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.vacuum_type
(VacuumType | Literal[\"regular\"]
) \u2014 Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.Spacy tables work better than regular tables with longer names, type annotations, descriptions, etc., by reserving more horizontal space on the second column.
Parameters:
Name Descriptionthreshold
Threshold for something.TYPE: int
DEFAULT: required flag
Enable something.TYPE: bool
DEFAULT: False
Other Parameters:
Name Descriptiongravity_forces
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.TYPE: list[int | float]
DEFAULT: required vacuum_type
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.TYPE:VacuumType | Literal[\"regular\"]
DEFAULT: VacuumType.PLASMA
"},{"location":"usage/configuration/docstrings/#merge_init_into_class","title":"merge_init_into_class
Thing(value=0)
Thing
","text":"bool
False
Whether to merge the __init__
method into the class' signature and docstring.
By default, only the class name is rendered in headings. When merging, the __init__
method parameters are added after the class name, like a signature, and the __init__
method docstring is appended to the class' docstring. This option is well used in combination with the ignore_init_summary
docstring option, to discard the first line of the __init__
docstring which is not often useful.
plugins:\n- mkdocstrings:\n handlers:\n python:\n options:\n docstring_options:\n ignore_init_summary: false\n merge_init_into_class: false\n
or in docs/some_page.md (local configuration)::: path.to.module\n options:\n docstring_options:\n ignore_init_summary: true\n merge_init_into_class: true\n
class Thing:\n \"\"\"A class for things.\"\"\"\n\n def __init__(self, value: int = 0):\n \"\"\"Initialize a thing.\n\n Parameters:\n value: The thing's value.\n \"\"\"\n self.value = value\n
Preview
Merged, summary discardedUnmerged, summary keptClass docstring.
Parameters:
Type Name Description Defaultint
value
The thing's value. 0
Class docstring.
__init__(value=0)
Initialize a thing.
Parameters:
Type Name Description Defaultint
value
The thing's value. 0
"},{"location":"usage/configuration/docstrings/#show_if_no_docstring","title":"show_if_no_docstring
function_without_docstring
function_with_docstring
ClassWithoutDocstring
function_with_docstring
ClassWithoutDocstring
","text":"bool
False
Show the object heading even if it has no docstring or children with docstrings.
Without an explicit list of members
, members are selected based on filters
, and then filtered again to keep only those with docstrings. Checking if a member has a docstring is done recursively: if at least one of its direct or indirect members (lower in the tree) has a docstring, the member is rendered. If the member does not have a docstring, and none of its members have a docstring, it is excluded.
With this option you can tell the Python handler to skip the docstring check.
in mkdocs.yml (global configuration)plugins:\n- mkdocstrings:\n handlers:\n python:\n options:\n show_if_no_docstring: false\n
or in docs/some_page.md (local configuration)::: path.to.module\n options:\n show_if_no_docstring: true\n
def function_without_docstring():\n ...\n\n\ndef function_with_docstring():\n \"\"\"Hello.\"\"\"\n\n\nclass ClassWithoutDocstring:\n def method_without_docstring(self):\n ...\n\n def method_with_docstring(self):\n \"\"\"Hello.\"\"\"\n
Preview
ShowDon't showHello.
method_without_docstring
method_with_docstring
Hello.
Hello.
method_with_docstring
Hello.
"},{"location":"usage/configuration/docstrings/#show_docstring_attributes","title":"show_docstring_attributes
Class
Class
","text":"bool
True
Whether to render the \"Attributes\" sections of docstrings.
in mkdocs.yml (global configuration)plugins:\n- mkdocstrings:\n handlers:\n python:\n options:\n show_docstring_attributes: true\n
or in docs/some_page.md (local configuration)::: path.to.module\n options:\n show_docstring_attributes: false\n
class Class:\n \"\"\"Summary.\n\n Attributes:\n attr: Some attribute.\n \"\"\"\n\n attr: int = 1\n
Preview
With attributesWithout attributesSummary.
Attributes:
Type Name Descriptionint
attr
Some attribute. Summary.
"},{"location":"usage/configuration/docstrings/#show_docstring_functions","title":"show_docstring_functions
modulemodule","text":"bool
True
Whether to render the \"Functions\" or \"Methods\" sections of docstrings.
in mkdocs.yml (global configuration)plugins:\n- mkdocstrings:\n handlers:\n python:\n options:\n show_docstring_functions: true\n
or in docs/some_page.md (local configuration)::: path.to.module\n options:\n show_docstring_functions: false\n
\"\"\"Summary.\n\nFunctions:\n foo: Some function.\n\"\"\"\n\n\ndef foo():\n ...\n\n\nclass Class:\n \"\"\"Summary.\n\n Methods:\n bar: Some method.\n \"\"\"\n\n def bar(self):\n ...\n
Preview
With functionsWithout functionsSummary.
Functions:
Name Descriptionfoo
Some function. Class
Summary.
Methods:
Name Descriptionbar
Some method. Summary.
Class
Summary.
"},{"location":"usage/configuration/docstrings/#show_docstring_classes","title":"show_docstring_classes
modulemodule","text":"bool
True
Whether to render the \"Classes\" sections of docstrings.
in mkdocs.yml (global configuration)plugins:\n- mkdocstrings:\n handlers:\n python:\n options:\n show_docstring_classes: true\n
or in docs/some_page.md (local configuration)::: path.to.module\n options:\n show_docstring_classes: false\n
\"\"\"Summary.\n\nClasses:\n Class: Some class.\n\"\"\"\n\n\nclass Class:\n \"\"\"Summary.\"\"\"\n
Preview
With classesWithout classesSummary.
Classes:
Name DescriptionClass
Some class. Class
Summary.
Summary.
Class
Summary.
"},{"location":"usage/configuration/docstrings/#show_docstring_modules","title":"show_docstring_modules
modulemodule","text":"bool
True
Whether to render the \"Modules\" sections of docstrings.
in mkdocs.yml (global configuration)plugins:\n- mkdocstrings:\n handlers:\n python:\n options:\n show_docstring_modules: true\n
or in docs/some_page.md (local configuration)::: path.to.module\n options:\n show_docstring_modules: false\n
\ud83d\udcc1 module/\n\u251c\u2500\u2500 \ud83d\udcc4 __init__.py\n\u2514\u2500\u2500 \ud83d\udcc4 submodule.py\n
module/__init__.py\"\"\"Summary.\n\nModules:\n submodule: Some module.\n\"\"\"\n
Preview
With modulesWithout modulesSummary.
Modules:
Name Descriptionsubmodule
Some module. Summary.
"},{"location":"usage/configuration/docstrings/#show_docstring_description","title":"show_docstring_description
Class
Class
","text":"bool
True
Whether to render the textual blocks (including admonitions) of docstrings.
in mkdocs.yml (global configuration)plugins:\n- mkdocstrings:\n handlers:\n python:\n options:\n show_docstring_description: true\n
or in docs/some_page.md (local configuration)::: path.to.module\n options:\n show_docstring_description: false\n
class Class:\n \"\"\"Summary.\n\n Long description.\n\n Warning: Deprecated\n Stop using this class.\n\n Attributes:\n attr: Some attribute.\n \"\"\"\n\n attr: int = 1\n
Preview
With description blocksWithout description blocksSummary.
Long description.
DeprecatedStop using this class.
Attributes:
Type Name Descriptionint
attr
Some attribute. Attributes:
Type Name Descriptionint
attr
Some attribute."},{"location":"usage/configuration/docstrings/#show_docstring_examples","title":"show_docstring_examples
print_hello
print_hello
","text":"bool
True
Whether to render the \"Examples\" section of docstrings.
in mkdocs.yml (global configuration)plugins:\n- mkdocstrings:\n handlers:\n python:\n options:\n show_docstring_examples: true\n
or in docs/some_page.md (local configuration)::: path.to.module\n options:\n show_docstring_examples: false\n
def print_hello():\n \"\"\"Print hello.\n\n Examples:\n >>> print(\"hello\")\n hello\n \"\"\"\n print(\"hello\")\n
Preview
With examplesWithout examplesPrint hello.
Examples:
>>> print(\"hello\")\nhello\n
Print hello.
"},{"location":"usage/configuration/docstrings/#show_docstring_other_parameters","title":"show_docstring_other_parameters
do_something
do_something
","text":"bool
True
Whether to render the \"Other Parameters\" section of docstrings.
in mkdocs.yml (global configuration)plugins:\n- mkdocstrings:\n handlers:\n python:\n options:\n show_docstring_other_parameters: true\n
or in docs/some_page.md (local configuration)::: path.to.module\n options:\n show_docstring_other_parameters: false\n
def do_something(**kwargs):\n \"\"\"Do something.\n\n Other parameters:\n whatever (int): Some integer.\n \"\"\"\n
Preview
With other parametersWithout other parametersDo something.
Other parameters:
Type Name Descriptionint
whatever
Some integer. Do something.
"},{"location":"usage/configuration/docstrings/#show_docstring_parameters","title":"show_docstring_parameters
do_something
do_something
","text":"bool
True
Whether to render the \"Parameters\" section of docstrings.
in mkdocs.yml (global configuration)plugins:\n- mkdocstrings:\n handlers:\n python:\n options:\n show_docstring_parameters: true\n
or in docs/some_page.md (local configuration)::: path.to.module\n options:\n show_docstring_parameters: false\n
def do_something(whatever: int = 0):\n \"\"\"Do something.\n\n Parameters:\n whatever: Some integer.\n \"\"\"\n
Preview
With parametersWithout parametersDo something.
Parameters:
Type Name Description Defaultint
whatever
Some integer. 0
Do something.
"},{"location":"usage/configuration/docstrings/#show_docstring_raises","title":"show_docstring_raises
raise_runtime_error
raise_runtime_error
","text":"bool
True
Whether to render the \"Raises\" section of docstrings.
in mkdocs.yml (global configuration)plugins:\n- mkdocstrings:\n handlers:\n python:\n options:\n show_docstring_raises: true\n
or in docs/some_page.md (local configuration)::: path.to.module\n options:\n show_docstring_raises: false\n
def raise_runtime_error():\n \"\"\"Raise a runtime error.\n\n Raises:\n RuntimeError: Not good.\n \"\"\"\n raise RuntimeError\n
Preview
With exceptionsWithout exceptionsRaise a runtime error.
Raises:
Type DescriptionRuntimeError
Not good. Raise a runtime error.
"},{"location":"usage/configuration/docstrings/#show_docstring_receives","title":"show_docstring_receives
iter_skip
iter_skip
","text":"bool
True
Whether to render the \"Receives\" section of docstrings.
in mkdocs.yml (global configuration)plugins:\n- mkdocstrings:\n handlers:\n python:\n options:\n show_docstring_receives: true\n
or in docs/some_page.md (local configuration)::: path.to.module\n options:\n show_docstring_receives: false\n
def iter_skip(\n iterable: Iterable[T],\n initial_skip: int = 0,\n) -> Generator[T, int, None]:\n \"\"\"Iterate and skip elements.\n\n Receives:\n skip: Number of elements to skip.\n \"\"\"\n skip = initial_skip\n for element in iterable:\n if skip or 0 > 0:\n skip -= 1\n else:\n skip = yield element\n
Preview
With received valuesWithout received valuesIterate and skip elements.
Receives:
Type Descriptionint
Number of elements to skip. Iterate and skip elements.
"},{"location":"usage/configuration/docstrings/#show_docstring_returns","title":"show_docstring_returns
rand
rand
","text":"bool
True
Whether to render the \"Returns\" section of docstrings.
in mkdocs.yml (global configuration)plugins:\n- mkdocstrings:\n handlers:\n python:\n options:\n show_docstring_returns: true\n
or in docs/some_page.md (local configuration)::: path.to.module\n options:\n show_docstring_returns: false\n
def rand() -> int:\n \"\"\"Return a random number.\n\n Returns:\n A random number.\n \"\"\"\n return random.randint(0, 1000)\n
Preview
With return valueWithout return valueReturn a random number.
Returns:
Type Descriptionint
A random number. Return a random number.
"},{"location":"usage/configuration/docstrings/#show_docstring_warns","title":"show_docstring_warns
warn
warn
","text":"bool
True
Whether to render the \"Warns\" section of docstrings.
in mkdocs.yml (global configuration)plugins:\n- mkdocstrings:\n handlers:\n python:\n options:\n show_docstring_warns: true\n
or in docs/some_page.md (local configuration)::: path.to.module\n options:\n show_docstring_warns: false\n
def warn():\n \"\"\"Warn user.\n\n Warns:\n UserWarning: When this is inappropriate.\n \"\"\"\n warnings.warn(UserWarning(\"This is inappropriate\"))\n
Preview
With warningsWithout warningsWarn user.
Warns:
Type DescriptionUserWarning
When this is inappropriate. Warn user.
"},{"location":"usage/configuration/docstrings/#show_docstring_yields","title":"show_docstring_yields
iter_skip
iter_skip
","text":"bool
True
Whether to render the \"Yields\" section of docstrings.
in mkdocs.yml (global configuration)plugins:\n- mkdocstrings:\n handlers:\n python:\n options:\n show_docstring_yields: true\n
or in docs/some_page.md (local configuration)::: path.to.module\n options:\n show_docstring_yields: false\n
def iter_skip(\n iterable: Iterable[T],\n initial_skip: int = 0,\n) -> Generator[T, int, None]:\n \"\"\"Iterate and skip elements.\n\n Yields:\n Elements of the iterable.\n \"\"\"\n skip = initial_skip\n for element in iterable:\n if skip or 0 > 0:\n skip -= 1\n else:\n skip = yield element\n
Preview
With yielded valuesWithout yielded valuesIterate and skip elements.
Yields:
Type DescriptionT
Elements of the iterable. Iterate and skip elements.
"},{"location":"usage/configuration/general/","title":"General options","text":""},{"location":"usage/configuration/general/#allow_inspection","title":"allow_inspection
SomeClass
SomeClass
","text":"bool
True
Whether to allow inspecting modules (importing them) when it is not possible to visit them (parse their source code).
When loading data for a given package, Griffe discovers every Python module, compiled or not, and inspects or visits them accordingly.
If you have compiled modules but also provide stubs for them, you might want to disable the inspection of these modules, because inspection picks up many more members, and sometimes the collected data is inaccurate (depending on the tool that was used to compile the module) or too low-level/technical for API documentation.
in mkdocs.yml (global configuration)plugins:\n- mkdocstrings:\n handlers:\n python:\n options:\n allow_inspection: true\n
or in docs/some_page.md (local configuration)::: path.to.object\n options:\n allow_inspection: false\n
Preview
With inspectionWithout inspectionDocstring of the class.
__eq__
Method docstring.
__weakref__
Method docstring.
documented_method
Method docstring.
Docstring of the class.
documented_method
Method docstring.
"},{"location":"usage/configuration/general/#show_bases","title":"show_bases
SomeClass()
SomeClass()
","text":"bool
True
Show the base classes of a class.
in mkdocs.yml (global configuration)plugins:\n- mkdocstrings:\n handlers:\n python:\n options:\n show_bases: true\n
or in docs/some_page.md (local configuration)::: path.to.object\n options:\n show_bases: false\n
Preview
With basesWithout basesBases: SomeBaseClass
Docstring of the class.
Docstring of the class.
"},{"location":"usage/configuration/general/#show_inheritance_diagram","title":"show_inheritance_diagram
","text":"Sponsors only \u2014 Insiders 1.7.0
bool
False
Show the inheritance diagram of a class using Mermaid.
With this option enabled, an inheritance diagram (as a flowchart) will be displayed after a class signature. Each node will act as a cross-reference and will bring you to the relevant class' documentation when clicking on it.
It should work out of the box with Material for MkDocs. For other themes, you must include Mermaid's Javascript code manually:
mkdocs.ymlextra_javascript:\n- https://unpkg.com/mermaid@10.9.0/dist/mermaid.min.js\n
in mkdocs.yml (global configuration)plugins:\n- mkdocstrings:\n handlers:\n python:\n options:\n show_inheritance_diagram: true\n
or in docs/some_page.md (local configuration)::: path.to.object\n options:\n show_inheritance_diagram: false\n
Preview
With the following classes:
class SuperAbstract:\n \"\"\"Super abstract class.\"\"\"\nclass Mixin1:\n \"\"\"Mixin 1.\"\"\"\nclass Abstract(SuperAbstract, Mixin1):\n \"\"\"Abstract class.\"\"\"\nclass Mixin2A:\n \"\"\"Mixin 2A.\"\"\"\nclass Mixin2B(Mixin2A):\n \"\"\"Mixin 2B.\"\"\"\nclass Concrete(Abstract, Mixin2B):\n \"\"\"Concrete class.\"\"\"\nclass SuperConcrete(Concrete):\n \"\"\"Super concrete class.\"\"\"\n
The diagram for SuperConcrete
will look like this:
flowchart TD\nSuperConcrete[SuperConcrete]\nConcrete[Concrete]\nAbstract[Abstract]\nSuperAbstract[SuperAbstract]\nMixin1[Mixin1]\nMixin2B[Mixin2B]\nMixin2A[Mixin2A]\n\nConcrete --> SuperConcrete\nAbstract --> Concrete\nSuperAbstract --> Abstract\nMixin1 --> Abstract\nMixin2B --> Concrete\nMixin2A --> Mixin2B
Nodes are not clickable in this example because these classes do not exist in our documentation.
"},{"location":"usage/configuration/general/#show_source","title":"show_source
some_function()
some_function()
","text":"bool
True
Show the source code of this object.
in mkdocs.yml (global configuration)plugins:\n- mkdocstrings:\n handlers:\n python:\n options:\n show_source: true\n
or in docs/some_page.md (local configuration)::: path.to.object\n options:\n show_source: false\n
Preview
With sourceWithout sourceDocstring of the function.
Source code inpackage/module.py
def some_function():\n ...\n
Docstring of the function.
"},{"location":"usage/configuration/general/#preload_modules","title":"preload_modules
your_module
your_module
","text":"list[str] | None
None
Pre-load modules that are not specified directly in autodoc instructions (::: identifier
). It is useful when you want to render documentation for a particular member of an object, and this member is imported from another package than its parent.
For an imported member to be rendered, you need to add it to the __all__
attribute of the importing module. The package from which the imported object originates must be accessible to the handler (see Finding modules).
plugins:\n- mkdocstrings:\n handlers:\n python:\n options:\n preload_modules:\n - their_package\n
or in docs/some_page.md (local configuration)::: your_package.your_module\n options:\n preload_modules:\n - their_package \n
your_package/your_module.pyfrom their_package.their_module import their_object\n\n__all__ = [\"their_object\"]\n\n# rest of your code\n
Preview
With preloaded modulesWithout preloaded modulesDocstring of your module.
their_object
Docstring of their object.
Docstring of your module.
"},{"location":"usage/configuration/general/#find_stubs_package","title":"find_stubs_package
your_func
your_func
","text":"bool
False
When looking for documentation specified in autodoc instructions (::: identifier
), also look for the stubs package as defined in PEP 561 if it exists. This is useful when most of your documentation is separately provided by such a package and not inline in your main package.
plugins:\n- mkdocstrings:\n handlers:\n python:\n options:\n find_stubs_package: true\n
or in docs/some_page.md (local configuration)::: your_package.your_module.your_func\n options:\n find_stubs_package: true\n
your_package/your_module.pydef your_func(a, b):\n # Function code\n ...\n\n# rest of your code\n
your_package-stubs/your_module.pyidef your_func(a: int, b: str):\n \"\"\"\n <Function docstring>\n \"\"\"\n ...\n\n# rest of your code\n
Preview
With find_stubs_packageWithout find_stubs_packageFunction docstring
"},{"location":"usage/configuration/headings/","title":"Headings options","text":""},{"location":"usage/configuration/headings/#heading_level","title":"heading_level
","text":"int
2
The initial heading level to use.
When injecting documentation for an object, the object itself and its members are rendered. For each layer of objects, we increase the heading level by 1.
The initial heading level will be used for the first layer. If you set it to 3, then headings will start with <h3>
.
If the heading for the root object is not shown, then the initial heading level is used for its members.
in mkdocs.yml (global configuration)plugins:\n- mkdocstrings:\n handlers:\n python:\n options:\n heading_level: 2\n
or in docs/some_page.md (local configuration)::: path.to.module\n options:\n heading_level: 3\n
Preview
With level 3 and root headingWith level 3, without root headingmodule
(3) Docstring of the module.
ClassA
(4) Docstring of class A.
ClassB
(4) Docstring of class B.
method_1
(5) Docstring of the method.
Docstring of the module.
ClassA
(3) Docstring of class A.
ClassB
(3) Docstring of class B.
method_1
(4) Docstring of the method.
"},{"location":"usage/configuration/headings/#parameter_headings","title":"parameter_headings
","text":"Sponsors only \u2014 Insiders 1.6.0
bool
False
Whether to render headings for function/method parameters.
With this option enabled, each function/method parameter (including parameters of __init__
methods merged in their parent class with the merge_init_into_class
option) gets a permalink, an entry in the Table of Contents, and an entry in the generated objects inventory. The permalink and inventory entry allow cross-references from internal and external pages.
The identifier used in the permalink and inventory is of the following form: path.to.function(param_name)
. To manually cross-reference a parameter, you can therefore use this Markdown syntax:
- Class parameter: [`param`][package.module.Class(param)]\n- Method parameter: [`param`][package.module.Class.method(param)]\n- Function parameter: [`param`][package.module.function(param)]\n- Variadic positional parameters: [`*args`][package.module.function(*args)]\n- Variadic keyword parameters: [`**kwargs`][package.module.function(**kwargs)]\n
Enabling this option along with signature_crossrefs
will automatically render cross-references to parameters in class/function/method signatures and attributes values.
plugins:\n- mkdocstrings:\n handlers:\n python:\n options:\n parameter_headings: false\n
or in docs/some_page.md (local configuration)::: path.to.module\n options:\n parameter_headings: true\n
Preview: Cross-references
Preview: Parameter sections
Table styleList styleSpacy style
Parameters:
Name Type Description Defaultstr
A distribution name.
'mkdocstrings-python'
Parameters:
PARAMETER DESCRIPTION
A distribution name.
TYPE: str
DEFAULT: 'mkdocstrings-python'
Preview: Table of contents (with symbol types)
get_version
dist
To customize symbols, see Customizing symbol types.
"},{"location":"usage/configuration/headings/#package.get_version","title":"get_version","text":"get_version(dist: str = 'mkdocstrings-python') -> str\n
Get version of the given distribution.
Parameters:
Returns:
str
\u2013 A version number.
dist
","text":"(str
, default: 'mkdocstrings-python'
) \u2013 A distribution name.
"},{"location":"usage/configuration/headings/#package.current_version","title":"current_versionmodule-attribute
","text":"current_version: str = get_version(dist='mkdocstrings-python')\n
Current package version.
"},{"location":"usage/configuration/headings/#package.get_version(dist)","title":"dist
","text":""},{"location":"usage/configuration/headings/#package.get_version(dist)","title":"dist
","text":"(str
, default: 'mkdocstrings-python'
) \u2013 A distribution name.
"},{"location":"usage/configuration/headings/#package.get_version(dist)","title":"dist
","text":""},{"location":"usage/configuration/headings/#show_root_heading","title":"show_root_heading
ClassA
(2)ClassB
(2)method_a1
(2)method_b1
(2)","text":"bool
False
Show the heading of the object at the root of the documentation tree (i.e. the object referenced by the identifier after :::
).
It is pretty common to inject documentation for one module per page, especially when following our automatic reference pages recipe. Since each page already has a title, usually being the module's name, we can spare one heading level by not showing the heading for the module itself (heading levels are limited to 6 by the HTML specification).
Sparing that extra level can be helpful when your objects tree is deeply nested (e.g. method in a class in a class in a module). If your objects tree is not deeply nested, and you are injecting documentation for many different objects on a single page, it might be preferable to render the heading of each object.
in mkdocs.yml (global configuration)plugins:\n- mkdocstrings:\n handlers:\n python:\n options:\n show_root_heading: false\n
or in docs/some_page.md (local configuration)::: path.to.ClassA\n options:\n show_root_heading: true\n\n::: path.to.ClassB\n options:\n show_root_heading: true\n
Preview
With root headingWithout root headingDocstring of class A.
method_a1
(3) Docstring of the method.
Docstring of class B.
method_b1
(3) Docstring of the method.
Docstring of class A.
Docstring of the method.
Docstring of class B.
Docstring of the method.
"},{"location":"usage/configuration/headings/#show_root_toc_entry","title":"show_root_toc_entry
","text":"bool
True
If the root heading is not shown, at least add a ToC entry for it.
If you inject documentation for an object in the middle of a page, after long paragraphs, and without showing the root heading, then you will not be able to link to this particular object as it won't have a permalink and will be \"lost\" in the middle of text. In that case, it is useful to add a hidden anchor to the document, which will also appear in the table of contents.
In other cases, you might want to disable the entry to avoid polluting the ToC. It is not possible to show the root heading and hide the ToC entry.
in mkdocs.yml (global configuration)plugins:\n- mkdocstrings:\n handlers:\n python:\n options:\n show_root_toc_entry: true\n
or in docs/some_page.md (local configuration)## Some heading\n\nLots of text.\n\n::: path.to.object\n options:\n show_root_toc_entry: false\n\n## Other heading.\n\nMore text.\n
Preview
With ToC entryWithout ToC entryTable of contents Some heading object
Other heading
Table of contents Some heading Other heading
"},{"location":"usage/configuration/headings/#show_root_full_path","title":"show_root_full_path
package.module.Class.method
method
","text":"bool
True
Show the full Python path for the root object heading.
The path of a Python object is the dot-separated list of names under which it is accessible, for example package.module.Class.method
.
With this option you can choose to show the full path of the object you inject documentation for, or just its name. This option impacts only the object you specify, not its members. For members, see the two other options show_root_members_full_path
and show_object_full_path
.
plugins:\n- mkdocstrings:\n handlers:\n python:\n options:\n show_root_full_path: true\n
or in docs/some_page.md (local configuration)::: package.module.Class.method\n options:\n show_root_full_path: false\n
Preview
With root full pathWithout root full pathDocstring of the method.
Docstring of the method.
"},{"location":"usage/configuration/headings/#show_root_members_full_path","title":"show_root_members_full_path
package.module.Class
Class
","text":"bool
False
Show the full Python path of the root members.
This option does the same thing as show_root_full_path
, but for direct members of the root object instead of the root object itself.
To show the full path for every member recursively, see show_object_full_path
.
plugins:\n- mkdocstrings:\n handlers:\n python:\n options:\n show_root_members_full_path: true\n
or in docs/some_page.md (local configuration)::: package.module\n options:\n show_root_members_full_path: false\n
Preview
With members full pathWithout members full pathDocstring of the module.
Docstring of the class.
method
Docstring of the method.
Docstring of the module.
Docstring of the class.
method
Docstring of the method.
"},{"location":"usage/configuration/headings/#show_object_full_path","title":"show_object_full_path
package.module.Class
Class
","text":"bool
False
Show the full Python path of every object.
Same as for show_root_members_full_path
, but for every member, recursively. This option takes precedence over show_root_members_full_path
:
show_root_members_full_path
show_object_full_path
Direct root members path False False Name only False True Full True False Full True True Full in mkdocs.yml (global configuration)plugins:\n- mkdocstrings:\n handlers:\n python:\n options:\n show_object_full_path: true\n
or in docs/some_page.md (local configuration)::: package.module\n options:\n show_object_full_path: false\n
Preview
With objects full pathWithout objects full pathDocstring of the module.
Docstring of the class.
package.module.Class.method
Docstring of the method.
Docstring of the module.
Docstring of the class.
method
Docstring of the method.
"},{"location":"usage/configuration/headings/#show_category_heading","title":"show_category_heading
Attributes (2)Classes (2)module_attribute
(2)Class
(2)","text":"bool
False
When grouped by categories, show a heading for each category. These category headings will appear in the table of contents, allowing you to link to them using their permalinks.
Not recommended with deeply nested object
When injecting documentation for deeply nested objects, you'll quickly run out of heading levels, and the objects at the bottom of the tree risk all getting documented using H6 headings, which might decrease the readability of your API docs.
in mkdocs.yml (global configuration)plugins:\n- mkdocstrings:\n handlers:\n python:\n options:\n group_by_category: true\n show_category_heading: true\n
or in docs/some_page.md (local configuration)::: package.module\n options:\n group_by_category: true\n show_category_heading: false\n
Preview
With category headingsWithout category headingsDocstring of the module.
module_attribute
(3) Docstring of the module attribute.
Class
(3) Docstring of the class.
Attributes (4)class_attribute
(5) Docstring of the class attribute.
Methods (4)method
(5) Docstring of the method.
Docstring of the module.
Docstring of the module attribute.
Docstring of the class.
class_attribute
(3) Docstring of the class attribute.
method
(3) Docstring of the method.
"},{"location":"usage/configuration/headings/#show_symbol_type_heading","title":"show_symbol_type_heading
attribute
function
Class
attribute
function
Class
","text":"Insiders 1.1.0
bool
False
Show the symbol type in headings.
This option will prefix headings with ,
,
,
or
types. See also
show_symbol_type_toc
.
To customize symbols, see Customizing symbol types.
in mkdocs.yml (global configuration)plugins:\n- mkdocstrings:\n handlers:\n python:\n options:\n show_symbol_type_heading: true\n
or in docs/some_page.md (local configuration)::: package.module\n options:\n show_symbol_type_heading: false\n
Preview
With symbol type in headingsWithout symbol type in headings
module
Docstring of the module.
Docstring of the module attribute.
Docstring of the function.
Docstring of the class.
method
Docstring of the method.
module
Docstring of the module.
Docstring of the module attribute.
Docstring of the function.
Docstring of the class.
method
Docstring of the method.
"},{"location":"usage/configuration/headings/#show_symbol_type_toc","title":"show_symbol_type_toc
","text":"Insiders 1.1.0
bool
False
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
.
To customize symbols, see Customizing symbol types.
in mkdocs.yml (global configuration)plugins:\n- mkdocstrings:\n handlers:\n python:\n options:\n show_symbol_type_toc: true\n
or in docs/some_page.md (local configuration)::: package.module\n options:\n show_symbol_type_toc: false\n
Preview
With symbol type in ToCWithout symbol type in ToC
module
attribute
function
Class
methodmembers
this_function
ThisClass
this_attribute
ThisClass
","text":"list[str] | bool | None
None
An explicit list of members to render.
Only members declared in this list will be rendered. A member without a docstring will still be rendered, even if show_if_no_docstring
is set to false.
The members will be rendered in the specified order, regardless of the value of members_order
. Note that members will still be grouped by category, according to the group_by_category
option.
Passing a falsy value (no
, false
in YAML) or an empty list ([]
) will tell the Python handler not to render any member. Passing a truthy value (yes
, true
in YAML) will tell the Python handler to render every member.
Any given value, except for an explicit None
(null
in YAML) will tell the handler to ignore filters
for the object's members. Filters will still be applied to the next layers of members (grand-children).
plugins:\n- mkdocstrings:\n handlers:\n python:\n options:\n members:\n - hello # (1)\n
::: package.module\n options:\n members:\n - ThisClass\n - this_function\n
package/module.py\"\"\"Module docstring.\"\"\"\n\n\ndef this_function():\n \"\"\"Function docstring.\"\"\"\n\n\nclass ThisClass:\n \"\"\"Class docstring.\"\"\"\n\n def method(self):\n \"\"\"Method docstring.\"\"\"\n\n\nthis_attribute = 0\n\"\"\"Attribute docstring.\"\"\"\n
Preview
Withmembers: true
With members: false
or members: []
With members: [ThisClass]
Module docstring.
Function docstring.
Class docstring.
method
Method docstring.
Attribute docstring.
Module docstring.
Module docstring.
Class docstring.
method
Method docstring.
The default behavior (with unspecified members
or members: null
) is to use filters
.
inherited_members
Base
Main
Base
Main
","text":"list[str] | bool
False
An explicit list of inherited members (for classes) to render.
Inherited members are always fetched from classes that are in the same package as the currently rendered class. To fetch members inherited from base classes, themselves coming from external packages, use the preload_modules
option. For example, if your class inherits from Pydantic's BaseModel
, and you want to render BaseModel
's methods in your class, use preload_modules: [pydantic]
. The pydantic
package must be available in the current environment.
Passing a falsy value (no
, false
in YAML) or an empty list ([]
) will tell the Python handler not to render any inherited member. Passing a truthy value (yes
, true
in YAML) will tell the Python handler to render every inherited member.
When all inherited members are selected with inherited_members: true
, it is possible to specify both members and inherited members in the members
list:
inherited_members: true\nmembers:\n- inherited_member_a\n- inherited_member_b\n- member_x\n- member_y\n
The alternative is not supported:
inherited_members:\n- inherited_member_a\n- inherited_member_b\nmembers:\n- member_x\n- member_y\n
...because it would make members ordering ambiguous/unspecified.
You can render inherited members only by setting inherited_members: true
(or a list of inherited members) and setting members: false
:
inherited_members: true\nmembers: false\n
inherited_members:\n- inherited_member_a\n- inherited_member_b\nmembers: false\n
You can render all declared members and all or specific inherited members by leaving members
as null (default):
inherited_members:\n- inherited_member_a\n- inherited_member_b\n# members: null # (1)\n
filters
and docstrings
.inherited_members: true # (1)\n# members: null\n
filters
and docstrings
.You can render all declared members and all or specific inherited members, avoiding further filtering with filters
and docstrings
by setting members: true
:
inherited_members: true\nmembers: true\n
inherited_members:\n- inherited_member_a\n- inherited_member_b\nmembers: true\n
The general rule is that declared or inherited members specified in lists are never filtered out.
in mkdocs.yml (global configuration)plugins:\n- mkdocstrings:\n handlers:\n python:\n options:\n inherited_members: false\n
or in docs/some_page.md (local configuration)::: package.module\n options:\n inherited_members: true\n
package/module.py\"\"\"Module docstring.\"\"\"\n\n\nclass Base:\n \"\"\"Base class.\"\"\"\n\n def base(self):\n \"\"\"Base method.\"\"\"\n\n\nclass Main(Base):\n \"\"\"Main class.\"\"\"\n\n def main(self):\n \"\"\"Main method.\"\"\"\n
Preview
With inherited membersWithout inherited membersModule docstring.
Base class.
base
Base method.
Main class.
base
Base method.
main
Main method.
Module docstring.
Base class.
base
Base method.
Main class.
main
Main method.
"},{"location":"usage/configuration/members/#members_order","title":"members_order
function_a
function_b
function_c
function_b
function_a
function_c
","text":"str
\"alphabetical\"
The members ordering to use. Possible values:
alphabetical
: order by the members names.source
: order members as they appear in the source file.The order applies for all members, recursively. The order will be ignored for members that are explicitely sorted using the members
option. Note that members will still be grouped by category, according to the group_by_category
option.
plugins:\n- mkdocstrings:\n handlers:\n python:\n options:\n members_order: alphabetical\n
or in docs/some_page.md (local configuration)::: package.module\n options:\n members_order: source\n
package/module.py\"\"\"Module docstring.\"\"\"\n\n\ndef function_b():\n \"\"\"Function a.\"\"\"\n\n\ndef function_a():\n \"\"\"Function b.\"\"\"\n\n\ndef function_c():\n \"\"\"Function c.\"\"\"\n
Preview
With alphabetical orderWith source orderModule docstring.
Function a.
Function b.
Function c.
Module docstring.
Function b.
Function a.
Function c.
"},{"location":"usage/configuration/members/#filters","title":"filters
hello
_world
hello
_world
","text":"list[str] | None
[\"!^_[^_]\"]
A list of filters applied to filter objects based on their name.
Filters are regular expressions. These regular expressions are evaluated by Python and so must match the syntax supported by the re
module. A filter starting with !
(negative filter) will exclude matching objects instead of including them.
The default value ([\"!^_[^_]\"]
) means: render every object, except those starting with one underscore, unless they start with two underscores. It means that an object whose name is hello
, __hello
, or __hello__
will be rendered, but not one whose name is _hello
.
Each filter takes precedence over the previous one. This allows for fine-grain selection of objects by adding more specific filters. For example, you can start by unselecting objects that start with _
, and add a second filter that re-select objects that start with __
. The default filters can therefore be rewritten like this:
filters:\n- \"!^_\"\n- \"^__\"\n
If there are no negative filters, the handler considers that everything is unselected first, and then selects things based on your positive filters. If there is at least one negative filter, the handler considers that everything is selected first, and then re-selects/unselects things based on your other filters. In short, filters: [\"a\"]
means \"keep nothing except names containing a
\", while filters: [\"!a\"]
means \"keep everything except names containing a
\".
An empty list of filters tells the Python handler to render every object. The members
option takes precedence over filters (filters will still be applied recursively to lower members in the hierarchy).
plugins:\n- mkdocstrings:\n handlers:\n python:\n options:\n filters:\n - \"!^_\"\n
or in docs/some_page.md (local configuration)::: package.module\n options:\n filters: []\n
package/module.pydef hello():\n ...\n\n\ndef _world():\n ...\n
Preview
Withfilters: []
With filters: [\"hello\"]
With filters: [\"!hello\"]
Module docstring.
Function docstring.
Function docstring.
Module docstring.
Function docstring.
Module docstring.
Function docstring.
Common filters
Here are some common filters that you might to want to use.
[\"!^_\"]
: exclude all private/protected/special objects[\"!^_\", \"^__init__$\"]
: same as above, but keep __init__
methods[\"!^_[^_]\"]
: exclude all private/protected objects, keep special ones (default filters)group_by_category
attribute_c
ClassB
function_a
function_d
function_a
ClassB
attribute_c
function_d
","text":"bool
True
Group the object members by categories: attributes, classes, functions, and modules.
Members within a same category will be ordered according to the members_order
option. You can use the show_category_heading
option to also render a heading for each category.
plugins:\n- mkdocstrings:\n handlers:\n python:\n options:\n group_by_category: true\n
or in docs/some_page.md (local configuration)::: package.module\n options:\n group_by_category: false\n
package/module.pydef function_a():\n ...\n\n\nclass ClassB:\n ...\n\n\nattribute_C = 0\n\n\ndef function_d():\n ...\n
Preview
With category groupingWithout category groupingModule docstring.
Attribute docstring.
Class docstring.
Function docstring.
Function docstring.
Module docstring.
Function docstring.
Class docstring.
Attribute docstring.
Function docstring.
"},{"location":"usage/configuration/members/#show_submodules","title":"show_submodules
subpackage_member
submodule
subpackage_member
","text":"bool
False
When rendering a module, show its submodules recursively.
This is false by default, because most of the time we render only one module per page, and when rendering a package (a tree of modules and their members) on a single page, we quickly run out of heading levels.
in mkdocs.yml (global configuration)plugins:\n- mkdocstrings:\n handlers:\n python:\n options:\n show_submodules: true\n
or in docs/some_page.md (local configuration)::: package.subpackage\n options:\n show_submodules: false\n
package\ud83d\udcc1 package\n\u251c\u2500\u2500 \ud83d\udcc4 __init__.py\n\u2514\u2500\u2500 \ud83d\udcc1 subpackage\n \u251c\u2500\u2500 \ud83d\udcc4 __init__.py\n \u2514\u2500\u2500 \ud83d\udcc4 submodule.py\n
Preview
With submodulesWithout submodulesSubpackage docstring.
Member docstring.
Submodule docstring.
submodule_member
Member docstring.
Subpackage docstring.
Member docstring.
"},{"location":"usage/configuration/members/#summary","title":"summary
MyClassMyClass","text":"Sponsors only \u2014 Insiders 1.2.0
bool | dict[str, bool]
False
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:
summary: true\n
summary: false\n
summary:\n attributes: false\n functions: true\n modules: false\n
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.
plugins:\n- mkdocstrings:\n handlers:\n python:\n options:\n summary: true\n
or in docs/some_page.md (local configuration)::: path.to.module\n options:\n summary: false\n
Preview
With all summariesWith methods summary only::: path.to.module.MyClass\n options:\n summary: true\n
Class docstring.
Methods:
Attributes:
::: path.to.module.MyClass\n options:\n summary:\n functions: true\n
Class docstring.
Methods:
show_labels
","text":"bool
True
Whether to show labels of the members.
in mkdocs.yml (global configuration)plugins:\n- mkdocstrings:\n handlers:\n python:\n options:\n show_labels: true\n
or in docs/some_page.md (local configuration)::: package.module\n options:\n show_labels: false\n
package/module.pyclass SomeClass:\n some_attr: int\n
Preview
With labelsWithout labels some_attr: int
instance-attribute
some_attr: int
annotations_path
convert(text, md)
convert(text, md)
convert(text, md)
","text":"str
\"brief\"
The verbosity for annotations path.
Possible values:
brief
(recommended): render only the last component of each type path, not their full paths. For example, it will render Sequence[Path]
and not typing.Sequence[pathlib.Path]
. Brief annotations will cross-reference the right object anyway, and show the full path in a tooltip when hovering them.source
: render annotations as written in the source. For example if you imported typing
as t
, it will render typing.Sequence
as t.Sequence
. Each part will cross-reference the relevant object: t
will link to the typing
module and Sequence
will link to the Sequence
type.full
: render annotations with their full path (the opposite of brief). For example if you import Sequence
and Pattern
from typing
and annoate something using Sequence[Pattern]
, it will render as typing.Sequence[typing.Pattern]
, with each part cross-referencing the corresponding object.plugins:\n- mkdocstrings:\n handlers:\n python:\n options:\n annotations_path: brief\n
or in docs/some_page.md (local configuration)::: path.to.module\n options:\n annotations_path: source\n
Preview
Brief annotationsSource annotationsFull annotationsimport markdown\nimport markupsafe\n\n\ndef convert(text: str, md: markdown.Markdown) -> markupsafe.Markup:\n \"\"\"Convert text to Markdown.\n\n Parameters:\n text: The text to convert.\n md: A Markdown instance.\n\n Returns:\n Converted markup.\n \"\"\"\n return markupsafe.Markup(md.convert(text))\n
Convert text to Markdown.
Parameters:
Type Description Defaultstr
The text to convert. required Markdown
A Markdown instance. required Returns:
Type Name DescriptionMarkup
text
Converted markup. import markdown\nfrom markupsafe import Markup\n\n\ndef convert(text: str, md: markdown.Markdown) -> Markup:\n \"\"\"Convert text to Markdown.\n\n Parameters:\n text: The text to convert.\n md: A Markdown instance.\n\n Returns:\n Converted markup.\n \"\"\"\n return Markup(md.convert(text))\n
Convert text to Markdown.
Parameters:
Type Description Defaultstr
The text to convert. required markdown.Markdown
A Markdown instance. required Returns:
Type Name DescriptionMarkup
text
Converted markup. from markdown import Markdown\nfrom markupsafe import Markup\n\n\ndef convert(text: str, md: Markdown) -> Markup:\n \"\"\"Convert text to Markdown.\n\n Parameters:\n text: The text to convert.\n md: A Markdown instance.\n\n Returns:\n Converted markup.\n \"\"\"\n return Markup(md.convert(text))\n
Convert text to Markdown.
Parameters:
Type Description Defaultstr
The text to convert. required markdown.Markdown
A Markdown instance. required Returns:
Type Name Descriptionmarkupsafe.Markup
text
Converted markup."},{"location":"usage/configuration/signatures/#line_length","title":"line_length
long_function_namelong_function_name","text":"int
60
Maximum line length when formatting code/signatures.
When separating signatures from headings with the separate_signature
option, the Python handler will try to format the signatures using Black and the specified line length.
If Black is not installed, the handler issues an INFO log once.
in mkdocs.yml (global configuration)plugins:\n- mkdocstrings:\n handlers:\n python:\n options:\n separate_signature: true\n line_length: 60\n
or in docs/some_page.md (local configuration)::: path.to.module\n options:\n separate_signature: true\n line_length: 80\n
Preview
Line length 60Line length 80long_function_name(\n long_parameter_1=\"hello\",\n long_parameter_2=\"world\",\n)
long_function_name(long_parameter_1=\"hello\", long_parameter_2=\"world\")
"},{"location":"usage/configuration/signatures/#modernize_annotations","title":"modernize_annotations
","text":"Sponsors only \u2014 Insiders 1.8.0 \u2014 This feature also requires Griffe Insiders to be installed.
bool
False
Modernize annotations with latest features and PEPs of the Python language.
The Python language keeps evolving, and often library developers must continue to support a few minor versions of Python. Therefore they cannot use some features that were introduced in the latest versions.
Yet this doesn't mean they can't enjoy latest features in their docs: Griffe allows to \"modernize\" expressions, for example by replacing typing.Union
with PEP 604 type unions |
. Thanks to this, mkdocstrings' Python handler can automatically transform type annotations into their modern equivalent. This improves consistency in your docs, and shows users how to use your code with the latest features of the language.
Modernizations applied:
typing.Dict[A, B]
becomes dict[A, B]
typing.List[A]
becomes list[A]
typing.Set[A]
becomes set[A]
typing.Tuple[A]
becomes tuple[A]
typing.Union[A, B]
becomes A | B
typing.Optional[A]
becomes A | None
plugins:\n- mkdocstrings:\n handlers:\n python:\n options:\n modernize_annotations: true\n
or in docs/some_page.md (local configuration)::: path.to.object\n options:\n modernize_annotations: false\n
Preview
from typing import Optional, Union, List\n\nexample: Optional[Union[int, List[int]]] = None\n
Unchanged annotationsModernized annotations
"},{"location":"usage/configuration/signatures/#package.modern.example","title":"example","text":"
example: Optional[Union[int, List[int]]] = None\n
"},{"location":"usage/configuration/signatures/#package.modern.example","title":"example","text":"example: Optional[Union[int, List[int]]] = None\n
"},{"location":"usage/configuration/signatures/#show_signature","title":"show_signature
function(param1, param2=None)
function
","text":"bool
True
Show methods and functions signatures.
Without it, just the function/method name is rendered.
in mkdocs.yml (global configuration)plugins:\n- mkdocstrings:\n handlers:\n python:\n options:\n show_signature: true\n
or in docs/some_page.md (local configuration)::: path.to.module\n options:\n show_signature: false\n
Preview
With signatureWithout signatureFunction docstring.
Function docstring.
"},{"location":"usage/configuration/signatures/#show_signature_annotations","title":"show_signature_annotations
functionfunction","text":"bool
False
Show the type annotations in methods and functions signatures.
Since the heading can become quite long when annotations are rendered, it is usually best to separate the signature from the heading.
in mkdocs.yml (global configuration)plugins:\n- mkdocstrings:\n handlers:\n python:\n options:\n separate_signature: true\n show_signature_annotations: true\n
or in docs/some_page.md (local configuration)::: path.to.module\n options:\n separate_signature: true\n show_signature_annotations: false\n
Preview
With signature annotationsWithout signature annotationsfunction(\n param1: list[int | float],\n param2: bool | None = None,\n) -> float\n
Function docstring.
function(param1, param2=None)\n
Function docstring.
"},{"location":"usage/configuration/signatures/#separate_signature","title":"separate_signature
functionfunction(param1, param2=None)
","text":"bool
False
Whether to put the whole signature in a code block below the heading.
When separating signatures from headings, the Python handler will try to format the signatures using Black and the specified line length.
If Black is not installed, the handler issues an INFO log once.
in mkdocs.yml (global configuration)plugins:\n- mkdocstrings:\n handlers:\n python:\n options:\n separate_signature: false\n
or in docs/some_page.md (local configuration)::: path.to.module\n options:\n separate_signature: true\n
Preview
With separate signatureWithout separate signaturefunction(param1, param2=None)\n
Function docstring.
Function docstring.
"},{"location":"usage/configuration/signatures/#signature_crossrefs","title":"signature_crossrefs
do_format_codedo_format_code","text":"Insiders 1.0.0
Whether to render cross-references for type annotations in signatures.
When signatures are separated from headings with the separate_signature
option and type annotations are shown with the show_signature_annotations
option, this option will render a cross-reference (link) for each type annotation in the signature.
plugins:\n- mkdocstrings:\n handlers:\n python:\n options:\n separate_signature: true\n show_signature_annotations: true\n signature_crossrefs: false\n
or in docs/some_page.md (local configuration)::: path.to.module\n options:\n separate_signature: true\n show_signature_annotations: true\n signature_crossrefs: true\n
Preview
With signature cross-referencesWithout signature cross-referencesdo_format_code(code: str, line_length: int) -> str\n
Function docstring.
do_format_code(code: str, line_length: int) -> str\n
Function docstring.
"},{"location":"usage/configuration/signatures/#unwrap_annotated","title":"unwrap_annotated
","text":"bool
False
Whether to unwrap Annotated
types to show only the type without the annotations.
For example, unwrapping Annotated[int, Gt(10)]
will render int
.
plugins:\n- mkdocstrings:\n handlers:\n python:\n options:\n unwrap_annotated: false\n
or in docs/some_page.md (local configuration)::: path.to.module\n options:\n unwrap_annotated: true\n
"},{"location":"usage/docstrings/google/","title":"Google style","text":""},{"location":"usage/docstrings/google/#work-in-progress","title":"Work in Progress!","text":""},{"location":"usage/docstrings/google/#google-style-admonitions","title":"Google-style admonitions","text":"With Google-style docstrings, any section that is not recognized will be transformed into its admonition equivalent. For example:
DocstringResult\"\"\"\nNote:\n It looks like a section, but it will be rendered as an admonition.\n\nTip: You can even choose a title.\n This admonition has a custom title!\n\"\"\"\n
Note
It looks like a section, but it will be rendered as an admonition.
You can even choose a title.
This admonition has a custom title!
See Napoleon's documentation. See the supported docstring sections on Griffe's documentation.
"},{"location":"usage/docstrings/numpy/","title":"Numpydoc style","text":""},{"location":"usage/docstrings/numpy/#work-in-progress","title":"Work in Progress!","text":"Note
As Numpy-style is partially supported by the underlying parser, you may experience problems in the building process if your docstring has a Methods
section in the class docstring (see #366).
See Numpydoc's documentation. See the supported docstring sections on Griffe's documentation.
"},{"location":"usage/docstrings/sphinx/","title":"Sphinx style","text":""},{"location":"usage/docstrings/sphinx/#work-in-progress","title":"Work in Progress!","text":"See Sphinx's documentation. See the supported docstring sections on Griffe's documentation.
"}]} \ No newline at end of file diff --git a/sitemap.xml b/sitemap.xml new file mode 100644 index 00000000..bce06451 --- /dev/null +++ b/sitemap.xml @@ -0,0 +1,128 @@ + +docstring_style
¤str
"google"
The docstring style to expect when parsing docstrings.
Possible values:
"google"
: see Google style."numpy"
: see Numpy style."sphinx"
: see Sphinx style.None
(null
or ~
in YAML): no style at all, parse as regular text.plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ docstring_style: google
+
::: path.to.module
+ options:
+ docstring_style: numpy
+
Preview
Every style gets rendered the same way. Here are some docstring examples.
def greet(name: str) -> str:
+ """Greet someone.
+
+ Parameters:
+ name: The name of the person to greet.
+
+ Returns:
+ A greeting message.
+ """
+ return f"Hello {name}!"
+
def greet(name: str) -> str:
+ """Greet someone.
+
+ Parameters
+ ----------
+ name
+ The name of the person to greet.
+
+ Returns
+ -------
+ A greeting message.
+ """
+ return f"Hello {name}!"
+
def greet(name: str) -> str:
+ """Greet someone.
+
+ :param name: The name of the person to greet.
+ :return: A greeting message.
+ """
+ return f"Hello {name}!"
+
docstring_options
¤dict
{}
The options for the docstring parser.
The Sphinx style does not offer any option.
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ docstring_options:
+ ignore_init_summary: false
+ trim_doctest_flags: true
+
::: path.to.module
+ options:
+ docstring_options:
+ ignore_init_summary: true
+ trim_doctest_flags: false
+
class PrintOK:
+ """Class docstring."""
+
+ def __init__(self):
+ """Initialize the instance.
+
+ Examples:
+ >>> PrintOK() # doctest: +NORMALIZE_WHITESPACE
+ ok
+ """
+ print("ok")
+
Preview
PrintOK
Class docstring.
__init__
Examples:
>>> PrintOK()
+ok
+
PrintOK
Class docstring.
__init__
Initialize the instance.
Examples:
>>> PrintOK() # doctest: +NORMALIZE_WHITESPACE
+ok
+
docstring_section_style
¤str
"table"
The style used to render docstring sections.
A section is a block of text that has a special meaning in a docstring. There are sections for documenting attributes of an object, parameters of a function, exceptions raised by a function, the return value of a function, etc.
Sections are parsed as structured data and can therefore be rendered in different ways. Possible values:
"table"
: a simple table, usually with type, name and description columns"list"
: a simple list, akin to what you get with the ReadTheDocs Sphinx theme"spacy"
: a poor implementation of the amazing tables in Spacy's documentationplugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ docstring_section_style: table
+
::: path.to.module
+ options:
+ docstring_section_style: list
+
Preview
Tables work well when you have lots of items with short names, type annotations, descriptions, etc.. With longer strings, the columns risk getting squished horizontally. In that case, the Spacy tables can help.
Parameters:
Type | Name | Description | Default |
---|---|---|---|
int | threshold | Threshold for something. | required |
bool | flag | Enable something. | False |
Other Parameters:
Type | Name | Description | Default |
---|---|---|---|
list[int | float] | gravity_forces | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. | required |
VacuumType | Literal["regular"] | vacuum_type | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. | VacuumType.PLASMA |
Lists work well whatever the length of names, type annotations, descriptions, etc.
Parameters:
Other Parameters:
gravity_forces
(list[int | float]
) — Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.vacuum_type
(VacuumType | Literal["regular"]
) — Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.Spacy tables work better than regular tables with longer names, type annotations, descriptions, etc., by reserving more horizontal space on the second column.
Parameters:
Name | Description |
---|---|
threshold | Threshold for something. TYPE: int DEFAULT: required |
flag | Enable something. TYPE: bool DEFAULT: False |
Other Parameters:
Name | Description |
---|---|
gravity_forces | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. TYPE: list[int | float] DEFAULT: required |
vacuum_type | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. TYPE: VacuumType | Literal["regular"] DEFAULT: VacuumType.PLASMA |
merge_init_into_class
¤bool
False
Whether to merge the __init__
method into the class' signature and docstring.
By default, only the class name is rendered in headings. When merging, the __init__
method parameters are added after the class name, like a signature, and the __init__
method docstring is appended to the class' docstring. This option is well used in combination with the ignore_init_summary
docstring option, to discard the first line of the __init__
docstring which is not often useful.
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ docstring_options:
+ ignore_init_summary: false
+ merge_init_into_class: false
+
::: path.to.module
+ options:
+ docstring_options:
+ ignore_init_summary: true
+ merge_init_into_class: true
+
class Thing:
+ """A class for things."""
+
+ def __init__(self, value: int = 0):
+ """Initialize a thing.
+
+ Parameters:
+ value: The thing's value.
+ """
+ self.value = value
+
Preview
show_if_no_docstring
¤bool
False
Show the object heading even if it has no docstring or children with docstrings.
Without an explicit list of members
, members are selected based on filters
, and then filtered again to keep only those with docstrings. Checking if a member has a docstring is done recursively: if at least one of its direct or indirect members (lower in the tree) has a docstring, the member is rendered. If the member does not have a docstring, and none of its members have a docstring, it is excluded.
With this option you can tell the Python handler to skip the docstring check.
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ show_if_no_docstring: false
+
::: path.to.module
+ options:
+ show_if_no_docstring: true
+
def function_without_docstring():
+ ...
+
+
+def function_with_docstring():
+ """Hello."""
+
+
+class ClassWithoutDocstring:
+ def method_without_docstring(self):
+ ...
+
+ def method_with_docstring(self):
+ """Hello."""
+
Preview
function_without_docstring
function_with_docstring
Hello.
ClassWithoutDocstring
method_without_docstring
method_with_docstring
Hello.
function_with_docstring
Hello.
ClassWithoutDocstring
method_with_docstring
Hello.
show_docstring_attributes
¤bool
True
Whether to render the "Attributes" sections of docstrings.
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ show_docstring_attributes: true
+
::: path.to.module
+ options:
+ show_docstring_attributes: false
+
class Class:
+ """Summary.
+
+ Attributes:
+ attr: Some attribute.
+ """
+
+ attr: int = 1
+
Preview
Class
Summary.
show_docstring_functions
¤bool
True
Whether to render the "Functions" or "Methods" sections of docstrings.
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ show_docstring_functions: true
+
::: path.to.module
+ options:
+ show_docstring_functions: false
+
"""Summary.
+
+Functions:
+ foo: Some function.
+"""
+
+
+def foo():
+ ...
+
+
+class Class:
+ """Summary.
+
+ Methods:
+ bar: Some method.
+ """
+
+ def bar(self):
+ ...
+
Preview
Summary.
Functions:
Name | Description |
---|---|
foo | Some function. |
Class
Summary.
Methods:
Name | Description |
---|---|
bar | Some method. |
Summary.
Class
Summary.
show_docstring_classes
¤bool
True
Whether to render the "Classes" sections of docstrings.
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ show_docstring_classes: true
+
::: path.to.module
+ options:
+ show_docstring_classes: false
+
"""Summary.
+
+Classes:
+ Class: Some class.
+"""
+
+
+class Class:
+ """Summary."""
+
Preview
Summary.
Classes:
Name | Description |
---|---|
Class | Some class. |
Class
Summary.
Summary.
Class
Summary.
show_docstring_modules
¤bool
True
Whether to render the "Modules" sections of docstrings.
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ show_docstring_modules: true
+
::: path.to.module
+ options:
+ show_docstring_modules: false
+
📁 module/
+├── 📄 __init__.py
+└── 📄 submodule.py
+
"""Summary.
+
+Modules:
+ submodule: Some module.
+"""
+
Preview
Summary.
Modules:
Name | Description |
---|---|
submodule | Some module. |
Summary.
show_docstring_description
¤bool
True
Whether to render the textual blocks (including admonitions) of docstrings.
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ show_docstring_description: true
+
::: path.to.module
+ options:
+ show_docstring_description: false
+
class Class:
+ """Summary.
+
+ Long description.
+
+ Warning: Deprecated
+ Stop using this class.
+
+ Attributes:
+ attr: Some attribute.
+ """
+
+ attr: int = 1
+
Preview
show_docstring_examples
¤bool
True
Whether to render the "Examples" section of docstrings.
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ show_docstring_examples: true
+
::: path.to.module
+ options:
+ show_docstring_examples: false
+
def print_hello():
+ """Print hello.
+
+ Examples:
+ >>> print("hello")
+ hello
+ """
+ print("hello")
+
Preview
print_hello
Print hello.
Examples:
>>> print("hello")
+hello
+
print_hello
Print hello.
show_docstring_other_parameters
¤bool
True
Whether to render the "Other Parameters" section of docstrings.
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ show_docstring_other_parameters: true
+
::: path.to.module
+ options:
+ show_docstring_other_parameters: false
+
def do_something(**kwargs):
+ """Do something.
+
+ Other parameters:
+ whatever (int): Some integer.
+ """
+
Preview
do_something
Do something.
show_docstring_parameters
¤bool
True
Whether to render the "Parameters" section of docstrings.
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ show_docstring_parameters: true
+
::: path.to.module
+ options:
+ show_docstring_parameters: false
+
def do_something(whatever: int = 0):
+ """Do something.
+
+ Parameters:
+ whatever: Some integer.
+ """
+
Preview
do_something
Do something.
show_docstring_raises
¤bool
True
Whether to render the "Raises" section of docstrings.
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ show_docstring_raises: true
+
::: path.to.module
+ options:
+ show_docstring_raises: false
+
def raise_runtime_error():
+ """Raise a runtime error.
+
+ Raises:
+ RuntimeError: Not good.
+ """
+ raise RuntimeError
+
Preview
raise_runtime_error
Raise a runtime error.
show_docstring_receives
¤bool
True
Whether to render the "Receives" section of docstrings.
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ show_docstring_receives: true
+
::: path.to.module
+ options:
+ show_docstring_receives: false
+
def iter_skip(
+ iterable: Iterable[T],
+ initial_skip: int = 0,
+) -> Generator[T, int, None]:
+ """Iterate and skip elements.
+
+ Receives:
+ skip: Number of elements to skip.
+ """
+ skip = initial_skip
+ for element in iterable:
+ if skip or 0 > 0:
+ skip -= 1
+ else:
+ skip = yield element
+
Preview
iter_skip
Iterate and skip elements.
show_docstring_returns
¤bool
True
Whether to render the "Returns" section of docstrings.
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ show_docstring_returns: true
+
::: path.to.module
+ options:
+ show_docstring_returns: false
+
def rand() -> int:
+ """Return a random number.
+
+ Returns:
+ A random number.
+ """
+ return random.randint(0, 1000)
+
Preview
rand
Return a random number.
show_docstring_warns
¤bool
True
Whether to render the "Warns" section of docstrings.
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ show_docstring_warns: true
+
::: path.to.module
+ options:
+ show_docstring_warns: false
+
def warn():
+ """Warn user.
+
+ Warns:
+ UserWarning: When this is inappropriate.
+ """
+ warnings.warn(UserWarning("This is inappropriate"))
+
Preview
warn
Warn user.
show_docstring_yields
¤bool
True
Whether to render the "Yields" section of docstrings.
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ show_docstring_yields: true
+
::: path.to.module
+ options:
+ show_docstring_yields: false
+
def iter_skip(
+ iterable: Iterable[T],
+ initial_skip: int = 0,
+) -> Generator[T, int, None]:
+ """Iterate and skip elements.
+
+ Yields:
+ Elements of the iterable.
+ """
+ skip = initial_skip
+ for element in iterable:
+ if skip or 0 > 0:
+ skip -= 1
+ else:
+ skip = yield element
+
Preview
iter_skip
Iterate and skip elements.
Yields:
Type | Description |
---|---|
T | Elements of the iterable. |
iter_skip
Iterate and skip elements.
allow_inspection
¤bool
True
Whether to allow inspecting modules (importing them) when it is not possible to visit them (parse their source code).
When loading data for a given package, Griffe discovers every Python module, compiled or not, and inspects or visits them accordingly.
If you have compiled modules but also provide stubs for them, you might want to disable the inspection of these modules, because inspection picks up many more members, and sometimes the collected data is inaccurate (depending on the tool that was used to compile the module) or too low-level/technical for API documentation.
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ allow_inspection: true
+
::: path.to.object
+ options:
+ allow_inspection: false
+
Preview
SomeClass
Docstring of the class.
__eq__
Method docstring.
__weakref__
Method docstring.
documented_method
Method docstring.
SomeClass
Docstring of the class.
documented_method
Method docstring.
show_bases
¤bool
True
Show the base classes of a class.
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ show_bases: true
+
::: path.to.object
+ options:
+ show_bases: false
+
Preview
SomeClass()
Docstring of the class.
show_inheritance_diagram
¤Sponsors only — Insiders 1.7.0
bool
False
Show the inheritance diagram of a class using Mermaid.
With this option enabled, an inheritance diagram (as a flowchart) will be displayed after a class signature. Each node will act as a cross-reference and will bring you to the relevant class' documentation when clicking on it.
It should work out of the box with Material for MkDocs. For other themes, you must include Mermaid's Javascript code manually:
extra_javascript:
+- https://unpkg.com/mermaid@10.9.0/dist/mermaid.min.js
+
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ show_inheritance_diagram: true
+
::: path.to.object
+ options:
+ show_inheritance_diagram: false
+
Preview
With the following classes:
class SuperAbstract:
+ """Super abstract class."""
+class Mixin1:
+ """Mixin 1."""
+class Abstract(SuperAbstract, Mixin1):
+ """Abstract class."""
+class Mixin2A:
+ """Mixin 2A."""
+class Mixin2B(Mixin2A):
+ """Mixin 2B."""
+class Concrete(Abstract, Mixin2B):
+ """Concrete class."""
+class SuperConcrete(Concrete):
+ """Super concrete class."""
+
The diagram for SuperConcrete
will look like this:
flowchart TD
+SuperConcrete[SuperConcrete]
+Concrete[Concrete]
+Abstract[Abstract]
+SuperAbstract[SuperAbstract]
+Mixin1[Mixin1]
+Mixin2B[Mixin2B]
+Mixin2A[Mixin2A]
+
+Concrete --> SuperConcrete
+Abstract --> Concrete
+SuperAbstract --> Abstract
+Mixin1 --> Abstract
+Mixin2B --> Concrete
+Mixin2A --> Mixin2B
Nodes are not clickable in this example because these classes do not exist in our documentation.
show_source
¤bool
True
Show the source code of this object.
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ show_source: true
+
::: path.to.object
+ options:
+ show_source: false
+
Preview
some_function()
Docstring of the function.
package/module.py
1 +2 |
|
some_function()
Docstring of the function.
preload_modules
¤Pre-load modules that are not specified directly in autodoc instructions (::: identifier
). It is useful when you want to render documentation for a particular member of an object, and this member is imported from another package than its parent.
For an imported member to be rendered, you need to add it to the __all__
attribute of the importing module. The package from which the imported object originates must be accessible to the handler (see Finding modules).
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ preload_modules:
+ - their_package
+
::: your_package.your_module
+ options:
+ preload_modules:
+ - their_package
+
from their_package.their_module import their_object
+
+__all__ = ["their_object"]
+
+# rest of your code
+
Preview
your_module
Docstring of your module.
their_object
Docstring of their object.
your_module
Docstring of your module.
find_stubs_package
¤bool
False
When looking for documentation specified in autodoc instructions (::: identifier
), also look for the stubs package as defined in PEP 561 if it exists. This is useful when most of your documentation is separately provided by such a package and not inline in your main package.
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ find_stubs_package: true
+
::: your_package.your_module.your_func
+ options:
+ find_stubs_package: true
+
def your_func(a, b):
+ # Function code
+ ...
+
+# rest of your code
+
def your_func(a: int, b: str):
+ """
+ <Function docstring>
+ """
+ ...
+
+# rest of your code
+
Preview
your_func
Function docstring
your_func
heading_level
¤int
2
The initial heading level to use.
When injecting documentation for an object, the object itself and its members are rendered. For each layer of objects, we increase the heading level by 1.
The initial heading level will be used for the first layer. If you set it to 3, then headings will start with <h3>
.
If the heading for the root object is not shown, then the initial heading level is used for its members.
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ heading_level: 2
+
::: path.to.module
+ options:
+ heading_level: 3
+
Preview
module
(3)Docstring of the module.
ClassA
(4)Docstring of class A.
ClassB
(4)Docstring of class B.
method_1
(5)Docstring of the method.
Docstring of the module.
ClassA
(3)Docstring of class A.
ClassB
(3)Docstring of class B.
method_1
(4)Docstring of the method.
parameter_headings
¤Sponsors only — Insiders 1.6.0
bool
False
Whether to render headings for function/method parameters.
With this option enabled, each function/method parameter (including parameters of __init__
methods merged in their parent class with the merge_init_into_class
option) gets a permalink, an entry in the Table of Contents, and an entry in the generated objects inventory. The permalink and inventory entry allow cross-references from internal and external pages.
The identifier used in the permalink and inventory is of the following form: path.to.function(param_name)
. To manually cross-reference a parameter, you can therefore use this Markdown syntax:
- Class parameter: [`param`][package.module.Class(param)]
+- Method parameter: [`param`][package.module.Class.method(param)]
+- Function parameter: [`param`][package.module.function(param)]
+- Variadic positional parameters: [`*args`][package.module.function(*args)]
+- Variadic keyword parameters: [`**kwargs`][package.module.function(**kwargs)]
+
Enabling this option along with signature_crossrefs
will automatically render cross-references to parameters in class/function/method signatures and attributes values.
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ parameter_headings: false
+
::: path.to.module
+ options:
+ parameter_headings: true
+
Preview: Cross-references
get_version ¤
current_version module-attribute
¤current_version: str = get_version(dist='mkdocstrings-python')
+
Current package version.
Preview: Parameter sections
Preview: Table of contents (with symbol types)
get_version
dist
To customize symbols, see Customizing symbol types.
show_root_heading
¤bool
False
Show the heading of the object at the root of the documentation tree (i.e. the object referenced by the identifier after :::
).
It is pretty common to inject documentation for one module per page, especially when following our automatic reference pages recipe. Since each page already has a title, usually being the module's name, we can spare one heading level by not showing the heading for the module itself (heading levels are limited to 6 by the HTML specification).
Sparing that extra level can be helpful when your objects tree is deeply nested (e.g. method in a class in a class in a module). If your objects tree is not deeply nested, and you are injecting documentation for many different objects on a single page, it might be preferable to render the heading of each object.
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ show_root_heading: false
+
::: path.to.ClassA
+ options:
+ show_root_heading: true
+
+::: path.to.ClassB
+ options:
+ show_root_heading: true
+
Preview
ClassA
(2)Docstring of class A.
method_a1
(3)Docstring of the method.
ClassB
(2)Docstring of class B.
method_b1
(3)Docstring of the method.
Docstring of class A.
method_a1
(2)Docstring of the method.
Docstring of class B.
method_b1
(2)Docstring of the method.
show_root_toc_entry
¤bool
True
If the root heading is not shown, at least add a ToC entry for it.
If you inject documentation for an object in the middle of a page, after long paragraphs, and without showing the root heading, then you will not be able to link to this particular object as it won't have a permalink and will be "lost" in the middle of text. In that case, it is useful to add a hidden anchor to the document, which will also appear in the table of contents.
In other cases, you might want to disable the entry to avoid polluting the ToC. It is not possible to show the root heading and hide the ToC entry.
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ show_root_toc_entry: true
+
## Some heading
+
+Lots of text.
+
+::: path.to.object
+ options:
+ show_root_toc_entry: false
+
+## Other heading.
+
+More text.
+
Preview
Table of contents
Some heading
object
Other heading
Table of contents
Some heading
Other heading
show_root_full_path
¤bool
True
Show the full Python path for the root object heading.
The path of a Python object is the dot-separated list of names under which it is accessible, for example package.module.Class.method
.
With this option you can choose to show the full path of the object you inject documentation for, or just its name. This option impacts only the object you specify, not its members. For members, see the two other options show_root_members_full_path
and show_object_full_path
.
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ show_root_full_path: true
+
::: package.module.Class.method
+ options:
+ show_root_full_path: false
+
Preview
package.module.Class.method
Docstring of the method.
method
Docstring of the method.
show_root_members_full_path
¤bool
False
Show the full Python path of the root members.
This option does the same thing as show_root_full_path
, but for direct members of the root object instead of the root object itself.
To show the full path for every member recursively, see show_object_full_path
.
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ show_root_members_full_path: true
+
::: package.module
+ options:
+ show_root_members_full_path: false
+
Preview
Docstring of the module.
package.module.Class
Docstring of the class.
method
Docstring of the method.
Docstring of the module.
Class
Docstring of the class.
method
Docstring of the method.
show_object_full_path
¤bool
False
Show the full Python path of every object.
Same as for show_root_members_full_path
, but for every member, recursively. This option takes precedence over show_root_members_full_path
:
show_root_members_full_path | show_object_full_path | Direct root members path |
---|---|---|
False | False | Name only |
False | True | Full |
True | False | Full |
True | True | Full |
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ show_object_full_path: true
+
::: package.module
+ options:
+ show_object_full_path: false
+
Preview
Docstring of the module.
package.module.Class
Docstring of the class.
package.module.Class.method
Docstring of the method.
Docstring of the module.
Class
Docstring of the class.
method
Docstring of the method.
show_category_heading
¤bool
False
When grouped by categories, show a heading for each category. These category headings will appear in the table of contents, allowing you to link to them using their permalinks.
Not recommended with deeply nested object
When injecting documentation for deeply nested objects, you'll quickly run out of heading levels, and the objects at the bottom of the tree risk all getting documented using H6 headings, which might decrease the readability of your API docs.
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ group_by_category: true
+ show_category_heading: true
+
::: package.module
+ options:
+ group_by_category: true
+ show_category_heading: false
+
Preview
Docstring of the module.
module_attribute
(3)Docstring of the module attribute.
Class
(3)Docstring of the class.
class_attribute
(5)Docstring of the class attribute.
method
(5)Docstring of the method.
Docstring of the module.
module_attribute
(2)Docstring of the module attribute.
Class
(2)Docstring of the class.
class_attribute
(3)Docstring of the class attribute.
method
(3)Docstring of the method.
show_symbol_type_heading
¤bool
False
Show the symbol type in headings.
This option will prefix headings with ,
,
,
or
types. See also
show_symbol_type_toc
.
To customize symbols, see Customizing symbol types.
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ show_symbol_type_heading: true
+
::: package.module
+ options:
+ show_symbol_type_heading: false
+
Preview
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.
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
¤bool
False
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
.
To customize symbols, see Customizing symbol types.
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ show_symbol_type_toc: true
+
::: package.module
+ options:
+ show_symbol_type_toc: false
+
Preview
module
attribute
function
Class
methodmembers
¤An explicit list of members to render.
Only members declared in this list will be rendered. A member without a docstring will still be rendered, even if show_if_no_docstring
is set to false.
The members will be rendered in the specified order, regardless of the value of members_order
. Note that members will still be grouped by category, according to the group_by_category
option.
Passing a falsy value (no
, false
in YAML) or an empty list ([]
) will tell the Python handler not to render any member. Passing a truthy value (yes
, true
in YAML) will tell the Python handler to render every member.
Any given value, except for an explicit None
(null
in YAML) will tell the handler to ignore filters
for the object's members. Filters will still be applied to the next layers of members (grand-children).
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ members:
+ - hello # (1)
+
::: package.module
+ options:
+ members:
+ - ThisClass
+ - this_function
+
"""Module docstring."""
+
+
+def this_function():
+ """Function docstring."""
+
+
+class ThisClass:
+ """Class docstring."""
+
+ def method(self):
+ """Method docstring."""
+
+
+this_attribute = 0
+"""Attribute docstring."""
+
Preview
Module docstring.
this_function
Function docstring.
ThisClass
Class docstring.
method
Method docstring.
this_attribute
Attribute docstring.
Module docstring.
Module docstring.
ThisClass
Class docstring.
method
Method docstring.
The default behavior (with unspecified members
or members: null
) is to use filters
.
inherited_members
¤An explicit list of inherited members (for classes) to render.
Inherited members are always fetched from classes that are in the same package as the currently rendered class. To fetch members inherited from base classes, themselves coming from external packages, use the preload_modules
option. For example, if your class inherits from Pydantic's BaseModel
, and you want to render BaseModel
's methods in your class, use preload_modules: [pydantic]
. The pydantic
package must be available in the current environment.
Passing a falsy value (no
, false
in YAML) or an empty list ([]
) will tell the Python handler not to render any inherited member. Passing a truthy value (yes
, true
in YAML) will tell the Python handler to render every inherited member.
When all inherited members are selected with inherited_members: true
, it is possible to specify both members and inherited members in the members
list:
inherited_members: true
+members:
+- inherited_member_a
+- inherited_member_b
+- member_x
+- member_y
+
The alternative is not supported:
inherited_members:
+- inherited_member_a
+- inherited_member_b
+members:
+- member_x
+- member_y
+
...because it would make members ordering ambiguous/unspecified.
You can render inherited members only by setting inherited_members: true
(or a list of inherited members) and setting members: false
:
inherited_members: true
+members: false
+
inherited_members:
+- inherited_member_a
+- inherited_member_b
+members: false
+
You can render all declared members and all or specific inherited members by leaving members
as null (default):
inherited_members:
+- inherited_member_a
+- inherited_member_b
+# members: null # (1)
+
filters
and docstrings
.inherited_members: true # (1)
+# members: null
+
filters
and docstrings
.You can render all declared members and all or specific inherited members, avoiding further filtering with filters
and docstrings
by setting members: true
:
inherited_members: true
+members: true
+
inherited_members:
+- inherited_member_a
+- inherited_member_b
+members: true
+
The general rule is that declared or inherited members specified in lists are never filtered out.
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ inherited_members: false
+
::: package.module
+ options:
+ inherited_members: true
+
"""Module docstring."""
+
+
+class Base:
+ """Base class."""
+
+ def base(self):
+ """Base method."""
+
+
+class Main(Base):
+ """Main class."""
+
+ def main(self):
+ """Main method."""
+
Preview
Module docstring.
Base
Base class.
base
Base method.
Main
Main class.
base
Base method.
main
Main method.
Module docstring.
Base
Base class.
base
Base method.
Main
Main class.
main
Main method.
members_order
¤str
"alphabetical"
The members ordering to use. Possible values:
alphabetical
: order by the members names.source
: order members as they appear in the source file.The order applies for all members, recursively. The order will be ignored for members that are explicitely sorted using the members
option. Note that members will still be grouped by category, according to the group_by_category
option.
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ members_order: alphabetical
+
::: package.module
+ options:
+ members_order: source
+
"""Module docstring."""
+
+
+def function_b():
+ """Function a."""
+
+
+def function_a():
+ """Function b."""
+
+
+def function_c():
+ """Function c."""
+
Preview
Module docstring.
function_a
Function a.
function_b
Function b.
function_c
Function c.
Module docstring.
function_b
Function b.
function_a
Function a.
function_c
Function c.
filters
¤A list of filters applied to filter objects based on their name.
Filters are regular expressions. These regular expressions are evaluated by Python and so must match the syntax supported by the re
module. A filter starting with !
(negative filter) will exclude matching objects instead of including them.
The default value (["!^_[^_]"]
) means: render every object, except those starting with one underscore, unless they start with two underscores. It means that an object whose name is hello
, __hello
, or __hello__
will be rendered, but not one whose name is _hello
.
Each filter takes precedence over the previous one. This allows for fine-grain selection of objects by adding more specific filters. For example, you can start by unselecting objects that start with _
, and add a second filter that re-select objects that start with __
. The default filters can therefore be rewritten like this:
filters:
+- "!^_"
+- "^__"
+
If there are no negative filters, the handler considers that everything is unselected first, and then selects things based on your positive filters. If there is at least one negative filter, the handler considers that everything is selected first, and then re-selects/unselects things based on your other filters. In short, filters: ["a"]
means "keep nothing except names containing a
", while filters: ["!a"]
means "keep everything except names containing a
".
An empty list of filters tells the Python handler to render every object. The members
option takes precedence over filters (filters will still be applied recursively to lower members in the hierarchy).
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ filters:
+ - "!^_"
+
::: package.module
+ options:
+ filters: []
+
def hello():
+ ...
+
+
+def _world():
+ ...
+
Preview
Module docstring.
hello
Function docstring.
_world
Function docstring.
Module docstring.
hello
Function docstring.
Module docstring.
_world
Function docstring.
Common filters
Here are some common filters that you might to want to use.
["!^_"]
: exclude all private/protected/special objects["!^_", "^__init__$"]
: same as above, but keep __init__
methods["!^_[^_]"]
: exclude all private/protected objects, keep special ones (default filters)group_by_category
¤bool
True
Group the object members by categories: attributes, classes, functions, and modules.
Members within a same category will be ordered according to the members_order
option. You can use the show_category_heading
option to also render a heading for each category.
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ group_by_category: true
+
::: package.module
+ options:
+ group_by_category: false
+
def function_a():
+ ...
+
+
+class ClassB:
+ ...
+
+
+attribute_C = 0
+
+
+def function_d():
+ ...
+
Preview
Module docstring.
attribute_c
Attribute docstring.
ClassB
Class docstring.
function_a
Function docstring.
function_d
Function docstring.
Module docstring.
function_a
Function docstring.
ClassB
Class docstring.
attribute_c
Attribute docstring.
function_d
Function docstring.
show_submodules
¤bool
False
When rendering a module, show its submodules recursively.
This is false by default, because most of the time we render only one module per page, and when rendering a package (a tree of modules and their members) on a single page, we quickly run out of heading levels.
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ show_submodules: true
+
::: package.subpackage
+ options:
+ show_submodules: false
+
📁 package
+├── 📄 __init__.py
+└── 📁 subpackage
+ ├── 📄 __init__.py
+ └── 📄 submodule.py
+
Preview
Subpackage docstring.
subpackage_member
Member docstring.
submodule
Submodule docstring.
submodule_member
Member docstring.
Subpackage docstring.
subpackage_member
Member docstring.
summary
¤Sponsors only — Insiders 1.2.0
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:
summary: true
+
summary: false
+
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.
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ summary: true
+
::: path.to.module
+ options:
+ summary: false
+
Preview
::: path.to.module.MyClass
+ options:
+ summary: true
+
Class docstring.
Methods:
Attributes:
::: path.to.module.MyClass
+ options:
+ summary:
+ functions: true
+
Class docstring.
Methods:
show_labels
¤bool
True
Whether to show labels of the members.
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ show_labels: true
+
::: package.module
+ options:
+ show_labels: false
+
class SomeClass:
+ some_attr: int
+
Preview
some_attr: int
instance-attribute
some_attr: int
annotations_path
¤str
"brief"
The verbosity for annotations path.
Possible values:
brief
(recommended): render only the last component of each type path, not their full paths. For example, it will render Sequence[Path]
and not typing.Sequence[pathlib.Path]
. Brief annotations will cross-reference the right object anyway, and show the full path in a tooltip when hovering them.source
: render annotations as written in the source. For example if you imported typing
as t
, it will render typing.Sequence
as t.Sequence
. Each part will cross-reference the relevant object: t
will link to the typing
module and Sequence
will link to the Sequence
type.full
: render annotations with their full path (the opposite of brief). For example if you import Sequence
and Pattern
from typing
and annoate something using Sequence[Pattern]
, it will render as typing.Sequence[typing.Pattern]
, with each part cross-referencing the corresponding object.plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ annotations_path: brief
+
::: path.to.module
+ options:
+ annotations_path: source
+
Preview
import markdown
+import markupsafe
+
+
+def convert(text: str, md: markdown.Markdown) -> markupsafe.Markup:
+ """Convert text to Markdown.
+
+ Parameters:
+ text: The text to convert.
+ md: A Markdown instance.
+
+ Returns:
+ Converted markup.
+ """
+ return markupsafe.Markup(md.convert(text))
+
convert(text, md)
Convert text to Markdown.
Parameters:
Type | Description | Default |
---|---|---|
str | The text to convert. | required |
Markdown | A Markdown instance. | required |
Returns:
Type | Name | Description |
---|---|---|
Markup | text | Converted markup. |
import markdown
+from markupsafe import Markup
+
+
+def convert(text: str, md: markdown.Markdown) -> Markup:
+ """Convert text to Markdown.
+
+ Parameters:
+ text: The text to convert.
+ md: A Markdown instance.
+
+ Returns:
+ Converted markup.
+ """
+ return Markup(md.convert(text))
+
convert(text, md)
Convert text to Markdown.
Parameters:
Type | Description | Default |
---|---|---|
str | The text to convert. | required |
markdown.Markdown | A Markdown instance. | required |
Returns:
Type | Name | Description |
---|---|---|
Markup | text | Converted markup. |
from markdown import Markdown
+from markupsafe import Markup
+
+
+def convert(text: str, md: Markdown) -> Markup:
+ """Convert text to Markdown.
+
+ Parameters:
+ text: The text to convert.
+ md: A Markdown instance.
+
+ Returns:
+ Converted markup.
+ """
+ return Markup(md.convert(text))
+
convert(text, md)
Convert text to Markdown.
Parameters:
Type | Description | Default |
---|---|---|
str | The text to convert. | required |
markdown.Markdown | A Markdown instance. | required |
Returns:
Type | Name | Description |
---|---|---|
markupsafe.Markup | text | Converted markup. |
line_length
¤int
60
Maximum line length when formatting code/signatures.
When separating signatures from headings with the separate_signature
option, the Python handler will try to format the signatures using Black and the specified line length.
If Black is not installed, the handler issues an INFO log once.
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ separate_signature: true
+ line_length: 60
+
::: path.to.module
+ options:
+ separate_signature: true
+ line_length: 80
+
Preview
long_function_name(
+ long_parameter_1="hello",
+ long_parameter_2="world",
+)
long_function_name(long_parameter_1="hello", long_parameter_2="world")
modernize_annotations
¤Sponsors only — Insiders 1.8.0 — This feature also requires Griffe Insiders to be installed.
bool
False
Modernize annotations with latest features and PEPs of the Python language.
The Python language keeps evolving, and often library developers must continue to support a few minor versions of Python. Therefore they cannot use some features that were introduced in the latest versions.
Yet this doesn't mean they can't enjoy latest features in their docs: Griffe allows to "modernize" expressions, for example by replacing typing.Union
with PEP 604 type unions |
. Thanks to this, mkdocstrings' Python handler can automatically transform type annotations into their modern equivalent. This improves consistency in your docs, and shows users how to use your code with the latest features of the language.
Modernizations applied:
typing.Dict[A, B]
becomes dict[A, B]
typing.List[A]
becomes list[A]
typing.Set[A]
becomes set[A]
typing.Tuple[A]
becomes tuple[A]
typing.Union[A, B]
becomes A | B
typing.Optional[A]
becomes A | None
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ modernize_annotations: true
+
::: path.to.object
+ options:
+ modernize_annotations: false
+
Preview
from typing import Optional, Union, List
+
+example: Optional[Union[int, List[int]]] = None
+
show_signature
¤bool
True
Show methods and functions signatures.
Without it, just the function/method name is rendered.
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ show_signature: true
+
::: path.to.module
+ options:
+ show_signature: false
+
Preview
function(param1, param2=None)
Function docstring.
function
Function docstring.
show_signature_annotations
¤bool
False
Show the type annotations in methods and functions signatures.
Since the heading can become quite long when annotations are rendered, it is usually best to separate the signature from the heading.
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ separate_signature: true
+ show_signature_annotations: true
+
::: path.to.module
+ options:
+ separate_signature: true
+ show_signature_annotations: false
+
Preview
function(
+ param1: list[int | float],
+ param2: bool | None = None,
+) -> float
+
Function docstring.
function(param1, param2=None)
+
Function docstring.
separate_signature
¤bool
False
Whether to put the whole signature in a code block below the heading.
When separating signatures from headings, the Python handler will try to format the signatures using Black and the specified line length.
If Black is not installed, the handler issues an INFO log once.
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ separate_signature: false
+
::: path.to.module
+ options:
+ separate_signature: true
+
Preview
function(param1, param2=None)
+
Function docstring.
function(param1, param2=None)
Function docstring.
signature_crossrefs
¤Whether to render cross-references for type annotations in signatures.
When signatures are separated from headings with the separate_signature
option and type annotations are shown with the show_signature_annotations
option, this option will render a cross-reference (link) for each type annotation in the signature.
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ separate_signature: true
+ show_signature_annotations: true
+ signature_crossrefs: false
+
::: path.to.module
+ options:
+ separate_signature: true
+ show_signature_annotations: true
+ signature_crossrefs: true
+
Preview
unwrap_annotated
¤bool
False
Whether to unwrap Annotated
types to show only the type without the annotations.
For example, unwrapping Annotated[int, Gt(10)]
will render int
.
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ unwrap_annotated: false
+
::: path.to.module
+ options:
+ unwrap_annotated: true
+
It is possible to customize the output of the generated documentation with CSS and/or by overriding templates.
Our templates add CSS classes to many HTML elements to make it possible for users to customize the resulting look and feel.
To add CSS rules and style mkdocstrings' output, put them in a CSS file in your docs folder, for example in docs/css/mkdocstrings.css
, and reference this file in MkDocs' extra_css
configuration option:
extra_css:
+- css/mkdocstrings.css
+
Example:
.doc-section-title {
+ font-weight: bold;
+}
+
The following CSS classes are used in the generated HTML:
doc
: on all the following elementsdoc-children
: on div
s containing the children of an objectdoc-object
: on div
s containing an objectdoc-attribute
: on div
s containing an attributedoc-class
: on div
s containing a classdoc-function
: on div
s containing a functiondoc-module
: on div
s containing a moduledoc-heading
: on objects headingsdoc-object-name
: on span
s wrapping objects names/paths in the headingdoc-KIND-name
: as above, specific to the kind of object (module, class, function, attribute)doc-contents
: on div
s wrapping the docstring then the children (if any)first
: same, but only on the root object's contents div
doc-labels
: on span
s wrapping the object's labelsdoc-label
: on small
elements containing a labeldoc-label-LABEL
: same, where LABEL
is replaced by the actual labeldoc-section-title
: on section titles (depend on the selected style for section rendering)doc-section-item
: on section items (depend on the selected style for section rendering)doc-md-description
: on div
s containing HTML descriptions converted from Markdown docstringsdoc-symbol
: on code
tags of symbol typesdoc-symbol-heading
: on symbol types in headingsdoc-symbol-toc
: on symbol types in the ToCdoc-symbol-KIND
: specific to the kind of object (module
, class
, function
, method
, attribute
)Example with colorful labels
.doc-label { border-radius: 15px; padding: 2px 8px; font-weight: bold; }
+.doc-label-special { background-color: #3330E4; color: white; }
+.doc-label-private { background-color: #F637EC; color: white; }
+.doc-label-property { background-color: #FBB454; color: black; }
+.doc-label-read-only { background-color: #FAEA48; color: black; }
+
special private property read-only
You can customize the colors of the symbol types (see show_symbol_type_heading
and show_symbol_type_toc
) by overriding the values of our CSS variables, for example:
[data-md-color-scheme="default"] {
+ --doc-symbol-parameter-fg-color: #df50af;
+ --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-parameter-bg-color: #df50af1a;
+ --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-parameter-fg-color: #ffa8cc;
+ --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-parameter-bg-color: #ffa8cc1a;
+ --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:
:root {
+ --doc-symbol-parameter-fg-color: #df50af;
+ --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-parameter-bg-color: #df50af1a;
+ --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;
+}
+
Preview
Try cycling through the themes to see the colors for each theme:
You can also change the actual symbol names. For example, to use single letters instead of truncated types:
.doc-symbol-parameter::after {
+ content: "P";
+}
+
+.doc-symbol-attribute::after {
+ content: "A";
+}
+
+.doc-symbol-function::after {
+ content: "F";
+}
+
+.doc-symbol-method::after {
+ content: "M";
+}
+
+.doc-symbol-class::after {
+ content: "C";
+}
+
+.doc-symbol-module::after {
+ content: "M";
+}
+
Preview
Templates are organized into the following tree:
📁 theme/
+├── 📄 attribute.html
+├── 📄 attribute.html.jinja
+├── 📄 children.html
+├── 📄 children.html.jinja
+├── 📄 class.html
+├── 📄 class.html.jinja
+├── 📁 docstring/
+│ ├── 📄 admonition.html
+│ ├── 📄 admonition.html.jinja
+│ ├── 📄 attributes.html
+│ ├── 📄 attributes.html.jinja
+│ ├── 📄 classes.html
+│ ├── 📄 classes.html.jinja
+│ ├── 📄 examples.html
+│ ├── 📄 examples.html.jinja
+│ ├── 📄 functions.html
+│ ├── 📄 functions.html.jinja
+│ ├── 📄 modules.html
+│ ├── 📄 modules.html.jinja
+│ ├── 📄 other_parameters.html
+│ ├── 📄 other_parameters.html.jinja
+│ ├── 📄 parameters.html
+│ ├── 📄 parameters.html.jinja
+│ ├── 📄 raises.html
+│ ├── 📄 raises.html.jinja
+│ ├── 📄 receives.html
+│ ├── 📄 receives.html.jinja
+│ ├── 📄 returns.html
+│ ├── 📄 returns.html.jinja
+│ ├── 📄 warns.html
+│ ├── 📄 warns.html.jinja
+│ ├── 📄 yields.html
+│ └── 📄 yields.html.jinja
+├── 📄 docstring.html
+├── 📄 docstring.html.jinja
+├── 📄 expression.html
+├── 📄 expression.html.jinja
+├── 📄 function.html
+├── 📄 function.html.jinja
+├── 📄 labels.html
+├── 📄 labels.html.jinja
+├── 📄 language.html
+├── 📄 language.html.jinja
+├── 📁 languages/
+│ ├── 📄 en.html
+│ ├── 📄 en.html.jinja
+│ ├── 📄 ja.html
+│ ├── 📄 ja.html.jinja
+│ ├── 📄 zh.html
+│ └── 📄 zh.html.jinja
+├── 📄 module.html
+├── 📄 module.html.jinja
+├── 📄 signature.html
+├── 📄 signature.html.jinja
+├── 📁 summary/
+│ ├── 📄 attributes.html
+│ ├── 📄 attributes.html.jinja
+│ ├── 📄 classes.html
+│ ├── 📄 classes.html.jinja
+│ ├── 📄 functions.html
+│ ├── 📄 functions.html.jinja
+│ ├── 📄 modules.html
+│ └── 📄 modules.html.jinja
+├── 📄 summary.html
+└── 📄 summary.html.jinja
+
See them in the repository. See the general mkdocstrings documentation to learn how to override them: https://mkdocstrings.github.io/theming/#templates.
Each one of these templates extends a base version in theme/_base
. Example:
{% extends "_base/class.html" %}
+
Some of these templates define Jinja blocks. allowing to customize only parts of a template without having to fully copy-paste it into your project:
{% extends "_base/class.html" %}
+{% block contents %}
+ {{ block.super }}
+ Additional contents
+{% endblock contents %}
+
Only the templates for the Material for MkDocs provide Jinja blocks. The following tables show the block names, description, and the Jinja context available in their scope.
module.html
¤heading
: The module heading.labels
: The module labels.contents
: The module contents: docstring and children blocks.docstring
: The module docstring.summary
: The automatic summaries of members.children
: The module children.Available context:
config
: The handler configuration (dictionary).module
: The Module instance.class.html
¤heading
: The class heading.labels
: The class labels.signature
: The class signature.contents
: The class contents: bases, docstring, source and children blocks.bases
: The class bases.docstring
: The class docstring.summary
: The automatic summaries of members.source
: The class source code.children
: The class children.Available context:
config
: The handler configuration (dictionary).class
: The Class instance.function.html
¤heading
: The function heading.labels
: The function labels.signature
: The function signature.contents
: The function contents: docstring and source blocks.docstring
: The function docstring.source
: The function source code.Available context:
config
: The handler configuration (dictionary).function
: The Function instance.attribute.html
¤heading
: The attribute heading.labels
: The attribute labels.signature
: The attribute signature.contents
: The attribute contents: docstring block.docstring
: The attribute docstring.Available context:
config
: The handler configuration (dictionary).attribute
: The Attribute instance.In docstring/attributes.html
, docstring/functions.html
, docstring/classes.html
, docstring/modules.html
, docstring/other_parameters.html
, docstring/parameters.html
, docstring/raises.html
, docstring/receives.html
, docstring/returns.html
, docstring/warns.html
, and docstring/yields.html
:
table_style
: The section as a table.list_style
: The section as a list.spacy_style
: The section as a Spacy table.Available context:
section
: The DocstringSection instance (see DocstringSection*
subclasses).You can customize the colors in syntax highlighted signatures. If you are using the Material for MkDocs theme, here are some customization examples:
/* 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);
+}
+
+/* Fancier color for built-in types (only useful when cross-references are used). */
+.doc-signature .n > a[href^="https://docs.python.org/"][href*="/functions.html#"],
+.doc-signature .n > a[href^="https://docs.python.org/"][href*="/stdtypes.html#"] {
+ color: var(--md-code-hl-constant-color);
+}
+
For other themes, use their own CSS variables, or use plain colors such as violet
or #2987f2
.
Here are some CSS rules for the Material for MkDocs theme:
/* Indentation. */
+div.doc-contents:not(.first) {
+ padding-left: 25px;
+ border-left: .05rem solid var(--md-typeset-table-color);
+}
+
+/* Mark external links as such. */
+a.external::after,
+a.autorefs-external::after {
+ /* https://primer.style/octicons/arrow-up-right-24 */
+ mask-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.25 15.5a.75.75 0 00.75-.75v-9a.75.75 0 00-.75-.75h-9a.75.75 0 000 1.5h7.19L6.22 16.72a.75.75 0 101.06 1.06L17.5 7.56v7.19c0 .414.336.75.75.75z"></path></svg>');
+ -webkit-mask-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.25 15.5a.75.75 0 00.75-.75v-9a.75.75 0 00-.75-.75h-9a.75.75 0 000 1.5h7.19L6.22 16.72a.75.75 0 101.06 1.06L17.5 7.56v7.19c0 .414.336.75.75.75z"></path></svg>');
+ content: ' ';
+
+ display: inline-block;
+ vertical-align: middle;
+ position: relative;
+
+ height: 1em;
+ width: 1em;
+ background-color: currentColor;
+}
+
+a.external:hover::after,
+a.autorefs-external:hover::after {
+ background-color: var(--md-accent-fg-color);
+}
+
Here are some CSS rules for the built-in ReadTheDocs theme:
/* Indentation. */
+div.doc-contents:not(.first) {
+ padding-left: 25px;
+ border-left: .05rem solid rgba(200, 200, 200, 0.2);
+}
+
With Google-style docstrings, any section that is not recognized will be transformed into its admonition equivalent. For example:
"""
+Note:
+ It looks like a section, but it will be rendered as an admonition.
+
+Tip: You can even choose a title.
+ This admonition has a custom title!
+"""
+
Note
It looks like a section, but it will be rendered as an admonition.
You can even choose a title.
This admonition has a custom title!
See Napoleon's documentation. See the supported docstring sections on Griffe's documentation.
Note
As Numpy-style is partially supported by the underlying parser, you may experience problems in the building process if your docstring has a Methods
section in the class docstring (see #366).
See Numpydoc's documentation. See the supported docstring sections on Griffe's documentation.
See Sphinx's documentation. See the supported docstring sections on Griffe's documentation.
The Python handler supports extensions through mkdocstrings' handler extensions.
Specifically, additional templates can be added to the handler, and Griffe extensions can instruct the handler to use a particular template for a particular object by setting a value in the Griffe object's extra
dictionary:
obj = ... # get a reference to a Griffe object
+if "mkdocstrings" not in obj.extra:
+ obj.extra["mkdocstrings"] = {}
+obj.extra["mkdocstrings"]["template"] = "template_name.html"
+
This is the documentation for the NEW Python handler.
To read the documentation for the LEGACY handler, go to the legacy handler documentation.
You can install this handler as a mkdocstrings extra:
# PEP 621 dependencies declaration
+# adapt to your dependencies manager
+[project]
+dependencies = [
+ "mkdocstrings[python]>=0.18",
+]
+
You can also explicitly depend on the handler:
# PEP 621 dependencies declaration
+# adapt to your dependencies manager
+[project]
+dependencies = [
+ "mkdocstrings-python",
+]
+
The Python handler is the default mkdocstrings handler. You can change the default handler, or explicitely set the Python handler as default by defining the default_handler
configuration option of mkdocstrings
in mkdocs.yml
:
plugins:
+- mkdocstrings:
+ default_handler: python
+
With the Python handler installed and configured as default handler, you can inject documentation for a module, class, function, or any other Python object with mkdocstrings' autodoc syntax, in your Markdown pages:
::: path.to.object
+
If another handler was defined as default handler, you can explicitely ask for the Python handler to be used when injecting documentation with the handler
option:
::: path.to.object
+ handler: python
+
When installed, the Python handler becomes the default mkdocstrings handler. You can configure it in mkdocs.yml
:
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ ... # the Python handler configuration
+
Some options are global only, and go directly under the handler's name.
import
¤This option is used to import Sphinx-compatible objects inventories from other documentation sites. For example, you can import the standard library objects inventory like this:
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ import:
+ - https://docs.python-requests.org/en/master/objects.inv
+
When importing an inventory, you enable automatic cross-references to other documentation sites like the standard library docs or any third-party package docs. Typically, you want to import the inventories of your project's dependencies, at least those that are used in the public API.
See mkdocstrings' documentation on inventories for more details.
Additionally, the Python handler accepts a domains
option in the import items, which allows to select the inventory domains to select. By default the Python handler only selects the py
domain (for Python objects). You might find useful to also enable the std
domain:
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ import:
+ - url: https://docs.python-requests.org/en/master/objects.inv
+ domains: [std, py]
+
Note
The import
option is common to all handlers, however they might implement it differently, or not even implement it.
paths
¤This option is used to provide filesystem paths in which to search for Python modules. Non-absolute paths are computed as relative to MkDocs configuration file. Example:
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ paths: [src] # search packages in the src folder
+
More details at Finding modules.
load_external_modules
¤This option allows resolving aliases (imports) to any external module. Modules are considered external when they are not part of the package your are injecting documentation for. Enabling this option will tell the handler to resolve aliases recursively when they are made public through the __all__
variable.
Use with caution
This can load a lot of modules through Griffe, slowing down your build or triggering errors that Griffe does not yet handle. We recommend using the preload_modules
option instead, which acts as an include-list rather than as include-all.
Example:
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ load_external_modules: true
+
The other options can be used both globally and locally, under the options
key. For example, globally:
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ options:
+ do_something: true
+
...and locally, overriding the global configuration:
::: package.module.class
+ options:
+ do_something: false
+
These options affect how the documentation is collected from sources and rendered. See the following tables summarizing the options, and get more details for each option in the following pages:
Default handler configuration.
General options:
find_stubs_package
(bool
) – Whether to load stubs package (package-stubs) when extracting docstrings. Default False
.
allow_inspection
(bool
) – Whether to allow inspecting modules when visiting them is not possible. Default: True
.
show_bases
(bool
) – Show the base classes of a class. Default: True
.
show_inheritance_diagram
(bool
) – Show the inheritance diagram of a class using Mermaid. Default: False
.
show_source
(bool
) – Show the source code of this object. Default: True
.
preload_modules
(list[str] | None
) – Pre-load modules that are not specified directly in autodoc instructions (::: identifier
). It is useful when you want to render documentation for a particular member of an object, and this member is imported from another package than its parent.
For an imported member to be rendered, you need to add it to the __all__
attribute of the importing module.
The modules must be listed as an array of strings. Default: None
.
Headings options:
heading_level
(int
) – The initial heading level to use. Default: 2
.
parameter_headings
(bool
) – Whether to render headings for parameters (therefore showing parameters in the ToC). Default: False
.
show_root_heading
(bool
) – Show the heading of the object at the root of the documentation tree (i.e. the object referenced by the identifier after :::
). Default: False
.
show_root_toc_entry
(bool
) – If the root heading is not shown, at least add a ToC entry for it. Default: True
.
show_root_full_path
(bool
) – Show the full Python path for the root object heading. Default: True
.
show_root_members_full_path
(bool
) – Show the full Python path of the root members. Default: False
.
show_object_full_path
(bool
) – Show the full Python path of every object. Default: False
.
show_category_heading
(bool
) – When grouped by categories, show a heading for each category. Default: False
.
show_symbol_type_heading
(bool
) – Show the symbol type in headings (e.g. mod, class, meth, func and attr). Default: False
.
show_symbol_type_toc
(bool
) – Show the symbol type in the Table of Contents (e.g. mod, class, methd, func and attr). Default: False
.
Members options:
inherited_members
(list[str] | bool | None
) – A boolean, or an explicit list of inherited members to render. If true, select all inherited members, which can then be filtered with members
. If false or empty list, do not select any inherited member. Default: False
.
members
(list[str] | bool | None
) – A boolean, or an explicit list of members to render. If true, select all members without further filtering. If false or empty list, do not render members. If none, select all members and apply further filtering with filters and docstrings. Default: None
.
members_order
(str
) – The members ordering to use. Options: alphabetical
- order by the members names, source
- order members as they appear in the source file. Default: "alphabetical"
.
filters
(list[str] | None
) – A list of filters applied to filter objects based on their name. A filter starting with !
will exclude matching objects instead of including them. The members
option takes precedence over filters
(filters will still be applied recursively to lower members in the hierarchy). Default: ["!^_[^_]"]
.
group_by_category
(bool
) – Group the object's children by categories: attributes, classes, functions, and modules. Default: True
.
show_submodules
(bool
) – When rendering a module, show its submodules recursively. Default: False
.
summary
(bool | dict[str, bool]
) – Whether to render summaries of modules, classes, functions (methods) and attributes.
show_labels
(bool
) – Whether to show labels of the members. Default: True
.
Docstrings options:
docstring_style
(str
) – The docstring style to use: google
, numpy
, sphinx
, or None
. Default: "google"
.
docstring_options
(dict
) – The options for the docstring parser. See parsers under griffe.docstrings
.
docstring_section_style
(str
) – The style used to render docstring sections. Options: table
, list
, spacy
. Default: "table"
.
merge_init_into_class
(bool
) – Whether to merge the __init__
method into the class' signature and docstring. Default: False
.
show_if_no_docstring
(bool
) – Show the object heading even if it has no docstring or children with docstrings. Default: False
.
show_docstring_attributes
(bool
) – Whether to display the "Attributes" section in the object's docstring. Default: True
.
show_docstring_functions
(bool
) – Whether to display the "Functions" or "Methods" sections in the object's docstring. Default: True
.
show_docstring_classes
(bool
) – Whether to display the "Classes" section in the object's docstring. Default: True
.
show_docstring_modules
(bool
) – Whether to display the "Modules" section in the object's docstring. Default: True
.
show_docstring_description
(bool
) – Whether to display the textual block (including admonitions) in the object's docstring. Default: True
.
show_docstring_examples
(bool
) – Whether to display the "Examples" section in the object's docstring. Default: True
.
show_docstring_other_parameters
(bool
) – Whether to display the "Other Parameters" section in the object's docstring. Default: True
.
show_docstring_parameters
(bool
) – Whether to display the "Parameters" section in the object's docstring. Default: True
.
show_docstring_raises
(bool
) – Whether to display the "Raises" section in the object's docstring. Default: True
.
show_docstring_receives
(bool
) – Whether to display the "Receives" section in the object's docstring. Default: True
.
show_docstring_returns
(bool
) – Whether to display the "Returns" section in the object's docstring. Default: True
.
show_docstring_warns
(bool
) – Whether to display the "Warns" section in the object's docstring. Default: True
.
show_docstring_yields
(bool
) – Whether to display the "Yields" section in the object's docstring. Default: True
.
Signatures/annotations options:
annotations_path
(str
) – The verbosity for annotations path: brief
(recommended), or source
(as written in the source). Default: "brief"
.
line_length
(int
) – Maximum line length when formatting code/signatures. Default: 60
.
show_signature
(bool
) – Show methods and functions signatures. Default: True
.
show_signature_annotations
(bool
) – Show the type annotations in methods and functions signatures. Default: False
.
signature_crossrefs
(bool
) – Whether to render cross-references for type annotations in signatures. Default: False
.
separate_signature
(bool
) – Whether to put the whole signature in a code block below the heading. If Black is installed, the signature is also formatted using it. Default: False
.
unwrap_annotated
(bool
) – Whether to unwrap Annotated
types to show only the type without the annotations. Default: False
.
modernize_annotations
(bool
) – Whether to modernize annotations, for example Optional[str]
into str | None
. Default: False
.
There are multiple ways to tell the handler where to find your packages/modules.
The recommended method is to use the paths
option, as it's the only one that works with the -f
option of MkDocs, allowing to build the documentation from any location on the file system. Indeed, the paths provided with the paths
option are computed as relative to the configuration file (mkdocs.yml), so that the current working directory has no impact on the build process: you can build the docs from any location on your filesystem.
paths
option¤This is the recommended method.
mkdocs.yml in root, package in root
📁 root/
+├── 📄 mkdocs.yml
+└── 📁 package/
+
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ paths: [.] # actually not needed, default
+
mkdocs.yml in root, package in subfolder
📁 root/
+├── 📄 mkdocs.yml
+└── 📁 src/
+ └── 📁 package/
+
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ paths: [src]
+
mkdocs.yml in subfolder, package in root
📁 root/
+├── 📁 docs/
+│ └── 📄 mkdocs.yml
+└── 📁 package/
+
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ paths: [..]
+
mkdocs.yml in subfolder, package in subfolder
📁 root/
+├── 📁 docs/
+│ └── 📄 mkdocs.yml
+└── 📁 src/
+ └── 📁 package/
+
plugins:
+- mkdocstrings:
+ handlers:
+ python:
+ paths: [../src]
+
Except for case 1, which is supported by default, we strongly recommend setting the path to your packages using this option, even if it works without it (for example because your project manager automatically adds src
to PYTHONPATH), to make sure anyone can build your docs from any location on their filesystem.
This method has limitations.
This method might work for you, with your current setup, but not for others trying your build your docs with their own setup/environment. We recommend using the paths
method instead.
You can take advantage of the usual Python loading mechanisms. In Bash and other shells, you can run your command like this (note the prepended PYTHONPATH=...
):
mkdocs.yml in root, package in root
📁 root/
+├── 📄 mkdocs.yml
+└── 📁 package/
+
PYTHONPATH=. mkdocs build # actually not needed, default
+
mkdocs.yml in root, package in subfolder
📁 root/
+├── 📄 mkdocs.yml
+└── 📁 src/
+ └── 📁 package/
+
PYTHONPATH=src mkdocs build
+
mkdocs.yml in subfolder, package in root
📁 root/
+├── 📁 docs/
+│ └── 📄 mkdocs.yml
+└── 📁 package/
+
PYTHONPATH=. mkdocs build -f docs/mkdocs.yml
+
mkdocs.yml in subfolder, package in subfolder
📁 root/
+├── 📁 docs/
+│ └── 📄 mkdocs.yml
+└── 📁 src/
+ └── 📁 package/
+
PYTHONPATH=src mkdocs build -f docs/mkdocs.yml
+
This method has limitations.
This method might work for you, with your current setup, but not for others trying your build your docs with their own setup/environment. We recommend using the paths
method instead.
Install your package in the current environment, and run MkDocs:
. venv/bin/activate
+pip install -e .
+mkdocs build
+
pdm install
+pdm run mkdocs build
+
poetry install
+poetry run mkdocs build
+