diff options
author | Arthur Zamarin <arthurzam@gentoo.org> | 2022-11-15 13:21:30 +0200 |
---|---|---|
committer | Arthur Zamarin <arthurzam@gentoo.org> | 2022-11-15 13:21:30 +0200 |
commit | efcc7f32cc73b84b9012c4de88110a9d07bbfb40 (patch) | |
tree | c3d7cacd35027014119fc406c59cd10df07a6bfc /doc | |
parent | pquery: fix crash with verbose single uris attr (diff) | |
download | pkgcore-efcc7f32cc73b84b9012c4de88110a9d07bbfb40.tar.gz pkgcore-efcc7f32cc73b84b9012c4de88110a9d07bbfb40.tar.bz2 pkgcore-efcc7f32cc73b84b9012c4de88110a9d07bbfb40.zip |
docs: use snakeoil.dist sphinx extension
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/conf.py | 65 |
1 files changed, 13 insertions, 52 deletions
diff --git a/doc/conf.py b/doc/conf.py index 6165ae91..f1838214 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -11,22 +11,6 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import os -import sys -from importlib import import_module - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.path.abspath('../src/')) - -os.environ['PKGDIST_REPODIR'] = os.path.abspath('..') -from snakeoil.dist import distutils_extensions as pkgdist -from snakeoil.dist.generate_docs import generate_man, generate_html - -on_rtd = os.environ.get('READTHEDOCS', None) == 'True' - - # -- General configuration ----------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. @@ -35,10 +19,16 @@ on_rtd = os.environ.get('READTHEDOCS', None) == 'True' # 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.extlinks', 'sphinx.ext.autosummary', - 'sphinx.ext.autodoc', 'sphinx.ext.doctest', - 'sphinx.ext.intersphinx', 'sphinx.ext.todo', 'sphinx.ext.coverage', - 'sphinx.ext.ifconfig', 'sphinx.ext.viewcode', + 'sphinx.ext.extlinks', + 'sphinx.ext.autosummary', + 'sphinx.ext.autodoc', + 'sphinx.ext.doctest', + 'sphinx.ext.intersphinx', + 'sphinx.ext.todo', + 'sphinx.ext.coverage', + 'sphinx.ext.ifconfig', + 'sphinx.ext.viewcode', + 'snakeoil.dist.sphinxext', ] # Add any paths that contain templates here, relative to this directory. @@ -58,14 +48,8 @@ project = 'pkgcore' authors = '' copyright = '2006-2022, pkgcore contributors' -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The short X.Y version. -version = pkgdist.module_version() -# The full version, including alpha/beta/rc tags. -release = 'trunk' +# version is set by snakeoil extension +release = 'master' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -102,9 +86,6 @@ pygments_style = 'sphinx' #modindex_common_prefix = [] # auto-generate required files for RTD build environment -if on_rtd: - pkgdist.generate_man() - pkgdist.generate_html() # -- Options for HTML output --------------------------------------------------- @@ -226,33 +207,13 @@ latex_documents = [ # -- Options for manual page output -------------------------------------------- -generate_man(os.path.abspath('..'), '', 'pkgcore') -generate_html(os.path.abspath('..'), os.path.abspath('../src'), 'pkgcore') - -if sys.version_info >= (3, 11): - import tomllib -else: - import tomli as tomllib - -with open('../pyproject.toml', 'rb') as file: - pyproj = tomllib.load(file) - -generated_man_pages = [ - (entry.split(':')[0], name) for name, entry in pyproj['project']['scripts'].items() -] -authors_list = [ - f'{author["name"]} <{author["email"]}>' for author in pyproj['project']['authors'] -] # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ - (f'man/{script}', script, import_module(module).__doc__.strip().split('\n', 1)[0], authors_list, 1) - for module, script in generated_man_pages + ('man/pkgcore', 'pkgcore', 'a framework for package management', None, 5) ] -man_pages.append(('man/pkgcore', 'pkgcore', 'a framework for package management', authors_list, 5)) - # -- Options for Epub output --------------------------------------------------- # Bibliographic Dublin Core info. |