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',
28 html_theme
= 'default'
30 # {package_url} can be provided py jaraco.packaging.sphinx but we
31 # expand the value manually to avoid the dependency.
32 package_url
= 'https://gitlab.com/git-cola/git-cola'
36 # Link dates and other references in the changelog
37 if rst_linker
is not None:
38 extensions
+= ['rst.linker']
41 '../CHANGES.rst': dict(
42 using
=dict(GH
='https://github.com', package_url
=package_url
),
45 pattern
=r
'(Issue #|\B#)(?P<issue>\d+)',
46 url
='{package_url}/issues/{issue}',
49 pattern
=r
'(?m:^((?P<scm_version>v?\d+(\.\d+){1,2}))\n[-=]+\n)',
50 with_scm
='{text}\n{rev[timestamp]:%d %b %Y}\n',
53 pattern
=r
'PEP[- ](?P<pep_number>\d+)',
54 url
='https://www.python.org/dev/peps/pep-{pep_number:0>4}/',
60 # Be strict about any broken references
63 # Preserve authored syntax for defaults
64 autodoc_preserve_defaults
= True
66 # Get the version from cola/_version.py.
67 versionfile
= os
.path
.join(srcdir
, 'cola', '_version.py')
69 with
open(versionfile
) as f
:
72 version
= scope
['VERSION'] # The short X.Y version.
73 release
= version
# The full version, including alpha/beta/rc tags.
75 authors
= 'David Aguilar and contributors'
77 ('git-cola', 'git-cola', 'The highly caffeinated Git GUI', authors
, '1'),
78 ('git-dag', 'git-dag', 'The sleek and powerful Git history browser', authors
, '1'),
81 # Sphinx 4.0 creates sub-directories for each man section.
82 # Disable this feature for consistency across Sphinx versions.
83 man_make_section_directory
= False
85 # Enable the sphinx_rtd_theme.
86 if sphinx_rtd_theme
is not None:
87 extensions
+= ['sphinx_rtd_theme']
88 html_theme
= 'sphinx_rtd_theme'