Documentation: Use Sphinx's extlinks to cut down on repeated URLs. Merge Administration and Maintenance topics. Add database conversion chapter. Unify the header format of all recent release notes. Fix :doc: references.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
49
docs/conf.py
49
docs/conf.py
@@ -33,7 +33,9 @@ sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "_ext"))
|
||||
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
|
||||
#extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode']
|
||||
#extensions = ["djangodocs", "sphinx.ext.intersphinx"]
|
||||
extensions = ['sphinxcontrib.blockdiag', 'sphinxcontrib.spelling']
|
||||
extensions = [
|
||||
'sphinx.ext.extlinks', 'sphinxcontrib.blockdiag', 'sphinxcontrib.spelling'
|
||||
]
|
||||
|
||||
blockdiag_antialias = True
|
||||
blockdiag_html_image_format = "SVG"
|
||||
@@ -233,34 +235,17 @@ man_pages = [
|
||||
|
||||
html_theme = 'sphinx_rtd_theme'
|
||||
|
||||
from docutils import nodes, utils
|
||||
from docutils.parsers.rst import roles
|
||||
from sphinx.roles import _amp_re
|
||||
|
||||
def patched_menusel_role(typ, rawtext, text, lineno, inliner, options={}, content=[]):
|
||||
text = utils.unescape(text)
|
||||
if typ == 'menuselection':
|
||||
text = text.replace('-->', 'qwe\N{RIGHTWARDS ARROW}') # Here is the patch
|
||||
spans = _amp_re.split(text)
|
||||
|
||||
node = nodes.emphasis(rawtext=rawtext)
|
||||
for i, span in enumerate(spans):
|
||||
span = span.replace('&&', '&')
|
||||
if i == 0:
|
||||
if len(span) > 0:
|
||||
textnode = nodes.Text(span)
|
||||
node += textnode
|
||||
continue
|
||||
accel_node = nodes.inline()
|
||||
letter_node = nodes.Text(span[0])
|
||||
accel_node += letter_node
|
||||
accel_node['classes'].append('accelerator')
|
||||
node += accel_node
|
||||
textnode = nodes.Text(span[1:])
|
||||
node += textnode
|
||||
|
||||
node['classes'].append(typ)
|
||||
return [node], []
|
||||
|
||||
# Use 'patched_menusel_role' function for processing the 'menuselection' role
|
||||
roles.register_local_role('menuselection', patched_menusel_role)
|
||||
# -- External links --
|
||||
extlinks = {
|
||||
'django-docs': (
|
||||
'https://docs.djangoproject.com/en/{}/%s'.format(
|
||||
mayan.__django_version__
|
||||
), 'Django documentation section: '
|
||||
),
|
||||
'github-issue': (
|
||||
'https://github.com/mayan-edms/mayan-edms/issues/%s', 'GitHub issue #'
|
||||
),
|
||||
'gitlab-issue': (
|
||||
'https://gitlab.com/mayan-edms/mayan-edms/issues/%s', 'GitLab issue #'
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user