Files
tryton/trytond/doc/conf.py
T

49 lines
1.3 KiB
Python

# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
modules_url = 'https://docs.tryton.org/projects/modules-{module}/en/{series}/'
trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/'
def get_info():
import os
import subprocess
import sys
module_dir = os.path.dirname(os.path.dirname(__file__))
info = dict()
result = subprocess.run(
[sys.executable, 'setup.py', '--name'],
stdout=subprocess.PIPE, check=True, cwd=module_dir)
info['name'] = result.stdout.decode('utf-8').strip()
result = subprocess.run(
[sys.executable, 'setup.py', '--version'],
stdout=subprocess.PIPE, check=True, cwd=module_dir)
version = result.stdout.decode('utf-8').strip()
if 'dev' in version:
info['series'] = 'latest'
else:
info['series'] = '.'.join(version.split('.', 2)[:2])
return info
info = get_info()
master_doc = 'index'
project = info['name']
release = version = info['series']
default_role = 'ref'
highlight_language = 'none'
extensions = [
'sphinx.ext.intersphinx',
]
intersphinx_mapping = {
'python': ('https://docs.python.org/', None),
}
del get_info, info, modules_url, trytond_url