5 import sphinx_rtd_theme
7 sphinx_rtd_theme
= None
9 import rst
.linker
as rst_linker
13 # Add the source tree and extras/ to sys.path.
14 srcdir
= os
.path
.dirname(os
.path
.dirname(os
.path
.abspath(__file__
)))
15 extrasdir
= os
.path
.join(srcdir
, 'extras')
16 sys
.path
.insert(0, srcdir
)
17 sys
.path
.insert(1, extrasdir
)
23 'sphinx.ext.coverage',
25 # https://github.com/git-cola/git-cola/issues/1250
26 # https://github.com/jaraco/jaraco.packaging/issues/7
27 # 'jaraco.packaging.sphinx',
31 html_theme
= 'default'
33 # {package_url} is provided py jaraco.packaging.sphinx when available
34 # for use in the rst.linker configuration. We expand the value manually for now.
35 package_url
= 'https://gitlab.com/git-cola/git-cola'
37 # Link dates and other references in the changelog
38 if rst_linker
is not None:
39 extensions
+= ['rst.linker']
42 '../CHANGES.rst': dict(
43 using
=dict(GH
='https://github.com', package_url
=package_url
),
46 pattern
=r
'(Issue #|\B#)(?P<issue>\d+)',
47 url
='{package_url}/issues/{issue}',
50 pattern
=r
'(?m:^((?P<scm_version>v?\d+(\.\d+){1,2}))\n[-=]+\n)',
51 with_scm
='{text}\n{rev[timestamp]:%d %b %Y}\n',
54 pattern
=r
'PEP[- ](?P<pep_number>\d+)',
55 url
='https://www.python.org/dev/peps/pep-{pep_number:0>4}/',
61 # Be strict about any broken references
64 extensions
+= ['sphinx.ext.intersphinx']
65 intersphinx_mapping
= {
66 'python': ('https://docs.python.org/3', None),
67 'sphinx': ('https://www.sphinx-doc.org/en/stable/', None),
70 # Preserve authored syntax for defaults
71 autodoc_preserve_defaults
= True
73 # Get the version from cola/_version.py.
74 versionfile
= os
.path
.join(srcdir
, 'cola', '_version.py')
76 with
open(versionfile
) as f
:
79 version
= scope
['VERSION'] # The short X.Y version.
80 release
= version
# The full version, including alpha/beta/rc tags.
82 authors
= 'David Aguilar and contributors'
84 ('git-cola', 'git-cola', 'The highly caffeinated Git GUI', authors
, '1'),
85 ('git-dag', 'git-dag', 'The sleek and powerful Git history browser', authors
, '1'),
88 # Sphinx 4.0 creates sub-directories for each man section.
89 # Disable this feature for consistency across Sphinx versions.
90 man_make_section_directory
= False
92 # Enable the sphinx_rtd_theme.
93 if sphinx_rtd_theme
is not None:
94 extensions
+= ['sphinx_rtd_theme']
95 html_theme
= 'sphinx_rtd_theme'