Update glossary2rst file with new mark-up representations

Change-Id: I3c2b1927302bcfc335ad37c3d587661b3376daef
This commit is contained in:
venkatamahesh 2016-01-13 18:04:23 +05:30
parent fa97587754
commit c69f247450

View File

@ -24,13 +24,13 @@ KNOWN_TAGS = [
'code', 'code',
'command', 'command',
'filename', 'filename',
'link',
'literal',
'glossary', 'glossary',
'glossdef', 'glossdef',
'glossdiv', 'glossdiv',
'glossentry', 'glossentry',
'glossterm', 'glossterm',
'link',
'literal',
'para', 'para',
'phrase', 'phrase',
'systemitem', 'systemitem',
@ -118,9 +118,9 @@ def convert(element):
if tag == "command": if tag == "command":
return ":command:`%s`" % element.text return ":command:`%s`" % element.text
if tag == "code": if tag == "code":
return "`%s`" % element.text return "``%s``" % element.text
if tag == "filename": if tag == "filename":
return ":file:`%s`" % element.text return "``%s``" % element.text
if tag == "glossary": if tag == "glossary":
return concat(element) return concat(element)
if tag == "glossdiv": if tag == "glossdiv":
@ -130,7 +130,7 @@ def convert(element):
if tag == "link": if tag == "link":
return link(element) return link(element)
if tag == "literal": if tag == "literal":
return "`%s`" % element.text return "``%s``" % element.text
if tag == "para": if tag == "para":
return "\n\n" + concat(element) return "\n\n" + concat(element)
if tag == "phrase": if tag == "phrase":
@ -160,7 +160,7 @@ def glossary_convert(filename):
rstcontent = rst_convert(doc.getroot()).encode('utf-8') rstcontent = rst_convert(doc.getroot()).encode('utf-8')
heading = "========\n" + "Glossary\n" + "========\n\n" heading = "========\n" + "Glossary\n" + "========\n\n"
heading += ".. comments\n" heading += ".. comments\n"
heading += " This file file is automatically generated, edit the master" heading += " This file is automatically generated, edit the master"
heading += " doc/glossary/glossary-terms.xml to update it." heading += " doc/glossary/glossary-terms.xml to update it."
if len(sys.argv) != 2: if len(sys.argv) != 2: