Skip to content

Instantly share code, notes, and snippets.

@lelit
Created October 17, 2023 08:40
Show Gist options
  • Save lelit/6630bdbedfba31c8d8c214ea08e4ef8e to your computer and use it in GitHub Desktop.
Save lelit/6630bdbedfba31c8d8c214ea08e4ef8e to your computer and use it in GitHub Desktop.
Sphinx test
# 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']

Welcome to Sample's documentation!

.. toctree::
   :maxdepth: 2
   :caption: Contents:


.. autoclass:: sample.Foo
   :members:

.. autoclass:: sample.Bar
   :members:



Indices and tables

# 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"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment