-
-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: include classname for class members #79
Labels
feature
New feature or request
Comments
Have you tried the following? plugins:
- mkdocstrings:
handlers:
python:
options:
show_root_full_path: false
show_root_members_full_path: true Docs: https://mkdocstrings.github.io/python/usage/configuration/headings/#show_root_members_full_path EDIT: ah, I understand now. No, there's no such option. I'm open to adding one 🙂 |
Now that we have Jinja blocks in our templates, it's a bit easier to implement that with custom templates: # mkdocs.yml
plugins:
- mkdocstrings:
custom_templates: docs/templates
... In {% extends "_base/function.html" %}
{%- macro method_heading(function) -%}
{%- if show_full_path -%}
{{ function.path }}
{%- elif function.parent.is_class -%}
{{ function.parent.name }}.{{ function.name }}
{%- else -%}
{{ function.name }}
{%- endif -%}
{%- endmacro -%}
{% block heading %}
{% if config.separate_signature %}
<span class="doc doc-object-name doc-function-name">{{ method_heading(function) }}</span>
{% else %}
{% filter highlight(language="python", inline=True) %}
{{ method_heading(function) }}
{% include "signature.html" with context %}
{% endfilter %}
{% endif %}
{% endblock heading %}
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Could there be an option (or options) to achieve a more python style headers for module members and class members.
In the python's own documentation, the full path of each class and object is not included. But for class members, the class name is included. Taking a random example, the module
zipfile
contains a classzipfile.ZipFile
. All of the methods on that class are written asZipFile.close()
,ZipFile.getinfo()
, ... See here: https://docs.python.org/3/library/zipfile.html#zipfile.ZipFile.closeThe "include_full_path` options produce very verbose results.
The text was updated successfully, but these errors were encountered: