From 0affedf9eaf07491632ddcef29886f28fecbf5b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Mazzucotelli?= Date: Sun, 24 Mar 2024 23:10:02 +0100 Subject: [PATCH] Deployed ad6c55e with MkDocs version: 1.5.3 --- insiders/changelog/index.html | 2 +- insiders/goals.yml | 3 ++ insiders/index.html | 2 +- objects.inv | Bin 1339 -> 1356 bytes .../python/handler/index.html | 4 ++- search/search_index.json | 2 +- sitemap.xml.gz | Bin 424 -> 424 bytes snippets/package/modern.py | 3 ++ usage/configuration/signatures/index.html | 26 ++++++++++++++---- usage/index.html | 2 +- 10 files changed, 33 insertions(+), 11 deletions(-) create mode 100644 snippets/package/modern.py diff --git a/insiders/changelog/index.html b/insiders/changelog/index.html index 9de27000..a5c7b334 100644 --- a/insiders/changelog/index.html +++ b/insiders/changelog/index.html @@ -1 +1 @@ - Changelog - mkdocstrings-python
Skip to content

Changelog¤

mkdocstrings-python Insiders¤

1.7.0 March 24, 2024¤

1.6.0 January 30, 2024¤

  • Render cross-references to parameters documentation in signatures and attribute values.
  • Add parameter_headings option to render headings for parameters (enabling permalinks and ToC/inventory entries).
  • Render cross-references for default parameter values in signatures.

1.5.1 September 12, 2023¤

  • Prevent empty auto-summarized Methods section.

1.5.0 September 05, 2023¤

  • Render function signature overloads.

1.4.0 August 27, 2023¤

  • Render cross-references in attribute signatures.

1.3.0 August 24, 2023¤

  • Add "method" symbol type.

1.2.0 August 20, 2023¤

1.1.4 July 17, 2023¤

  • Fix heading level increment for class members.

1.1.3 July 17, 2023¤

  • Fix heading level (avoid with clause preventing to decrease it).

1.1.2 July 15, 2023¤

  • Use non-breaking spaces after symbol types.

1.1.1 June 27, 2023¤

  • Correctly escape expressions in signatures and other rendered types.

1.1.0 June 4, 2023¤

1.0.0 May 10, 2023¤

\ No newline at end of file + Changelog - mkdocstrings-python
Skip to content

Changelog¤

mkdocstrings-python Insiders¤

1.8.0 March 24, 2024¤

1.7.0 March 24, 2024¤

1.6.0 January 30, 2024¤

  • Render cross-references to parameters documentation in signatures and attribute values.
  • Add parameter_headings option to render headings for parameters (enabling permalinks and ToC/inventory entries).
  • Render cross-references for default parameter values in signatures.

1.5.1 September 12, 2023¤

  • Prevent empty auto-summarized Methods section.

1.5.0 September 05, 2023¤

  • Render function signature overloads.

1.4.0 August 27, 2023¤

  • Render cross-references in attribute signatures.

1.3.0 August 24, 2023¤

  • Add "method" symbol type.

1.2.0 August 20, 2023¤

1.1.4 July 17, 2023¤

  • Fix heading level increment for class members.

1.1.3 July 17, 2023¤

  • Fix heading level (avoid with clause preventing to decrease it).

1.1.2 July 15, 2023¤

  • Use non-breaking spaces after symbol types.

1.1.1 June 27, 2023¤

  • Correctly escape expressions in signatures and other rendered types.

1.1.0 June 4, 2023¤

1.0.0 May 10, 2023¤

\ No newline at end of file diff --git a/insiders/goals.yml b/insiders/goals.yml index 9ceb8653..064a325f 100644 --- a/insiders/goals.yml +++ b/insiders/goals.yml @@ -30,6 +30,9 @@ goals: - name: Class inheritance diagrams with Mermaid ref: /usage/configuration/general/#show_inheritance_diagram since: 2024/03/24 + - name: Annotations modernization + ref: /usage/configuration/signatures/#modernize_annotations + since: 2024/03/24 2000: name: FusionDrive Ejection Configuration features: [] diff --git a/insiders/index.html b/insiders/index.html index d2b0b6c8..cbb96e25 100644 --- a/insiders/index.html +++ b/insiders/index.html @@ -1 +1 @@ - Insiders - mkdocstrings-python
Skip to content

Insiders¤

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!

What is Insiders?¤

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

What sponsorships achieve¤

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!

What's in it for me?¤

The moment you become a sponsor, you'll get immediate access to 8 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.

How to become a sponsor¤

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

  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.

Funding ¤

Goals¤

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.

$ 1,000 — GraviFridge Fluid Renewal¤

$ 1,500 — HyperLamp Navigation Tips¤

$ 2,000 — FusionDrive Ejection Configuration¤

There are no features in this goal for this project.
See the features in this goal for all Insiders projects.

Goals completed¤

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.

$ 500 — PlasmaVac User Guide¤

Frequently asked questions¤

Compatibility¤

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.

Payment¤

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.

Terms¤

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.


  1. 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

  2. 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. 

  3. 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. 

  4. 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. 

  5. 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. 

\ No newline at end of file + Insiders - mkdocstrings-python
Skip to content

Insiders¤

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!

What is Insiders?¤

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

What sponsorships achieve¤

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!

What's in it for me?¤

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.

How to become a sponsor¤

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

  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.

Funding ¤

Goals¤

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.

$ 1,000 — GraviFridge Fluid Renewal¤

$ 1,500 — HyperLamp Navigation Tips¤

$ 2,000 — FusionDrive Ejection Configuration¤

There are no features in this goal for this project.
See the features in this goal for all Insiders projects.

Goals completed¤

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.

$ 500 — PlasmaVac User Guide¤

Frequently asked questions¤

Compatibility¤

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.

Payment¤

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.

Terms¤

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.


  1. 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

  2. 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. 

  3. 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. 

  4. 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. 

  5. 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. 

\ No newline at end of file diff --git a/objects.inv b/objects.inv index b55715101f231128c94e9b0cdd113a4314fd750c..729f33df5bc2fc378a32f0852767f615fa9ac23e 100644 GIT binary patch delta 1220 zcmV;#1Uvh?3d{fgcK)uPs5L`~?`?_wUcmj--{FqvNS0&oXSQy1u;fdgANUR&s%CIXTVo4M%_FyxXKMY1{%AUM^|{mPq!@Fh(?S}b|F*VTy$?Gf zluqo$j$Bo%tHtno+1+QSoGeAj%~|I{#-BEq}S?#afDGxQW-P^~$sPZl2Ix z63M4eVLP{#yE)x>pHid4wo*YIY!MVI=S?vzhu2qBhKqXZV>MT-S+JqV=3K%0I?-$h z&GCCER%*@3%({0u-ESbKii|fAGlJSe#W1%IzqsAave;s6D&a@CnWYR5a|6pk<~oL@ z%ClX?LVw{9v$wobo;Bm({^izU{TrvWlpslaq{S2*L6KPJ8k8>-lj2!$VhtsWAUn&; z{j*^C;7^EHuASKv=!bX~r?Si{5017gVwCZqi4F1;)46AnLVzZQu!bbsog#RXGsQD1 zdlX!1{GbOqo^XWS@i9yaW8Vk}E>d-9(p#=n#*+gB6n|#tyD3dng7*`YbQqLYsW)pQ z&xPM1V+P8N`#DO?!m`S$CqQX}+cR{E)b;to6Oa&DW?tT8v8u5JSMon-oO?_G)JHr- z&h+Z@2rH^D&I~M)T$CwTrc86B_vlQ*G6KRQ#m8hCmgyoMCq5(-alfpMt5w?`v$VO1 z$qzU6g@126-ZY5Zpt?r$Wd_a1$wKLOD`sU$7O16MmHV()_cDy?`{UUXWoIgz1D2*R zj5{`*o-qea?3fit9?Os{JJfqHOumP(kuIxD$s8M}9{7~TIRkj6&Pdv8Y>dtTgjTsg zAhpXSP5%uxO1lc8v&l@lUou-c?1ti_ z!zTL~4DOJ7d@PiKjI8z)MGY9;*rcVP znysfvY~-1GDjkH)_t`!;g`QgD|=CR_dKg_go7F)}s0qFLUCg8Q(twWSa#gLa7U%!^KPL6ojHb#J6;C<{qFf@R^M6Irl7CxXtfg3nn|Ma8SDwvx^Mvk_ zNIrfH+qtdW%`xMBN{tTNN(J>~i=bFJZ;D|#yuP9`T+~}1tGQy$f(=DB=L*)>iEcw^ zj^9JEQfp2|*1gN=egiR8WW0%(F{v$73}gH7liS@ak1f`w5`ILOS<3LRFt8kCZeUod zJUdh@6n_qL_Lf)5v!);1zua1^f8&&v5+rGlw3vb;C=%~ngYt!9QalSztf6EPWM_G~ ze-85TJ=6tRb20P7%Dxnc^9h zKMF22{-g&wo^XWS@i7bvV_yjfE>d-9(p#=n#*+gB6n{qNn<-6Hg0~ZtbQqLgsW)q* z$c1l^F$3ks{TwA`VOeF>6QDGc+cOwN>iT@)2}p=MGcRwlSk>5qEBQY(!9At`>LVVa zV0!g=gca2nX9gBYF3J=vQ>Ho6dvqpY83Eyu;$t!m%XATs6CaX^xL?-B)v9feS=!vh zG=t{DWTEt5D`sU$7O16MmHV()_cHYA`{%PI%Fa|a2P{ot z7qss*`eNpVe&nMjdWRMO6J%&b;qZ4&KbZn86#=0u`xOa5PIbT zfz&UTH2pW&DD5hU&NF8Kq<%SPS+GQ$jged9Tz?Qj_CzO}WLCnKq{YeHeaUR)up5ex z4x8*paJWOZ_*gt?E*)X}6RG#%mIuKKC^BN013<~NVMB3Bn${pp&3sz&Q5@}GCS=`B zxqZc@iKjniOzl>($7ndx&aW$J;L= R&Z^_`?ZVsD{02h{m6nkrQ-S~h diff --git a/reference/mkdocstrings_handlers/python/handler/index.html b/reference/mkdocstrings_handlers/python/handler/index.html index 5ad212b6..c3463c26 100644 --- a/reference/mkdocstrings_handlers/python/handler/index.html +++ b/reference/mkdocstrings_handlers/python/handler/index.html @@ -57,6 +57,7 @@ "show_docstring_yields": True, "show_source": True, "show_bases": True, + "show_inheritance_diagram": False, "show_submodules": False, "group_by_category": True, "heading_level": 2, @@ -72,8 +73,9 @@ "show_labels": True, "unwrap_annotated": False, "parameter_headings": False, + "modernize_annotations": False, } -

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_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.

domain class-attribute instance-attribute ¤

domain: str = 'py'
+

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.

domain class-attribute instance-attribute ¤

domain: str = 'py'
 

The cross-documentation domain/language for this handler.

enable_inventory class-attribute instance-attribute ¤

enable_inventory: bool = True
 

Whether this handler is interested in enabling the creation of the objects.inv Sphinx inventory file.

extra_css class-attribute instance-attribute ¤

extra_css = ''
 

Extra CSS.

fallback_config class-attribute ¤

