python-efl/doc/conf.py

200 lines
6.5 KiB
Python
Raw Normal View History

# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
2021-11-17 22:22:27 -08:00
# pylint: disable=invalid-name
import os
import sys
import platform
# -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here.
2021-11-17 22:22:27 -08:00
d = 'lib.%s-%s-%d.%d' % (
platform.system().lower(),
platform.machine(),
sys.version_info[0],
sys.version_info[1]
)
sys.path.insert(0, os.path.abspath('../build/' + d))
# sys.path.insert(0, os.path.abspath('../build/lib.linux-i686-3.2'))
2014-08-16 06:42:03 -07:00
# Delete any previously imported efl package
2021-11-17 22:22:27 -08:00
if 'efl' in sys.modules:
del sys.modules['efl']
2014-08-16 06:42:03 -07:00
# -- Project information -----------------------------------------------------
2021-11-17 22:22:27 -08:00
project = 'Python EFL'
author = 'The Python-EFL community (see AUTHORS)'
2022-02-27 10:07:34 -08:00
copyright = '2008-2022, ' + author # pylint: disable=redefined-builtin
# -- General configuration ----------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
needs_sphinx = '3.1'
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.coverage',
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The master toctree document.
# master_doc = 'index'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['_build']
# -- Autodoc configuration -----------------------------------------------------
autodoc_default_options = {
'members': True, # show methods for classes
'show-inheritance': True, # show bases class
'member-order': 'alphabetical', # bysource, alphabetical, groupwise
'no-undoc-members': True, # dont show members without docstring
'no-inherited-members': True, # dont show members from parent classes
}
# both the class and the __init__ methods docstring are concatenated
autoclass_content = 'both'
def setup(app):
app.connect('autodoc-process-signature', autodoc_process_signature)
2021-11-17 22:22:27 -08:00
def autodoc_process_signature(_app, what, _name, _obj, _options, signature, return_annotation):
"""Cleanup params: remove the 'self' param and all the cython types"""
if what not in ('function', 'method'):
2021-11-17 22:22:27 -08:00
return None
2021-11-17 22:22:27 -08:00
params = []
for param in (p.strip() for p in signature[1:-1].split(',')):
if param != 'self':
params.append(param.rpartition(' ')[2])
return ('(%s)' % ', '.join(params), return_annotation)
# -- Inheritance Diagram ------------------------------------------------------
try:
2021-11-17 22:22:27 -08:00
import gv # pylint: disable=unused-import
except ImportError:
pass
else:
extensions.append('sphinx.ext.inheritance_diagram')
# svg scale better (look at the full elm dia)
# but svg links are broken :(
graphviz_output_format = 'png' # png (default) or svg
inheritance_graph_attrs = dict(
2021-11-17 22:22:27 -08:00
bgcolor = 'gray25', #404040
)
inheritance_node_attrs = dict(
2021-11-17 22:22:27 -08:00
style = 'rounded', # or 'filled',
# fillcolor = 'gray20', # bg color (should be #CCCCCC)
color = 'gray10', # border color (should be #202020)
fontcolor = 'white',
font = 'sans',
)
inheritance_edge_attrs = dict(
2021-11-17 22:22:27 -08:00
color = 'dodgerblue3', # arrow color (should be #4399FF)
dir = 'none', # arrow direction (back, forward, both or none)
)
# -- Options for HTML output ---------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
# html_theme = 'alabaster' # Default sphinx theme
# html_theme = 'default' # Classic python style
# html_theme = 'sphinxdoc' # Much modern sphinx style
# html_theme = 'sphinx13' # The latest one from the sphinx site
html_theme = 'efldoc' # Our custom EFL dark style
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
html_theme_path = ['themes']
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
#html_title = None
# A shorter title for the navigation bar. Default is the same as html_title.
2021-11-17 22:22:27 -08:00
html_short_title = 'Python EFL'
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
2021-11-17 22:22:27 -08:00
html_logo = 'images/logo.png'
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
2021-11-17 22:22:27 -08:00
html_favicon = 'images/logo.ico'
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['images']
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
html_last_updated_fmt = '%b %d, %Y'
# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_additional_pages = {}
# If false, no module index is generated.
#html_domain_indices = True
# If false, no index is generated.
#html_use_index = True
# If true, the index is split into individual pages for each letter.
#html_split_index = False
# If true, links to the reST sources are added to the pages.
html_show_sourcelink = False
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
#html_show_sphinx = True
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
#html_show_copyright = True
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
#html_use_opensearch = ''
# This is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = None
# Output file base name for HTML help builder.
htmlhelp_basename = 'PythonEFLdoc'