maint: code formatting
[git-cola.git] / share / doc / git-cola / conf.py
blobcee22dcb221c163a6f3ff440af478fc1d2de8f5f
1 # -*- coding: utf-8 -*-
2 import os
3 import sys
5 try:
6 import sphinx_rtd_theme
7 except ImportError:
8 sphinx_rtd_theme = None
10 # Add the cola source directory to sys.path
11 abspath = os.path.abspath(os.path.realpath(__file__))
12 docdir = os.path.dirname(os.path.dirname(abspath))
13 srcdir = os.path.dirname(os.path.dirname(docdir))
14 extrasdir = os.path.join(srcdir, 'extras')
15 sys.path.insert(1, extrasdir)
17 extensions = [
18 'sphinx.ext.autodoc',
19 'sphinx.ext.doctest',
20 'sphinx.ext.todo',
21 'sphinx.ext.coverage',
22 'sphinxtogithub',
23 'jaraco.packaging.sphinx',
24 'rst.linker',
26 if sphinx_rtd_theme:
27 extensions.append('sphinx_rtd_theme')
29 templates_path = ['_templates']
30 source_suffix = '.rst'
31 source_encoding = 'utf-8'
32 master_doc = 'index'
34 project = 'git-cola'
35 copyright = '2007-2022, David Aguilar and contributors'
36 authors = 'David Aguilar and contributors'
38 versionfile = os.path.join(srcdir, 'cola', '_version.py')
39 scope = {}
40 with open(versionfile) as f:
41 exec(f.read(), scope)
43 # The short X.Y version.
44 version = scope['VERSION']
45 # The full version, including alpha/beta/rc tags.
46 release = version
48 exclude_trees = ['_build']
49 add_function_parentheses = True
50 pygments_style = 'default'
52 if sphinx_rtd_theme:
53 html_theme = 'sphinx_rtd_theme'
54 html_theme_path = ['_themes']
55 html_static_path = ['_static']
56 html_show_sourcelink = True
57 htmlhelp_basename = 'git-cola-doc'
59 man_pages = [
60 ('git-cola', 'git-cola', 'The highly caffeinated Git GUI', authors, '1'),
61 ('git-dag', 'git-dag', 'The sleek and powerful Git history browser', authors, '1'),
64 # Sphinx 4.0 creates sub-directories for each man section.
65 # Disable this feature for consistency across Sphinx versions.
66 man_make_section_directory = False
68 latex_documents = [
70 'index',
71 'git-cola.tex',
72 'git-cola Documentation',
73 'David Aguilar and contributors',
74 'manual',
78 # Example configuration for intersphinx: refer to the Python standard library.
79 intersphinx_mapping = {'https://docs.python.org/3': None}
81 link_files = {
82 '../../../CHANGES.rst': dict(
83 using=dict(GH='https://github.com'),
84 replace=[
85 dict(
86 pattern=r'(Issue #|\B#)(?P<issue>\d+)',
87 url='{package_url}/issues/{issue}',
89 dict(
90 pattern=r'\B\+(?P<pull>\d+)',
91 url='{package_url}/pull/{pull}',
93 dict(
94 pattern=r'^(?m)((?P<scm_version>v?\d+(\.\d+){1,2}))\n[-=]+\n',
95 with_scm='{text}\n{rev[timestamp]:%d %b %Y}\n',
97 dict(
98 pattern=r'PEP[- ](?P<pep_number>\d+)',
99 url='https://www.python.org/dev/peps/pep-{pep_number:0>4}/',