Cédric Krier pushed to branch branch/6.4 at Tryton / Tryton


Commits:
00866239 by Cédric Krier at 2022-12-18T21:29:13+01:00
Prepare migration to monorepo
- - - - -


2 changed files:

- + modules/commission/doc/conf.py
- modules/commission/doc/index.rst


Changes:

=====================================
modules/commission/doc/conf.py
=====================================
@@ -0,0 +1,69 @@
+# This file is part of Tryton.  The COPYRIGHT file at the top level of
+# this repository contains the full copyright notices and license terms.
+
+import os
+
+base_url = os.environ.get('DOC_BASE_URL')
+if base_url:
+    modules_url = base_url + '/modules-{module}/'
+    trytond_url = base_url + '/server/'
+else:
+    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 configparser
+    import subprocess
+    import sys
+
+    module_dir = os.path.dirname(os.path.dirname(__file__))
+
+    config = configparser.ConfigParser()
+    config.read_file(open(os.path.join(module_dir, 'tryton.cfg')))
+    info = dict(config.items('tryton'))
+
+    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])
+
+    for key in {'depends', 'extras_depend'}:
+        info[key] = info.get(key, '').strip().splitlines()
+    info['modules'] = set(info['depends'] + info['extras_depend'])
+    info['modules'] -= {'ir', 'res'}
+
+    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 = {
+    'trytond': (trytond_url.format(series=version), None),
+    }
+intersphinx_mapping.update({
+        m: (modules_url.format(
+                module=m.replace('_', '-'), series=version), None)
+        for m in info['modules']
+        })
+linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*']
+
+del get_info, info, base_url, modules_url, trytond_url


=====================================
modules/commission/doc/index.rst
=====================================
@@ -30,8 +30,8 @@
 Line
 ----
 
-- The *Formula* is a Python expression that will be evaluated with `amount` as
-  the invoiced amount.
+- The *Formula* is a Python expression that will be evaluated with ``amount``
+  as the invoiced amount.
 
 The criteria:
 



View it on Heptapod: 
https://foss.heptapod.net/tryton/tryton/-/commit/0086623958c1151cd49f40ba19dd03f9c7bea414

-- 
View it on Heptapod: 
https://foss.heptapod.net/tryton/tryton/-/commit/0086623958c1151cd49f40ba19dd03f9c7bea414
You're receiving this email because of your account on foss.heptapod.net.


Reply via email to