Skip to content

Commit

Permalink
Do not show __init__ method in document
Browse files Browse the repository at this point in the history
  • Loading branch information
knshnb committed Apr 27, 2023
1 parent df31abe commit 93f0251
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions docs/_templates/autosummary/class.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{% extends "!autosummary/class.rst" %}

{#
Ref: https://github.com/optuna/optuna/blob/41045cef7a8f5d0e5e4026bf0c5c649b269fc312/docs/source/_templates/autosummary/class.rst
An autosummary template to exclude the class constructor (__init__)
which doesn't contain any docstring in Optuna Dashboard.
#}

{% block methods %}
{% set methods = methods | select("ne", "__init__") | list %}
{% if methods %}
.. rubric:: Methods

.. autosummary::
{% for item in methods %}
~{{ name }}.{{ item }}
{%- endfor %}
{% endif %}

{% endblock %}

0 comments on commit 93f0251

Please sign in to comment.