* Lowercase glossary terms

* Consistently format None, True and False.
This commit is contained in:
Georg Brandl
2007-10-21 12:53:41 +00:00
parent 1212840dcc
commit 6814e09677
3 changed files with 10 additions and 2 deletions

View File

@@ -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

View File

@@ -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:

View File

@@ -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 = []