Reorganize documentation into topics and chapters. Add new material from Wiki.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
@@ -232,3 +232,35 @@ 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)
|
||||
|
||||
Reference in New Issue
Block a user