.. toctree:: :maxdepth: 2 :caption: Contents:
.. autoclass:: sample.Foo :members:
.. autoclass:: sample.Bar :members:
# Configuration file for the Sphinx documentation builder. | |
# | |
# For the full list of built-in configuration values, see the documentation: | |
# https://www.sphinx-doc.org/en/master/usage/configuration.html | |
# -- Project information ----------------------------------------------------- | |
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information | |
project = 'Sample' | |
copyright = '2023, Lele' | |
author = 'Lele' | |
release = '1.0' | |
# -- General configuration --------------------------------------------------- | |
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration | |
extensions = ['sphinx.ext.autodoc'] | |
templates_path = ['_templates'] | |
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] | |
# -- Options for HTML output ------------------------------------------------- | |
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output | |
html_theme = 'alabaster' | |
html_static_path = ['_static'] |
# Minimal makefile for Sphinx documentation | |
# | |
# You can set these variables from the command line, and also | |
# from the environment for the first two. | |
SPHINXOPTS ?= | |
SPHINXBUILD ?= sphinx-build | |
SOURCEDIR = . | |
BUILDDIR = _build | |
# Put it first so that "make" without argument is like "make help". | |
help: | |
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | |
.PHONY: help Makefile | |
# Catch-all target: route all unknown targets to Sphinx using the new | |
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). | |
%: Makefile | |
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
import typing | |
class Foo: | |
"This is a base class" | |
metadata: dict = {} | |
"This is something" | |
if False: | |
hidden: bool = True | |
"This is something that should be visible only when TYPE_CHECKING is True" | |
class Bar(Foo): | |
"This is a derivated class" |