mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
* Lowercase glossary terms
* Consistently format None, True and False.
This commit is contained in:
@@ -643,7 +643,8 @@ def glossary_directive(name, arguments, options, content, lineno,
|
||||
env.gloss_entries.add(new_id)
|
||||
li[0]['names'].append(new_id)
|
||||
li[0]['ids'].append(new_id)
|
||||
state.document.settings.env.note_reftarget('term', termtext, new_id)
|
||||
state.document.settings.env.note_reftarget('term', termtext.lower(),
|
||||
new_id)
|
||||
return [node]
|
||||
|
||||
glossary_directive.content = 1
|
||||
|
||||
@@ -117,7 +117,7 @@ def xfileref_role(typ, rawtext, text, lineno, inliner, options={}, content=[]):
|
||||
text = text[1:]
|
||||
pnode['refspecific'] = True
|
||||
if typ == 'term':
|
||||
pnode['reftarget'] = ws_re.sub(' ', text)
|
||||
pnode['reftarget'] = ws_re.sub(' ', text).lower()
|
||||
elif typ == 'option':
|
||||
pnode['reftarget'] = text[1:] if text[0] in '-/' else text
|
||||
else:
|
||||
|
||||
@@ -160,6 +160,13 @@ def translator_class(config, buildername):
|
||||
self.body.append(highlight_block(node.rawsource, self.highlightlang))
|
||||
raise nodes.SkipNode
|
||||
|
||||
# overwritten
|
||||
def visit_literal(self, node):
|
||||
if len(node.children) == 1 and \
|
||||
node.children[0] in ('None', 'True', 'False'):
|
||||
node['classes'].append('xref')
|
||||
BaseTranslator.visit_literal(self, node)
|
||||
|
||||
def visit_productionlist(self, node):
|
||||
self.body.append(self.starttag(node, 'pre'))
|
||||
names = []
|
||||
|
||||
Reference in New Issue
Block a user