Use Sphinx book theme for documentation
This commit is contained in:
@@ -3,5 +3,8 @@ build:
|
||||
os: ubuntu-22.04
|
||||
tools:
|
||||
python: "3"
|
||||
python:
|
||||
install:
|
||||
- requirements: modules/trytond_account_statement_ofx/doc/requirements-doc.txt
|
||||
sphinx:
|
||||
configuration: modules/account_statement_ofx/doc/conf.py
|
||||
|
||||
@@ -25,9 +25,10 @@ def get_info():
|
||||
info = dict(config.items('tryton'))
|
||||
|
||||
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'],
|
||||
@@ -38,8 +39,10 @@ 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']
|
||||
|
||||
for key in {'depends', 'extras_depend'}:
|
||||
info[key] = info.get(key, '').strip().splitlines()
|
||||
@@ -51,12 +54,25 @@ def get_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': 'modules/account_statement_ofx/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 = {
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
sphinx_book_theme
|
||||
sphinx_copybutton
|
||||
Reference in New Issue
Block a user