Use Sphinx book theme for documentation

This commit is contained in:
Cédric Krier
2023-09-01 09:44:09 +02:00
parent 6d4b80cd6d
commit 6a06579e13
619 changed files with 4728 additions and 416 deletions
+3
View File
@@ -3,5 +3,8 @@ build:
os: ubuntu-22.04
tools:
python: "3"
python:
install:
- requirements: trytond-gis/doc/requirements-doc.txt
sphinx:
configuration: trytond-gis/doc/conf.py
+18 -2
View File
@@ -22,9 +22,10 @@ def get_info():
info = dict()
result = subprocess.run(
[sys.executable, 'setup.py', '--name'],
[sys.executable, 'setup.py', '--name', '--description'],
stdout=subprocess.PIPE, check=True, cwd=module_dir)
info['name'] = result.stdout.decode('utf-8').strip()
info['name'], info['description'] = (
result.stdout.decode('utf-8').strip().splitlines())
result = subprocess.run(
[sys.executable, 'setup.py', '--version'],
@@ -35,20 +36,35 @@ def get_info():
minor_version = int(minor_version)
if minor_version % 2:
info['series'] = 'latest'
info['branch'] = 'branch/default'
else:
info['series'] = '.'.join(version.split('.', 2)[:2])
info['branch'] = 'branch/' + info['series']
return info
info = get_info()
html_theme = 'sphinx_book_theme'
html_theme_options = {
'repository_provider': 'gitlab',
'repository_url': 'https://code.tryton.org/tryton',
'repository_branch': info['branch'],
'use_source_button': True,
'use_edit_page_button': True,
'use_repository_button': True,
'use_download_button': False,
'path_to_docs': 'trytond-gis/doc',
}
html_title = info['description']
master_doc = 'index'
project = info['name']
release = version = info['series']
default_role = 'ref'
highlight_language = 'none'
extensions = [
'sphinx_copybutton',
'sphinx.ext.intersphinx',
]
intersphinx_mapping = {
+2
View File
@@ -0,0 +1,2 @@
sphinx_book_theme
sphinx_copybutton