fallback_config: dict = {'fallback': True}
diff --git a/search/search_index.json b/search/search_index.json
index a8971e7e..212d6599 100644
--- a/search/search_index.json
+++ b/search/search_index.json
@@ -1 +1 @@
-{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"],"fields":{"title":{"boost":1000.0},"text":{"boost":1.0},"tags":{"boost":1000000.0}}},"docs":[{"location":"","title":"Overview","text":"mkdocstrings-python 

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.

"},{"location":"#installation","title":"Installation","text":"

You can install this handler as a mkdocstrings extra:

pyproject.toml
# PEP 621 dependencies declaration\n# adapt to your dependencies manager\n[project]\ndependencies = [\n    \"mkdocstrings[python]>=0.18\",\n]\n

You can also explicitly depend on the handler:

pyproject.toml
# PEP 621 dependencies declaration\n# adapt to your dependencies manager\n[project]\ndependencies = [\n    \"mkdocstrings-python\",\n]\n
"},{"location":"#preview","title":"Preview","text":""},{"location":"#features","title":"Features","text":"
  • 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 __init__ methods.

  • 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 Note: or Warning: will be transformed to their admonition equivalent. We do not support nested admonitions in docstrings!

  • 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: [this object][package.module.object] or directly with [package.module.object][]

  • Source code display: mkdocstrings can add a collapsible div containing the highlighted source code of the Python object.

"},{"location":"changelog/","title":"Changelog","text":"

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.

"},{"location":"changelog/#190-2024-03-13","title":"1.9.0 - 2024-03-13","text":"

Compare with 1.8.0

"},{"location":"changelog/#dependencies","title":"Dependencies","text":"
  • Add upper bound on Python-Markdown 3.6 to temporarily prevent breaking changes (cd93ee3 by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#features","title":"Features","text":"
  • Add show_labels option to show/hide labels (eaf9b82 by Viicos). Issue #120, PR #130
  • Add option to search for stubs packages (0c6aa32 by Romain). PR #128, PR griffe#221: : https://github.com/mkdocstrings/griffe/pull/221
"},{"location":"changelog/#code-refactoring","title":"Code Refactoring","text":"
  • Mark all Jinja blocks as scoped (548bdad by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#180-2024-01-08","title":"1.8.0 - 2024-01-08","text":"

Compare with 1.7.5

"},{"location":"changelog/#features_1","title":"Features","text":"
  • Release Insiders features of the $500/month funding goal (bd30106 by Timoth\u00e9e Mazzucotelli). The features and projects related to mkdocstrings-python are:

    • Cross-references for type annotations in signatures
    • Symbol types in headings and table of contents
    • griffe-inherited-docstrings, a Griffe extension for inheriting docstrings
    • griffe2md, a tool to output API docs to Markdown using Griffe

    See the complete list of features and projects here: https://pawamoy.github.io/insiders/#500-plasmavac-user-guide.

"},{"location":"changelog/#175-2023-11-21","title":"1.7.5 - 2023-11-21","text":"

Compare with 1.7.4

"},{"location":"changelog/#bug-fixes","title":"Bug Fixes","text":"
  • Add missing translations (fallback theme) for ReadTheDocs (2fb6513 by Timoth\u00e9e Mazzucotelli). Issue #115
"},{"location":"changelog/#174-2023-11-12","title":"1.7.4 - 2023-11-12","text":"

Compare with 1.7.3

"},{"location":"changelog/#bug-fixes_1","title":"Bug Fixes","text":"
  • Make extension paths relative to config file (5035e92 by Waylan Limberg). PR #112, Co-authored-by: Timoth\u00e9e Mazzucotelli pawamoy@pm.me
"},{"location":"changelog/#code-refactoring_1","title":"Code Refactoring","text":"
  • Prepare for Griffe 0.37 (b5bb8a9 by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#173-2023-10-09","title":"1.7.3 - 2023-10-09","text":"

Compare with 1.7.2

"},{"location":"changelog/#bug-fixes_2","title":"Bug Fixes","text":"
  • Don't deepcopy the local config (1300d2c by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#172-2023-10-05","title":"1.7.2 - 2023-10-05","text":"

Compare with 1.7.1

"},{"location":"changelog/#bug-fixes_3","title":"Bug Fixes","text":"
  • Prevent alias resolution error when source-ordering members (67df10c by Timoth\u00e9e Mazzucotelli). Issue griffe#213
"},{"location":"changelog/#code-refactoring_2","title":"Code Refactoring","text":"
  • Use package relative filepath if filepath is not relative (aa5a3f7 by Timoth\u00e9e Mazzucotelli). Discussion mkdocstrings#622
"},{"location":"changelog/#171-2023-09-28","title":"1.7.1 - 2023-09-28","text":"

Compare with 1.7.0

"},{"location":"changelog/#bug-fixes_4","title":"Bug Fixes","text":"
  • Stop propagation of annotation to next parameter in signature template (3a760ac by Timoth\u00e9e Mazzucotelli). Issue #110
"},{"location":"changelog/#code-refactoring_3","title":"Code Refactoring","text":"
  • Look into inherited members for __init__ methods when merging docstrings (b97d51f by Timoth\u00e9e Mazzucotelli). Issue #106
"},{"location":"changelog/#170-2023-09-14","title":"1.7.0 - 2023-09-14","text":"

Compare with 1.6.3

"},{"location":"changelog/#features_2","title":"Features","text":"
  • Add option to unwrap Annotated types (53db04b by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#163-2023-09-11","title":"1.6.3 - 2023-09-11","text":"

Compare with 1.6.2

"},{"location":"changelog/#bug-fixes_5","title":"Bug Fixes","text":"
  • Make load_external_modules a global-only option (266f41f by Timoth\u00e9e Mazzucotelli). Issue #87
  • Never fail when trying to format code with Black (df24bbc by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#code-refactoring_4","title":"Code Refactoring","text":"
  • Wrap docstring section elements (list style) in code tags to prevent spell checker errors (1ae8dd8 by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#162-2023-09-05","title":"1.6.2 - 2023-09-05","text":"

Compare with 1.6.1

"},{"location":"changelog/#bug-fixes_6","title":"Bug Fixes","text":"
  • Don't render cross-ref spans when they're not enabled (eed51ee by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#161-2023-09-04","title":"1.6.1 - 2023-09-04","text":"

Compare with 1.6.0

"},{"location":"changelog/#bug-fixes_7","title":"Bug Fixes","text":"
  • Fix spacing for rendered named items in Yields, Receives and Returns sections (list style) (e12688e by Timoth\u00e9e Mazzucotelli).
  • Fix rendering Receives sections as lists (9ff7e68 by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#160-2023-08-27","title":"1.6.0 - 2023-08-27","text":"

Compare with 1.5.2

"},{"location":"changelog/#features_3","title":"Features","text":"
  • Add doc-signature CSS class to separate signature code blocks (b6c648f by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#code-refactoring_5","title":"Code Refactoring","text":"
  • Add a format_attribute filter, preparing for cross-refs in attribute signatures (8f0ade2 by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#152-2023-08-25","title":"1.5.2 - 2023-08-25","text":"

Compare with 1.5.1

"},{"location":"changelog/#bug-fixes_8","title":"Bug Fixes","text":"
  • Regression in children template: fix condition for when members are specified (beeebff by Timoth\u00e9e Mazzucotelli). Issue #100
  • Prevent whitespace removal before highlight filter (c6f36c0 by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#code-refactoring_6","title":"Code Refactoring","text":"
  • Never show full object path in ToC entry (9aa758b by Timoth\u00e9e Mazzucotelli).
  • Sync templates with insiders, remove useless lines (38b317f by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#151-2023-08-24","title":"1.5.1 - 2023-08-24","text":"

Compare with 1.5.0

"},{"location":"changelog/#code-refactoring_7","title":"Code Refactoring","text":"
  • Never show full path in separate signature since it would appear in the heading already (9e02049 by Timoth\u00e9e Mazzucotelli).
  • Improve guessing whether an object is public (35eb811 by Timoth\u00e9e Mazzucotelli).
  • Always sort modules alphabetically as source order wouldn't make sense (70c81ce by Timoth\u00e9e Mazzucotelli).
  • Return anchors as a tuple, not a set, to preserve order (736a2b5 by Timoth\u00e9e Mazzucotelli). Related-to #mkdocstrings/crystal#6
"},{"location":"changelog/#150-2023-08-20","title":"1.5.0 - 2023-08-20","text":"

Compare with 1.4.0

"},{"location":"changelog/#features_4","title":"Features","text":"
  • Add support for new Griffe docstring sections: modules, classes, and functions (methods) (d5337af by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#140-2023-08-18","title":"1.4.0 - 2023-08-18","text":"

Compare with 1.3.0

"},{"location":"changelog/#features_5","title":"Features","text":"
  • Support new Griffe expressions (in v0.33) (9b8e1b1 by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#code-refactoring_8","title":"Code Refactoring","text":"
  • Deprecate crossref and multi_crossref filters (4fe3d20 by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#130-2023-08-06","title":"1.3.0 - 2023-08-06","text":"

Compare with 1.2.1

"},{"location":"changelog/#dependencies_1","title":"Dependencies","text":"
  • Set upper bound on Griffe (0.33) (ad8c2a3 by Timoth\u00e9e Mazzucotelli). See https://github.com/mkdocstrings/griffe/discussions/195.
"},{"location":"changelog/#features_6","title":"Features","text":"
  • Show parameter default values within the \"list\" section style too (55f08f3 by Antoine Dechaume). PR #92, Co-authored-by: Timoth\u00e9e Mazzucotelli pawamoy@pm.me
"},{"location":"changelog/#121-2023-07-20","title":"1.2.1 - 2023-07-20","text":"

Compare with 1.2.0

"},{"location":"changelog/#bug-fixes_9","title":"Bug Fixes","text":"
  • Fix members ordering when members are specified with a boolean (c69f9c3 by Timoth\u00e9e Mazzucotelli). Issue #89
"},{"location":"changelog/#120-2023-07-14","title":"1.2.0 - 2023-07-14","text":"

Compare with 1.1.2

"},{"location":"changelog/#features_7","title":"Features","text":"
  • Add Jinja blocks to module, class, function and attribute templates (299fe48 by Timoth\u00e9e Mazzucotelli).
  • Setup infrastructure for I18N, add translations for simplified chinese and japanese (b053b29 by Nyuan Zhang). PR #77
  • Support inheritance (ae42356 by Timoth\u00e9e Mazzucotelli). Issue mkdocstrings#157, Discussion mkdocstrings#536
"},{"location":"changelog/#bug-fixes_10","title":"Bug Fixes","text":"
  • Don't show None as return annotation of class signatures (3d8724e by Timoth\u00e9e Mazzucotelli). Issue #85
  • Show labels in deterministic order (02619a8 by Oleh Prypin).
"},{"location":"changelog/#112-2023-06-04","title":"1.1.2 - 2023-06-04","text":"

Compare with 1.1.1

"},{"location":"changelog/#code-refactoring_9","title":"Code Refactoring","text":"
  • Keep headings style consistent (CSS) (92032e5 by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#111-2023-06-04","title":"1.1.1 - 2023-06-04","text":"

Compare with 1.1.0

"},{"location":"changelog/#bug-fixes_11","title":"Bug Fixes","text":"
  • Fix mkdocs and readthedocs themes support (14f18b2 by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#code-refactoring_10","title":"Code Refactoring","text":"
  • Improve display of paragraphs in docstring sections (439f5e6 by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#110-2023-05-25","title":"1.1.0 - 2023-05-25","text":"

Compare with 1.0.0

"},{"location":"changelog/#features_8","title":"Features","text":"
  • Support custom templates through objects' extra data (8ff2b06 by Timoth\u00e9e Mazzucotelli). PR #70
"},{"location":"changelog/#100-2023-05-11","title":"1.0.0 - 2023-05-11","text":"

Compare with 0.10.1

"},{"location":"changelog/#breaking-changes","title":"Breaking changes","text":"
  • The signature of the 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

    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.

"},{"location":"changelog/#bug-fixes_12","title":"Bug Fixes","text":"
  • Bring compatibility with insiders signature crossrefs feature (f686f4e by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#0101-2023-05-07","title":"0.10.1 - 2023-05-07","text":"

Compare with 0.10.0

"},{"location":"changelog/#bug-fixes_13","title":"Bug Fixes","text":"
  • Format signatures with full-path names (685512d by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#0100-2023-05-07","title":"0.10.0 - 2023-05-07","text":"

Compare with 0.9.0

"},{"location":"changelog/#features_9","title":"Features","text":"
  • Add option to disallow inspection (40f2f26 by Nyuan Zhang). Issue #68, PR #69
"},{"location":"changelog/#bug-fixes_14","title":"Bug Fixes","text":"
  • Make admonitions open by default (79cd153 by Timoth\u00e9e Mazzucotelli). Issue #22
"},{"location":"changelog/#code-refactoring_11","title":"Code Refactoring","text":"
  • Match documented behavior for filtering (all members, list, none) (c7f70c3 by Timoth\u00e9e Mazzucotelli).
  • Switch to an info level log for when black's not installed (f593bb0 by Faster Speeding).
  • Return anchors as a set (e2b820c by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#090-2023-04-03","title":"0.9.0 - 2023-04-03","text":"

Compare with 0.8.3

"},{"location":"changelog/#features_10","title":"Features","text":"
  • Allow resolving alias to external modules (02052e2 by Gilad). PR #61, Follow-up of PR #60
  • Allow pre-loading modules (36002cb by Gilad). Issue mkdocstrings/mkdocstrings#503, PR #60
  • Add show options for docstrings (a6c55fb by Jeremy Goh). Issue mkdocstrings/mkdocstrings#466, PR #56
  • Allow custom list of domains for inventories (f5ea6fd by Sorin Sbarnea). Issue mkdocstrings/mkdocstrings#510, PR #49
"},{"location":"changelog/#bug-fixes_15","title":"Bug Fixes","text":"
  • Prevent alias resolution error when searching for anchors (a190e2c by Timoth\u00e9e Mazzucotelli). Issue #64
"},{"location":"changelog/#code-refactoring_12","title":"Code Refactoring","text":"
  • Support Griffe 0.26 (075735c by Timoth\u00e9e Mazzucotelli).
  • Log (debug) unresolved aliases (9164742 by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#083-2023-01-04","title":"0.8.3 - 2023-01-04","text":"

Compare with 0.8.2

"},{"location":"changelog/#code-refactoring_13","title":"Code Refactoring","text":"
  • Change \"unresolved aliases\" log level to DEBUG (dccb818 by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#082-2022-11-19","title":"0.8.2 - 2022-11-19","text":"

Compare with 0.8.1

"},{"location":"changelog/#bug-fixes_16","title":"Bug Fixes","text":"
  • Fix base directory used to expand globs (34cfa4b by Florian Hofer). PR #45
"},{"location":"changelog/#081-2022-11-19","title":"0.8.1 - 2022-11-19","text":"

Compare with 0.8.0

"},{"location":"changelog/#bug-fixes_17","title":"Bug Fixes","text":"
  • Expand globs relative to configuration file path (0dc45ae by David Vegh). Issue #42, PR #43
"},{"location":"changelog/#080-2022-11-13","title":"0.8.0 - 2022-11-13","text":"

Compare with 0.7.1

"},{"location":"changelog/#features_11","title":"Features","text":"
  • Add support for globs in paths configuration (29edd02 by Andrew Guenther). Issue #33, PR #34
"},{"location":"changelog/#code-refactoring_14","title":"Code Refactoring","text":"
  • Support Griffe 0.24 (3b9f701 by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#071-2022-06-12","title":"0.7.1 - 2022-06-12","text":"

Compare with 0.7.0

"},{"location":"changelog/#bug-fixes_18","title":"Bug Fixes","text":"
  • Fix rendering of / in signatures (3e927e4 by Timoth\u00e9e Mazzucotelli). Issue #25
"},{"location":"changelog/#070-2022-05-28","title":"0.7.0 - 2022-05-28","text":"

Compare with 0.6.6

"},{"location":"changelog/#packaging-dependencies","title":"Packaging / Dependencies","text":"
  • Depend on mkdocstrings 0.19 (b6a9a47 by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#features_12","title":"Features","text":"
  • Add config option for annotations paths verbosity (b6c9893 by Timoth\u00e9e Mazzucotelli).
  • Use sections titles in SpaCy-styled docstrings (fe16b54 by Timoth\u00e9e Mazzucotelli).
  • Wrap objects names in spans to allow custom styling (0822ff9 by Timoth\u00e9e Mazzucotelli). Issue mkdocstrings/mkdocstrings#240
  • Add Jinja blocks around docstring section styles (aaa79ee by Timoth\u00e9e Mazzucotelli).
  • Add members and filters options (24a6136 by Timoth\u00e9e Mazzucotelli).
  • Add paths option (dd41182 by Timoth\u00e9e Mazzucotelli). Issue mkdocstrings/mkdocstrings#311, PR #20
"},{"location":"changelog/#bug-fixes_19","title":"Bug Fixes","text":"
  • Fix CSS class on labels (312a709 by Timoth\u00e9e Mazzucotelli).
  • Fix categories rendering (6407cf4 by Timoth\u00e9e Mazzucotelli). Issue #14
"},{"location":"changelog/#code-refactoring_15","title":"Code Refactoring","text":"
  • Disable show_submodules by default (480d0c3 by Timoth\u00e9e Mazzucotelli).
  • Merge default configuration options in handler (347ce76 by Timoth\u00e9e Mazzucotelli).
  • Reduce number of template debug logs (8fed314 by Timoth\u00e9e Mazzucotelli).
  • Respect show_root_full_path for ToC entries (hidden headings) (8f4c853 by Timoth\u00e9e Mazzucotelli).
  • Bring consistency on headings style (59104c4 by Timoth\u00e9e Mazzucotelli).
  • Stop using deprecated base classes (d5ea1c5 by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#066-2022-03-06","title":"0.6.6 - 2022-03-06","text":"

Compare with 0.6.5

"},{"location":"changelog/#code-refactoring_16","title":"Code Refactoring","text":"
  • Always hide self and cls parameters (7f579d1 by Timoth\u00e9e Mazzucotelli). Issue #7
  • Use pycon for examples code blocks (6545900 by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#065-2022-02-24","title":"0.6.5 - 2022-02-24","text":"

Compare with 0.6.4

"},{"location":"changelog/#bug-fixes_20","title":"Bug Fixes","text":"
  • Don't escape signatures return annotations (ac54bfc by Timoth\u00e9e Mazzucotelli). Issue #6
"},{"location":"changelog/#064-2022-02-22","title":"0.6.4 - 2022-02-22","text":"

Compare with 0.6.3

"},{"location":"changelog/#bug-fixes_21","title":"Bug Fixes","text":"
  • Fix rendering of signature return annotation (b92ba3b by Timoth\u00e9e Mazzucotelli). Issue #4
"},{"location":"changelog/#063-2022-02-20","title":"0.6.3 - 2022-02-20","text":"

Compare with 0.6.2

"},{"location":"changelog/#bug-fixes_22","title":"Bug Fixes","text":"
  • Fix examples rendering (a06a7e3 by Timoth\u00e9e Mazzucotelli). Issue mkdocstrings/griffe#46
"},{"location":"changelog/#062-2022-02-17","title":"0.6.2 - 2022-02-17","text":"

Compare with 0.6.1

"},{"location":"changelog/#bug-fixes_23","title":"Bug Fixes","text":"
  • Catch alias resolution errors (b734dd0 by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#061-2022-02-17","title":"0.6.1 - 2022-02-17","text":"

Compare with 0.6.0

"},{"location":"changelog/#bug-fixes_24","title":"Bug Fixes","text":"
  • Don't pop from fallback config (bde32af by Timoth\u00e9e Mazzucotelli).
  • Fix rendering init method source when merged into class (4a20aea by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#060-2022-02-13","title":"0.6.0 - 2022-02-13","text":"

Compare with 0.5.4

"},{"location":"changelog/#features_13","title":"Features","text":"
  • Add option to merge __init__ methods' docstrings into their classes' docstrings (1b4d1c0 by Timoth\u00e9e Mazzucotelli).
  • Support separate attribute signature (e962b88 by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#bug-fixes_25","title":"Bug Fixes","text":"
  • Restore full cross-refs paths on hover (ac11970 by Timoth\u00e9e Mazzucotelli).
  • Fix rendering of labels (52919c5 by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#code-refactoring_17","title":"Code Refactoring","text":"
  • Don't add trailing parentheses in functions heading when separate signature (885696e by Timoth\u00e9e Mazzucotelli).
  • Use more explicit template debug messages (f2122d7 by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#054-2022-02-13","title":"0.5.4 - 2022-02-13","text":"

Compare with 0.5.3

"},{"location":"changelog/#bug-fixes_26","title":"Bug Fixes","text":"
  • Don't load additional modules during fallback (69b8e25 by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#053-2022-02-08","title":"0.5.3 - 2022-02-08","text":"

Compare with 0.5.2

"},{"location":"changelog/#bug-fixes_27","title":"Bug Fixes","text":"
  • Allow passing null as docstring style (f526816 by Timoth\u00e9e Mazzucotelli). Issue #2
"},{"location":"changelog/#052-2022-02-05","title":"0.5.2 - 2022-02-05","text":"

Compare with 0.5.1

"},{"location":"changelog/#dependencies_2","title":"Dependencies","text":"
  • Require at least mkdocstrings 0.18 (7abdda4 by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#051-2022-02-03","title":"0.5.1 - 2022-02-03","text":"

Compare with 0.5.0

"},{"location":"changelog/#dependencies_3","title":"Dependencies","text":"
  • Depend on Griffe >= 0.11.1 (1303557 by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#code-refactoring_18","title":"Code Refactoring","text":"
  • Move handler into its own module (b787e78 by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#050-2022-02-03","title":"0.5.0 - 2022-02-03","text":"

Compare with 0.4.1

"},{"location":"changelog/#features_14","title":"Features","text":"
  • Allow changing docstring style of an object (39240c1 by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#bug-fixes_28","title":"Bug Fixes","text":"
  • Warn if Black is not installed when formatting signature (b848277 by Timoth\u00e9e Mazzucotelli).
  • Fix missing default for docstring_section_style option (774988e by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#code-refactoring_19","title":"Code Refactoring","text":"
  • Change to new way of stripping paragraphs (33d4594 by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#041-2022-02-01","title":"0.4.1 - 2022-02-01","text":"

Compare with 0.4.0

"},{"location":"changelog/#bug-fixes_29","title":"Bug Fixes","text":"
  • Fix docstring admonitions rendering (a24ae2e by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#040-2022-02-01","title":"0.4.0 - 2022-02-01","text":"

Compare with 0.3.0

"},{"location":"changelog/#code-refactoring_20","title":"Code Refactoring","text":"
  • Use the new mkdocstrings_handlers namespace (23c9023 by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#030-2022-01-14","title":"0.3.0 - 2022-01-14","text":"

Compare with 0.2.0

"},{"location":"changelog/#features_15","title":"Features","text":"
  • Support griffe 0.10 (28061de by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#dependencies_4","title":"Dependencies","text":"
  • Require griffe 0.10 (cfbd7bb by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#code-refactoring_21","title":"Code Refactoring","text":"
  • Use new logger patching utility (4cdb292 by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#020-2021-12-28","title":"0.2.0 - 2021-12-28","text":"

Compare with 0.1.0

"},{"location":"changelog/#dependencies_5","title":"Dependencies","text":"
  • Depend on griffe >= 0.7.1 (34f7ebd by Timoth\u00e9e Mazzucotelli).
  • Upgrade griffe, no upper bound (8f0aa42 by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#features_16","title":"Features","text":"
  • Add show_signature rendering option (0f07c2e by Will Da Silva).
"},{"location":"changelog/#bug-fixes_30","title":"Bug Fixes","text":"
  • Fix templates for named docstring elements (47868a1 by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#010-2021-12-19","title":"0.1.0 - 2021-12-19","text":"

Compare with first commit

"},{"location":"changelog/#features_17","title":"Features","text":"
  • Implement handler and add templates (dbb580a by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#bug-fixes_31","title":"Bug Fixes","text":"
  • Fix separate signature feature (da6e81c by Timoth\u00e9e Mazzucotelli).
  • Fix signature template (parameters annotations) (b34ead0 by Timoth\u00e9e Mazzucotelli).
  • Only show source when present (c270d68 by Timoth\u00e9e Mazzucotelli).
"},{"location":"changelog/#code-refactoring_22","title":"Code Refactoring","text":"
  • Return all known anchors (9bbfe14 by Timoth\u00e9e Mazzucotelli).
  • Update for griffe 0.4.0 (831aabb by Timoth\u00e9e Mazzucotelli).
"},{"location":"code_of_conduct/","title":"Contributor Covenant Code of Conduct","text":""},{"location":"code_of_conduct/#our-pledge","title":"Our Pledge","text":"

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.

"},{"location":"code_of_conduct/#our-standards","title":"Our Standards","text":"

Examples of behavior that contributes to a positive environment for our community include:

  • Demonstrating empathy and kindness toward other people
  • Being respectful of differing opinions, viewpoints, and experiences
  • Giving and gracefully accepting constructive feedback
  • Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
  • Focusing on what is best not just for us as individuals, but for the overall community

Examples of unacceptable behavior include:

  • The use of sexualized language or imagery, and sexual attention or advances of any kind
  • Trolling, insulting or derogatory comments, and personal or political attacks
  • Public or private harassment
  • Publishing others' private information, such as a physical or email address, without their explicit permission
  • Other conduct which could reasonably be considered inappropriate in a professional setting
"},{"location":"code_of_conduct/#enforcement-responsibilities","title":"Enforcement Responsibilities","text":"

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.

"},{"location":"code_of_conduct/#scope","title":"Scope","text":"

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.

"},{"location":"code_of_conduct/#enforcement","title":"Enforcement","text":"

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.

"},{"location":"code_of_conduct/#enforcement-guidelines","title":"Enforcement Guidelines","text":"

Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:

"},{"location":"code_of_conduct/#1-correction","title":"1. Correction","text":"

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.

"},{"location":"code_of_conduct/#2-warning","title":"2. Warning","text":"

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.

"},{"location":"code_of_conduct/#3-temporary-ban","title":"3. Temporary Ban","text":"

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.

"},{"location":"code_of_conduct/#4-permanent-ban","title":"4. Permanent Ban","text":"

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.

"},{"location":"code_of_conduct/#attribution","title":"Attribution","text":"

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.

"},{"location":"contributing/","title":"Contributing","text":"

Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given.

"},{"location":"contributing/#environment-setup","title":"Environment setup","text":"

Nothing easier!

Fork and clone the repository, then:

cd python\nmake setup\n

Note

If it fails for some reason, you'll need to install uv manually.

You can install it with:

python3 -m pip install --user pipx\npipx install uv\n

Now you can try running make setup again, or simply uv install.

You now have the dependencies installed.

Run make help to see all the available actions!

"},{"location":"contributing/#tasks","title":"Tasks","text":"

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 make run duty TASK.

The Makefile detects if a virtual environment is activated, so make will work the same with the virtualenv activated or not.

If you work in VSCode, we provide an action to configure VSCode for the project.

"},{"location":"contributing/#development","title":"Development","text":"

As usual:

  1. create a new branch: git switch -c feature-or-bugfix-name
  2. edit the code and/or the documentation

Before committing:

  1. run make format to auto-format the code
  2. run make check to check everything (fix any warning)
  3. run make test to run the tests (fix any issue)
  4. if you updated the documentation or the project dependencies:
    1. run make docs
    2. go to http://localhost:8000 and check that everything looks good
  5. follow our commit message convention

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.

"},{"location":"contributing/#commit-message-convention","title":"Commit message convention","text":"

Commit messages must follow our convention based on the Angular style or the Karma convention:

<type>[(scope)]: Subject\n\n[Body]\n

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:

  • 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.

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:

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

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 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).

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.

"},{"location":"contributing/#pull-requests-guidelines","title":"Pull requests guidelines","text":"

Link to any related issue in the Pull Request message.

During the review, we recommend using fixups:

# SHA is the SHA of the commit you want to fix\ngit commit --fixup=SHA\n

Once all the changes are approved, you can squash your commits:

git rebase -i --autosquash main\n

And force-push:

git push -f\n

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.

"},{"location":"credits/","title":"Credits","text":""},{"location":"credits/#exec-1--credits","title":"Credits","text":"

These projects were used to build mkdocstrings-python. Thank you!

Python | uv | copier-uv

"},{"location":"credits/#exec-1--runtime-dependencies","title":"Runtime dependencies","text":"Project Summary Version (accepted) Version (last resolved) License Jinja2 A very fast and expressive template engine. >=2.11.1 3.1.3 BSD-3-Clause Markdown Python implementation of John Gruber's Markdown. >=3.3, <3.6 3.5.2 BSD License MarkupSafe Safely add untrusted strings to HTML/XML markup. >=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 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.40 0.42.0.1.2.0 ISC importlib_metadata Read metadata from Python packages >=4.6 7.0.2 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.5.3 BSD-2-Clause mkdocs-autorefs Automatically link across pages in MkDocs. >=0.3.1 1.0.1 ISC mkdocstrings Automatic documentation from sources, for MkDocs. >=0.23, >=0.20 0.24.1 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.9.0, >=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.0 MIT pymdown-extensions Extension pack for Python Markdown. >=6.3 10.7.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 4.10.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.0 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.14.0 BSD-3-Clause GitPython GitPython is a Python library used to interact with Git repositories 3.1.42 BSD-3-Clause Jinja2 A very fast and expressive template engine. >=2.11.1 3.1.3 BSD-3-Clause Markdown Python implementation of John Gruber's Markdown. >=3.3, <3.6 3.5.2 BSD License MarkupSafe Safely add untrusted strings to HTML/XML markup. >=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.13.0, <3.0.0 2.17.2 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.2.0 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.1.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.4.3 Apache-2.0 cryptography cryptography is a package which provides cryptographic recipes and primitives to Python developers. >=2.0 42.0.5 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.20.1 public domain, Python, 2-Clause BSD, GPL 3 (see COPYING.txt) dparse A parser for Python dependency files >=0.6.2 0.6.3 MIT license duty A simple task runner. >=0.10 1.2.0 ISC execnet execnet: rapid multi-Python deployment >=1.1 2.0.2 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.4.0 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.6 BSD License importlib_metadata Read metadata from Python packages >=4.6 7.0.2 Apache Software License iniconfig brain-dead simple config-ini parsing 2.0.0 MIT jaraco.classes Utility functions for Python class constructs 3.3.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 24.3.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.5.3 BSD-2-Clause mkdocs-autorefs Automatically link across pages in MkDocs. >=0.3.1 1.0.1 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-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.13+insiders.4.53.1 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.23, >=0.20 0.24.1 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.9.0 MIT mypy-extensions Type system extensions for programs checked with the mypy type checker. >=0.4.3 1.0.0 MIT License nh3 Python bindings to the ammonia HTML sanitization library. >=0.2.14 0.2.15 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.9.0, >=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.0 MIT pluggy plugin and hook calling mechanisms for python >=1.4, <2.0 1.4.0 MIT ptyprocess Run a subprocess in a pseudo terminal ~=0.6 0.7.0 ISC License (ISCL) pycparser C parser in Python 2.21 BSD pymdown-extensions Extension pack for Python Markdown. >=6.3 10.7.1 MIT pyproject_hooks Wrappers to call pyproject.toml-based build backend hooks. 1.0.0 MIT License pytest pytest: simple powerful testing with Python >=7.4 8.1.1 MIT pytest-cov Pytest plugin for measuring coverage. >=4.1 4.1.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.5.0 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 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 2023.12.25 Apache Software License requests Python HTTP for Humans. 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.3.2 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.2.0 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.5.0.20240311 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 4.10.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.0 MIT License

More credits from the author

"},{"location":"license/","title":"License","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
"},{"location":"insiders/","title":"Insiders","text":"

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!

"},{"location":"insiders/#what-is-insiders","title":"What is Insiders?","text":"

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

"},{"location":"insiders/#what-sponsorships-achieve","title":"What sponsorships achieve","text":"

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!

"},{"location":"insiders/#whats-in-it-for-me","title":"What's in it for me?","text":"

The moment you become a sponsor, you'll get immediate access to 8 additional features that you can start using right away, and which are currently exclusively available to sponsors:

  • Class inheritance diagrams with Mermaid
  • Parameter headings
  • Automatic cross-references to parameters
  • Automatic cross-references for default parameter values in signatures
  • Automatic rendering of function signature overloads
  • Auto-summary of object members
  • griffe-warnings-deprecated \u2014 [Project] Griffe extension for @warnings.deprecated (PEP 702)
  • griffe-pydantic \u2014 [Project] Griffe extension for Pydantic

These are just the features related to this project. See the complete feature list on the author's main Insiders page.

"},{"location":"insiders/#how-to-become-a-sponsor","title":"How to become a sponsor","text":"

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.

"},{"location":"insiders/#funding","title":"Funding","text":""},{"location":"insiders/#goals","title":"Goals","text":"

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.

"},{"location":"insiders/#1000-gravifridge-fluid-renewal","title":"$ 1,000 \u2014 GraviFridge Fluid Renewal","text":"
  • Auto-summary of object members
  • Automatic rendering of function signature overloads
  • Parameter headings
  • Automatic cross-references to parameters
  • Automatic cross-references for default parameter values in signatures
  • griffe-pydantic \u2014 [Project] Griffe extension for Pydantic
  • griffe-warnings-deprecated \u2014 [Project] Griffe extension for @warnings.deprecated (PEP 702)
"},{"location":"insiders/#1500-hyperlamp-navigation-tips","title":"$ 1,500 \u2014 HyperLamp Navigation Tips","text":"
  • Class inheritance diagrams with Mermaid
"},{"location":"insiders/#2000-fusiondrive-ejection-configuration","title":"$ 2,000 \u2014 FusionDrive Ejection Configuration","text":"

There are no features in this goal for this project. See the features in this goal for all Insiders projects.

"},{"location":"insiders/#goals-completed","title":"Goals completed","text":"

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.

"},{"location":"insiders/#500-plasmavac-user-guide","title":"$ 500 \u2014 PlasmaVac User Guide","text":"
  • Cross-references for type annotations in signatures
  • Symbol types in headings and table of contents
  • griffe-inherited-docstrings \u2014 [Project] Griffe extension for inheriting docstrings
"},{"location":"insiders/#frequently-asked-questions","title":"Frequently asked questions","text":""},{"location":"insiders/#compatibility","title":"Compatibility","text":"

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.

"},{"location":"insiders/#payment","title":"Payment","text":"

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.

"},{"location":"insiders/#terms","title":"Terms","text":"

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.

  1. 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

  2. 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

  3. 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

  4. 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

  5. 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

"},{"location":"insiders/changelog/","title":"Changelog","text":""},{"location":"insiders/changelog/#mkdocstrings-python-insiders","title":"mkdocstrings-python Insiders","text":""},{"location":"insiders/changelog/#1.7.0","title":"1.7.0 March 24, 2024","text":"
  • Class inheritance diagrams with Mermaid
"},{"location":"insiders/changelog/#1.6.0","title":"1.6.0 January 30, 2024","text":"
  • Render cross-references to parameters documentation in signatures and attribute values.
  • Add parameter_headings option to render headings for parameters (enabling permalinks and ToC/inventory entries).
  • Render cross-references for default parameter values in signatures.
"},{"location":"insiders/changelog/#1.5.1","title":"1.5.1 September 12, 2023","text":"
  • Prevent empty auto-summarized Methods section.
"},{"location":"insiders/changelog/#1.5.0","title":"1.5.0 September 05, 2023","text":"
  • Render function signature overloads.
"},{"location":"insiders/changelog/#1.4.0","title":"1.4.0 August 27, 2023","text":"
  • Render cross-references in attribute signatures.
"},{"location":"insiders/changelog/#1.3.0","title":"1.3.0 August 24, 2023","text":"
  • Add \"method\" symbol type.
"},{"location":"insiders/changelog/#1.2.0","title":"1.2.0 August 20, 2023","text":"
  • Add member auto-summaries.
"},{"location":"insiders/changelog/#1.1.4","title":"1.1.4 July 17, 2023","text":"
  • Fix heading level increment for class members.
"},{"location":"insiders/changelog/#1.1.3","title":"1.1.3 July 17, 2023","text":"
  • Fix heading level (avoid with clause preventing to decrease it).
"},{"location":"insiders/changelog/#1.1.2","title":"1.1.2 July 15, 2023","text":"
  • Use non-breaking spaces after symbol types.
"},{"location":"insiders/changelog/#1.1.1","title":"1.1.1 June 27, 2023","text":"
  • Correctly escape expressions in signatures and other rendered types.
"},{"location":"insiders/changelog/#1.1.0","title":"1.1.0 June 4, 2023","text":"
  • Add Symbol types in headings and table of contents.
"},{"location":"insiders/changelog/#1.0.0","title":"1.0.0 May 10, 2023","text":"
  • Add cross-references for type annotations in signatures. Make sure to update your local templates as the signature of the format_signature filter has changed. The templates that must be updated: class.html, expression.html, function.html and signature.html.
"},{"location":"insiders/installation/","title":"Getting started with Insiders","text":"

mkdocstrings-python Insiders is a compatible drop-in replacement for mkdocstrings-python, and can be installed similarly using pip or git. Note that in order to access the Insiders repository, you need to become an eligible sponsor of @pawamoy on GitHub.

"},{"location":"insiders/installation/#installation","title":"Installation","text":""},{"location":"insiders/installation/#with-pypi-insiders","title":"with PyPI Insiders","text":"

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.

"},{"location":"insiders/installation/#with-pip-sshhttps","title":"with pip (ssh/https)","text":"

mkdocstrings-python Insiders can be installed with pip using SSH:

pip install git+ssh://git@github.com/pawamoy-insiders/mkdocstrings-python.git\n

Or using HTTPS:

pip install git+https://${GH_TOKEN}@github.com/pawamoy-insiders/mkdocstrings-python.git\n
How to get a GitHub personal access token

The 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:

  1. Go to https://github.com/settings/tokens
  2. Click on Generate a new token
  3. Enter a name and select the repo scope
  4. Generate the token and store it in a safe place

Note that the personal access token must be kept secret at all times, as it allows the owner to access your private repositories.

"},{"location":"insiders/installation/#with-pip-self-hosted","title":"with pip (self-hosted)","text":"

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:

# download distributions in ~/dists, then upload with:\ntwine upload --repository-url https://your-private-index.com ~/dists/*\n

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:

pip config set global.extra-index-url https://your-private-index.com/simple\n

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.

Full example with pypiserver

In this example we use pypiserver to serve a local PyPI index.

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

We can configure the credentials to access the server in ~/.pypirc:

.pypirc
[distutils]\nindex-servers =\n    local\n\n[local]\nrepository: http://localhost:8080\nusername:\npassword:\n

We then clone the Insiders repository, build distributions and upload them to our local server:

# 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

Finally, we configure pip, and for example PDM, to use our local index to find packages:

pip config set global.extra-index-url http://localhost:8080/simple\npdm config pypi.extra.url http://localhost:8080/simple\n

Now when running 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!

"},{"location":"insiders/installation/#with-git","title":"with git","text":"

Of course, you can use mkdocstrings-python Insiders directly from git:

git clone git@github.com:pawamoy-insiders/mkdocstrings-python\n

When cloning from git, the package must be installed:

pip install -e mkdocstrings-python\n
"},{"location":"insiders/installation/#upgrading","title":"Upgrading","text":"

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 8.x.x.4.x.x means that Insiders 4.x.x is currently based on 8.x.x.

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.

"},{"location":"reference/SUMMARY/","title":"SUMMARY","text":"
  • mkdocstrings_handlers
    • python
      • debug
      • handler
      • rendering
"},{"location":"reference/mkdocstrings_handlers/python/","title":"mkdocstrings_handlers.python","text":""},{"location":"reference/mkdocstrings_handlers/python/#mkdocstrings_handlers.python","title":"python","text":"

Python handler for mkdocstrings.

Modules:

  • debug \u2013

    Debugging utilities.

  • handler \u2013

    This module implements a handler for the Python language.

  • rendering \u2013

    This module implements rendering utilities.

Functions:

  • get_handler \u2013

    Simply return an instance of PythonHandler.

"},{"location":"reference/mkdocstrings_handlers/python/#mkdocstrings_handlers.python.get_handler","title":"get_handler","text":"
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

Simply return an instance of PythonHandler.

Parameters:

Returns:

  • PythonHandler \u2013

    An instance of PythonHandler.

"},{"location":"reference/mkdocstrings_handlers/python/#mkdocstrings_handlers.python.get_handler(theme)","title":"theme","text":"(str) \u2013

The theme to use when rendering contents.

"},{"location":"reference/mkdocstrings_handlers/python/#mkdocstrings_handlers.python.get_handler(custom_templates)","title":"custom_templates","text":"(str | None, default: None ) \u2013

Directory containing custom templates.

"},{"location":"reference/mkdocstrings_handlers/python/#mkdocstrings_handlers.python.get_handler(config_file_path)","title":"config_file_path","text":"(str | None, default: None ) \u2013

The MkDocs configuration file path.

"},{"location":"reference/mkdocstrings_handlers/python/#mkdocstrings_handlers.python.get_handler(paths)","title":"paths","text":"(list[str] | None, default: None ) \u2013

A list of paths to use as Griffe search paths.

"},{"location":"reference/mkdocstrings_handlers/python/#mkdocstrings_handlers.python.get_handler(locale)","title":"locale","text":"(str, default: 'en' ) \u2013

The locale to use when rendering content.

"},{"location":"reference/mkdocstrings_handlers/python/#mkdocstrings_handlers.python.get_handler(load_external_modules)","title":"load_external_modules","text":"(bool, default: False ) \u2013

Load external modules when resolving aliases.

"},{"location":"reference/mkdocstrings_handlers/python/#mkdocstrings_handlers.python.get_handler(**config)","title":"**config","text":"(Any, default: {} ) \u2013

Configuration passed to the handler.

"},{"location":"reference/mkdocstrings_handlers/python/debug/","title":"mkdocstrings_handlers.python.debug","text":""},{"location":"reference/mkdocstrings_handlers/python/debug/#mkdocstrings_handlers.python.debug","title":"debug","text":"

Debugging utilities.

Classes:

  • Environment \u2013

    Dataclass to store environment information.

  • Package \u2013

    Dataclass describing a Python package.

  • Variable \u2013

    Dataclass describing an environment variable.

Functions:

  • get_debug_info \u2013

    Get debug/environment information.

  • get_version \u2013

    Get version of the given distribution.

  • print_debug_info \u2013

    Print debug/environment information.

"},{"location":"reference/mkdocstrings_handlers/python/debug/#mkdocstrings_handlers.python.debug.Environment","title":"Environment 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

Dataclass to store environment information.

Attributes:

  • interpreter_name (str) \u2013

    Python interpreter name.

  • interpreter_path (str) \u2013

    Path to Python executable.

  • interpreter_version (str) \u2013

    Python interpreter version.

  • packages (list[Package]) \u2013

    Installed packages.

  • platform (str) \u2013

    Operating System.

  • variables (list[Variable]) \u2013

    Environment variables.

"},{"location":"reference/mkdocstrings_handlers/python/debug/#mkdocstrings_handlers.python.debug.Environment.interpreter_name","title":"interpreter_name instance-attribute","text":"
interpreter_name: str\n

Python interpreter name.

"},{"location":"reference/mkdocstrings_handlers/python/debug/#mkdocstrings_handlers.python.debug.Environment.interpreter_path","title":"interpreter_path instance-attribute","text":"
interpreter_path: str\n

Path to Python executable.

"},{"location":"reference/mkdocstrings_handlers/python/debug/#mkdocstrings_handlers.python.debug.Environment.interpreter_version","title":"interpreter_version instance-attribute","text":"
interpreter_version: str\n

Python interpreter version.

"},{"location":"reference/mkdocstrings_handlers/python/debug/#mkdocstrings_handlers.python.debug.Environment.packages","title":"packages instance-attribute","text":"
packages: list[Package]\n

Installed packages.

"},{"location":"reference/mkdocstrings_handlers/python/debug/#mkdocstrings_handlers.python.debug.Environment.platform","title":"platform instance-attribute","text":"
platform: str\n

Operating System.

"},{"location":"reference/mkdocstrings_handlers/python/debug/#mkdocstrings_handlers.python.debug.Environment.variables","title":"variables instance-attribute","text":"
variables: list[Variable]\n

Environment variables.

"},{"location":"reference/mkdocstrings_handlers/python/debug/#mkdocstrings_handlers.python.debug.Package","title":"Package dataclass","text":"
Package(name: str, version: str)\n

Dataclass describing a Python package.

Attributes:

  • name (str) \u2013

    Package name.

  • version (str) \u2013

    Package version.

"},{"location":"reference/mkdocstrings_handlers/python/debug/#mkdocstrings_handlers.python.debug.Package.name","title":"name instance-attribute","text":"
name: str\n

Package name.

"},{"location":"reference/mkdocstrings_handlers/python/debug/#mkdocstrings_handlers.python.debug.Package.version","title":"version instance-attribute","text":"
version: str\n

Package version.

"},{"location":"reference/mkdocstrings_handlers/python/debug/#mkdocstrings_handlers.python.debug.Variable","title":"Variable dataclass","text":"
Variable(name: str, value: str)\n

Dataclass describing an environment variable.

Attributes:

  • name (str) \u2013

    Variable name.

  • value (str) \u2013

    Variable value.

"},{"location":"reference/mkdocstrings_handlers/python/debug/#mkdocstrings_handlers.python.debug.Variable.name","title":"name instance-attribute","text":"
name: str\n

Variable name.

"},{"location":"reference/mkdocstrings_handlers/python/debug/#mkdocstrings_handlers.python.debug.Variable.value","title":"value instance-attribute","text":"
value: str\n

Variable value.

"},{"location":"reference/mkdocstrings_handlers/python/debug/#mkdocstrings_handlers.python.debug.get_debug_info","title":"get_debug_info","text":"
get_debug_info() -> Environment\n

Get debug/environment information.

Returns:

  • Environment \u2013

    Environment information.

"},{"location":"reference/mkdocstrings_handlers/python/debug/#mkdocstrings_handlers.python.debug.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.

"},{"location":"reference/mkdocstrings_handlers/python/debug/#mkdocstrings_handlers.python.debug.get_version(dist)","title":"dist","text":"(str, default: 'mkdocstrings-python' ) \u2013

A distribution name.

"},{"location":"reference/mkdocstrings_handlers/python/debug/#mkdocstrings_handlers.python.debug.print_debug_info","title":"print_debug_info","text":"
print_debug_info() -> None\n

Print debug/environment information.

"},{"location":"reference/mkdocstrings_handlers/python/handler/","title":"mkdocstrings_handlers.python.handler","text":""},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler","title":"handler","text":"

This module implements a handler for the Python language.

Classes:

  • PythonHandler \u2013

    The Python handler class.

Functions:

  • get_handler \u2013

    Simply return an instance of PythonHandler.

"},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler","title":"PythonHandler","text":"
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          

The Python handler class.

Parameters:

Methods:

  • do_convert_markdown \u2013

    Render Markdown text; for use inside templates.

  • do_heading \u2013

    Render an HTML heading and register it for the table of contents. For use inside templates.

  • get_extended_templates_dirs \u2013

    Load template extensions for the given handler, return their templates directories.

  • get_headings \u2013

    Return and clear the headings gathered so far.

  • get_templates_dir \u2013

    Return the path to the handler's templates directory.

  • load_inventory \u2013

    Yield items and their URLs from an inventory file streamed from in_file.

  • normalize_extension_paths \u2013

    Resolve extension paths relative to config file.

  • teardown \u2013

    Teardown the handler.

Attributes:

  • default_config (dict) \u2013

    Default handler configuration.

  • domain (str) \u2013

    The cross-documentation domain/language for this handler.

  • enable_inventory (bool) \u2013

    Whether this handler is interested in enabling the creation of the objects.inv Sphinx inventory file.

  • extra_css \u2013

    Extra CSS.

  • fallback_config (dict) \u2013

    The configuration used to collect item during autorefs fallback.

  • fallback_theme \u2013

    The fallback theme.

  • name (str) \u2013

    The handler's name, for example \"python\".

"},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler(*args)","title":"*args","text":"(Any, default: () ) \u2013

Handler name, theme and custom templates.

"},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler(config_file_path)","title":"config_file_path","text":"(str | None, default: None ) \u2013

The MkDocs configuration file path.

"},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler(paths)","title":"paths","text":"(list[str] | None, default: None ) \u2013

A list of paths to use as Griffe search paths.

"},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler(locale)","title":"locale","text":"(str, default: 'en' ) \u2013

The locale to use when rendering content.

"},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler(load_external_modules)","title":"load_external_modules","text":"(bool, default: False ) \u2013

Load external modules when resolving aliases.

"},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler(**kwargs)","title":"**kwargs","text":"(Any, default: {} ) \u2013

Same thing, but with keyword arguments.

"},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.default_config","title":"default_config 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_submodules\": False,\n    \"group_by_category\": True,\n    \"heading_level\": 2,\n    \"members_order\": 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}\n

Default handler configuration.

General options:

  • find_stubs_package (bool) \u2013

    Whether to load stubs package (package-stubs) when extracting docstrings. Default False.

  • allow_inspection (bool) \u2013

    Whether to allow inspecting modules when visiting them is not possible. Default: True.

  • show_bases (bool) \u2013

    Show the base classes of a class. Default: True.

  • show_source (bool) \u2013

    Show the source code of this object. Default: True.

  • preload_modules (list[str] | None) \u2013

    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) \u2013

    The initial heading level to use. Default: 2.

  • parameter_headings (bool) \u2013

    Whether to render headings for parameters (therefore showing parameters in the ToC). Default: False.

  • show_root_heading (bool) \u2013

    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) \u2013

    If the root heading is not shown, at least add a ToC entry for it. Default: True.

  • show_root_full_path (bool) \u2013

    Show the full Python path for the root object heading. Default: True.

  • show_root_members_full_path (bool) \u2013

    Show the full Python path of the root members. Default: False.

  • show_object_full_path (bool) \u2013

    Show the full Python path of every object. Default: False.

  • show_category_heading (bool) \u2013

    When grouped by categories, show a heading for each category. Default: False.

  • show_symbol_type_heading (bool) \u2013

    Show the symbol type in headings (e.g. mod, class, meth, func and attr). Default: False.

  • show_symbol_type_toc (bool) \u2013

    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) \u2013

    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) \u2013

    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) \u2013

    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) \u2013

    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) \u2013

    Group the object's children by categories: attributes, classes, functions, and modules. Default: True.

  • show_submodules (bool) \u2013

    When rendering a module, show its submodules recursively. Default: False.

  • summary (bool | dict[str, bool]) \u2013

    Whether to render summaries of modules, classes, functions (methods) and attributes.

  • show_labels (bool) \u2013

    Whether to show labels of the members. Default: True.

Docstrings options:

  • docstring_style (str) \u2013

    The docstring style to use: google, numpy, sphinx, or None. Default: \"google\".

  • docstring_options (dict) \u2013

    The options for the docstring parser. See parsers under griffe.docstrings.

  • docstring_section_style (str) \u2013

    The style used to render docstring sections. Options: table, list, spacy. Default: \"table\".

  • merge_init_into_class (bool) \u2013

    Whether to merge the __init__ method into the class' signature and docstring. Default: False.

  • show_if_no_docstring (bool) \u2013

    Show the object heading even if it has no docstring or children with docstrings. Default: False.

  • show_docstring_attributes (bool) \u2013

    Whether to display the \"Attributes\" section in the object's docstring. Default: True.

  • show_docstring_functions (bool) \u2013

    Whether to display the \"Functions\" or \"Methods\" sections in the object's docstring. Default: True.

  • show_docstring_classes (bool) \u2013

    Whether to display the \"Classes\" section in the object's docstring. Default: True.

  • show_docstring_modules (bool) \u2013

    Whether to display the \"Modules\" section in the object's docstring. Default: True.

  • show_docstring_description (bool) \u2013

    Whether to display the textual block (including admonitions) in the object's docstring. Default: True.

  • show_docstring_examples (bool) \u2013

    Whether to display the \"Examples\" section in the object's docstring. Default: True.

  • show_docstring_other_parameters (bool) \u2013

    Whether to display the \"Other Parameters\" section in the object's docstring. Default: True.

  • show_docstring_parameters (bool) \u2013

    Whether to display the \"Parameters\" section in the object's docstring. Default: True.

  • show_docstring_raises (bool) \u2013

    Whether to display the \"Raises\" section in the object's docstring. Default: True.

  • show_docstring_receives (bool) \u2013

    Whether to display the \"Receives\" section in the object's docstring. Default: True.

  • show_docstring_returns (bool) \u2013

    Whether to display the \"Returns\" section in the object's docstring. Default: True.

  • show_docstring_warns (bool) \u2013

    Whether to display the \"Warns\" section in the object's docstring. Default: True.

  • show_docstring_yields (bool) \u2013

    Whether to display the \"Yields\" section in the object's docstring. Default: True.

Signatures/annotations options:

  • annotations_path (str) \u2013

    The verbosity for annotations path: brief (recommended), or source (as written in the source). Default: \"brief\".

  • line_length (int) \u2013

    Maximum line length when formatting code/signatures. Default: 60.

  • show_signature (bool) \u2013

    Show methods and functions signatures. Default: True.

  • show_signature_annotations (bool) \u2013

    Show the type annotations in methods and functions signatures. Default: False.

  • signature_crossrefs (bool) \u2013

    Whether to render cross-references for type annotations in signatures. Default: False.

  • separate_signature (bool) \u2013

    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) \u2013

    Whether to unwrap Annotated types to show only the type without the annotations. Default: False.

"},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.domain","title":"domain class-attribute instance-attribute","text":"
domain: str = 'py'\n

The cross-documentation domain/language for this handler.

"},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.enable_inventory","title":"enable_inventory class-attribute instance-attribute","text":"
enable_inventory: bool = True\n

Whether this handler is interested in enabling the creation of the objects.inv Sphinx inventory file.

"},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.extra_css","title":"extra_css class-attribute instance-attribute","text":"
extra_css = ''\n

Extra CSS.

"},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.fallback_config","title":"fallback_config class-attribute","text":"
fallback_config: dict = {'fallback': True}\n

The configuration used to collect item during autorefs fallback.

"},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.fallback_theme","title":"fallback_theme class-attribute instance-attribute","text":"
fallback_theme = 'material'\n

The fallback theme.

"},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.name","title":"name class-attribute instance-attribute","text":"
name: str = ''\n

The handler's name, for example \"python\".

"},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.do_convert_markdown","title":"do_convert_markdown","text":"
do_convert_markdown(\n    text: str,\n    heading_level: int,\n    html_id: str = \"\",\n    *,\n    strip_paragraph: bool = False\n) -> Markup\n

Render Markdown text; for use inside templates.

Parameters:

  • "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.do_convert_markdown(text)","title":"text","text":"(str) \u2013

    The text to convert.

    "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.do_convert_markdown(heading_level)","title":"heading_level","text":"(int) \u2013

    The base heading level to start all Markdown headings from.

    "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.do_convert_markdown(html_id)","title":"html_id","text":"(str, default: '' ) \u2013

    The HTML id of the element that's considered the parent of this element.

    "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.do_convert_markdown(strip_paragraph)","title":"strip_paragraph","text":"(bool, default: False ) \u2013

    Whether to exclude the

    tag from around the whole output.

    Returns:

    • Markup \u2013

      An HTML string.

    "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.do_heading","title":"do_heading","text":"
    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

    Render an HTML heading and register it for the table of contents. For use inside templates.

    Parameters:

    Returns:

    • Markup \u2013

      An HTML string.

    "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.do_heading(content)","title":"content","text":"(Markup) \u2013

    The HTML within the heading.

    "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.do_heading(heading_level)","title":"heading_level","text":"(int) \u2013

    The level of heading (e.g. 3 -> h3).

    "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.do_heading(role)","title":"role","text":"(str | None, default: None ) \u2013

    An optional role for the object bound to this heading.

    "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.do_heading(hidden)","title":"hidden","text":"(bool, default: False ) \u2013

    If True, only register it for the table of contents, don't render anything.

    "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.do_heading(toc_label)","title":"toc_label","text":"(str | None, default: None ) \u2013

    The title to use in the table of contents ('data-toc-label' attribute).

    "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.do_heading(**attributes)","title":"**attributes","text":"(str, default: {} ) \u2013

    Any extra HTML attributes of the heading.

    "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.get_extended_templates_dirs","title":"get_extended_templates_dirs","text":"
    get_extended_templates_dirs(handler: str) -> list[Path]\n

    Load template extensions for the given handler, return their templates directories.

    Parameters:

    Returns:

    • list[Path] \u2013

      The extensions templates directories.

    "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.get_extended_templates_dirs(handler)","title":"handler","text":"(str) \u2013

    The name of the handler to get the extended templates directory of.

    "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.get_headings","title":"get_headings","text":"
    get_headings() -> Sequence[Element]\n

    Return and clear the headings gathered so far.

    Returns:

    • Sequence[Element] \u2013

      A list of HTML elements.

    "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.get_templates_dir","title":"get_templates_dir","text":"
    get_templates_dir(handler: str | None = None) -> Path\n

    Return the path to the handler's templates directory.

    Override to customize how the templates directory is found.

    Parameters:

    Raises:

    • ModuleNotFoundError \u2013

      When no such handler is installed.

    • FileNotFoundError \u2013

      When the templates directory cannot be found.

    Returns:

    • Path \u2013

      The templates directory path.

    "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.get_templates_dir(handler)","title":"handler","text":"(str | None, default: None ) \u2013

    The name of the handler to get the templates directory of.

    "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.load_inventory","title":"load_inventory 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

    Yield items and their URLs from an inventory file streamed from in_file.

    This implements mkdocstrings' load_inventory \"protocol\" (see mkdocstrings.plugin).

    Parameters:

    Yields:

    • str \u2013

      Tuples of (item identifier, item URL).

    "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.load_inventory(in_file)","title":"in_file","text":"(BinaryIO) \u2013

    The binary file-like object to read the inventory from.

    "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.load_inventory(url)","title":"url","text":"(str) \u2013

    The URL that this file is being streamed from (used to guess base_url).

    "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.load_inventory(base_url)","title":"base_url","text":"(str | None, default: None ) \u2013

    The URL that this inventory's sub-paths are relative to.

    "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.load_inventory(domains)","title":"domains","text":"(list[str] | None, default: None ) \u2013

    A list of domain strings to filter the inventory by, when not passed, \"py\" will be used.

    "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.load_inventory(**kwargs)","title":"**kwargs","text":"(Any, default: {} ) \u2013

    Ignore additional arguments passed from the config.

    "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.normalize_extension_paths","title":"normalize_extension_paths","text":"
    normalize_extension_paths(extensions: Sequence) -> Sequence\n

    Resolve extension paths relative to config file.

    "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.teardown","title":"teardown","text":"
    teardown() -> None\n

    Teardown the handler.

    This method should be implemented to, for example, terminate a subprocess that was started when creating the handler instance.

    "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.get_handler","title":"get_handler","text":"
    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

    Simply return an instance of PythonHandler.

    Parameters:

    Returns:

    • PythonHandler \u2013

      An instance of PythonHandler.

    "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.get_handler(theme)","title":"theme","text":"(str) \u2013

    The theme to use when rendering contents.

    "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.get_handler(custom_templates)","title":"custom_templates","text":"(str | None, default: None ) \u2013

    Directory containing custom templates.

    "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.get_handler(config_file_path)","title":"config_file_path","text":"(str | None, default: None ) \u2013

    The MkDocs configuration file path.

    "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.get_handler(paths)","title":"paths","text":"(list[str] | None, default: None ) \u2013

    A list of paths to use as Griffe search paths.

    "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.get_handler(locale)","title":"locale","text":"(str, default: 'en' ) \u2013

    The locale to use when rendering content.

    "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.get_handler(load_external_modules)","title":"load_external_modules","text":"(bool, default: False ) \u2013

    Load external modules when resolving aliases.

    "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.get_handler(**config)","title":"**config","text":"(Any, default: {} ) \u2013

    Configuration passed to the handler.

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/","title":"mkdocstrings_handlers.python.rendering","text":""},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering","title":"rendering","text":"

    This module implements rendering utilities.

    Classes:

    • Order \u2013

      Enumeration for the possible members ordering.

    Functions:

    • do_as_attributes_section \u2013

      Build an attributes section from a list of attributes.

    • do_as_classes_section \u2013

      Build a classes section from a list of classes.

    • do_as_functions_section \u2013

      Build a functions section from a list of functions.

    • do_as_modules_section \u2013

      Build a modules section from a list of modules.

    • do_crossref \u2013

      Deprecated. Filter to create cross-references.

    • do_filter_objects \u2013

      Filter a dictionary of objects based on their docstrings.

    • do_format_attribute \u2013

      Format an attribute using Black.

    • do_format_code \u2013

      Format code using Black.

    • do_format_signature \u2013

      Format a signature using Black.

    • do_get_template \u2013

      Get the template name used to render an object.

    • do_multi_crossref \u2013

      Deprecated. Filter to create cross-references.

    • do_order_members \u2013

      Order members given an ordering method.

    • do_split_path \u2013

      Split object paths for building cross-references.

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.Order","title":"Order","text":"
    \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          

    Enumeration for the possible members ordering.

    Attributes:

    • alphabetical \u2013

      Alphabetical order.

    • source \u2013

      Source code order.

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.Order.alphabetical","title":"alphabetical class-attribute instance-attribute","text":"
    alphabetical = 'alphabetical'\n

    Alphabetical order.

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.Order.source","title":"source class-attribute instance-attribute","text":"
    source = 'source'\n

    Source code order.

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_as_attributes_section","title":"do_as_attributes_section","text":"
    do_as_attributes_section(\n    context: Context,\n    attributes: Sequence[Attribute],\n    *,\n    check_public: bool = True\n) -> DocstringSectionAttributes\n

    Build an attributes section from a list of attributes.

    Parameters:

    Returns:

    • DocstringSectionAttributes \u2013

      An attributes docstring section.

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_as_attributes_section(attributes)","title":"attributes","text":"(Sequence[Attribute]) \u2013

    The attributes to build the section from.

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_as_attributes_section(check_public)","title":"check_public","text":"(bool, default: True ) \u2013

    Whether to check if the attribute is public.

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_as_classes_section","title":"do_as_classes_section","text":"
    do_as_classes_section(\n    context: Context,\n    classes: Sequence[Class],\n    *,\n    check_public: bool = True\n) -> DocstringSectionClasses\n

    Build a classes section from a list of classes.

    Parameters:

    Returns:

    • DocstringSectionClasses \u2013

      A classes docstring section.

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_as_classes_section(classes)","title":"classes","text":"(Sequence[Class]) \u2013

    The classes to build the section from.

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_as_classes_section(check_public)","title":"check_public","text":"(bool, default: True ) \u2013

    Whether to check if the class is public.

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_as_functions_section","title":"do_as_functions_section","text":"
    do_as_functions_section(\n    context: Context,\n    functions: Sequence[Function],\n    *,\n    check_public: bool = True\n) -> DocstringSectionFunctions\n

    Build a functions section from a list of functions.

    Parameters:

    Returns:

    • DocstringSectionFunctions \u2013

      A functions docstring section.

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_as_functions_section(functions)","title":"functions","text":"(Sequence[Function]) \u2013

    The functions to build the section from.

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_as_functions_section(check_public)","title":"check_public","text":"(bool, default: True ) \u2013

    Whether to check if the function is public.

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_as_modules_section","title":"do_as_modules_section","text":"
    do_as_modules_section(\n    context: Context,\n    modules: Sequence[Module],\n    *,\n    check_public: bool = True\n) -> DocstringSectionModules\n

    Build a modules section from a list of modules.

    Parameters:

    Returns:

    • DocstringSectionModules \u2013

      A modules docstring section.

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_as_modules_section(modules)","title":"modules","text":"(Sequence[Module]) \u2013

    The modules to build the section from.

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_as_modules_section(check_public)","title":"check_public","text":"(bool, default: True ) \u2013

    Whether to check if the module is public.

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_crossref","title":"do_crossref","text":"
    do_crossref(path: str, *, brief: bool = True) -> Markup\n

    Deprecated. Filter to create cross-references.

    Parameters:

    Returns:

    • Markup \u2013

      Markup text.

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_crossref(path)","title":"path","text":"(str) \u2013

    The path to link to.

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_crossref(brief)","title":"brief","text":"(bool, default: True ) \u2013

    Show only the last part of the path, add full path as hover.

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_filter_objects","title":"do_filter_objects","text":"
    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

    Filter a dictionary of objects based on their docstrings.

    Parameters:

    Returns:

    • list[Object | Alias] \u2013

      A list of objects.

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_filter_objects(objects_dictionary)","title":"objects_dictionary","text":"(dict[str, Object | Alias]) \u2013

    The dictionary of objects.

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_filter_objects(filters)","title":"filters","text":"(Sequence[tuple[Pattern, bool]] | None, default: None ) \u2013

    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.

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_filter_objects(members_list)","title":"members_list","text":"(bool | list[str] | None, default: None ) \u2013

    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.

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_filter_objects(inherited_members)","title":"inherited_members","text":"(bool | list[str], default: False ) \u2013

    Whether to keep inherited members or exclude them.

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_filter_objects(keep_no_docstrings)","title":"keep_no_docstrings","text":"(bool, default: True ) \u2013

    Whether to keep objects with no/empty docstrings (recursive check).

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_format_attribute","title":"do_format_attribute","text":"
    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

    Format an attribute using Black.

    Parameters:

    Returns:

    • str \u2013

      The same code, formatted.

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_format_attribute(context)","title":"context","text":"(Context) \u2013

    Jinja context, passed automatically.

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_format_attribute(attribute_path)","title":"attribute_path","text":"(Markup) \u2013

    The path of the callable we render the signature of.

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_format_attribute(attribute)","title":"attribute","text":"(Attribute) \u2013

    The attribute we render the signature of.

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_format_attribute(line_length)","title":"line_length","text":"(int) \u2013

    The line length to give to Black.

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_format_attribute(crossrefs)","title":"crossrefs","text":"(bool, default: False ) \u2013

    Whether to cross-reference types in the signature.

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_format_code","title":"do_format_code","text":"
    do_format_code(code: str, line_length: int) -> str\n

    Format code using Black.

    Parameters:

    Returns:

    • str \u2013

      The same code, formatted.

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_format_code(code)","title":"code","text":"(str) \u2013

    The code to format.

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_format_code(line_length)","title":"line_length","text":"(int) \u2013

    The line length to give to Black.

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_format_signature","title":"do_format_signature","text":"
    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

    Format a signature using Black.

    Parameters:

    Returns:

    • str \u2013

      The same code, formatted.

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_format_signature(context)","title":"context","text":"(Context) \u2013

    Jinja context, passed automatically.

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_format_signature(callable_path)","title":"callable_path","text":"(Markup) \u2013

    The path of the callable we render the signature of.

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_format_signature(function)","title":"function","text":"(Function) \u2013

    The function we render the signature of.

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_format_signature(line_length)","title":"line_length","text":"(int) \u2013

    The line length to give to Black.

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_format_signature(annotations)","title":"annotations","text":"(bool | None, default: None ) \u2013

    Whether to show type annotations.

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_format_signature(crossrefs)","title":"crossrefs","text":"(bool, default: False ) \u2013

    Whether to cross-reference types in the signature.

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_get_template","title":"do_get_template","text":"
    do_get_template(obj: Object) -> str\n

    Get the template name used to render an object.

    Parameters:

    Returns:

    • str \u2013

      A template name.

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_get_template(obj)","title":"obj","text":"(Object) \u2013

    A Griffe object.

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_multi_crossref","title":"do_multi_crossref","text":"
    do_multi_crossref(\n    text: str, *, code: bool = True\n) -> Markup\n

    Deprecated. Filter to create cross-references.

    Parameters:

    Returns:

    • Markup \u2013

      Markup text.

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_multi_crossref(text)","title":"text","text":"(str) \u2013

    The text to scan.

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_multi_crossref(code)","title":"code","text":"(bool, default: True ) \u2013

    Whether to wrap the result in a code tag.

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_order_members","title":"do_order_members","text":"
    do_order_members(\n    members: Sequence[Object | Alias],\n    order: Order,\n    members_list: bool | list[str] | None,\n) -> Sequence[Object | Alias]\n

    Order members given an ordering method.

    Parameters:

    Returns:

    • Sequence[Object | Alias] \u2013

      The same members, ordered.

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_order_members(members)","title":"members","text":"(Sequence[Object | Alias]) \u2013

    The members to order.

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_order_members(order)","title":"order","text":"(Order) \u2013

    The ordering method.

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_order_members(members_list)","title":"members_list","text":"(bool | list[str] | None) \u2013

    An optional member list (manual ordering).

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_split_path","title":"do_split_path","text":"
    do_split_path(\n    path: str, full_path: str\n) -> list[tuple[str, str]]\n

    Split object paths for building cross-references.

    Parameters:

    Returns:

    • list[tuple[str, str]] \u2013

      A list of pairs (title, full path).

    "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_split_path(path)","title":"path","text":"(str) \u2013

    The path to split.

    "},{"location":"usage/","title":"Usage","text":"

    This is the documentation for the NEW Python handler.

    To read the documentation for the LEGACY handler, go to the legacy handler documentation.

    "},{"location":"usage/#installation","title":"Installation","text":"

    You can install this handler as a mkdocstrings extra:

    pyproject.toml
    # PEP 621 dependencies declaration\n# adapt to your dependencies manager\n[project]\ndependencies = [\n    \"mkdocstrings[python]>=0.18\",\n]\n

    You can also explicitly depend on the handler:

    pyproject.toml
    # PEP 621 dependencies declaration\n# adapt to your dependencies manager\n[project]\ndependencies = [\n    \"mkdocstrings-python\",\n]\n

    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:

    mkdocs.yml
    plugins:\n- mkdocstrings:\n    default_handler: python\n
    "},{"location":"usage/#injecting-documentation","title":"Injecting documentation","text":"

    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\n

    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\n    handler: python\n
    "},{"location":"usage/#configuration","title":"Configuration","text":"

    When installed, the Python handler becomes the default mkdocstrings handler. You can configure it in mkdocs.yml:

    mkdocs.yml
    plugins:\n- mkdocstrings:\n    handlers:\n      python:\n        ...  # the Python handler configuration\n
    "},{"location":"usage/#global-only-options","title":"Global-only options","text":"

    Some options are global only, and go directly under the handler's name.

    "},{"location":"usage/#import","title":"import","text":"

    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:

    mkdocs.yml
    plugins:\n- mkdocstrings:\n    handlers:\n      python:\n        import:\n        - https://docs.python-requests.org/en/master/objects.inv\n

    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:

    mkdocs.yml
    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

    Note

    The import option is common to all handlers, however they might implement it differently, or not even implement it.

    "},{"location":"usage/#paths","title":"paths","text":"

    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:

    mkdocs.yml
    plugins:\n- mkdocstrings:\n    handlers:\n      python:\n        paths: [src]  # search packages in the src folder\n

    More details at Finding modules.

    "},{"location":"usage/#load_external_modules","title":"load_external_modules","text":"

    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:

    mkdocs.yml
    plugins:\n- mkdocstrings:\n    handlers:\n      python:\n        load_external_modules: true\n
    "},{"location":"usage/#globallocal-options","title":"Global/local options","text":"

    The other options can be used both globally and locally, under the options key. For example, globally:

    mkdocs.yml
    plugins:\n- mkdocstrings:\n    handlers:\n      python:\n        options:\n          do_something: true\n

    ...and locally, overriding the global configuration:

    docs/some_page.md
    ::: package.module.class\n    options:\n      do_something: false\n

    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:

    • General options: various options that do not fit in the other categories
    • Headings options: options related to headings and the table of contents (or sidebar, depending on the theme used)
    • Members options: options related to filtering or ordering members in the generated documentation
    • Docstrings options: options related to docstrings (parsing and rendering)
    • Signature options: options related to signatures and type annotations
    "},{"location":"usage/#options-summary","title":"Options summary","text":"

    Default handler configuration.

    General options:

    • find_stubs_package (bool) \u2013

      Whether to load stubs package (package-stubs) when extracting docstrings. Default False.

    • allow_inspection (bool) \u2013

      Whether to allow inspecting modules when visiting them is not possible. Default: True.

    • show_bases (bool) \u2013

      Show the base classes of a class. Default: True.

    • show_source (bool) \u2013

      Show the source code of this object. Default: True.

    • preload_modules (list[str] | None) \u2013

      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) \u2013

      The initial heading level to use. Default: 2.

    • parameter_headings (bool) \u2013

      Whether to render headings for parameters (therefore showing parameters in the ToC). Default: False.

    • show_root_heading (bool) \u2013

      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) \u2013

      If the root heading is not shown, at least add a ToC entry for it. Default: True.

    • show_root_full_path (bool) \u2013

      Show the full Python path for the root object heading. Default: True.

    • show_root_members_full_path (bool) \u2013

      Show the full Python path of the root members. Default: False.

    • show_object_full_path (bool) \u2013

      Show the full Python path of every object. Default: False.

    • show_category_heading (bool) \u2013

      When grouped by categories, show a heading for each category. Default: False.

    • show_symbol_type_heading (bool) \u2013

      Show the symbol type in headings (e.g. mod, class, meth, func and attr). Default: False.

    • show_symbol_type_toc (bool) \u2013

      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) \u2013

      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) \u2013

      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) \u2013

      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) \u2013

      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) \u2013

      Group the object's children by categories: attributes, classes, functions, and modules. Default: True.

    • show_submodules (bool) \u2013

      When rendering a module, show its submodules recursively. Default: False.

    • summary (bool | dict[str, bool]) \u2013

      Whether to render summaries of modules, classes, functions (methods) and attributes.

    • show_labels (bool) \u2013

      Whether to show labels of the members. Default: True.

    Docstrings options:

    • docstring_style (str) \u2013

      The docstring style to use: google, numpy, sphinx, or None. Default: \"google\".

    • docstring_options (dict) \u2013

      The options for the docstring parser. See parsers under griffe.docstrings.

    • docstring_section_style (str) \u2013

      The style used to render docstring sections. Options: table, list, spacy. Default: \"table\".

    • merge_init_into_class (bool) \u2013

      Whether to merge the __init__ method into the class' signature and docstring. Default: False.

    • show_if_no_docstring (bool) \u2013

      Show the object heading even if it has no docstring or children with docstrings. Default: False.

    • show_docstring_attributes (bool) \u2013

      Whether to display the \"Attributes\" section in the object's docstring. Default: True.

    • show_docstring_functions (bool) \u2013

      Whether to display the \"Functions\" or \"Methods\" sections in the object's docstring. Default: True.

    • show_docstring_classes (bool) \u2013

      Whether to display the \"Classes\" section in the object's docstring. Default: True.

    • show_docstring_modules (bool) \u2013

      Whether to display the \"Modules\" section in the object's docstring. Default: True.

    • show_docstring_description (bool) \u2013

      Whether to display the textual block (including admonitions) in the object's docstring. Default: True.

    • show_docstring_examples (bool) \u2013

      Whether to display the \"Examples\" section in the object's docstring. Default: True.

    • show_docstring_other_parameters (bool) \u2013

      Whether to display the \"Other Parameters\" section in the object's docstring. Default: True.

    • show_docstring_parameters (bool) \u2013

      Whether to display the \"Parameters\" section in the object's docstring. Default: True.

    • show_docstring_raises (bool) \u2013

      Whether to display the \"Raises\" section in the object's docstring. Default: True.

    • show_docstring_receives (bool) \u2013

      Whether to display the \"Receives\" section in the object's docstring. Default: True.

    • show_docstring_returns (bool) \u2013

      Whether to display the \"Returns\" section in the object's docstring. Default: True.

    • show_docstring_warns (bool) \u2013

      Whether to display the \"Warns\" section in the object's docstring. Default: True.

    • show_docstring_yields (bool) \u2013

      Whether to display the \"Yields\" section in the object's docstring. Default: True.

    Signatures/annotations options:

    • annotations_path (str) \u2013

      The verbosity for annotations path: brief (recommended), or source (as written in the source). Default: \"brief\".

    • line_length (int) \u2013

      Maximum line length when formatting code/signatures. Default: 60.

    • show_signature (bool) \u2013

      Show methods and functions signatures. Default: True.

    • show_signature_annotations (bool) \u2013

      Show the type annotations in methods and functions signatures. Default: False.

    • signature_crossrefs (bool) \u2013

      Whether to render cross-references for type annotations in signatures. Default: False.

    • separate_signature (bool) \u2013

      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) \u2013

      Whether to unwrap Annotated types to show only the type without the annotations. Default: False.

    "},{"location":"usage/#finding-modules","title":"Finding modules","text":"

    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.

    "},{"location":"usage/#using-the-paths-option","title":"Using the paths option","text":"

    This is the recommended method.

    1. 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

      mkdocs.yml
      plugins:\n- mkdocstrings:\n    handlers:\n      python:\n        paths: [.]  # actually not needed, default\n
    2. 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.yml
      plugins:\n- mkdocstrings:\n    handlers:\n      python:\n        paths: [src]\n
    3. 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.yml
      plugins:\n- mkdocstrings:\n    handlers:\n      python:\n        paths: [..]\n
    4. 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.yml
      plugins:\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.

    "},{"location":"usage/#using-the-pythonpath-environment-variable","title":"Using the PYTHONPATH environment variable","text":"

    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=...):

    1. 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
    2. 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
    3. 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
    4. 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
    "},{"location":"usage/#installing-your-package-in-the-current-python-environment","title":"Installing your package in the current Python environment","text":"

    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":"

    The following CSS classes are used in the generated HTML:

    • doc: on all the following elements
    • doc-children: on divs containing the children of an object
    • doc-object: on divs containing an object
      • doc-attribute: on divs containing an attribute
      • doc-class: on divs containing a class
      • doc-function: on divs containing a function
      • doc-module: on divs containing a module
    • doc-heading: on objects headings
      • doc-object-name: on spans wrapping objects names/paths in the heading
        • doc-KIND-name: as above, specific to the kind of object (module, class, function, attribute)
    • doc-contents: on divs wrapping the docstring then the children (if any)
      • first: same, but only on the root object's contents div
    • doc-labels: on spans wrapping the object's labels
      • doc-label: on small elements containing a label
        • doc-label-LABEL: same, where LABEL is replaced by the actual label
    • doc-md-description: on divs containing HTML descriptions converted from Markdown docstrings
    • doc-symbol: on code tags of symbol types
      • doc-symbol-heading: on symbol types in headings
      • doc-symbol-toc: on symbol types in the ToC
      • doc-symbol-KIND: specific to the kind of object (module, class, function, method, attribute)

    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:

    docs/css/mkdocstrings.css
    [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:

    docs/css/mkdocstrings.css
    :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:

    "},{"location":"usage/customization/#names","title":"Names","text":"

    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

    • Parameter:
    • Attribute:
    • Function:
    • Method:
    • Class:
    • Module:
    "},{"location":"usage/customization/#templates","title":"Templates","text":"

    Templates are organized into the following tree:

    \ud83d\udcc1 theme/\n\u251c\u2500\u2500 \ud83d\udcc4 attribute.html\n\u251c\u2500\u2500 \ud83d\udcc4 children.html\n\u251c\u2500\u2500 \ud83d\udcc4 class.html\n\u251c\u2500\u2500 \ud83d\udcc1 docstring/\n\u2502   \u251c\u2500\u2500 \ud83d\udcc4 admonition.html\n\u2502   \u251c\u2500\u2500 \ud83d\udcc4 attributes.html\n\u2502   \u251c\u2500\u2500 \ud83d\udcc4 classes.html\n\u2502   \u251c\u2500\u2500 \ud83d\udcc4 examples.html\n\u2502   \u251c\u2500\u2500 \ud83d\udcc4 functions.html\n\u2502   \u251c\u2500\u2500 \ud83d\udcc4 modules.html\n\u2502   \u251c\u2500\u2500 \ud83d\udcc4 other_parameters.html\n\u2502   \u251c\u2500\u2500 \ud83d\udcc4 parameters.html\n\u2502   \u251c\u2500\u2500 \ud83d\udcc4 raises.html\n\u2502   \u251c\u2500\u2500 \ud83d\udcc4 receives.html\n\u2502   \u251c\u2500\u2500 \ud83d\udcc4 returns.html\n\u2502   \u251c\u2500\u2500 \ud83d\udcc4 warns.html\n\u2502   \u2514\u2500\u2500 \ud83d\udcc4 yields.html\n\u251c\u2500\u2500 \ud83d\udcc4 docstring.html\n\u251c\u2500\u2500 \ud83d\udcc4 expression.html\n\u251c\u2500\u2500 \ud83d\udcc4 function.html\n\u251c\u2500\u2500 \ud83d\udcc4 labels.html\n\u251c\u2500\u2500 \ud83d\udcc4 language.html\n\u251c\u2500\u2500 \ud83d\udcc1 languages/\n\u2502   \u251c\u2500\u2500 \ud83d\udcc4 en.html\n\u2502   \u251c\u2500\u2500 \ud83d\udcc4 ja.html\n\u2502   \u2514\u2500\u2500 \ud83d\udcc4 zh.html\n\u251c\u2500\u2500 \ud83d\udcc4 module.html\n\u251c\u2500\u2500 \ud83d\udcc4 signature.html\n\u251c\u2500\u2500 \ud83d\udcc1 summary/\n\u2502   \u251c\u2500\u2500 \ud83d\udcc4 attributes.html\n\u2502   \u251c\u2500\u2500 \ud83d\udcc4 classes.html\n\u2502   \u251c\u2500\u2500 \ud83d\udcc4 functions.html\n\u2502   \u2514\u2500\u2500 \ud83d\udcc4 modules.html\n\u2514\u2500\u2500 \ud83d\udcc4 summary.html\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:

    theme/class.html
    {% 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.
    "},{"location":"usage/customization/#classhtml","title":"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.
    "},{"location":"usage/customization/#functionhtml","title":"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.
    "},{"location":"usage/customization/#attributehtml","title":"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.
    "},{"location":"usage/customization/#docstring-sections","title":"Docstring sections","text":"

    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).
    "},{"location":"usage/customization/#syntax-highlight-in-signatures","title":"Syntax highlight in signatures","text":"

    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.

    "},{"location":"usage/customization/#style-recommendations","title":"Style recommendations","text":""},{"location":"usage/customization/#material","title":"Material","text":"

    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:

    griffe_extension.py
    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":"
    • Type 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.
    in mkdocs.yml (global configuration)
    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.

    GoogleNumpySphinx
    def 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_optionsPrintOKPrintOK","text":"
    • Type dict {}

    The options for the docstring parser.

    • Google-style options
    • Numpydoc-style options

    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            >>> Class()  # doctest: +NORMALIZE_WHITESPACE\n            ok\n        \"\"\"\n        print(\"ok\")\n

    Preview

    Ignore init summary, trim doctest flagsKeep init summary and doctest flags

    Class docstring.

    __init__

    Examples:

    >>> Class()\nok\n

    Class docstring.

    __init__

    Initialize the instance.

    Examples:

    >>> Class()  # doctest: +NORMALIZE_WHITESPACE\nok\n
    "},{"location":"usage/configuration/docstrings/#docstring_section_style","title":"docstring_section_style","text":"
    • Type 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 documentation
    in mkdocs.yml (global configuration)
    plugins:\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

    TableListSpacy

    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:

    • 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 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"},{"location":"usage/configuration/docstrings/#merge_init_into_class","title":"merge_init_into_classThing(value=0)Thing","text":"
    • Type 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.

    in mkdocs.yml (global configuration)
    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 kept

    Class docstring.

    Parameters:

    Type Name Description Default int value The thing's value. 0

    Class docstring.

    __init__(value=0)

    Initialize a thing.

    Parameters:

    Type Name Description Default int value The thing's value. 0"},{"location":"usage/configuration/docstrings/#show_if_no_docstring","title":"show_if_no_docstringfunction_without_docstringfunction_with_docstringClassWithoutDocstringfunction_with_docstringClassWithoutDocstring","text":"
    • Type 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 show

    Hello.

    method_without_docstring method_with_docstring

    Hello.

    Hello.

    method_with_docstring

    Hello.

    "},{"location":"usage/configuration/docstrings/#show_docstring_attributes","title":"show_docstring_attributesClassClass","text":"
    • Type 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 attributes

    Summary.

    Attributes:

    Type Name Description int attr Some attribute.

    Summary.

    "},{"location":"usage/configuration/docstrings/#show_docstring_functions","title":"show_docstring_functionsmodulemodule","text":"
    • Type 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 functions

    Summary.

    Functions:

    Name Description foo Some function. Class

    Summary.

    Methods:

    Name Description bar Some method.

    Summary.

    Class

    Summary.

    "},{"location":"usage/configuration/docstrings/#show_docstring_classes","title":"show_docstring_classesmodulemodule","text":"
    • Type 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 classes

    Summary.

    Classes:

    Name Description Class Some class. Class

    Summary.

    Summary.

    Class

    Summary.

    "},{"location":"usage/configuration/docstrings/#show_docstring_modules","title":"show_docstring_modulesmodulemodule","text":"
    • Type 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 modules

    Summary.

    Modules:

    Name Description submodule Some module.

    Summary.

    "},{"location":"usage/configuration/docstrings/#show_docstring_description","title":"show_docstring_descriptionClassClass","text":"
    • Type 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 blocks

    Summary.

    Long description.

    Deprecated

    Stop using this class.

    Attributes:

    Type Name Description int attr Some attribute.

    Attributes:

    Type Name Description int attr Some attribute."},{"location":"usage/configuration/docstrings/#show_docstring_examples","title":"show_docstring_examplesprint_helloprint_hello","text":"
    • Type 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 examples

    Print hello.

    Examples:

    >>> print(\"hello\")\nhello\n

    Print hello.

    "},{"location":"usage/configuration/docstrings/#show_docstring_other_parameters","title":"show_docstring_other_parametersdo_somethingdo_something","text":"
    • Type 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 parameters

    Do something.

    Other parameters:

    Type Name Description int whatever Some integer.

    Do something.

    "},{"location":"usage/configuration/docstrings/#show_docstring_parameters","title":"show_docstring_parametersdo_somethingdo_something","text":"
    • Type 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 parameters

    Do something.

    Parameters:

    Type Name Description Default int whatever Some integer. 0

    Do something.

    "},{"location":"usage/configuration/docstrings/#show_docstring_raises","title":"show_docstring_raisesraise_runtime_errorraise_runtime_error","text":"
    • Type 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 exceptions

    Raise a runtime error.

    Raises:

    Type Description RuntimeError Not good.

    Raise a runtime error.

    "},{"location":"usage/configuration/docstrings/#show_docstring_receives","title":"show_docstring_receivesiter_skipiter_skip","text":"
    • Type 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 values

    Iterate and skip elements.

    Receives:

    Type Description int Number of elements to skip.

    Iterate and skip elements.

    "},{"location":"usage/configuration/docstrings/#show_docstring_returns","title":"show_docstring_returnsrandrand","text":"
    • Type 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 value

    Return a random number.

    Returns:

    Type Description int A random number.

    Return a random number.

    "},{"location":"usage/configuration/docstrings/#show_docstring_warns","title":"show_docstring_warnswarnwarn","text":"
    • Type 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 warnings

    Warn user.

    Warns:

    Type Description UserWarning When this is inappropriate.

    Warn user.

    "},{"location":"usage/configuration/docstrings/#show_docstring_yields","title":"show_docstring_yieldsiter_skipiter_skip","text":"
    • Type 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 values

    Iterate and skip elements.

    Yields:

    Type Description T Elements of the iterable.

    Iterate and skip elements.

    "},{"location":"usage/configuration/general/","title":"General options","text":""},{"location":"usage/configuration/general/#allow_inspection","title":"allow_inspectionSomeClassSomeClass","text":"
    • Type 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 inspection

    Docstring 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_basesSomeClass()SomeClass()","text":"
    • Type 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 bases

    Bases: 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

    • Type 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.yml
    extra_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_sourcesome_function()some_function()","text":"
    • Type 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 source

    Docstring of the function.

    Source code in package/module.py
    def some_function():\n    ...\n

    Docstring of the function.

    "},{"location":"usage/configuration/general/#preload_modules","title":"preload_modulesyour_moduleyour_module","text":"
    • Type 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).

    in mkdocs.yml (global configuration)
    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.py
    from their_package.their_module import their_object\n\n__all__ = [\"their_object\"]\n\n# rest of your code\n

    Preview

    With preloaded modulesWithout preloaded modules

    Docstring of your module.

    their_object

    Docstring of their object.

    Docstring of your module.

    "},{"location":"usage/configuration/general/#find_stubs_package","title":"find_stubs_packageyour_funcyour_func","text":"
    • Type 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.

    in mkdocs.yml (global configuration)
    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.py
    def your_func(a, b):\n    # Function code\n    ...\n\n# rest of your code\n
    your_package-stubs/your_module.pyi
    def 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_package

    Function docstring

    "},{"location":"usage/configuration/headings/","title":"Headings options","text":""},{"location":"usage/configuration/headings/#heading_level","title":"heading_level","text":"
    • Type 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 heading 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.

    "},{"location":"usage/configuration/headings/#parameter_headings","title":"parameter_headings","text":"

    Sponsors only \u2014 Insiders 1.6.0

    • Type 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.

    in mkdocs.yml (global configuration)
    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 Default str

    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.

    "},{"location":"usage/configuration/headings/#package.get_version(dist)","title":"dist","text":"(str, default: 'mkdocstrings-python' ) \u2013

    A distribution name.

    "},{"location":"usage/configuration/headings/#package.current_version","title":"current_version module-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_headingClassA (2)ClassB (2)method_a1 (2)method_b1 (2)","text":"
    • Type 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 heading

    Docstring 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":"
    • Type 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 entry

    Table 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_pathpackage.module.Class.methodmethod","text":"
    • Type 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.

    in mkdocs.yml (global configuration)
    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 path

    Docstring of the method.

    Docstring of the method.

    "},{"location":"usage/configuration/headings/#show_root_members_full_path","title":"show_root_members_full_pathpackage.module.ClassClass","text":"
    • Type 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.

    in mkdocs.yml (global configuration)
    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 path

    Docstring 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_pathpackage.module.ClassClass","text":"
    • Type 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 path

    Docstring 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_headingAttributes (2)Classes (2)module_attribute (2)Class (2)","text":"
    • Type 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 headings

    Docstring 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 ClassattributefunctionClass","text":"

    Insiders 1.1.0

    • Type 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

    • Type 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
      • method
    • module
    • attribute
    • function
    • Class
      • method
    "},{"location":"usage/configuration/members/","title":"Members options","text":""},{"location":"usage/configuration/members/#members","title":"membersthis_functionThisClassthis_attributeThisClass","text":"
    • Type 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).

    in mkdocs.yml (global configuration)
    plugins:\n- mkdocstrings:\n    handlers:\n      python:\n        options:\n          members:\n          - hello  # (1)\n
    1. Most of the time it won't make sense to use this option at the global level.
    or in docs/some_page.md (local configuration)
    ::: 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

    With members: trueWith 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.

    "},{"location":"usage/configuration/members/#inherited_members","title":"inherited_membersBaseMainBaseMain","text":"
    • Type 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
    1. In this case, only declared members will be subject to further filtering with filters and docstrings.
    inherited_members: true  # (1)\n# members: null\n
    1. In this case, both declared and inherited members will be subject to further filtering with 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 members

    Module 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_orderfunction_afunction_bfunction_cfunction_bfunction_afunction_c","text":"
    • Type 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.

    in mkdocs.yml (global configuration)
    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 order

    Module docstring.

    Function a.

    Function b.

    Function c.

    Module docstring.

    Function b.

    Function a.

    Function c.

    "},{"location":"usage/configuration/members/#filters","title":"filtershello_worldhello_world","text":"
    • Type 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).

    in mkdocs.yml (global configuration)
    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.py
    def hello():\n    ...\n\n\ndef _world():\n    ...\n

    Preview

    With filters: []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)
    "},{"location":"usage/configuration/members/#group_by_category","title":"group_by_categoryattribute_cClassBfunction_afunction_dfunction_aClassBattribute_cfunction_d","text":"
    • Type 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.

    in mkdocs.yml (global configuration)
    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.py
    def 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 grouping

    Module 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_submodulessubpackage_membersubmodulesubpackage_member","text":"
    • Type 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 submodules

    Subpackage docstring.

    Member docstring.

    Submodule docstring.

    submodule_member

    Member docstring.

    Subpackage docstring.

    Member docstring.

    "},{"location":"usage/configuration/members/#summary","title":"summaryMyClassMyClass","text":"

    Sponsors only \u2014 Insiders 1.2.0

    • Type 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.

    in mkdocs.yml (global configuration)
    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:

    • my_method1: Summary of the method (first docstring line).
    • my_method2: Summary of the method (first docstring line).

    Attributes:

    • attr1: Summary of the attribute (first docstring line).
    • attr2: Summary of the attribute (first docstring line).
    ::: path.to.module.MyClass\n    options:\n      summary:\n        functions: true\n

    Class docstring.

    Methods:

    • my_method1: Summary of the method (first docstring line).
    • my_method2: Summary of the method (first docstring line).
    "},{"location":"usage/configuration/members/#show_labels","title":"show_labels","text":"
    • Type 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.py
    class SomeClass:\n    some_attr: int\n

    Preview

    With labelsWithout labels

    some_attr: int instance-attribute

    some_attr: int

    "},{"location":"usage/configuration/signatures/","title":"Signatures options","text":""},{"location":"usage/configuration/signatures/#annotations_path","title":"annotations_pathconvert(text, md)convert(text, md)convert(text, md)","text":"
    • Type 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.
    in mkdocs.yml (global configuration)
    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 annotations
    import 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 Default str The text to convert. required Markdown A Markdown instance. required

    Returns:

    Type Name Description Markup 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 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\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 Default str The text to convert. required markdown.Markdown A Markdown instance. required

    Returns:

    Type Name Description markupsafe.Markup text Converted markup."},{"location":"usage/configuration/signatures/#line_length","title":"line_lengthlong_function_namelong_function_name","text":"
    • Type 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 80
    long_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/#show_signature","title":"show_signaturefunction(param1, param2=None)function","text":"
    • Type 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 signature

    Function docstring.

    Function docstring.

    "},{"location":"usage/configuration/signatures/#show_signature_annotations","title":"show_signature_annotationsfunctionfunction","text":"
    • Type 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 annotations
    function(\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_signaturefunctionfunction(param1, param2=None)","text":"
    • Type 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 signature
    function(param1, param2=None)\n

    Function docstring.

    Function docstring.

    "},{"location":"usage/configuration/signatures/#signature_crossrefs","title":"signature_crossrefsdo_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.

    in mkdocs.yml (global configuration)
    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-references
    do_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":"
    • Type 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.

    in mkdocs.yml (global configuration)
    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 +{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"],"fields":{"title":{"boost":1000.0},"text":{"boost":1.0},"tags":{"boost":1000000.0}}},"docs":[{"location":"","title":"Overview","text":"mkdocstrings-python

    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.

    "},{"location":"#installation","title":"Installation","text":"

    You can install this handler as a mkdocstrings extra:

    pyproject.toml
    # PEP 621 dependencies declaration\n# adapt to your dependencies manager\n[project]\ndependencies = [\n    \"mkdocstrings[python]>=0.18\",\n]\n

    You can also explicitly depend on the handler:

    pyproject.toml
    # PEP 621 dependencies declaration\n# adapt to your dependencies manager\n[project]\ndependencies = [\n    \"mkdocstrings-python\",\n]\n
    "},{"location":"#preview","title":"Preview","text":""},{"location":"#features","title":"Features","text":"
    • 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 __init__ methods.

    • 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 Note: or Warning: will be transformed to their admonition equivalent. We do not support nested admonitions in docstrings!

    • 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: [this object][package.module.object] or directly with [package.module.object][]

    • Source code display: mkdocstrings can add a collapsible div containing the highlighted source code of the Python object.

    "},{"location":"changelog/","title":"Changelog","text":"

    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.

    "},{"location":"changelog/#190-2024-03-13","title":"1.9.0 - 2024-03-13","text":"

    Compare with 1.8.0

    "},{"location":"changelog/#dependencies","title":"Dependencies","text":"
    • Add upper bound on Python-Markdown 3.6 to temporarily prevent breaking changes (cd93ee3 by Timoth\u00e9e Mazzucotelli).
    "},{"location":"changelog/#features","title":"Features","text":"
    • Add show_labels option to show/hide labels (eaf9b82 by Viicos). Issue #120, PR #130
    • Add option to search for stubs packages (0c6aa32 by Romain). PR #128, PR griffe#221: : https://github.com/mkdocstrings/griffe/pull/221
    "},{"location":"changelog/#code-refactoring","title":"Code Refactoring","text":"
    • Mark all Jinja blocks as scoped (548bdad by Timoth\u00e9e Mazzucotelli).
    "},{"location":"changelog/#180-2024-01-08","title":"1.8.0 - 2024-01-08","text":"

    Compare with 1.7.5

    "},{"location":"changelog/#features_1","title":"Features","text":"
    • Release Insiders features of the $500/month funding goal (bd30106 by Timoth\u00e9e Mazzucotelli). The features and projects related to mkdocstrings-python are:

      • Cross-references for type annotations in signatures
      • Symbol types in headings and table of contents
      • griffe-inherited-docstrings, a Griffe extension for inheriting docstrings
      • griffe2md, a tool to output API docs to Markdown using Griffe

      See the complete list of features and projects here: https://pawamoy.github.io/insiders/#500-plasmavac-user-guide.

    "},{"location":"changelog/#175-2023-11-21","title":"1.7.5 - 2023-11-21","text":"

    Compare with 1.7.4

    "},{"location":"changelog/#bug-fixes","title":"Bug Fixes","text":"
    • Add missing translations (fallback theme) for ReadTheDocs (2fb6513 by Timoth\u00e9e Mazzucotelli). Issue #115
    "},{"location":"changelog/#174-2023-11-12","title":"1.7.4 - 2023-11-12","text":"

    Compare with 1.7.3

    "},{"location":"changelog/#bug-fixes_1","title":"Bug Fixes","text":"
    • Make extension paths relative to config file (5035e92 by Waylan Limberg). PR #112, Co-authored-by: Timoth\u00e9e Mazzucotelli pawamoy@pm.me
    "},{"location":"changelog/#code-refactoring_1","title":"Code Refactoring","text":"
    • Prepare for Griffe 0.37 (b5bb8a9 by Timoth\u00e9e Mazzucotelli).
    "},{"location":"changelog/#173-2023-10-09","title":"1.7.3 - 2023-10-09","text":"

    Compare with 1.7.2

    "},{"location":"changelog/#bug-fixes_2","title":"Bug Fixes","text":"
    • Don't deepcopy the local config (1300d2c by Timoth\u00e9e Mazzucotelli).
    "},{"location":"changelog/#172-2023-10-05","title":"1.7.2 - 2023-10-05","text":"

    Compare with 1.7.1

    "},{"location":"changelog/#bug-fixes_3","title":"Bug Fixes","text":"
    • Prevent alias resolution error when source-ordering members (67df10c by Timoth\u00e9e Mazzucotelli). Issue griffe#213
    "},{"location":"changelog/#code-refactoring_2","title":"Code Refactoring","text":"
    • Use package relative filepath if filepath is not relative (aa5a3f7 by Timoth\u00e9e Mazzucotelli). Discussion mkdocstrings#622
    "},{"location":"changelog/#171-2023-09-28","title":"1.7.1 - 2023-09-28","text":"

    Compare with 1.7.0

    "},{"location":"changelog/#bug-fixes_4","title":"Bug Fixes","text":"
    • Stop propagation of annotation to next parameter in signature template (3a760ac by Timoth\u00e9e Mazzucotelli). Issue #110
    "},{"location":"changelog/#code-refactoring_3","title":"Code Refactoring","text":"
    • Look into inherited members for __init__ methods when merging docstrings (b97d51f by Timoth\u00e9e Mazzucotelli). Issue #106
    "},{"location":"changelog/#170-2023-09-14","title":"1.7.0 - 2023-09-14","text":"

    Compare with 1.6.3

    "},{"location":"changelog/#features_2","title":"Features","text":"
    • Add option to unwrap Annotated types (53db04b by Timoth\u00e9e Mazzucotelli).
    "},{"location":"changelog/#163-2023-09-11","title":"1.6.3 - 2023-09-11","text":"

    Compare with 1.6.2

    "},{"location":"changelog/#bug-fixes_5","title":"Bug Fixes","text":"
    • Make load_external_modules a global-only option (266f41f by Timoth\u00e9e Mazzucotelli). Issue #87
    • Never fail when trying to format code with Black (df24bbc by Timoth\u00e9e Mazzucotelli).
    "},{"location":"changelog/#code-refactoring_4","title":"Code Refactoring","text":"
    • Wrap docstring section elements (list style) in code tags to prevent spell checker errors (1ae8dd8 by Timoth\u00e9e Mazzucotelli).
    "},{"location":"changelog/#162-2023-09-05","title":"1.6.2 - 2023-09-05","text":"

    Compare with 1.6.1

    "},{"location":"changelog/#bug-fixes_6","title":"Bug Fixes","text":"
    • Don't render cross-ref spans when they're not enabled (eed51ee by Timoth\u00e9e Mazzucotelli).
    "},{"location":"changelog/#161-2023-09-04","title":"1.6.1 - 2023-09-04","text":"

    Compare with 1.6.0

    "},{"location":"changelog/#bug-fixes_7","title":"Bug Fixes","text":"
    • Fix spacing for rendered named items in Yields, Receives and Returns sections (list style) (e12688e by Timoth\u00e9e Mazzucotelli).
    • Fix rendering Receives sections as lists (9ff7e68 by Timoth\u00e9e Mazzucotelli).
    "},{"location":"changelog/#160-2023-08-27","title":"1.6.0 - 2023-08-27","text":"

    Compare with 1.5.2

    "},{"location":"changelog/#features_3","title":"Features","text":"
    • Add doc-signature CSS class to separate signature code blocks (b6c648f by Timoth\u00e9e Mazzucotelli).
    "},{"location":"changelog/#code-refactoring_5","title":"Code Refactoring","text":"
    • Add a format_attribute filter, preparing for cross-refs in attribute signatures (8f0ade2 by Timoth\u00e9e Mazzucotelli).
    "},{"location":"changelog/#152-2023-08-25","title":"1.5.2 - 2023-08-25","text":"

    Compare with 1.5.1

    "},{"location":"changelog/#bug-fixes_8","title":"Bug Fixes","text":"
    • Regression in children template: fix condition for when members are specified (beeebff by Timoth\u00e9e Mazzucotelli). Issue #100
    • Prevent whitespace removal before highlight filter (c6f36c0 by Timoth\u00e9e Mazzucotelli).
    "},{"location":"changelog/#code-refactoring_6","title":"Code Refactoring","text":"
    • Never show full object path in ToC entry (9aa758b by Timoth\u00e9e Mazzucotelli).
    • Sync templates with insiders, remove useless lines (38b317f by Timoth\u00e9e Mazzucotelli).
    "},{"location":"changelog/#151-2023-08-24","title":"1.5.1 - 2023-08-24","text":"

    Compare with 1.5.0

    "},{"location":"changelog/#code-refactoring_7","title":"Code Refactoring","text":"
    • Never show full path in separate signature since it would appear in the heading already (9e02049 by Timoth\u00e9e Mazzucotelli).
    • Improve guessing whether an object is public (35eb811 by Timoth\u00e9e Mazzucotelli).
    • Always sort modules alphabetically as source order wouldn't make sense (70c81ce by Timoth\u00e9e Mazzucotelli).
    • Return anchors as a tuple, not a set, to preserve order (736a2b5 by Timoth\u00e9e Mazzucotelli). Related-to #mkdocstrings/crystal#6
    "},{"location":"changelog/#150-2023-08-20","title":"1.5.0 - 2023-08-20","text":"

    Compare with 1.4.0

    "},{"location":"changelog/#features_4","title":"Features","text":"
    • Add support for new Griffe docstring sections: modules, classes, and functions (methods) (d5337af by Timoth\u00e9e Mazzucotelli).
    "},{"location":"changelog/#140-2023-08-18","title":"1.4.0 - 2023-08-18","text":"

    Compare with 1.3.0

    "},{"location":"changelog/#features_5","title":"Features","text":"
    • Support new Griffe expressions (in v0.33) (9b8e1b1 by Timoth\u00e9e Mazzucotelli).
    "},{"location":"changelog/#code-refactoring_8","title":"Code Refactoring","text":"
    • Deprecate crossref and multi_crossref filters (4fe3d20 by Timoth\u00e9e Mazzucotelli).
    "},{"location":"changelog/#130-2023-08-06","title":"1.3.0 - 2023-08-06","text":"

    Compare with 1.2.1

    "},{"location":"changelog/#dependencies_1","title":"Dependencies","text":"
    • Set upper bound on Griffe (0.33) (ad8c2a3 by Timoth\u00e9e Mazzucotelli). See https://github.com/mkdocstrings/griffe/discussions/195.
    "},{"location":"changelog/#features_6","title":"Features","text":"
    • Show parameter default values within the \"list\" section style too (55f08f3 by Antoine Dechaume). PR #92, Co-authored-by: Timoth\u00e9e Mazzucotelli pawamoy@pm.me
    "},{"location":"changelog/#121-2023-07-20","title":"1.2.1 - 2023-07-20","text":"

    Compare with 1.2.0

    "},{"location":"changelog/#bug-fixes_9","title":"Bug Fixes","text":"
    • Fix members ordering when members are specified with a boolean (c69f9c3 by Timoth\u00e9e Mazzucotelli). Issue #89
    "},{"location":"changelog/#120-2023-07-14","title":"1.2.0 - 2023-07-14","text":"

    Compare with 1.1.2

    "},{"location":"changelog/#features_7","title":"Features","text":"
    • Add Jinja blocks to module, class, function and attribute templates (299fe48 by Timoth\u00e9e Mazzucotelli).
    • Setup infrastructure for I18N, add translations for simplified chinese and japanese (b053b29 by Nyuan Zhang). PR #77
    • Support inheritance (ae42356 by Timoth\u00e9e Mazzucotelli). Issue mkdocstrings#157, Discussion mkdocstrings#536
    "},{"location":"changelog/#bug-fixes_10","title":"Bug Fixes","text":"
    • Don't show None as return annotation of class signatures (3d8724e by Timoth\u00e9e Mazzucotelli). Issue #85
    • Show labels in deterministic order (02619a8 by Oleh Prypin).
    "},{"location":"changelog/#112-2023-06-04","title":"1.1.2 - 2023-06-04","text":"

    Compare with 1.1.1

    "},{"location":"changelog/#code-refactoring_9","title":"Code Refactoring","text":"
    • Keep headings style consistent (CSS) (92032e5 by Timoth\u00e9e Mazzucotelli).
    "},{"location":"changelog/#111-2023-06-04","title":"1.1.1 - 2023-06-04","text":"

    Compare with 1.1.0

    "},{"location":"changelog/#bug-fixes_11","title":"Bug Fixes","text":"
    • Fix mkdocs and readthedocs themes support (14f18b2 by Timoth\u00e9e Mazzucotelli).
    "},{"location":"changelog/#code-refactoring_10","title":"Code Refactoring","text":"
    • Improve display of paragraphs in docstring sections (439f5e6 by Timoth\u00e9e Mazzucotelli).
    "},{"location":"changelog/#110-2023-05-25","title":"1.1.0 - 2023-05-25","text":"

    Compare with 1.0.0

    "},{"location":"changelog/#features_8","title":"Features","text":"
    • Support custom templates through objects' extra data (8ff2b06 by Timoth\u00e9e Mazzucotelli). PR #70
    "},{"location":"changelog/#100-2023-05-11","title":"1.0.0 - 2023-05-11","text":"

    Compare with 0.10.1

    "},{"location":"changelog/#breaking-changes","title":"Breaking changes","text":"
    • The signature of the 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

      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.

    "},{"location":"changelog/#bug-fixes_12","title":"Bug Fixes","text":"
    • Bring compatibility with insiders signature crossrefs feature (f686f4e by Timoth\u00e9e Mazzucotelli).
    "},{"location":"changelog/#0101-2023-05-07","title":"0.10.1 - 2023-05-07","text":"

    Compare with 0.10.0

    "},{"location":"changelog/#bug-fixes_13","title":"Bug Fixes","text":"
    • Format signatures with full-path names (685512d by Timoth\u00e9e Mazzucotelli).
    "},{"location":"changelog/#0100-2023-05-07","title":"0.10.0 - 2023-05-07","text":"

    Compare with 0.9.0

    "},{"location":"changelog/#features_9","title":"Features","text":"
    • Add option to disallow inspection (40f2f26 by Nyuan Zhang). Issue #68, PR #69
    "},{"location":"changelog/#bug-fixes_14","title":"Bug Fixes","text":"
    • Make admonitions open by default (79cd153 by Timoth\u00e9e Mazzucotelli). Issue #22
    "},{"location":"changelog/#code-refactoring_11","title":"Code Refactoring","text":"
    • Match documented behavior for filtering (all members, list, none) (c7f70c3 by Timoth\u00e9e Mazzucotelli).
    • Switch to an info level log for when black's not installed (f593bb0 by Faster Speeding).
    • Return anchors as a set (e2b820c by Timoth\u00e9e Mazzucotelli).
    "},{"location":"changelog/#090-2023-04-03","title":"0.9.0 - 2023-04-03","text":"

    Compare with 0.8.3

    "},{"location":"changelog/#features_10","title":"Features","text":"
    • Allow resolving alias to external modules (02052e2 by Gilad). PR #61, Follow-up of PR #60
    • Allow pre-loading modules (36002cb by Gilad). Issue mkdocstrings/mkdocstrings#503, PR #60
    • Add show options for docstrings (a6c55fb by Jeremy Goh). Issue mkdocstrings/mkdocstrings#466, PR #56
    • Allow custom list of domains for inventories (f5ea6fd by Sorin Sbarnea). Issue mkdocstrings/mkdocstrings#510, PR #49
    "},{"location":"changelog/#bug-fixes_15","title":"Bug Fixes","text":"
    • Prevent alias resolution error when searching for anchors (a190e2c by Timoth\u00e9e Mazzucotelli). Issue #64
    "},{"location":"changelog/#code-refactoring_12","title":"Code Refactoring","text":"
    • Support Griffe 0.26 (075735c by Timoth\u00e9e Mazzucotelli).
    • Log (debug) unresolved aliases (9164742 by Timoth\u00e9e Mazzucotelli).
    "},{"location":"changelog/#083-2023-01-04","title":"0.8.3 - 2023-01-04","text":"

    Compare with 0.8.2

    "},{"location":"changelog/#code-refactoring_13","title":"Code Refactoring","text":"
    • Change \"unresolved aliases\" log level to DEBUG (dccb818 by Timoth\u00e9e Mazzucotelli).
    "},{"location":"changelog/#082-2022-11-19","title":"0.8.2 - 2022-11-19","text":"

    Compare with 0.8.1

    "},{"location":"changelog/#bug-fixes_16","title":"Bug Fixes","text":"
    • Fix base directory used to expand globs (34cfa4b by Florian Hofer). PR #45
    "},{"location":"changelog/#081-2022-11-19","title":"0.8.1 - 2022-11-19","text":"

    Compare with 0.8.0

    "},{"location":"changelog/#bug-fixes_17","title":"Bug Fixes","text":"
    • Expand globs relative to configuration file path (0dc45ae by David Vegh). Issue #42, PR #43
    "},{"location":"changelog/#080-2022-11-13","title":"0.8.0 - 2022-11-13","text":"

    Compare with 0.7.1

    "},{"location":"changelog/#features_11","title":"Features","text":"
    • Add support for globs in paths configuration (29edd02 by Andrew Guenther). Issue #33, PR #34
    "},{"location":"changelog/#code-refactoring_14","title":"Code Refactoring","text":"
    • Support Griffe 0.24 (3b9f701 by Timoth\u00e9e Mazzucotelli).
    "},{"location":"changelog/#071-2022-06-12","title":"0.7.1 - 2022-06-12","text":"

    Compare with 0.7.0

    "},{"location":"changelog/#bug-fixes_18","title":"Bug Fixes","text":"
    • Fix rendering of / in signatures (3e927e4 by Timoth\u00e9e Mazzucotelli). Issue #25
    "},{"location":"changelog/#070-2022-05-28","title":"0.7.0 - 2022-05-28","text":"

    Compare with 0.6.6

    "},{"location":"changelog/#packaging-dependencies","title":"Packaging / Dependencies","text":"
    • Depend on mkdocstrings 0.19 (b6a9a47 by Timoth\u00e9e Mazzucotelli).
    "},{"location":"changelog/#features_12","title":"Features","text":"
    • Add config option for annotations paths verbosity (b6c9893 by Timoth\u00e9e Mazzucotelli).
    • Use sections titles in SpaCy-styled docstrings (fe16b54 by Timoth\u00e9e Mazzucotelli).
    • Wrap objects names in spans to allow custom styling (0822ff9 by Timoth\u00e9e Mazzucotelli). Issue mkdocstrings/mkdocstrings#240
    • Add Jinja blocks around docstring section styles (aaa79ee by Timoth\u00e9e Mazzucotelli).
    • Add members and filters options (24a6136 by Timoth\u00e9e Mazzucotelli).
    • Add paths option (dd41182 by Timoth\u00e9e Mazzucotelli). Issue mkdocstrings/mkdocstrings#311, PR #20
    "},{"location":"changelog/#bug-fixes_19","title":"Bug Fixes","text":"
    • Fix CSS class on labels (312a709 by Timoth\u00e9e Mazzucotelli).
    • Fix categories rendering (6407cf4 by Timoth\u00e9e Mazzucotelli). Issue #14
    "},{"location":"changelog/#code-refactoring_15","title":"Code Refactoring","text":"
    • Disable show_submodules by default (480d0c3 by Timoth\u00e9e Mazzucotelli).
    • Merge default configuration options in handler (347ce76 by Timoth\u00e9e Mazzucotelli).
    • Reduce number of template debug logs (8fed314 by Timoth\u00e9e Mazzucotelli).
    • Respect show_root_full_path for ToC entries (hidden headings) (8f4c853 by Timoth\u00e9e Mazzucotelli).
    • Bring consistency on headings style (59104c4 by Timoth\u00e9e Mazzucotelli).
    • Stop using deprecated base classes (d5ea1c5 by Timoth\u00e9e Mazzucotelli).
    "},{"location":"changelog/#066-2022-03-06","title":"0.6.6 - 2022-03-06","text":"

    Compare with 0.6.5

    "},{"location":"changelog/#code-refactoring_16","title":"Code Refactoring","text":"
    • Always hide self and cls parameters (7f579d1 by Timoth\u00e9e Mazzucotelli). Issue #7
    • Use pycon for examples code blocks (6545900 by Timoth\u00e9e Mazzucotelli).
    "},{"location":"changelog/#065-2022-02-24","title":"0.6.5 - 2022-02-24","text":"

    Compare with 0.6.4

    "},{"location":"changelog/#bug-fixes_20","title":"Bug Fixes","text":"
    • Don't escape signatures return annotations (ac54bfc by Timoth\u00e9e Mazzucotelli). Issue #6
    "},{"location":"changelog/#064-2022-02-22","title":"0.6.4 - 2022-02-22","text":"

    Compare with 0.6.3

    "},{"location":"changelog/#bug-fixes_21","title":"Bug Fixes","text":"
    • Fix rendering of signature return annotation (b92ba3b by Timoth\u00e9e Mazzucotelli). Issue #4
    "},{"location":"changelog/#063-2022-02-20","title":"0.6.3 - 2022-02-20","text":"

    Compare with 0.6.2

    "},{"location":"changelog/#bug-fixes_22","title":"Bug Fixes","text":"
    • Fix examples rendering (a06a7e3 by Timoth\u00e9e Mazzucotelli). Issue mkdocstrings/griffe#46
    "},{"location":"changelog/#062-2022-02-17","title":"0.6.2 - 2022-02-17","text":"

    Compare with 0.6.1

    "},{"location":"changelog/#bug-fixes_23","title":"Bug Fixes","text":"
    • Catch alias resolution errors (b734dd0 by Timoth\u00e9e Mazzucotelli).
    "},{"location":"changelog/#061-2022-02-17","title":"0.6.1 - 2022-02-17","text":"

    Compare with 0.6.0

    "},{"location":"changelog/#bug-fixes_24","title":"Bug Fixes","text":"
    • Don't pop from fallback config (bde32af by Timoth\u00e9e Mazzucotelli).
    • Fix rendering init method source when merged into class (4a20aea by Timoth\u00e9e Mazzucotelli).
    "},{"location":"changelog/#060-2022-02-13","title":"0.6.0 - 2022-02-13","text":"

    Compare with 0.5.4

    "},{"location":"changelog/#features_13","title":"Features","text":"
    • Add option to merge __init__ methods' docstrings into their classes' docstrings (1b4d1c0 by Timoth\u00e9e Mazzucotelli).
    • Support separate attribute signature (e962b88 by Timoth\u00e9e Mazzucotelli).
    "},{"location":"changelog/#bug-fixes_25","title":"Bug Fixes","text":"
    • Restore full cross-refs paths on hover (ac11970 by Timoth\u00e9e Mazzucotelli).
    • Fix rendering of labels (52919c5 by Timoth\u00e9e Mazzucotelli).
    "},{"location":"changelog/#code-refactoring_17","title":"Code Refactoring","text":"
    • Don't add trailing parentheses in functions heading when separate signature (885696e by Timoth\u00e9e Mazzucotelli).
    • Use more explicit template debug messages (f2122d7 by Timoth\u00e9e Mazzucotelli).
    "},{"location":"changelog/#054-2022-02-13","title":"0.5.4 - 2022-02-13","text":"

    Compare with 0.5.3

    "},{"location":"changelog/#bug-fixes_26","title":"Bug Fixes","text":"
    • Don't load additional modules during fallback (69b8e25 by Timoth\u00e9e Mazzucotelli).
    "},{"location":"changelog/#053-2022-02-08","title":"0.5.3 - 2022-02-08","text":"

    Compare with 0.5.2

    "},{"location":"changelog/#bug-fixes_27","title":"Bug Fixes","text":"
    • Allow passing null as docstring style (f526816 by Timoth\u00e9e Mazzucotelli). Issue #2
    "},{"location":"changelog/#052-2022-02-05","title":"0.5.2 - 2022-02-05","text":"

    Compare with 0.5.1

    "},{"location":"changelog/#dependencies_2","title":"Dependencies","text":"
    • Require at least mkdocstrings 0.18 (7abdda4 by Timoth\u00e9e Mazzucotelli).
    "},{"location":"changelog/#051-2022-02-03","title":"0.5.1 - 2022-02-03","text":"

    Compare with 0.5.0

    "},{"location":"changelog/#dependencies_3","title":"Dependencies","text":"
    • Depend on Griffe >= 0.11.1 (1303557 by Timoth\u00e9e Mazzucotelli).
    "},{"location":"changelog/#code-refactoring_18","title":"Code Refactoring","text":"
    • Move handler into its own module (b787e78 by Timoth\u00e9e Mazzucotelli).
    "},{"location":"changelog/#050-2022-02-03","title":"0.5.0 - 2022-02-03","text":"

    Compare with 0.4.1

    "},{"location":"changelog/#features_14","title":"Features","text":"
    • Allow changing docstring style of an object (39240c1 by Timoth\u00e9e Mazzucotelli).
    "},{"location":"changelog/#bug-fixes_28","title":"Bug Fixes","text":"
    • Warn if Black is not installed when formatting signature (b848277 by Timoth\u00e9e Mazzucotelli).
    • Fix missing default for docstring_section_style option (774988e by Timoth\u00e9e Mazzucotelli).
    "},{"location":"changelog/#code-refactoring_19","title":"Code Refactoring","text":"
    • Change to new way of stripping paragraphs (33d4594 by Timoth\u00e9e Mazzucotelli).
    "},{"location":"changelog/#041-2022-02-01","title":"0.4.1 - 2022-02-01","text":"

    Compare with 0.4.0

    "},{"location":"changelog/#bug-fixes_29","title":"Bug Fixes","text":"
    • Fix docstring admonitions rendering (a24ae2e by Timoth\u00e9e Mazzucotelli).
    "},{"location":"changelog/#040-2022-02-01","title":"0.4.0 - 2022-02-01","text":"

    Compare with 0.3.0

    "},{"location":"changelog/#code-refactoring_20","title":"Code Refactoring","text":"
    • Use the new mkdocstrings_handlers namespace (23c9023 by Timoth\u00e9e Mazzucotelli).
    "},{"location":"changelog/#030-2022-01-14","title":"0.3.0 - 2022-01-14","text":"

    Compare with 0.2.0

    "},{"location":"changelog/#features_15","title":"Features","text":"
    • Support griffe 0.10 (28061de by Timoth\u00e9e Mazzucotelli).
    "},{"location":"changelog/#dependencies_4","title":"Dependencies","text":"
    • Require griffe 0.10 (cfbd7bb by Timoth\u00e9e Mazzucotelli).
    "},{"location":"changelog/#code-refactoring_21","title":"Code Refactoring","text":"
    • Use new logger patching utility (4cdb292 by Timoth\u00e9e Mazzucotelli).
    "},{"location":"changelog/#020-2021-12-28","title":"0.2.0 - 2021-12-28","text":"

    Compare with 0.1.0

    "},{"location":"changelog/#dependencies_5","title":"Dependencies","text":"
    • Depend on griffe >= 0.7.1 (34f7ebd by Timoth\u00e9e Mazzucotelli).
    • Upgrade griffe, no upper bound (8f0aa42 by Timoth\u00e9e Mazzucotelli).
    "},{"location":"changelog/#features_16","title":"Features","text":"
    • Add show_signature rendering option (0f07c2e by Will Da Silva).
    "},{"location":"changelog/#bug-fixes_30","title":"Bug Fixes","text":"
    • Fix templates for named docstring elements (47868a1 by Timoth\u00e9e Mazzucotelli).
    "},{"location":"changelog/#010-2021-12-19","title":"0.1.0 - 2021-12-19","text":"

    Compare with first commit

    "},{"location":"changelog/#features_17","title":"Features","text":"
    • Implement handler and add templates (dbb580a by Timoth\u00e9e Mazzucotelli).
    "},{"location":"changelog/#bug-fixes_31","title":"Bug Fixes","text":"
    • Fix separate signature feature (da6e81c by Timoth\u00e9e Mazzucotelli).
    • Fix signature template (parameters annotations) (b34ead0 by Timoth\u00e9e Mazzucotelli).
    • Only show source when present (c270d68 by Timoth\u00e9e Mazzucotelli).
    "},{"location":"changelog/#code-refactoring_22","title":"Code Refactoring","text":"
    • Return all known anchors (9bbfe14 by Timoth\u00e9e Mazzucotelli).
    • Update for griffe 0.4.0 (831aabb by Timoth\u00e9e Mazzucotelli).
    "},{"location":"code_of_conduct/","title":"Contributor Covenant Code of Conduct","text":""},{"location":"code_of_conduct/#our-pledge","title":"Our Pledge","text":"

    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.

    "},{"location":"code_of_conduct/#our-standards","title":"Our Standards","text":"

    Examples of behavior that contributes to a positive environment for our community include:

    • Demonstrating empathy and kindness toward other people
    • Being respectful of differing opinions, viewpoints, and experiences
    • Giving and gracefully accepting constructive feedback
    • Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
    • Focusing on what is best not just for us as individuals, but for the overall community

    Examples of unacceptable behavior include:

    • The use of sexualized language or imagery, and sexual attention or advances of any kind
    • Trolling, insulting or derogatory comments, and personal or political attacks
    • Public or private harassment
    • Publishing others' private information, such as a physical or email address, without their explicit permission
    • Other conduct which could reasonably be considered inappropriate in a professional setting
    "},{"location":"code_of_conduct/#enforcement-responsibilities","title":"Enforcement Responsibilities","text":"

    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.

    "},{"location":"code_of_conduct/#scope","title":"Scope","text":"

    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.

    "},{"location":"code_of_conduct/#enforcement","title":"Enforcement","text":"

    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.

    "},{"location":"code_of_conduct/#enforcement-guidelines","title":"Enforcement Guidelines","text":"

    Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:

    "},{"location":"code_of_conduct/#1-correction","title":"1. Correction","text":"

    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.

    "},{"location":"code_of_conduct/#2-warning","title":"2. Warning","text":"

    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.

    "},{"location":"code_of_conduct/#3-temporary-ban","title":"3. Temporary Ban","text":"

    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.

    "},{"location":"code_of_conduct/#4-permanent-ban","title":"4. Permanent Ban","text":"

    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.

    "},{"location":"code_of_conduct/#attribution","title":"Attribution","text":"

    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.

    "},{"location":"contributing/","title":"Contributing","text":"

    Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given.

    "},{"location":"contributing/#environment-setup","title":"Environment setup","text":"

    Nothing easier!

    Fork and clone the repository, then:

    cd python\nmake setup\n

    Note

    If it fails for some reason, you'll need to install uv manually.

    You can install it with:

    python3 -m pip install --user pipx\npipx install uv\n

    Now you can try running make setup again, or simply uv install.

    You now have the dependencies installed.

    Run make help to see all the available actions!

    "},{"location":"contributing/#tasks","title":"Tasks","text":"

    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 make run duty TASK.

    The Makefile detects if a virtual environment is activated, so make will work the same with the virtualenv activated or not.

    If you work in VSCode, we provide an action to configure VSCode for the project.

    "},{"location":"contributing/#development","title":"Development","text":"

    As usual:

    1. create a new branch: git switch -c feature-or-bugfix-name
    2. edit the code and/or the documentation

    Before committing:

    1. run make format to auto-format the code
    2. run make check to check everything (fix any warning)
    3. run make test to run the tests (fix any issue)
    4. if you updated the documentation or the project dependencies:
      1. run make docs
      2. go to http://localhost:8000 and check that everything looks good
    5. follow our commit message convention

    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.

    "},{"location":"contributing/#commit-message-convention","title":"Commit message convention","text":"

    Commit messages must follow our convention based on the Angular style or the Karma convention:

    <type>[(scope)]: Subject\n\n[Body]\n

    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:

    • 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.

    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:

    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

    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 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).

    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.

    "},{"location":"contributing/#pull-requests-guidelines","title":"Pull requests guidelines","text":"

    Link to any related issue in the Pull Request message.

    During the review, we recommend using fixups:

    # SHA is the SHA of the commit you want to fix\ngit commit --fixup=SHA\n

    Once all the changes are approved, you can squash your commits:

    git rebase -i --autosquash main\n

    And force-push:

    git push -f\n

    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.

    "},{"location":"credits/","title":"Credits","text":""},{"location":"credits/#exec-1--credits","title":"Credits","text":"

    These projects were used to build mkdocstrings-python. Thank you!

    Python | uv | copier-uv

    "},{"location":"credits/#exec-1--runtime-dependencies","title":"Runtime dependencies","text":"Project Summary Version (accepted) Version (last resolved) License Jinja2 A very fast and expressive template engine. >=2.11.1 3.1.3 BSD-3-Clause Markdown Python implementation of John Gruber's Markdown. >=3.3, <3.6 3.5.2 BSD License MarkupSafe Safely add untrusted strings to HTML/XML markup. >=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 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.40 0.42.0.1.2.0 ISC importlib_metadata Read metadata from Python packages >=4.6 7.0.2 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.5.3 BSD-2-Clause mkdocs-autorefs Automatically link across pages in MkDocs. >=0.3.1 1.0.1 ISC mkdocstrings Automatic documentation from sources, for MkDocs. >=0.23, >=0.20 0.24.1 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.9.0, >=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.0 MIT pymdown-extensions Extension pack for Python Markdown. >=6.3 10.7.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 4.10.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.0 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.14.0 BSD-3-Clause GitPython GitPython is a Python library used to interact with Git repositories 3.1.42 BSD-3-Clause Jinja2 A very fast and expressive template engine. >=2.11.1 3.1.3 BSD-3-Clause Markdown Python implementation of John Gruber's Markdown. >=3.3, <3.6 3.5.2 BSD License MarkupSafe Safely add untrusted strings to HTML/XML markup. >=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.13.0, <3.0.0 2.17.2 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.2.0 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.1.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.4.3 Apache-2.0 cryptography cryptography is a package which provides cryptographic recipes and primitives to Python developers. >=2.0 42.0.5 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.20.1 public domain, Python, 2-Clause BSD, GPL 3 (see COPYING.txt) dparse A parser for Python dependency files >=0.6.2 0.6.3 MIT license duty A simple task runner. >=0.10 1.2.0 ISC execnet execnet: rapid multi-Python deployment >=1.1 2.0.2 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.4.0 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.6 BSD License importlib_metadata Read metadata from Python packages >=4.6 7.0.2 Apache Software License iniconfig brain-dead simple config-ini parsing 2.0.0 MIT jaraco.classes Utility functions for Python class constructs 3.3.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 24.3.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.5.3 BSD-2-Clause mkdocs-autorefs Automatically link across pages in MkDocs. >=0.3.1 1.0.1 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-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.13+insiders.4.53.1 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.23, >=0.20 0.24.1 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.9.0 MIT mypy-extensions Type system extensions for programs checked with the mypy type checker. >=0.4.3 1.0.0 MIT License nh3 Python bindings to the ammonia HTML sanitization library. >=0.2.14 0.2.15 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.9.0, >=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.0 MIT pluggy plugin and hook calling mechanisms for python >=1.4, <2.0 1.4.0 MIT ptyprocess Run a subprocess in a pseudo terminal ~=0.6 0.7.0 ISC License (ISCL) pycparser C parser in Python 2.21 BSD pymdown-extensions Extension pack for Python Markdown. >=6.3 10.7.1 MIT pyproject_hooks Wrappers to call pyproject.toml-based build backend hooks. 1.0.0 MIT License pytest pytest: simple powerful testing with Python >=7.4 8.1.1 MIT pytest-cov Pytest plugin for measuring coverage. >=4.1 4.1.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.5.0 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 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 2023.12.25 Apache Software License requests Python HTTP for Humans. 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.3.2 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.2.0 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.5.0.20240311 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 4.10.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.0 MIT License

    More credits from the author

    "},{"location":"license/","title":"License","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
    "},{"location":"insiders/","title":"Insiders","text":"

    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!

    "},{"location":"insiders/#what-is-insiders","title":"What is Insiders?","text":"

    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

    "},{"location":"insiders/#what-sponsorships-achieve","title":"What sponsorships achieve","text":"

    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!

    "},{"location":"insiders/#whats-in-it-for-me","title":"What's in it for me?","text":"

    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:

    • Class inheritance diagrams with Mermaid
    • Annotations modernization
    • Parameter headings
    • Automatic cross-references to parameters
    • Automatic cross-references for default parameter values in signatures
    • Automatic rendering of function signature overloads
    • Auto-summary of object members
    • griffe-warnings-deprecated \u2014 [Project] Griffe extension for @warnings.deprecated (PEP 702)
    • griffe-pydantic \u2014 [Project] Griffe extension for Pydantic

    These are just the features related to this project. See the complete feature list on the author's main Insiders page.

    "},{"location":"insiders/#how-to-become-a-sponsor","title":"How to become a sponsor","text":"

    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.

    "},{"location":"insiders/#funding","title":"Funding","text":""},{"location":"insiders/#goals","title":"Goals","text":"

    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.

    "},{"location":"insiders/#1000-gravifridge-fluid-renewal","title":"$ 1,000 \u2014 GraviFridge Fluid Renewal","text":"
    • Auto-summary of object members
    • Automatic rendering of function signature overloads
    • Parameter headings
    • Automatic cross-references to parameters
    • Automatic cross-references for default parameter values in signatures
    • griffe-pydantic \u2014 [Project] Griffe extension for Pydantic
    • griffe-warnings-deprecated \u2014 [Project] Griffe extension for @warnings.deprecated (PEP 702)
    "},{"location":"insiders/#1500-hyperlamp-navigation-tips","title":"$ 1,500 \u2014 HyperLamp Navigation Tips","text":"
    • Class inheritance diagrams with Mermaid
    • Annotations modernization
    "},{"location":"insiders/#2000-fusiondrive-ejection-configuration","title":"$ 2,000 \u2014 FusionDrive Ejection Configuration","text":"

    There are no features in this goal for this project. See the features in this goal for all Insiders projects.

    "},{"location":"insiders/#goals-completed","title":"Goals completed","text":"

    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.

    "},{"location":"insiders/#500-plasmavac-user-guide","title":"$ 500 \u2014 PlasmaVac User Guide","text":"
    • Cross-references for type annotations in signatures
    • Symbol types in headings and table of contents
    • griffe-inherited-docstrings \u2014 [Project] Griffe extension for inheriting docstrings
    "},{"location":"insiders/#frequently-asked-questions","title":"Frequently asked questions","text":""},{"location":"insiders/#compatibility","title":"Compatibility","text":"

    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.

    "},{"location":"insiders/#payment","title":"Payment","text":"

    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.

    "},{"location":"insiders/#terms","title":"Terms","text":"

    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.

    1. 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

    2. 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

    3. 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

    4. 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

    5. 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

    "},{"location":"insiders/changelog/","title":"Changelog","text":""},{"location":"insiders/changelog/#mkdocstrings-python-insiders","title":"mkdocstrings-python Insiders","text":""},{"location":"insiders/changelog/#1.8.0","title":"1.8.0 March 24, 2024","text":"
    • Annotations modernization
    "},{"location":"insiders/changelog/#1.7.0","title":"1.7.0 March 24, 2024","text":"
    • Class inheritance diagrams with Mermaid
    "},{"location":"insiders/changelog/#1.6.0","title":"1.6.0 January 30, 2024","text":"
    • Render cross-references to parameters documentation in signatures and attribute values.
    • Add parameter_headings option to render headings for parameters (enabling permalinks and ToC/inventory entries).
    • Render cross-references for default parameter values in signatures.
    "},{"location":"insiders/changelog/#1.5.1","title":"1.5.1 September 12, 2023","text":"
    • Prevent empty auto-summarized Methods section.
    "},{"location":"insiders/changelog/#1.5.0","title":"1.5.0 September 05, 2023","text":"
    • Render function signature overloads.
    "},{"location":"insiders/changelog/#1.4.0","title":"1.4.0 August 27, 2023","text":"
    • Render cross-references in attribute signatures.
    "},{"location":"insiders/changelog/#1.3.0","title":"1.3.0 August 24, 2023","text":"
    • Add \"method\" symbol type.
    "},{"location":"insiders/changelog/#1.2.0","title":"1.2.0 August 20, 2023","text":"
    • Add member auto-summaries.
    "},{"location":"insiders/changelog/#1.1.4","title":"1.1.4 July 17, 2023","text":"
    • Fix heading level increment for class members.
    "},{"location":"insiders/changelog/#1.1.3","title":"1.1.3 July 17, 2023","text":"
    • Fix heading level (avoid with clause preventing to decrease it).
    "},{"location":"insiders/changelog/#1.1.2","title":"1.1.2 July 15, 2023","text":"
    • Use non-breaking spaces after symbol types.
    "},{"location":"insiders/changelog/#1.1.1","title":"1.1.1 June 27, 2023","text":"
    • Correctly escape expressions in signatures and other rendered types.
    "},{"location":"insiders/changelog/#1.1.0","title":"1.1.0 June 4, 2023","text":"
    • Add Symbol types in headings and table of contents.
    "},{"location":"insiders/changelog/#1.0.0","title":"1.0.0 May 10, 2023","text":"
    • Add cross-references for type annotations in signatures. Make sure to update your local templates as the signature of the format_signature filter has changed. The templates that must be updated: class.html, expression.html, function.html and signature.html.
    "},{"location":"insiders/installation/","title":"Getting started with Insiders","text":"

    mkdocstrings-python Insiders is a compatible drop-in replacement for mkdocstrings-python, and can be installed similarly using pip or git. Note that in order to access the Insiders repository, you need to become an eligible sponsor of @pawamoy on GitHub.

    "},{"location":"insiders/installation/#installation","title":"Installation","text":""},{"location":"insiders/installation/#with-pypi-insiders","title":"with PyPI Insiders","text":"

    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.

    "},{"location":"insiders/installation/#with-pip-sshhttps","title":"with pip (ssh/https)","text":"

    mkdocstrings-python Insiders can be installed with pip using SSH:

    pip install git+ssh://git@github.com/pawamoy-insiders/mkdocstrings-python.git\n

    Or using HTTPS:

    pip install git+https://${GH_TOKEN}@github.com/pawamoy-insiders/mkdocstrings-python.git\n
    How to get a GitHub personal access token

    The 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:

    1. Go to https://github.com/settings/tokens
    2. Click on Generate a new token
    3. Enter a name and select the repo scope
    4. Generate the token and store it in a safe place

    Note that the personal access token must be kept secret at all times, as it allows the owner to access your private repositories.

    "},{"location":"insiders/installation/#with-pip-self-hosted","title":"with pip (self-hosted)","text":"

    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:

    # download distributions in ~/dists, then upload with:\ntwine upload --repository-url https://your-private-index.com ~/dists/*\n

    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:

    pip config set global.extra-index-url https://your-private-index.com/simple\n

    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.

    Full example with pypiserver

    In this example we use pypiserver to serve a local PyPI index.

    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

    We can configure the credentials to access the server in ~/.pypirc:

    .pypirc
    [distutils]\nindex-servers =\n    local\n\n[local]\nrepository: http://localhost:8080\nusername:\npassword:\n

    We then clone the Insiders repository, build distributions and upload them to our local server:

    # 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

    Finally, we configure pip, and for example PDM, to use our local index to find packages:

    pip config set global.extra-index-url http://localhost:8080/simple\npdm config pypi.extra.url http://localhost:8080/simple\n

    Now when running 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!

    "},{"location":"insiders/installation/#with-git","title":"with git","text":"

    Of course, you can use mkdocstrings-python Insiders directly from git:

    git clone git@github.com:pawamoy-insiders/mkdocstrings-python\n

    When cloning from git, the package must be installed:

    pip install -e mkdocstrings-python\n
    "},{"location":"insiders/installation/#upgrading","title":"Upgrading","text":"

    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 8.x.x.4.x.x means that Insiders 4.x.x is currently based on 8.x.x.

    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.

    "},{"location":"reference/SUMMARY/","title":"SUMMARY","text":"
    • mkdocstrings_handlers
      • python
        • debug
        • handler
        • rendering
    "},{"location":"reference/mkdocstrings_handlers/python/","title":"mkdocstrings_handlers.python","text":""},{"location":"reference/mkdocstrings_handlers/python/#mkdocstrings_handlers.python","title":"python","text":"

    Python handler for mkdocstrings.

    Modules:

    • debug \u2013

      Debugging utilities.

    • handler \u2013

      This module implements a handler for the Python language.

    • rendering \u2013

      This module implements rendering utilities.

    Functions:

    • get_handler \u2013

      Simply return an instance of PythonHandler.

    "},{"location":"reference/mkdocstrings_handlers/python/#mkdocstrings_handlers.python.get_handler","title":"get_handler","text":"
    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

    Simply return an instance of PythonHandler.

    Parameters:

    Returns:

    • PythonHandler \u2013

      An instance of PythonHandler.

    "},{"location":"reference/mkdocstrings_handlers/python/#mkdocstrings_handlers.python.get_handler(theme)","title":"theme","text":"(str) \u2013

    The theme to use when rendering contents.

    "},{"location":"reference/mkdocstrings_handlers/python/#mkdocstrings_handlers.python.get_handler(custom_templates)","title":"custom_templates","text":"(str | None, default: None ) \u2013

    Directory containing custom templates.

    "},{"location":"reference/mkdocstrings_handlers/python/#mkdocstrings_handlers.python.get_handler(config_file_path)","title":"config_file_path","text":"(str | None, default: None ) \u2013

    The MkDocs configuration file path.

    "},{"location":"reference/mkdocstrings_handlers/python/#mkdocstrings_handlers.python.get_handler(paths)","title":"paths","text":"(list[str] | None, default: None ) \u2013

    A list of paths to use as Griffe search paths.

    "},{"location":"reference/mkdocstrings_handlers/python/#mkdocstrings_handlers.python.get_handler(locale)","title":"locale","text":"(str, default: 'en' ) \u2013

    The locale to use when rendering content.

    "},{"location":"reference/mkdocstrings_handlers/python/#mkdocstrings_handlers.python.get_handler(load_external_modules)","title":"load_external_modules","text":"(bool, default: False ) \u2013

    Load external modules when resolving aliases.

    "},{"location":"reference/mkdocstrings_handlers/python/#mkdocstrings_handlers.python.get_handler(**config)","title":"**config","text":"(Any, default: {} ) \u2013

    Configuration passed to the handler.

    "},{"location":"reference/mkdocstrings_handlers/python/debug/","title":"mkdocstrings_handlers.python.debug","text":""},{"location":"reference/mkdocstrings_handlers/python/debug/#mkdocstrings_handlers.python.debug","title":"debug","text":"

    Debugging utilities.

    Classes:

    • Environment \u2013

      Dataclass to store environment information.

    • Package \u2013

      Dataclass describing a Python package.

    • Variable \u2013

      Dataclass describing an environment variable.

    Functions:

    • get_debug_info \u2013

      Get debug/environment information.

    • get_version \u2013

      Get version of the given distribution.

    • print_debug_info \u2013

      Print debug/environment information.

    "},{"location":"reference/mkdocstrings_handlers/python/debug/#mkdocstrings_handlers.python.debug.Environment","title":"Environment 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

    Dataclass to store environment information.

    Attributes:

    • interpreter_name (str) \u2013

      Python interpreter name.

    • interpreter_path (str) \u2013

      Path to Python executable.

    • interpreter_version (str) \u2013

      Python interpreter version.

    • packages (list[Package]) \u2013

      Installed packages.

    • platform (str) \u2013

      Operating System.

    • variables (list[Variable]) \u2013

      Environment variables.

    "},{"location":"reference/mkdocstrings_handlers/python/debug/#mkdocstrings_handlers.python.debug.Environment.interpreter_name","title":"interpreter_name instance-attribute","text":"
    interpreter_name: str\n

    Python interpreter name.

    "},{"location":"reference/mkdocstrings_handlers/python/debug/#mkdocstrings_handlers.python.debug.Environment.interpreter_path","title":"interpreter_path instance-attribute","text":"
    interpreter_path: str\n

    Path to Python executable.

    "},{"location":"reference/mkdocstrings_handlers/python/debug/#mkdocstrings_handlers.python.debug.Environment.interpreter_version","title":"interpreter_version instance-attribute","text":"
    interpreter_version: str\n

    Python interpreter version.

    "},{"location":"reference/mkdocstrings_handlers/python/debug/#mkdocstrings_handlers.python.debug.Environment.packages","title":"packages instance-attribute","text":"
    packages: list[Package]\n

    Installed packages.

    "},{"location":"reference/mkdocstrings_handlers/python/debug/#mkdocstrings_handlers.python.debug.Environment.platform","title":"platform instance-attribute","text":"
    platform: str\n

    Operating System.

    "},{"location":"reference/mkdocstrings_handlers/python/debug/#mkdocstrings_handlers.python.debug.Environment.variables","title":"variables instance-attribute","text":"
    variables: list[Variable]\n

    Environment variables.

    "},{"location":"reference/mkdocstrings_handlers/python/debug/#mkdocstrings_handlers.python.debug.Package","title":"Package dataclass","text":"
    Package(name: str, version: str)\n

    Dataclass describing a Python package.

    Attributes:

    • name (str) \u2013

      Package name.

    • version (str) \u2013

      Package version.

    "},{"location":"reference/mkdocstrings_handlers/python/debug/#mkdocstrings_handlers.python.debug.Package.name","title":"name instance-attribute","text":"
    name: str\n

    Package name.

    "},{"location":"reference/mkdocstrings_handlers/python/debug/#mkdocstrings_handlers.python.debug.Package.version","title":"version instance-attribute","text":"
    version: str\n

    Package version.

    "},{"location":"reference/mkdocstrings_handlers/python/debug/#mkdocstrings_handlers.python.debug.Variable","title":"Variable dataclass","text":"
    Variable(name: str, value: str)\n

    Dataclass describing an environment variable.

    Attributes:

    • name (str) \u2013

      Variable name.

    • value (str) \u2013

      Variable value.

    "},{"location":"reference/mkdocstrings_handlers/python/debug/#mkdocstrings_handlers.python.debug.Variable.name","title":"name instance-attribute","text":"
    name: str\n

    Variable name.

    "},{"location":"reference/mkdocstrings_handlers/python/debug/#mkdocstrings_handlers.python.debug.Variable.value","title":"value instance-attribute","text":"
    value: str\n

    Variable value.

    "},{"location":"reference/mkdocstrings_handlers/python/debug/#mkdocstrings_handlers.python.debug.get_debug_info","title":"get_debug_info","text":"
    get_debug_info() -> Environment\n

    Get debug/environment information.

    Returns:

    • Environment \u2013

      Environment information.

    "},{"location":"reference/mkdocstrings_handlers/python/debug/#mkdocstrings_handlers.python.debug.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.

    "},{"location":"reference/mkdocstrings_handlers/python/debug/#mkdocstrings_handlers.python.debug.get_version(dist)","title":"dist","text":"(str, default: 'mkdocstrings-python' ) \u2013

    A distribution name.

    "},{"location":"reference/mkdocstrings_handlers/python/debug/#mkdocstrings_handlers.python.debug.print_debug_info","title":"print_debug_info","text":"
    print_debug_info() -> None\n

    Print debug/environment information.

    "},{"location":"reference/mkdocstrings_handlers/python/handler/","title":"mkdocstrings_handlers.python.handler","text":""},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler","title":"handler","text":"

    This module implements a handler for the Python language.

    Classes:

    • PythonHandler \u2013

      The Python handler class.

    Functions:

    • get_handler \u2013

      Simply return an instance of PythonHandler.

    "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler","title":"PythonHandler","text":"
    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          

    The Python handler class.

    Parameters:

    Methods:

    • do_convert_markdown \u2013

      Render Markdown text; for use inside templates.

    • do_heading \u2013

      Render an HTML heading and register it for the table of contents. For use inside templates.

    • get_extended_templates_dirs \u2013

      Load template extensions for the given handler, return their templates directories.

    • get_headings \u2013

      Return and clear the headings gathered so far.

    • get_templates_dir \u2013

      Return the path to the handler's templates directory.

    • load_inventory \u2013

      Yield items and their URLs from an inventory file streamed from in_file.

    • normalize_extension_paths \u2013

      Resolve extension paths relative to config file.

    • teardown \u2013

      Teardown the handler.

    Attributes:

    • default_config (dict) \u2013

      Default handler configuration.

    • domain (str) \u2013

      The cross-documentation domain/language for this handler.

    • enable_inventory (bool) \u2013

      Whether this handler is interested in enabling the creation of the objects.inv Sphinx inventory file.

    • extra_css \u2013

      Extra CSS.

    • fallback_config (dict) \u2013

      The configuration used to collect item during autorefs fallback.

    • fallback_theme \u2013

      The fallback theme.

    • name (str) \u2013

      The handler's name, for example \"python\".

    "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler(*args)","title":"*args","text":"(Any, default: () ) \u2013

    Handler name, theme and custom templates.

    "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler(config_file_path)","title":"config_file_path","text":"(str | None, default: None ) \u2013

    The MkDocs configuration file path.

    "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler(paths)","title":"paths","text":"(list[str] | None, default: None ) \u2013

    A list of paths to use as Griffe search paths.

    "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler(locale)","title":"locale","text":"(str, default: 'en' ) \u2013

    The locale to use when rendering content.

    "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler(load_external_modules)","title":"load_external_modules","text":"(bool, default: False ) \u2013

    Load external modules when resolving aliases.

    "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler(**kwargs)","title":"**kwargs","text":"(Any, default: {} ) \u2013

    Same thing, but with keyword arguments.

    "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.default_config","title":"default_config 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\": 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

    Default handler configuration.

    General options:

    • find_stubs_package (bool) \u2013

      Whether to load stubs package (package-stubs) when extracting docstrings. Default False.

    • allow_inspection (bool) \u2013

      Whether to allow inspecting modules when visiting them is not possible. Default: True.

    • show_bases (bool) \u2013

      Show the base classes of a class. Default: True.

    • show_inheritance_diagram (bool) \u2013

      Show the inheritance diagram of a class using Mermaid. Default: False.

    • show_source (bool) \u2013

      Show the source code of this object. Default: True.

    • preload_modules (list[str] | None) \u2013

      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) \u2013

      The initial heading level to use. Default: 2.

    • parameter_headings (bool) \u2013

      Whether to render headings for parameters (therefore showing parameters in the ToC). Default: False.

    • show_root_heading (bool) \u2013

      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) \u2013

      If the root heading is not shown, at least add a ToC entry for it. Default: True.

    • show_root_full_path (bool) \u2013

      Show the full Python path for the root object heading. Default: True.

    • show_root_members_full_path (bool) \u2013

      Show the full Python path of the root members. Default: False.

    • show_object_full_path (bool) \u2013

      Show the full Python path of every object. Default: False.

    • show_category_heading (bool) \u2013

      When grouped by categories, show a heading for each category. Default: False.

    • show_symbol_type_heading (bool) \u2013

      Show the symbol type in headings (e.g. mod, class, meth, func and attr). Default: False.

    • show_symbol_type_toc (bool) \u2013

      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) \u2013

      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) \u2013

      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) \u2013

      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) \u2013

      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) \u2013

      Group the object's children by categories: attributes, classes, functions, and modules. Default: True.

    • show_submodules (bool) \u2013

      When rendering a module, show its submodules recursively. Default: False.

    • summary (bool | dict[str, bool]) \u2013

      Whether to render summaries of modules, classes, functions (methods) and attributes.

    • show_labels (bool) \u2013

      Whether to show labels of the members. Default: True.

    Docstrings options:

    • docstring_style (str) \u2013

      The docstring style to use: google, numpy, sphinx, or None. Default: \"google\".

    • docstring_options (dict) \u2013

      The options for the docstring parser. See parsers under griffe.docstrings.

    • docstring_section_style (str) \u2013

      The style used to render docstring sections. Options: table, list, spacy. Default: \"table\".

    • merge_init_into_class (bool) \u2013

      Whether to merge the __init__ method into the class' signature and docstring. Default: False.

    • show_if_no_docstring (bool) \u2013

      Show the object heading even if it has no docstring or children with docstrings. Default: False.

    • show_docstring_attributes (bool) \u2013

      Whether to display the \"Attributes\" section in the object's docstring. Default: True.

    • show_docstring_functions (bool) \u2013

      Whether to display the \"Functions\" or \"Methods\" sections in the object's docstring. Default: True.

    • show_docstring_classes (bool) \u2013

      Whether to display the \"Classes\" section in the object's docstring. Default: True.

    • show_docstring_modules (bool) \u2013

      Whether to display the \"Modules\" section in the object's docstring. Default: True.

    • show_docstring_description (bool) \u2013

      Whether to display the textual block (including admonitions) in the object's docstring. Default: True.

    • show_docstring_examples (bool) \u2013

      Whether to display the \"Examples\" section in the object's docstring. Default: True.

    • show_docstring_other_parameters (bool) \u2013

      Whether to display the \"Other Parameters\" section in the object's docstring. Default: True.

    • show_docstring_parameters (bool) \u2013

      Whether to display the \"Parameters\" section in the object's docstring. Default: True.

    • show_docstring_raises (bool) \u2013

      Whether to display the \"Raises\" section in the object's docstring. Default: True.

    • show_docstring_receives (bool) \u2013

      Whether to display the \"Receives\" section in the object's docstring. Default: True.

    • show_docstring_returns (bool) \u2013

      Whether to display the \"Returns\" section in the object's docstring. Default: True.

    • show_docstring_warns (bool) \u2013

      Whether to display the \"Warns\" section in the object's docstring. Default: True.

    • show_docstring_yields (bool) \u2013

      Whether to display the \"Yields\" section in the object's docstring. Default: True.

    Signatures/annotations options:

    • annotations_path (str) \u2013

      The verbosity for annotations path: brief (recommended), or source (as written in the source). Default: \"brief\".

    • line_length (int) \u2013

      Maximum line length when formatting code/signatures. Default: 60.

    • show_signature (bool) \u2013

      Show methods and functions signatures. Default: True.

    • show_signature_annotations (bool) \u2013

      Show the type annotations in methods and functions signatures. Default: False.

    • signature_crossrefs (bool) \u2013

      Whether to render cross-references for type annotations in signatures. Default: False.

    • separate_signature (bool) \u2013

      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) \u2013

      Whether to unwrap Annotated types to show only the type without the annotations. Default: False.

    • modernize_annotations (bool) \u2013

      Whether to modernize annotations, for example Optional[str] into str | None. Default: False.

    "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.domain","title":"domain class-attribute instance-attribute","text":"
    domain: str = 'py'\n

    The cross-documentation domain/language for this handler.

    "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.enable_inventory","title":"enable_inventory class-attribute instance-attribute","text":"
    enable_inventory: bool = True\n

    Whether this handler is interested in enabling the creation of the objects.inv Sphinx inventory file.

    "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.extra_css","title":"extra_css class-attribute instance-attribute","text":"
    extra_css = ''\n

    Extra CSS.

    "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.fallback_config","title":"fallback_config class-attribute","text":"
    fallback_config: dict = {'fallback': True}\n

    The configuration used to collect item during autorefs fallback.

    "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.fallback_theme","title":"fallback_theme class-attribute instance-attribute","text":"
    fallback_theme = 'material'\n

    The fallback theme.

    "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.name","title":"name class-attribute instance-attribute","text":"
    name: str = ''\n

    The handler's name, for example \"python\".

    "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.do_convert_markdown","title":"do_convert_markdown","text":"
    do_convert_markdown(\n    text: str,\n    heading_level: int,\n    html_id: str = \"\",\n    *,\n    strip_paragraph: bool = False\n) -> Markup\n

    Render Markdown text; for use inside templates.

    Parameters:

    • "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.do_convert_markdown(text)","title":"text","text":"(str) \u2013

      The text to convert.

      "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.do_convert_markdown(heading_level)","title":"heading_level","text":"(int) \u2013

      The base heading level to start all Markdown headings from.

      "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.do_convert_markdown(html_id)","title":"html_id","text":"(str, default: '' ) \u2013

      The HTML id of the element that's considered the parent of this element.

      "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.do_convert_markdown(strip_paragraph)","title":"strip_paragraph","text":"(bool, default: False ) \u2013

      Whether to exclude the

      tag from around the whole output.

      Returns:

      • Markup \u2013

        An HTML string.

      "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.do_heading","title":"do_heading","text":"
      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

      Render an HTML heading and register it for the table of contents. For use inside templates.

      Parameters:

      Returns:

      • Markup \u2013

        An HTML string.

      "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.do_heading(content)","title":"content","text":"(Markup) \u2013

      The HTML within the heading.

      "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.do_heading(heading_level)","title":"heading_level","text":"(int) \u2013

      The level of heading (e.g. 3 -> h3).

      "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.do_heading(role)","title":"role","text":"(str | None, default: None ) \u2013

      An optional role for the object bound to this heading.

      "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.do_heading(hidden)","title":"hidden","text":"(bool, default: False ) \u2013

      If True, only register it for the table of contents, don't render anything.

      "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.do_heading(toc_label)","title":"toc_label","text":"(str | None, default: None ) \u2013

      The title to use in the table of contents ('data-toc-label' attribute).

      "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.do_heading(**attributes)","title":"**attributes","text":"(str, default: {} ) \u2013

      Any extra HTML attributes of the heading.

      "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.get_extended_templates_dirs","title":"get_extended_templates_dirs","text":"
      get_extended_templates_dirs(handler: str) -> list[Path]\n

      Load template extensions for the given handler, return their templates directories.

      Parameters:

      Returns:

      • list[Path] \u2013

        The extensions templates directories.

      "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.get_extended_templates_dirs(handler)","title":"handler","text":"(str) \u2013

      The name of the handler to get the extended templates directory of.

      "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.get_headings","title":"get_headings","text":"
      get_headings() -> Sequence[Element]\n

      Return and clear the headings gathered so far.

      Returns:

      • Sequence[Element] \u2013

        A list of HTML elements.

      "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.get_templates_dir","title":"get_templates_dir","text":"
      get_templates_dir(handler: str | None = None) -> Path\n

      Return the path to the handler's templates directory.

      Override to customize how the templates directory is found.

      Parameters:

      Raises:

      • ModuleNotFoundError \u2013

        When no such handler is installed.

      • FileNotFoundError \u2013

        When the templates directory cannot be found.

      Returns:

      • Path \u2013

        The templates directory path.

      "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.get_templates_dir(handler)","title":"handler","text":"(str | None, default: None ) \u2013

      The name of the handler to get the templates directory of.

      "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.load_inventory","title":"load_inventory 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

      Yield items and their URLs from an inventory file streamed from in_file.

      This implements mkdocstrings' load_inventory \"protocol\" (see mkdocstrings.plugin).

      Parameters:

      Yields:

      • str \u2013

        Tuples of (item identifier, item URL).

      "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.load_inventory(in_file)","title":"in_file","text":"(BinaryIO) \u2013

      The binary file-like object to read the inventory from.

      "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.load_inventory(url)","title":"url","text":"(str) \u2013

      The URL that this file is being streamed from (used to guess base_url).

      "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.load_inventory(base_url)","title":"base_url","text":"(str | None, default: None ) \u2013

      The URL that this inventory's sub-paths are relative to.

      "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.load_inventory(domains)","title":"domains","text":"(list[str] | None, default: None ) \u2013

      A list of domain strings to filter the inventory by, when not passed, \"py\" will be used.

      "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.load_inventory(**kwargs)","title":"**kwargs","text":"(Any, default: {} ) \u2013

      Ignore additional arguments passed from the config.

      "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.normalize_extension_paths","title":"normalize_extension_paths","text":"
      normalize_extension_paths(extensions: Sequence) -> Sequence\n

      Resolve extension paths relative to config file.

      "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.PythonHandler.teardown","title":"teardown","text":"
      teardown() -> None\n

      Teardown the handler.

      This method should be implemented to, for example, terminate a subprocess that was started when creating the handler instance.

      "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.get_handler","title":"get_handler","text":"
      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

      Simply return an instance of PythonHandler.

      Parameters:

      Returns:

      • PythonHandler \u2013

        An instance of PythonHandler.

      "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.get_handler(theme)","title":"theme","text":"(str) \u2013

      The theme to use when rendering contents.

      "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.get_handler(custom_templates)","title":"custom_templates","text":"(str | None, default: None ) \u2013

      Directory containing custom templates.

      "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.get_handler(config_file_path)","title":"config_file_path","text":"(str | None, default: None ) \u2013

      The MkDocs configuration file path.

      "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.get_handler(paths)","title":"paths","text":"(list[str] | None, default: None ) \u2013

      A list of paths to use as Griffe search paths.

      "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.get_handler(locale)","title":"locale","text":"(str, default: 'en' ) \u2013

      The locale to use when rendering content.

      "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.get_handler(load_external_modules)","title":"load_external_modules","text":"(bool, default: False ) \u2013

      Load external modules when resolving aliases.

      "},{"location":"reference/mkdocstrings_handlers/python/handler/#mkdocstrings_handlers.python.handler.get_handler(**config)","title":"**config","text":"(Any, default: {} ) \u2013

      Configuration passed to the handler.

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/","title":"mkdocstrings_handlers.python.rendering","text":""},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering","title":"rendering","text":"

      This module implements rendering utilities.

      Classes:

      • Order \u2013

        Enumeration for the possible members ordering.

      Functions:

      • do_as_attributes_section \u2013

        Build an attributes section from a list of attributes.

      • do_as_classes_section \u2013

        Build a classes section from a list of classes.

      • do_as_functions_section \u2013

        Build a functions section from a list of functions.

      • do_as_modules_section \u2013

        Build a modules section from a list of modules.

      • do_crossref \u2013

        Deprecated. Filter to create cross-references.

      • do_filter_objects \u2013

        Filter a dictionary of objects based on their docstrings.

      • do_format_attribute \u2013

        Format an attribute using Black.

      • do_format_code \u2013

        Format code using Black.

      • do_format_signature \u2013

        Format a signature using Black.

      • do_get_template \u2013

        Get the template name used to render an object.

      • do_multi_crossref \u2013

        Deprecated. Filter to create cross-references.

      • do_order_members \u2013

        Order members given an ordering method.

      • do_split_path \u2013

        Split object paths for building cross-references.

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.Order","title":"Order","text":"
      \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          

      Enumeration for the possible members ordering.

      Attributes:

      • alphabetical \u2013

        Alphabetical order.

      • source \u2013

        Source code order.

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.Order.alphabetical","title":"alphabetical class-attribute instance-attribute","text":"
      alphabetical = 'alphabetical'\n

      Alphabetical order.

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.Order.source","title":"source class-attribute instance-attribute","text":"
      source = 'source'\n

      Source code order.

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_as_attributes_section","title":"do_as_attributes_section","text":"
      do_as_attributes_section(\n    context: Context,\n    attributes: Sequence[Attribute],\n    *,\n    check_public: bool = True\n) -> DocstringSectionAttributes\n

      Build an attributes section from a list of attributes.

      Parameters:

      Returns:

      • DocstringSectionAttributes \u2013

        An attributes docstring section.

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_as_attributes_section(attributes)","title":"attributes","text":"(Sequence[Attribute]) \u2013

      The attributes to build the section from.

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_as_attributes_section(check_public)","title":"check_public","text":"(bool, default: True ) \u2013

      Whether to check if the attribute is public.

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_as_classes_section","title":"do_as_classes_section","text":"
      do_as_classes_section(\n    context: Context,\n    classes: Sequence[Class],\n    *,\n    check_public: bool = True\n) -> DocstringSectionClasses\n

      Build a classes section from a list of classes.

      Parameters:

      Returns:

      • DocstringSectionClasses \u2013

        A classes docstring section.

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_as_classes_section(classes)","title":"classes","text":"(Sequence[Class]) \u2013

      The classes to build the section from.

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_as_classes_section(check_public)","title":"check_public","text":"(bool, default: True ) \u2013

      Whether to check if the class is public.

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_as_functions_section","title":"do_as_functions_section","text":"
      do_as_functions_section(\n    context: Context,\n    functions: Sequence[Function],\n    *,\n    check_public: bool = True\n) -> DocstringSectionFunctions\n

      Build a functions section from a list of functions.

      Parameters:

      Returns:

      • DocstringSectionFunctions \u2013

        A functions docstring section.

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_as_functions_section(functions)","title":"functions","text":"(Sequence[Function]) \u2013

      The functions to build the section from.

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_as_functions_section(check_public)","title":"check_public","text":"(bool, default: True ) \u2013

      Whether to check if the function is public.

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_as_modules_section","title":"do_as_modules_section","text":"
      do_as_modules_section(\n    context: Context,\n    modules: Sequence[Module],\n    *,\n    check_public: bool = True\n) -> DocstringSectionModules\n

      Build a modules section from a list of modules.

      Parameters:

      Returns:

      • DocstringSectionModules \u2013

        A modules docstring section.

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_as_modules_section(modules)","title":"modules","text":"(Sequence[Module]) \u2013

      The modules to build the section from.

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_as_modules_section(check_public)","title":"check_public","text":"(bool, default: True ) \u2013

      Whether to check if the module is public.

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_crossref","title":"do_crossref","text":"
      do_crossref(path: str, *, brief: bool = True) -> Markup\n

      Deprecated. Filter to create cross-references.

      Parameters:

      Returns:

      • Markup \u2013

        Markup text.

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_crossref(path)","title":"path","text":"(str) \u2013

      The path to link to.

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_crossref(brief)","title":"brief","text":"(bool, default: True ) \u2013

      Show only the last part of the path, add full path as hover.

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_filter_objects","title":"do_filter_objects","text":"
      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

      Filter a dictionary of objects based on their docstrings.

      Parameters:

      Returns:

      • list[Object | Alias] \u2013

        A list of objects.

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_filter_objects(objects_dictionary)","title":"objects_dictionary","text":"(dict[str, Object | Alias]) \u2013

      The dictionary of objects.

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_filter_objects(filters)","title":"filters","text":"(Sequence[tuple[Pattern, bool]] | None, default: None ) \u2013

      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.

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_filter_objects(members_list)","title":"members_list","text":"(bool | list[str] | None, default: None ) \u2013

      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.

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_filter_objects(inherited_members)","title":"inherited_members","text":"(bool | list[str], default: False ) \u2013

      Whether to keep inherited members or exclude them.

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_filter_objects(keep_no_docstrings)","title":"keep_no_docstrings","text":"(bool, default: True ) \u2013

      Whether to keep objects with no/empty docstrings (recursive check).

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_format_attribute","title":"do_format_attribute","text":"
      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

      Format an attribute using Black.

      Parameters:

      Returns:

      • str \u2013

        The same code, formatted.

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_format_attribute(context)","title":"context","text":"(Context) \u2013

      Jinja context, passed automatically.

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_format_attribute(attribute_path)","title":"attribute_path","text":"(Markup) \u2013

      The path of the callable we render the signature of.

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_format_attribute(attribute)","title":"attribute","text":"(Attribute) \u2013

      The attribute we render the signature of.

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_format_attribute(line_length)","title":"line_length","text":"(int) \u2013

      The line length to give to Black.

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_format_attribute(crossrefs)","title":"crossrefs","text":"(bool, default: False ) \u2013

      Whether to cross-reference types in the signature.

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_format_code","title":"do_format_code","text":"
      do_format_code(code: str, line_length: int) -> str\n

      Format code using Black.

      Parameters:

      Returns:

      • str \u2013

        The same code, formatted.

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_format_code(code)","title":"code","text":"(str) \u2013

      The code to format.

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_format_code(line_length)","title":"line_length","text":"(int) \u2013

      The line length to give to Black.

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_format_signature","title":"do_format_signature","text":"
      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

      Format a signature using Black.

      Parameters:

      Returns:

      • str \u2013

        The same code, formatted.

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_format_signature(context)","title":"context","text":"(Context) \u2013

      Jinja context, passed automatically.

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_format_signature(callable_path)","title":"callable_path","text":"(Markup) \u2013

      The path of the callable we render the signature of.

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_format_signature(function)","title":"function","text":"(Function) \u2013

      The function we render the signature of.

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_format_signature(line_length)","title":"line_length","text":"(int) \u2013

      The line length to give to Black.

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_format_signature(annotations)","title":"annotations","text":"(bool | None, default: None ) \u2013

      Whether to show type annotations.

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_format_signature(crossrefs)","title":"crossrefs","text":"(bool, default: False ) \u2013

      Whether to cross-reference types in the signature.

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_get_template","title":"do_get_template","text":"
      do_get_template(obj: Object) -> str\n

      Get the template name used to render an object.

      Parameters:

      Returns:

      • str \u2013

        A template name.

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_get_template(obj)","title":"obj","text":"(Object) \u2013

      A Griffe object.

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_multi_crossref","title":"do_multi_crossref","text":"
      do_multi_crossref(\n    text: str, *, code: bool = True\n) -> Markup\n

      Deprecated. Filter to create cross-references.

      Parameters:

      Returns:

      • Markup \u2013

        Markup text.

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_multi_crossref(text)","title":"text","text":"(str) \u2013

      The text to scan.

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_multi_crossref(code)","title":"code","text":"(bool, default: True ) \u2013

      Whether to wrap the result in a code tag.

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_order_members","title":"do_order_members","text":"
      do_order_members(\n    members: Sequence[Object | Alias],\n    order: Order,\n    members_list: bool | list[str] | None,\n) -> Sequence[Object | Alias]\n

      Order members given an ordering method.

      Parameters:

      Returns:

      • Sequence[Object | Alias] \u2013

        The same members, ordered.

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_order_members(members)","title":"members","text":"(Sequence[Object | Alias]) \u2013

      The members to order.

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_order_members(order)","title":"order","text":"(Order) \u2013

      The ordering method.

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_order_members(members_list)","title":"members_list","text":"(bool | list[str] | None) \u2013

      An optional member list (manual ordering).

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_split_path","title":"do_split_path","text":"
      do_split_path(\n    path: str, full_path: str\n) -> list[tuple[str, str]]\n

      Split object paths for building cross-references.

      Parameters:

      Returns:

      • list[tuple[str, str]] \u2013

        A list of pairs (title, full path).

      "},{"location":"reference/mkdocstrings_handlers/python/rendering/#mkdocstrings_handlers.python.rendering.do_split_path(path)","title":"path","text":"(str) \u2013

      The path to split.

      "},{"location":"usage/","title":"Usage","text":"

      This is the documentation for the NEW Python handler.

      To read the documentation for the LEGACY handler, go to the legacy handler documentation.

      "},{"location":"usage/#installation","title":"Installation","text":"

      You can install this handler as a mkdocstrings extra:

      pyproject.toml
      # PEP 621 dependencies declaration\n# adapt to your dependencies manager\n[project]\ndependencies = [\n    \"mkdocstrings[python]>=0.18\",\n]\n

      You can also explicitly depend on the handler:

      pyproject.toml
      # PEP 621 dependencies declaration\n# adapt to your dependencies manager\n[project]\ndependencies = [\n    \"mkdocstrings-python\",\n]\n

      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:

      mkdocs.yml
      plugins:\n- mkdocstrings:\n    default_handler: python\n
      "},{"location":"usage/#injecting-documentation","title":"Injecting documentation","text":"

      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\n

      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\n    handler: python\n
      "},{"location":"usage/#configuration","title":"Configuration","text":"

      When installed, the Python handler becomes the default mkdocstrings handler. You can configure it in mkdocs.yml:

      mkdocs.yml
      plugins:\n- mkdocstrings:\n    handlers:\n      python:\n        ...  # the Python handler configuration\n
      "},{"location":"usage/#global-only-options","title":"Global-only options","text":"

      Some options are global only, and go directly under the handler's name.

      "},{"location":"usage/#import","title":"import","text":"

      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:

      mkdocs.yml
      plugins:\n- mkdocstrings:\n    handlers:\n      python:\n        import:\n        - https://docs.python-requests.org/en/master/objects.inv\n

      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:

      mkdocs.yml
      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

      Note

      The import option is common to all handlers, however they might implement it differently, or not even implement it.

      "},{"location":"usage/#paths","title":"paths","text":"

      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:

      mkdocs.yml
      plugins:\n- mkdocstrings:\n    handlers:\n      python:\n        paths: [src]  # search packages in the src folder\n

      More details at Finding modules.

      "},{"location":"usage/#load_external_modules","title":"load_external_modules","text":"

      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:

      mkdocs.yml
      plugins:\n- mkdocstrings:\n    handlers:\n      python:\n        load_external_modules: true\n
      "},{"location":"usage/#globallocal-options","title":"Global/local options","text":"

      The other options can be used both globally and locally, under the options key. For example, globally:

      mkdocs.yml
      plugins:\n- mkdocstrings:\n    handlers:\n      python:\n        options:\n          do_something: true\n

      ...and locally, overriding the global configuration:

      docs/some_page.md
      ::: package.module.class\n    options:\n      do_something: false\n

      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:

      • General options: various options that do not fit in the other categories
      • Headings options: options related to headings and the table of contents (or sidebar, depending on the theme used)
      • Members options: options related to filtering or ordering members in the generated documentation
      • Docstrings options: options related to docstrings (parsing and rendering)
      • Signature options: options related to signatures and type annotations
      "},{"location":"usage/#options-summary","title":"Options summary","text":"

      Default handler configuration.

      General options:

      • find_stubs_package (bool) \u2013

        Whether to load stubs package (package-stubs) when extracting docstrings. Default False.

      • allow_inspection (bool) \u2013

        Whether to allow inspecting modules when visiting them is not possible. Default: True.

      • show_bases (bool) \u2013

        Show the base classes of a class. Default: True.

      • show_inheritance_diagram (bool) \u2013

        Show the inheritance diagram of a class using Mermaid. Default: False.

      • show_source (bool) \u2013

        Show the source code of this object. Default: True.

      • preload_modules (list[str] | None) \u2013

        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) \u2013

        The initial heading level to use. Default: 2.

      • parameter_headings (bool) \u2013

        Whether to render headings for parameters (therefore showing parameters in the ToC). Default: False.

      • show_root_heading (bool) \u2013

        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) \u2013

        If the root heading is not shown, at least add a ToC entry for it. Default: True.

      • show_root_full_path (bool) \u2013

        Show the full Python path for the root object heading. Default: True.

      • show_root_members_full_path (bool) \u2013

        Show the full Python path of the root members. Default: False.

      • show_object_full_path (bool) \u2013

        Show the full Python path of every object. Default: False.

      • show_category_heading (bool) \u2013

        When grouped by categories, show a heading for each category. Default: False.

      • show_symbol_type_heading (bool) \u2013

        Show the symbol type in headings (e.g. mod, class, meth, func and attr). Default: False.

      • show_symbol_type_toc (bool) \u2013

        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) \u2013

        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) \u2013

        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) \u2013

        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) \u2013

        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) \u2013

        Group the object's children by categories: attributes, classes, functions, and modules. Default: True.

      • show_submodules (bool) \u2013

        When rendering a module, show its submodules recursively. Default: False.

      • summary (bool | dict[str, bool]) \u2013

        Whether to render summaries of modules, classes, functions (methods) and attributes.

      • show_labels (bool) \u2013

        Whether to show labels of the members. Default: True.

      Docstrings options:

      • docstring_style (str) \u2013

        The docstring style to use: google, numpy, sphinx, or None. Default: \"google\".

      • docstring_options (dict) \u2013

        The options for the docstring parser. See parsers under griffe.docstrings.

      • docstring_section_style (str) \u2013

        The style used to render docstring sections. Options: table, list, spacy. Default: \"table\".

      • merge_init_into_class (bool) \u2013

        Whether to merge the __init__ method into the class' signature and docstring. Default: False.

      • show_if_no_docstring (bool) \u2013

        Show the object heading even if it has no docstring or children with docstrings. Default: False.

      • show_docstring_attributes (bool) \u2013

        Whether to display the \"Attributes\" section in the object's docstring. Default: True.

      • show_docstring_functions (bool) \u2013

        Whether to display the \"Functions\" or \"Methods\" sections in the object's docstring. Default: True.

      • show_docstring_classes (bool) \u2013

        Whether to display the \"Classes\" section in the object's docstring. Default: True.

      • show_docstring_modules (bool) \u2013

        Whether to display the \"Modules\" section in the object's docstring. Default: True.

      • show_docstring_description (bool) \u2013

        Whether to display the textual block (including admonitions) in the object's docstring. Default: True.

      • show_docstring_examples (bool) \u2013

        Whether to display the \"Examples\" section in the object's docstring. Default: True.

      • show_docstring_other_parameters (bool) \u2013

        Whether to display the \"Other Parameters\" section in the object's docstring. Default: True.

      • show_docstring_parameters (bool) \u2013

        Whether to display the \"Parameters\" section in the object's docstring. Default: True.

      • show_docstring_raises (bool) \u2013

        Whether to display the \"Raises\" section in the object's docstring. Default: True.

      • show_docstring_receives (bool) \u2013

        Whether to display the \"Receives\" section in the object's docstring. Default: True.

      • show_docstring_returns (bool) \u2013

        Whether to display the \"Returns\" section in the object's docstring. Default: True.

      • show_docstring_warns (bool) \u2013

        Whether to display the \"Warns\" section in the object's docstring. Default: True.

      • show_docstring_yields (bool) \u2013

        Whether to display the \"Yields\" section in the object's docstring. Default: True.

      Signatures/annotations options:

      • annotations_path (str) \u2013

        The verbosity for annotations path: brief (recommended), or source (as written in the source). Default: \"brief\".

      • line_length (int) \u2013

        Maximum line length when formatting code/signatures. Default: 60.

      • show_signature (bool) \u2013

        Show methods and functions signatures. Default: True.

      • show_signature_annotations (bool) \u2013

        Show the type annotations in methods and functions signatures. Default: False.

      • signature_crossrefs (bool) \u2013

        Whether to render cross-references for type annotations in signatures. Default: False.

      • separate_signature (bool) \u2013

        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) \u2013

        Whether to unwrap Annotated types to show only the type without the annotations. Default: False.

      • modernize_annotations (bool) \u2013

        Whether to modernize annotations, for example Optional[str] into str | None. Default: False.

      "},{"location":"usage/#finding-modules","title":"Finding modules","text":"

      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.

      "},{"location":"usage/#using-the-paths-option","title":"Using the paths option","text":"

      This is the recommended method.

      1. 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

        mkdocs.yml
        plugins:\n- mkdocstrings:\n    handlers:\n      python:\n        paths: [.]  # actually not needed, default\n
      2. 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.yml
        plugins:\n- mkdocstrings:\n    handlers:\n      python:\n        paths: [src]\n
      3. 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.yml
        plugins:\n- mkdocstrings:\n    handlers:\n      python:\n        paths: [..]\n
      4. 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.yml
        plugins:\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.

      "},{"location":"usage/#using-the-pythonpath-environment-variable","title":"Using the PYTHONPATH environment variable","text":"

      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=...):

      1. 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
      2. 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
      3. 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
      4. 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
      "},{"location":"usage/#installing-your-package-in-the-current-python-environment","title":"Installing your package in the current Python environment","text":"

      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":"

      The following CSS classes are used in the generated HTML:

      • doc: on all the following elements
      • doc-children: on divs containing the children of an object
      • doc-object: on divs containing an object
        • doc-attribute: on divs containing an attribute
        • doc-class: on divs containing a class
        • doc-function: on divs containing a function
        • doc-module: on divs containing a module
      • doc-heading: on objects headings
        • doc-object-name: on spans wrapping objects names/paths in the heading
          • doc-KIND-name: as above, specific to the kind of object (module, class, function, attribute)
      • doc-contents: on divs wrapping the docstring then the children (if any)
        • first: same, but only on the root object's contents div
      • doc-labels: on spans wrapping the object's labels
        • doc-label: on small elements containing a label
          • doc-label-LABEL: same, where LABEL is replaced by the actual label
      • doc-md-description: on divs containing HTML descriptions converted from Markdown docstrings
      • doc-symbol: on code tags of symbol types
        • doc-symbol-heading: on symbol types in headings
        • doc-symbol-toc: on symbol types in the ToC
        • doc-symbol-KIND: specific to the kind of object (module, class, function, method, attribute)

      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:

      docs/css/mkdocstrings.css
      [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:

      docs/css/mkdocstrings.css
      :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:

      "},{"location":"usage/customization/#names","title":"Names","text":"

      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

      • Parameter:
      • Attribute:
      • Function:
      • Method:
      • Class:
      • Module:
      "},{"location":"usage/customization/#templates","title":"Templates","text":"

      Templates are organized into the following tree:

      \ud83d\udcc1 theme/\n\u251c\u2500\u2500 \ud83d\udcc4 attribute.html\n\u251c\u2500\u2500 \ud83d\udcc4 children.html\n\u251c\u2500\u2500 \ud83d\udcc4 class.html\n\u251c\u2500\u2500 \ud83d\udcc1 docstring/\n\u2502   \u251c\u2500\u2500 \ud83d\udcc4 admonition.html\n\u2502   \u251c\u2500\u2500 \ud83d\udcc4 attributes.html\n\u2502   \u251c\u2500\u2500 \ud83d\udcc4 classes.html\n\u2502   \u251c\u2500\u2500 \ud83d\udcc4 examples.html\n\u2502   \u251c\u2500\u2500 \ud83d\udcc4 functions.html\n\u2502   \u251c\u2500\u2500 \ud83d\udcc4 modules.html\n\u2502   \u251c\u2500\u2500 \ud83d\udcc4 other_parameters.html\n\u2502   \u251c\u2500\u2500 \ud83d\udcc4 parameters.html\n\u2502   \u251c\u2500\u2500 \ud83d\udcc4 raises.html\n\u2502   \u251c\u2500\u2500 \ud83d\udcc4 receives.html\n\u2502   \u251c\u2500\u2500 \ud83d\udcc4 returns.html\n\u2502   \u251c\u2500\u2500 \ud83d\udcc4 warns.html\n\u2502   \u2514\u2500\u2500 \ud83d\udcc4 yields.html\n\u251c\u2500\u2500 \ud83d\udcc4 docstring.html\n\u251c\u2500\u2500 \ud83d\udcc4 expression.html\n\u251c\u2500\u2500 \ud83d\udcc4 function.html\n\u251c\u2500\u2500 \ud83d\udcc4 labels.html\n\u251c\u2500\u2500 \ud83d\udcc4 language.html\n\u251c\u2500\u2500 \ud83d\udcc1 languages/\n\u2502   \u251c\u2500\u2500 \ud83d\udcc4 en.html\n\u2502   \u251c\u2500\u2500 \ud83d\udcc4 ja.html\n\u2502   \u2514\u2500\u2500 \ud83d\udcc4 zh.html\n\u251c\u2500\u2500 \ud83d\udcc4 module.html\n\u251c\u2500\u2500 \ud83d\udcc4 signature.html\n\u251c\u2500\u2500 \ud83d\udcc1 summary/\n\u2502   \u251c\u2500\u2500 \ud83d\udcc4 attributes.html\n\u2502   \u251c\u2500\u2500 \ud83d\udcc4 classes.html\n\u2502   \u251c\u2500\u2500 \ud83d\udcc4 functions.html\n\u2502   \u2514\u2500\u2500 \ud83d\udcc4 modules.html\n\u2514\u2500\u2500 \ud83d\udcc4 summary.html\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:

      theme/class.html
      {% 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.
      "},{"location":"usage/customization/#classhtml","title":"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.
      "},{"location":"usage/customization/#functionhtml","title":"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.
      "},{"location":"usage/customization/#attributehtml","title":"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.
      "},{"location":"usage/customization/#docstring-sections","title":"Docstring sections","text":"

      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).
      "},{"location":"usage/customization/#syntax-highlight-in-signatures","title":"Syntax highlight in signatures","text":"

      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.

      "},{"location":"usage/customization/#style-recommendations","title":"Style recommendations","text":""},{"location":"usage/customization/#material","title":"Material","text":"

      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:

      griffe_extension.py
      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":"
      • Type 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.
      in mkdocs.yml (global configuration)
      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.

      GoogleNumpySphinx
      def 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_optionsPrintOKPrintOK","text":"
      • Type dict {}

      The options for the docstring parser.

      • Google-style options
      • Numpydoc-style options

      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            >>> Class()  # doctest: +NORMALIZE_WHITESPACE\n            ok\n        \"\"\"\n        print(\"ok\")\n

      Preview

      Ignore init summary, trim doctest flagsKeep init summary and doctest flags

      Class docstring.

      __init__

      Examples:

      >>> Class()\nok\n

      Class docstring.

      __init__

      Initialize the instance.

      Examples:

      >>> Class()  # doctest: +NORMALIZE_WHITESPACE\nok\n
      "},{"location":"usage/configuration/docstrings/#docstring_section_style","title":"docstring_section_style","text":"
      • Type 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 documentation
      in mkdocs.yml (global configuration)
      plugins:\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

      TableListSpacy

      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:

      • 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 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"},{"location":"usage/configuration/docstrings/#merge_init_into_class","title":"merge_init_into_classThing(value=0)Thing","text":"
      • Type 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.

      in mkdocs.yml (global configuration)
      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 kept

      Class docstring.

      Parameters:

      Type Name Description Default int value The thing's value. 0

      Class docstring.

      __init__(value=0)

      Initialize a thing.

      Parameters:

      Type Name Description Default int value The thing's value. 0"},{"location":"usage/configuration/docstrings/#show_if_no_docstring","title":"show_if_no_docstringfunction_without_docstringfunction_with_docstringClassWithoutDocstringfunction_with_docstringClassWithoutDocstring","text":"
      • Type 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 show

      Hello.

      method_without_docstring method_with_docstring

      Hello.

      Hello.

      method_with_docstring

      Hello.

      "},{"location":"usage/configuration/docstrings/#show_docstring_attributes","title":"show_docstring_attributesClassClass","text":"
      • Type 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 attributes

      Summary.

      Attributes:

      Type Name Description int attr Some attribute.

      Summary.

      "},{"location":"usage/configuration/docstrings/#show_docstring_functions","title":"show_docstring_functionsmodulemodule","text":"
      • Type 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 functions

      Summary.

      Functions:

      Name Description foo Some function. Class

      Summary.

      Methods:

      Name Description bar Some method.

      Summary.

      Class

      Summary.

      "},{"location":"usage/configuration/docstrings/#show_docstring_classes","title":"show_docstring_classesmodulemodule","text":"
      • Type 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 classes

      Summary.

      Classes:

      Name Description Class Some class. Class

      Summary.

      Summary.

      Class

      Summary.

      "},{"location":"usage/configuration/docstrings/#show_docstring_modules","title":"show_docstring_modulesmodulemodule","text":"
      • Type 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 modules

      Summary.

      Modules:

      Name Description submodule Some module.

      Summary.

      "},{"location":"usage/configuration/docstrings/#show_docstring_description","title":"show_docstring_descriptionClassClass","text":"
      • Type 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 blocks

      Summary.

      Long description.

      Deprecated

      Stop using this class.

      Attributes:

      Type Name Description int attr Some attribute.

      Attributes:

      Type Name Description int attr Some attribute."},{"location":"usage/configuration/docstrings/#show_docstring_examples","title":"show_docstring_examplesprint_helloprint_hello","text":"
      • Type 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 examples

      Print hello.

      Examples:

      >>> print(\"hello\")\nhello\n

      Print hello.

      "},{"location":"usage/configuration/docstrings/#show_docstring_other_parameters","title":"show_docstring_other_parametersdo_somethingdo_something","text":"
      • Type 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 parameters

      Do something.

      Other parameters:

      Type Name Description int whatever Some integer.

      Do something.

      "},{"location":"usage/configuration/docstrings/#show_docstring_parameters","title":"show_docstring_parametersdo_somethingdo_something","text":"
      • Type 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 parameters

      Do something.

      Parameters:

      Type Name Description Default int whatever Some integer. 0

      Do something.

      "},{"location":"usage/configuration/docstrings/#show_docstring_raises","title":"show_docstring_raisesraise_runtime_errorraise_runtime_error","text":"
      • Type 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 exceptions

      Raise a runtime error.

      Raises:

      Type Description RuntimeError Not good.

      Raise a runtime error.

      "},{"location":"usage/configuration/docstrings/#show_docstring_receives","title":"show_docstring_receivesiter_skipiter_skip","text":"
      • Type 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 values

      Iterate and skip elements.

      Receives:

      Type Description int Number of elements to skip.

      Iterate and skip elements.

      "},{"location":"usage/configuration/docstrings/#show_docstring_returns","title":"show_docstring_returnsrandrand","text":"
      • Type 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 value

      Return a random number.

      Returns:

      Type Description int A random number.

      Return a random number.

      "},{"location":"usage/configuration/docstrings/#show_docstring_warns","title":"show_docstring_warnswarnwarn","text":"
      • Type 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 warnings

      Warn user.

      Warns:

      Type Description UserWarning When this is inappropriate.

      Warn user.

      "},{"location":"usage/configuration/docstrings/#show_docstring_yields","title":"show_docstring_yieldsiter_skipiter_skip","text":"
      • Type 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 values

      Iterate and skip elements.

      Yields:

      Type Description T Elements of the iterable.

      Iterate and skip elements.

      "},{"location":"usage/configuration/general/","title":"General options","text":""},{"location":"usage/configuration/general/#allow_inspection","title":"allow_inspectionSomeClassSomeClass","text":"
      • Type 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 inspection

      Docstring 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_basesSomeClass()SomeClass()","text":"
      • Type 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 bases

      Bases: 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

      • Type 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.yml
      extra_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_sourcesome_function()some_function()","text":"
      • Type 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 source

      Docstring of the function.

      Source code in package/module.py
      def some_function():\n    ...\n

      Docstring of the function.

      "},{"location":"usage/configuration/general/#preload_modules","title":"preload_modulesyour_moduleyour_module","text":"
      • Type 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).

      in mkdocs.yml (global configuration)
      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.py
      from their_package.their_module import their_object\n\n__all__ = [\"their_object\"]\n\n# rest of your code\n

      Preview

      With preloaded modulesWithout preloaded modules

      Docstring of your module.

      their_object

      Docstring of their object.

      Docstring of your module.

      "},{"location":"usage/configuration/general/#find_stubs_package","title":"find_stubs_packageyour_funcyour_func","text":"
      • Type 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.

      in mkdocs.yml (global configuration)
      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.py
      def your_func(a, b):\n    # Function code\n    ...\n\n# rest of your code\n
      your_package-stubs/your_module.pyi
      def 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_package

      Function docstring

      "},{"location":"usage/configuration/headings/","title":"Headings options","text":""},{"location":"usage/configuration/headings/#heading_level","title":"heading_level","text":"
      • Type 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 heading 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.

      "},{"location":"usage/configuration/headings/#parameter_headings","title":"parameter_headings","text":"

      Sponsors only \u2014 Insiders 1.6.0

      • Type 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.

      in mkdocs.yml (global configuration)
      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 Default str

      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.

      "},{"location":"usage/configuration/headings/#package.get_version(dist)","title":"dist","text":"(str, default: 'mkdocstrings-python' ) \u2013

      A distribution name.

      "},{"location":"usage/configuration/headings/#package.current_version","title":"current_version module-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_headingClassA (2)ClassB (2)method_a1 (2)method_b1 (2)","text":"
      • Type 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 heading

      Docstring 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":"
      • Type 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 entry

      Table 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_pathpackage.module.Class.methodmethod","text":"
      • Type 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.

      in mkdocs.yml (global configuration)
      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 path

      Docstring of the method.

      Docstring of the method.

      "},{"location":"usage/configuration/headings/#show_root_members_full_path","title":"show_root_members_full_pathpackage.module.ClassClass","text":"
      • Type 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.

      in mkdocs.yml (global configuration)
      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 path

      Docstring 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_pathpackage.module.ClassClass","text":"
      • Type 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 path

      Docstring 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_headingAttributes (2)Classes (2)module_attribute (2)Class (2)","text":"
      • Type 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 headings

      Docstring 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 ClassattributefunctionClass","text":"

      Insiders 1.1.0

      • Type 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

      • Type 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
        • method
      • module
      • attribute
      • function
      • Class
        • method
      "},{"location":"usage/configuration/members/","title":"Members options","text":""},{"location":"usage/configuration/members/#members","title":"membersthis_functionThisClassthis_attributeThisClass","text":"
      • Type 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).

      in mkdocs.yml (global configuration)
      plugins:\n- mkdocstrings:\n    handlers:\n      python:\n        options:\n          members:\n          - hello  # (1)\n
      1. Most of the time it won't make sense to use this option at the global level.
      or in docs/some_page.md (local configuration)
      ::: 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

      With members: trueWith 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.

      "},{"location":"usage/configuration/members/#inherited_members","title":"inherited_membersBaseMainBaseMain","text":"
      • Type 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
      1. In this case, only declared members will be subject to further filtering with filters and docstrings.
      inherited_members: true  # (1)\n# members: null\n
      1. In this case, both declared and inherited members will be subject to further filtering with 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 members

      Module 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_orderfunction_afunction_bfunction_cfunction_bfunction_afunction_c","text":"
      • Type 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.

      in mkdocs.yml (global configuration)
      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 order

      Module docstring.

      Function a.

      Function b.

      Function c.

      Module docstring.

      Function b.

      Function a.

      Function c.

      "},{"location":"usage/configuration/members/#filters","title":"filtershello_worldhello_world","text":"
      • Type 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).

      in mkdocs.yml (global configuration)
      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.py
      def hello():\n    ...\n\n\ndef _world():\n    ...\n

      Preview

      With filters: []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)
      "},{"location":"usage/configuration/members/#group_by_category","title":"group_by_categoryattribute_cClassBfunction_afunction_dfunction_aClassBattribute_cfunction_d","text":"
      • Type 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.

      in mkdocs.yml (global configuration)
      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.py
      def 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 grouping

      Module 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_submodulessubpackage_membersubmodulesubpackage_member","text":"
      • Type 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 submodules

      Subpackage docstring.

      Member docstring.

      Submodule docstring.

      submodule_member

      Member docstring.

      Subpackage docstring.

      Member docstring.

      "},{"location":"usage/configuration/members/#summary","title":"summaryMyClassMyClass","text":"

      Sponsors only \u2014 Insiders 1.2.0

      • Type 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.

      in mkdocs.yml (global configuration)
      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:

      • my_method1: Summary of the method (first docstring line).
      • my_method2: Summary of the method (first docstring line).

      Attributes:

      • attr1: Summary of the attribute (first docstring line).
      • attr2: Summary of the attribute (first docstring line).
      ::: path.to.module.MyClass\n    options:\n      summary:\n        functions: true\n

      Class docstring.

      Methods:

      • my_method1: Summary of the method (first docstring line).
      • my_method2: Summary of the method (first docstring line).
      "},{"location":"usage/configuration/members/#show_labels","title":"show_labels","text":"
      • Type 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.py
      class SomeClass:\n    some_attr: int\n

      Preview

      With labelsWithout labels

      some_attr: int instance-attribute

      some_attr: int

      "},{"location":"usage/configuration/signatures/","title":"Signatures options","text":""},{"location":"usage/configuration/signatures/#annotations_path","title":"annotations_pathconvert(text, md)convert(text, md)convert(text, md)","text":"
      • Type 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.
      in mkdocs.yml (global configuration)
      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 annotations
      import 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 Default str The text to convert. required Markdown A Markdown instance. required

      Returns:

      Type Name Description Markup 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 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\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 Default str The text to convert. required markdown.Markdown A Markdown instance. required

      Returns:

      Type Name Description markupsafe.Markup text Converted markup."},{"location":"usage/configuration/signatures/#line_length","title":"line_lengthlong_function_namelong_function_name","text":"
      • Type 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 80
      long_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.

      • Type 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
      in mkdocs.yml (global configuration)
      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: int | list[int] | None = None\n
      "},{"location":"usage/configuration/signatures/#show_signature","title":"show_signaturefunction(param1, param2=None)function","text":"
      • Type 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 signature

      Function docstring.

      Function docstring.

      "},{"location":"usage/configuration/signatures/#show_signature_annotations","title":"show_signature_annotationsfunctionfunction","text":"
      • Type 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 annotations
      function(\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_signaturefunctionfunction(param1, param2=None)","text":"
      • Type 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 signature
      function(param1, param2=None)\n

      Function docstring.

      Function docstring.

      "},{"location":"usage/configuration/signatures/#signature_crossrefs","title":"signature_crossrefsdo_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.

      in mkdocs.yml (global configuration)
      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-references
      do_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":"
      • Type 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.

      in mkdocs.yml (global configuration)
      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.gz b/sitemap.xml.gz index 84a1a14e0669b67cb941675c2bf025e292cdece6..e6b6f48bd12dcda6edd3a82dc5854dbc353d37e2 100644 GIT binary patch delta 15 WcmZ3%yn>lczMF$%>ynLZix>eV9R$h% delta 15 WcmZ3%yn>lczMF$1$9E&!B1Qlqv;-;u diff --git a/snippets/package/modern.py b/snippets/package/modern.py new file mode 100644 index 00000000..c992b5df --- /dev/null +++ b/snippets/package/modern.py @@ -0,0 +1,3 @@ +from typing import Optional, Union, List + +example: Optional[Union[int, List[int]]] = None diff --git a/usage/configuration/signatures/index.html b/usage/configuration/signatures/index.html index 66ad6a75..59e87f25 100644 --- a/usage/configuration/signatures/index.html +++ b/usage/configuration/signatures/index.html @@ -1,4 +1,4 @@ - Signatures - mkdocstrings-python

      Signatures options¤

      annotations_path¤

      • Type 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.
      in mkdocs.yml (global configuration)
      plugins:
      + Signatures - mkdocstrings-python      

      Signatures options¤

      annotations_path¤

      • Type 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.
      in mkdocs.yml (global configuration)
      plugins:
       - mkdocstrings:
           handlers:
             python:
      @@ -66,7 +66,21 @@
       

      Preview

      long_function_name

      long_function_name(
           long_parameter_1="hello",
           long_parameter_2="world",
      -)

      long_function_name

      long_function_name(long_parameter_1="hello", long_parameter_2="world")

      show_signature¤

      Show methods and functions signatures.

      Without it, just the function/method name is rendered.

      in mkdocs.yml (global configuration)
      plugins:
      +)

      long_function_name

      long_function_name(long_parameter_1="hello", long_parameter_2="world")

      modernize_annotations¤

      Sponsors only Insiders 1.8.0This feature also requires Griffe Insiders to be installed.

      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
      in mkdocs.yml (global configuration)
      plugins:
      +- mkdocstrings:
      +    handlers:
      +      python:
      +        options:
      +          modernize_annotations: true
      +
      or in docs/some_page.md (local configuration)
      ::: path.to.object
      +    options:
      +      modernize_annotations: false
      +

      Preview

      from typing import Optional, Union, List
      +
      +example: Optional[Union[int, List[int]]] = None
      +

      example ¤

      example: Optional[Union[int, List[int]]] = None
      +

      example ¤

      example: int | list[int] | None = None
      +

      show_signature¤

      Show methods and functions signatures.

      Without it, just the function/method name is rendered.

      in mkdocs.yml (global configuration)
      plugins:
       - mkdocstrings:
           handlers:
             python:
      @@ -75,7 +89,7 @@
       
      or in docs/some_page.md (local configuration)
      ::: path.to.module
           options:
             show_signature: false
      -

      Preview

      function(param1, param2=None)

      Function docstring.

      function

      Function docstring.

      show_signature_annotations¤

      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:
      +

      Preview

      function(param1, param2=None)

      Function docstring.

      function

      Function docstring.

      show_signature_annotations¤

      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:
       - mkdocstrings:
           handlers:
             python:
      @@ -86,7 +100,7 @@
           options:
             separate_signature: true
             show_signature_annotations: false
      -

      Preview

      function

      function(
      +

      Preview

      function

      function(
           param1: list[int | float],
           param2: bool | None = None,
       ) -> float
      @@ -100,7 +114,7 @@
       
      or in docs/some_page.md (local configuration)
      ::: path.to.module
           options:
             separate_signature: true
      -

      Preview

      function

      function(param1, param2=None)
      +

      Preview

      function

      function(param1, param2=None)
       

      Function docstring.

      function(param1, param2=None)

      Function docstring.

      signature_crossrefs¤

      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.

      in mkdocs.yml (global configuration)
      plugins:
       - mkdocstrings:
           handlers:
      @@ -114,7 +128,7 @@
             separate_signature: true
             show_signature_annotations: true
             signature_crossrefs: true
      -

      Preview

      do_format_code

      do_format_code(code: str, line_length: int) -> str
      +

      Preview

      do_format_code

      do_format_code(code: str, line_length: int) -> str
       

      Function docstring.

      do_format_code

      do_format_code(code: str, line_length: int) -> str
       

      Function docstring.

      unwrap_annotated¤

      Whether to unwrap Annotated types to show only the type without the annotations.

      For example, unwrapping Annotated[int, Gt(10)] will render int.

      in mkdocs.yml (global configuration)
      plugins:
       - mkdocstrings:
      diff --git a/usage/index.html b/usage/index.html
      index f4b8beaf..3db50dec 100644
      --- a/usage/index.html
      +++ b/usage/index.html
      @@ -53,7 +53,7 @@
       

      ...and locally, overriding the global configuration:

      docs/some_page.md
      ::: 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:

      • General options: various options that do not fit in the other categories
      • Headings options: options related to headings and the table of contents (or sidebar, depending on the theme used)
      • Members options: options related to filtering or ordering members in the generated documentation
      • Docstrings options: options related to docstrings (parsing and rendering)
      • Signature options: options related to signatures and type annotations

      Options summary¤

      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_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.

      Finding modules¤

      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.

      Using the paths option¤

      This is the recommended method.

      1. mkdocs.yml in root, package in root

        📁 root/
        +

        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:

        • General options: various options that do not fit in the other categories
        • Headings options: options related to headings and the table of contents (or sidebar, depending on the theme used)
        • Members options: options related to filtering or ordering members in the generated documentation
        • Docstrings options: options related to docstrings (parsing and rendering)
        • Signature options: options related to signatures and type annotations

        Options summary¤

        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.

        Finding modules¤

        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.

        Using the paths option¤

        This is the recommended method.

        1. mkdocs.yml in root, package in root

          📁 root/
           ├── 📄 mkdocs.yml
           └── 📁 package/
           

          mkdocs.yml
          plugins: