diff options
author | Timo Richter <timo@iera.de> | 2011-08-26 13:29:27 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2011-08-26 13:30:51 +0200 |
commit | e56dbe6b95f14f9e4d3a416ea567b550fc9b79ed (patch) | |
tree | 6511a8aae332213778a297dc06f8183ea3dd7d88 /helpcontent2/wiki-to-help | |
parent | 260b7c155537741fd6100eb88090b649c9904f02 (diff) |
License update. Implemented metabook generator.
mwlib modification: Base url to wiki is definable in nfo.json
mwlib modification: Implemented function that creates an article link
Created new docbook grammar for mwlib
Input test2.xml now contains one internal link in Mainpage > Writer/Welcome
Diffstat (limited to 'helpcontent2/wiki-to-help')
-rw-r--r-- | helpcontent2/wiki-to-help/README | 2 | ||||
-rwxr-xr-x | helpcontent2/wiki-to-help/convert.py | 62 | ||||
-rw-r--r-- | helpcontent2/wiki-to-help/metabook.json | 22 | ||||
-rw-r--r-- | helpcontent2/wiki-to-help/metabook.py | 111 | ||||
-rw-r--r-- | helpcontent2/wiki-to-help/metabook_translated.py | 55 | ||||
-rw-r--r-- | helpcontent2/wiki-to-help/mw.py | 9 | ||||
-rw-r--r-- | helpcontent2/wiki-to-help/mwlib_mods/__init__.py | 8 | ||||
-rw-r--r-- | helpcontent2/wiki-to-help/mwlib_mods/custom_nfo.py | 18 | ||||
-rw-r--r-- | helpcontent2/wiki-to-help/mwlib_mods/docbook45grammar.py | 2 | ||||
-rw-r--r-- | helpcontent2/wiki-to-help/mwlib_mods/docbook_internLinks.py | 67 | ||||
-rw-r--r-- | helpcontent2/wiki-to-help/nfo.json | 5 | ||||
-rw-r--r-- | helpcontent2/wiki-to-help/test2.xml | 50 |
12 files changed, 382 insertions, 29 deletions
diff --git a/helpcontent2/wiki-to-help/README b/helpcontent2/wiki-to-help/README index 5dcfc95865..1eb3e442c5 100644 --- a/helpcontent2/wiki-to-help/README +++ b/helpcontent2/wiki-to-help/README @@ -25,5 +25,5 @@ The following programs are required: The following applies to all files if not stated differently - - Licensed under GNU LGPLv3 / MPL + - Licensed under GNU LGPLv3 or later / MPL - Copyright 2011 Timo Richter diff --git a/helpcontent2/wiki-to-help/convert.py b/helpcontent2/wiki-to-help/convert.py index a86b4b60d8..cd0ffac143 100755 --- a/helpcontent2/wiki-to-help/convert.py +++ b/helpcontent2/wiki-to-help/convert.py @@ -13,17 +13,19 @@ Microsoft HHC: http://go.microsoft.com/fwlink/?LinkId=14188 """ -import xml.dom.minidom as minidom import subprocess, tempfile, os, shutil +import mwlib_mods from hhc import HHC from mw import MW +from metabook_translated import MetabookTranslated scriptpath=os.path.dirname(os.path.realpath(__file__) ) class Main(object): + createChm = True # final + keepTmp = True # final workingDir = "./test" # final - #mwpath='/usr/local/bin/' # final style=os.path.join(scriptpath,'xsl/htmlhelp/htmlhelp.xsl') # final tmp=None @@ -47,6 +49,25 @@ class Main(object): self.hhc = HHC() self.convert("test2.xml",self.workingDir) + def createDir(self,path): + try: + os.mkdir(path) + except OSError: + pass + + def createMetabook(self,xmldump,output): + """ + @xmldump String path + @output String path + """ + m = MetabookTranslated() + jsonStructFile = os.path.join(scriptpath,"metabook.json") + with open(jsonStructFile,"r") as f: + m.loadTemplate(f) + m(xmldump) + with open(output,"w") as f: + m.write(f) + def convert(self,source,dest,startpage=None): """ Create the converted files. @@ -55,15 +76,18 @@ class Main(object): @startpage Path to an html file """ tmp = self.tmp - try: - os.mkdir(dest) - except OSError: - pass - names = self.getArtNames(source) + self.createDir(dest) + + shutil.copy(os.path.join(scriptpath,"nfo.json"),tmp) + #names = self.getArtNames(source) + metabook=os.path.join(tmp,"metabook.json") + self.createMetabook(source,metabook) + MW.buildcdb(source,tmp) + #MW.render("--config=%s/wikiconf.txt"%(tmp), + # "-w","docbook","-o",tmp+"/docbook.xml",*names) MW.render("--config=%s/wikiconf.txt"%(tmp), - "-w","docbook","-o",tmp+"/docbook.xml",*names) - + "-w","docbook","-o",tmp+"/docbook.xml","-m",metabook) #and mwlib.apps.render #self.ex(self.mwpath+"mw-buildcdb","--input",source,"--output",tmp) and \ #self.ex( @@ -72,6 +96,7 @@ class Main(object): (shutil.copy(tmp+'/docbook.xml',dest) or True) \ and self.ex("/usr/bin/xsltproc","--nonet","--novalid","-o",tmp+'/',self.style,tmp+'/docbook.xml') \ and self.setStartpage(startpage) \ + and self.createChm \ and (self.hhc(tmp) or True) \ and (shutil.copy(os.path.join(tmp,'htmlhelp.chm'),dest) or True) @@ -89,23 +114,8 @@ class Main(object): return True def __del__(self): - shutil.rmtree(self.tmp) # remove temp files - pass - - def getArtNames(self,filename): - """ - Get Article Names - Reads all title tags from an xml file and returns a list of all titles. - @filename XML-file - @return List of Strings - """ - dom=minidom.parse(filename) - elements=dom.getElementsByTagName("title") - names=[] - for element in elements: - name=element.childNodes[0].data - names.append(name) - return names + if not self.keepTmp: + shutil.rmtree(self.tmp) # remove temp files if __name__ == '__main__': Main() diff --git a/helpcontent2/wiki-to-help/metabook.json b/helpcontent2/wiki-to-help/metabook.json new file mode 100644 index 0000000000..76814b6a2d --- /dev/null +++ b/helpcontent2/wiki-to-help/metabook.json @@ -0,0 +1,22 @@ +{ + "items": [], + "licenses": [ + { + "mw_license_url": "", + "type": "license" + } + ], + "summary": "", + "type": "collection", + "version": 1, + "wikis(deprecated)": [ + { + "baseurl": "http://help.libreoffice.org/", + "imagesize": 800, + "keep_tmpfiles": false, + "script_extension": ".php", + "type": "wikiconf", + "ident": "en" + } + ] +} diff --git a/helpcontent2/wiki-to-help/metabook.py b/helpcontent2/wiki-to-help/metabook.py new file mode 100644 index 0000000000..575b7e2fb9 --- /dev/null +++ b/helpcontent2/wiki-to-help/metabook.py @@ -0,0 +1,111 @@ +import json +import xml.dom.minidom as minidom + +class Article(object): + itemTag = {"content_type":"text/x-wiki","type":"article"} + #itemTag = {"content_type":"text/x-wiki","type":"article","wikiident":"lo","url":"http://asdlkf/","source-url":"http://sourceurl/","source":"http://source/"} + attributes = {} + include = True #""" True if this article should be included in the metabook """ + + def __init__(self,attributes): + self.attributes = attributes + + def getInclude(self): + """ @return True if this article should be included in the metabook """ + return self.include + + def toDict(self): + #if not self.include: return None + article = self.itemTag.copy() + article.update(self.attributes) # merge dicts + return article + +class Metabook(object): + """ + I am your metabook and wish you a pleasant evening. + """ + ArticleClass = Article # final + artTags = ["title"] # final + + m = {} # Dict metabook + source = "" # String input file, xmldump + dest = "" # FileObject destination of json metabook + + def getClone(self): + m = Metabook() + m.m = self.m.copy() + #m.dest = self.dest + #m.source = self.source + return m + + def getArtTags(self,filename,tagnames): + """ + Get Article Tags + Reads all title tags from an xml file and returns a list of all titles. + @filename XML-file + @tagnames List of String Tagnames + @return List of Dict<String Tagname, String Value> + """ + dom=minidom.parse(filename) + out = [] + + elements=dom.getElementsByTagName("page") + + for element in elements: + tagdict = {} + for tagname in tagnames: + tags = element.getElementsByTagName(tagname) + if len(tags) > 0: + tagdict[tagname] = self.getText(tags[0]) + else: + tagdict[tagname] = "" + out.append(tagdict) + return out + + def getText(self,element): + """ + @element xml Node + @return String content + """ + return element.childNodes[0].data + + def load_data(self,filename): + """ Unserialize data from jsonfile """ + with open(filename, "r") as infile: + outdict = json.load(infile) + return outdict + + def loadTemplate(self,jsonStruct): + """ + Loads an existing json file at the beginning + @jsonStruct File object + """ + self.m = json.load(jsonStruct) + #self.m = self.load_data(source) + + def setArticles(self): + pages = self.getArtTags(self.source,self.artTags) + items=[] + for page in pages: + #item=self.itemTag.copy() + #item["title"] = name + item = self.ArticleClass(page) + if item.getInclude(): + items.append(item.toDict()) + self.m["items"] = items + + def __call__(self,source): + """ + Creates a metabook for @source and saves it to @dest + @source xml-dump + @dest File object as destination of json-file + """ + self.source = source + #self.dest = dest + #self.loadStructure() + self.setArticles() + + def write(self,dest): + json.dump(self.m,dest) + + diff --git a/helpcontent2/wiki-to-help/metabook_translated.py b/helpcontent2/wiki-to-help/metabook_translated.py new file mode 100644 index 0000000000..07364dd0d4 --- /dev/null +++ b/helpcontent2/wiki-to-help/metabook_translated.py @@ -0,0 +1,55 @@ +import metabook +import re + +class ArticleTranslated(metabook.Article): + lang = "en" # default language code + trans = "" # translated title + + def __init__(self,attributes): + title = attributes["title"] + parts = title.split("/") + #if len(parts) < 2: + # self.include = False + # return + if len(parts) == 1: + # title = "blabla" + self.title = title + if len(parts) == 2: + # title = "Category/englishTitle" + self.title = parts[1] + if len(parts) == 3: + # title = "Category/englishTitle/langCode" + self.lang = parts[2] + self.title = parts[1] + + comment = attributes["comment"] + if '{Lang|' in comment: + # Language-tag exists + r = re.search("\{Lang\|([^\}]*)\}",comment) + trans = r.group(1) + self.trans = trans + else: + self.trans = self.title + + attr = {} + attr["title"] = attributes["title"] + attr["displaytitle"] = self.trans + attr["lang"] = self.lang + self.attributes = attr + +class MetabookTranslated(metabook.Metabook): + """ + This concrete metabook expects article titles in this form: + Category/Title/lang + Comments include this: + {{Lang|translatedTitle}} + """ + ArticleClass=ArticleTranslated + artTags = ["title","comment"] + + def splitByLanguage(self): + """ + @return List of Metabook + """ + pass + diff --git a/helpcontent2/wiki-to-help/mw.py b/helpcontent2/wiki-to-help/mw.py index d2709cc6bc..ca56633dae 100644 --- a/helpcontent2/wiki-to-help/mw.py +++ b/helpcontent2/wiki-to-help/mw.py @@ -1,8 +1,12 @@ -import mwlib.cdbwiki, mwlib.apps.render, mwlib.apps +#import mwlib.cdbwiki, mwlib.apps.render, mwlib.apps +import mwlib.apps import sys class MW(object): - """ This is the proxy class for mwlib """ + """ + Use this adapter class to call mwlib within python. + Example: import mw; MW.buildcdb("in.xml","out") + """ @staticmethod def _setArgs(function,args): @@ -23,4 +27,5 @@ class MW(object): @staticmethod def render(*args): + import mwlib.apps.render return MW._setArgs(mwlib.apps.render.Main(),args) diff --git a/helpcontent2/wiki-to-help/mwlib_mods/__init__.py b/helpcontent2/wiki-to-help/mwlib_mods/__init__.py new file mode 100644 index 0000000000..43368eee21 --- /dev/null +++ b/helpcontent2/wiki-to-help/mwlib_mods/__init__.py @@ -0,0 +1,8 @@ +""" +This package sets up modifications and bugfixes for mwlib. +Usage: import mwlib_mods +""" + +import docbook_internLinks +import custom_nfo + diff --git a/helpcontent2/wiki-to-help/mwlib_mods/custom_nfo.py b/helpcontent2/wiki-to-help/mwlib_mods/custom_nfo.py new file mode 100644 index 0000000000..12a3497bed --- /dev/null +++ b/helpcontent2/wiki-to-help/mwlib_mods/custom_nfo.py @@ -0,0 +1,18 @@ +""" +Enable looking for a custom nfo.json and siteinfo.json + +Author: Timo Richter +""" +import mwlib.cdbwiki +class WikiDB(mwlib.cdbwiki.WikiDB): + def __init__(self, dir, prefix='wiki', lang="en"): + try: + super(WikiDB,self).__init__(dir,prefix,lang) + except(RuntimeError): + print("Warning: "+"could not get siteinfo for language %r" % (lang,)) + print("Please set up a custom siteinfo and nfo.") + print "Mod: WikiDB" + self.nfo = self.get_data("nfo") or self.nfo + self.siteinfo = self.get_data("siteinfo") or self.siteinfo +mwlib.cdbwiki.WikiDB=WikiDB + diff --git a/helpcontent2/wiki-to-help/mwlib_mods/docbook45grammar.py b/helpcontent2/wiki-to-help/mwlib_mods/docbook45grammar.py new file mode 100644 index 0000000000..d773957dd8 --- /dev/null +++ b/helpcontent2/wiki-to-help/mwlib_mods/docbook45grammar.py @@ -0,0 +1,2 @@ +# autogenerated grammar from file docbook-rng-4.5b1/docbook.rng using: ./build_rng_grammar.new.py +grammar = {'em': {'attributes': [], 'children': []}, 'programlisting': {'attributes': ['revisionflag', 'continuation', 'xml:space', 'xml:base', 'startinglinenumber', 'id', 'width', 'role', 'xreflabel', 'conformance', 'revision', 'remap', 'vendor', 'linenumbering', 'format', 'userlevel', 'arch', 'condition', 'lang', 'language', 'wordsize', 'security', 'os', 'dir'], 'children': ['code', 'keycombo', 'modespec', 'guiicon', 'lineannotation', 'guimenu', 'guisubmenu', 'userinput', 'errortext', 'methodsynopsis', 'footnoteref', 'inlineequation', 'structname', 'interfacename', 'mousebutton', 'envar', 'othercredit', 'ulink', 'methodname', 'guimenuitem', 'classsynopsis', 'systemitem', 'keycap', 'productname', 'token', 'citerefentry', 'medialabel', 'guilabel', 'termdef', 'wordasword', 'corpauthor', 'ooexception', 'destructorsynopsis', 'filename', 'errorcode', 'constructorsynopsis', 'computeroutput', 'subscript', 'email', 'acronym', 'replaceable', 'citetitle', 'exceptionname', 'oointerface', 'revhistory', 'interface', 'optional', 'keycode', 'remark', 'package', 'varname', 'errortype', 'textobject', 'ooclass', 'guibutton', 'structfield', 'funcsynopsis', 'productnumber', 'authorinitials', 'classname', 'fieldsynopsis', 'prompt', 'inlinegraphic', 'personname', 'trademark', 'literal', 'type', 'olink', 'function', 'option', 'corpcredit', 'link', 'foreignphrase', 'co', 'inlinemediaobject', 'glossterm', 'property', 'anchor', 'constant', 'menuchoice', 'footnote', 'citation', 'errorname', 'hardware', 'phrase', 'xref', 'author', 'orgname', 'synopsis', 'application', 'emphasis', 'returnvalue', 'indexterm', 'parameter', 'firstterm', 'sgmltag', 'quote', 'symbol', 'beginpage', 'cmdsynopsis', 'action', 'biblioref', 'database', 'markup', 'coref', 'uri', 'abbrev', 'command', 'keysym', 'superscript']}, 'varlistentry': {'attributes': ['lang', 'revisionflag', 'remap', 'vendor', 'os', 'conformance', 'wordsize', 'role', 'dir', 'xreflabel', 'userlevel', 'xml:base', 'security', 'arch', 'id', 'condition', 'revision'], 'children': ['term', 'listitem']}, 'mediaobject': {'attributes': ['lang', 'revisionflag', 'remap', 'vendor', 'os', 'conformance', 'wordsize', 'role', 'dir', 'xreflabel', 'userlevel', 'xml:base', 'security', 'arch', 'id', 'condition', 'revision'], 'children': ['audioobject', 'videoobject', 'caption', 'imageobject', 'imageobjectco', 'textobject', 'objectinfo']}, 'citation': {'attributes': ['lang', 'revisionflag', 'remap', 'vendor', 'os', 'conformance', 'wordsize', 'role', 'dir', 'xreflabel', 'userlevel', 'xml:base', 'security', 'arch', 'id', 'condition', 'revision'], 'children': ['code', 'keycombo', 'modespec', 'guiicon', 'guimenu', 'guisubmenu', 'userinput', 'errortext', 'methodsynopsis', 'footnoteref', 'inlineequation', 'structname', 'interfacename', 'mousebutton', 'envar', 'othercredit', 'ulink', 'methodname', 'guimenuitem', 'classsynopsis', 'systemitem', 'keycap', 'productname', 'token', 'citerefentry', 'medialabel', 'guilabel', 'termdef', 'wordasword', 'corpauthor', 'ooexception', 'destructorsynopsis', 'filename', 'errorcode', 'constructorsynopsis', 'computeroutput', 'subscript', 'email', 'acronym', 'replaceable', 'citetitle', 'exceptionname', 'oointerface', 'revhistory', 'interface', 'optional', 'keycode', 'remark', 'package', 'varname', 'errortype', 'ooclass', 'guibutton', 'structfield', 'funcsynopsis', 'productnumber', 'authorinitials', 'classname', 'fieldsynopsis', 'prompt', 'inlinegraphic', 'personname', 'trademark', 'literal', 'type', 'olink', 'function', 'option', 'corpcredit', 'link', 'foreignphrase', 'inlinemediaobject', 'glossterm', 'property', 'anchor', 'constant', 'menuchoice', 'footnote', 'citation', 'errorname', 'hardware', 'phrase', 'xref', 'author', 'orgname', 'synopsis', 'application', 'emphasis', 'returnvalue', 'indexterm', 'parameter', 'firstterm', 'sgmltag', 'quote', 'symbol', 'beginpage', 'cmdsynopsis', 'action', 'biblioref', 'database', 'markup', 'uri', 'abbrev', 'command', 'keysym', 'superscript']}, 'imageobject': {'attributes': ['lang', 'revisionflag', 'remap', 'vendor', 'os', 'conformance', 'wordsize', 'role', 'dir', 'xreflabel', 'userlevel', 'xml:base', 'security', 'arch', 'id', 'condition', 'revision'], 'children': ['objectinfo', 'imagedata']}, 'phrase': {'attributes': ['lang', 'revisionflag', 'remap', 'vendor', 'os', 'conformance', 'wordsize', 'role', 'dir', 'xreflabel', 'userlevel', 'xml:base', 'security', 'arch', 'id', 'condition', 'revision'], 'children': ['code', 'keycombo', 'modespec', 'guiicon', 'guimenu', 'guisubmenu', 'userinput', 'errortext', 'methodsynopsis', 'footnoteref', 'inlineequation', 'structname', 'interfacename', 'mousebutton', 'envar', 'othercredit', 'ulink', 'methodname', 'guimenuitem', 'classsynopsis', 'systemitem', 'keycap', 'productname', 'token', 'citerefentry', 'medialabel', 'guilabel', 'termdef', 'wordasword', 'corpauthor', 'ooexception', 'destructorsynopsis', 'filename', 'errorcode', 'constructorsynopsis', 'computeroutput', 'subscript', 'email', 'acronym', 'replaceable', 'citetitle', 'exceptionname', 'oointerface', 'revhistory', 'interface', 'optional', 'keycode', 'remark', 'package', 'varname', 'errortype', 'ooclass', 'guibutton', 'structfield', 'funcsynopsis', 'productnumber', 'authorinitials', 'classname', 'fieldsynopsis', 'prompt', 'inlinegraphic', 'personname', 'trademark', 'literal', 'type', 'olink', 'function', 'option', 'corpcredit', 'link', 'foreignphrase', 'inlinemediaobject', 'glossterm', 'property', 'anchor', 'constant', 'menuchoice', 'footnote', 'citation', 'errorname', 'hardware', 'phrase', 'xref', 'author', 'orgname', 'synopsis', 'application', 'emphasis', 'returnvalue', 'indexterm', 'parameter', 'firstterm', 'sgmltag', 'quote', 'symbol', 'beginpage', 'cmdsynopsis', 'action', 'biblioref', 'database', 'markup', 'uri', 'abbrev', 'command', 'keysym', 'superscript']}, 'literallayout': {'attributes': ['revisionflag', 'continuation', 'xml:space', 'xml:base', 'startinglinenumber', 'id', 'width', 'role', 'xreflabel', 'conformance', 'revision', 'remap', 'vendor', 'linenumbering', 'format', 'userlevel', 'arch', 'class', 'condition', 'lang', 'language', 'wordsize', 'security', 'os', 'dir'], 'children': ['code', 'keycombo', 'modespec', 'guiicon', 'lineannotation', 'guimenu', 'guisubmenu', 'userinput', 'errortext', 'methodsynopsis', 'footnoteref', 'inlineequation', 'structname', 'interfacename', 'mousebutton', 'envar', 'othercredit', 'ulink', 'methodname', 'guimenuitem', 'classsynopsis', 'systemitem', 'keycap', 'productname', 'token', 'citerefentry', 'medialabel', 'guilabel', 'termdef', 'wordasword', 'corpauthor', 'ooexception', 'destructorsynopsis', 'filename', 'errorcode', 'constructorsynopsis', 'computeroutput', 'subscript', 'email', 'acronym', 'replaceable', 'citetitle', 'exceptionname', 'oointerface', 'revhistory', 'interface', 'optional', 'keycode', 'remark', 'package', 'varname', 'errortype', 'textobject', 'ooclass', 'guibutton', 'structfield', 'funcsynopsis', 'productnumber', 'authorinitials', 'classname', 'fieldsynopsis', 'prompt', 'inlinegraphic', 'personname', 'trademark', 'literal', 'type', 'olink', 'function', 'option', 'corpcredit', 'link', 'foreignphrase', 'co', 'inlinemediaobject', 'glossterm', 'property', 'anchor', 'constant', 'menuchoice', 'footnote', 'citation', 'errorname', 'hardware', 'phrase', 'xref', 'author', 'orgname', 'synopsis', 'application', 'emphasis', 'returnvalue', 'indexterm', 'parameter', 'firstterm', 'sgmltag', 'quote', 'symbol', 'beginpage', 'cmdsynopsis', 'action', 'biblioref', 'database', 'markup', 'coref', 'uri', 'abbrev', 'command', 'keysym', 'superscript']}, 'xref': {'attributes': ['lang', 'revisionflag', 'remap', 'vendor', 'os', 'conformance', 'endterm', 'xrefstyle', 'linkend', 'wordsize', 'role', 'dir', 'xreflabel', 'userlevel', 'xml:base', 'security', 'arch', 'id', 'condition', 'revision'], 'children': []}, 'span': {'attributes': [], 'children': []}, 'caption': {'attributes': ['revisionflag', 'onmousedown', 'xml:base', 'id', 'style', 'title', 'wordsize', 'role', 'onclick', 'onmousemove', 'conformance', 'revision', 'remap', 'vendor', 'xreflabel', 'onmouseout', 'onkeypress', 'onkeydown', 'onmouseover', 'userlevel', 'arch', 'class', 'condition', 'lang', 'align', 'xml:lang', 'onmouseup', 'onkeyup', 'security', 'ondblclick', 'os', 'dir'], 'children': ['programlisting', 'tip', 'formalpara', 'warning', 'caution', 'literallayout', 'glosslist', 'screenshot', 'simpara', 'segmentedlist', 'note', 'screenco', 'calloutlist', 'blockquote', 'para', 'screen', 'important', 'orderedlist', 'programlistingco', 'bibliolist', 'variablelist', 'simplelist', 'itemizedlist']}, 'section': {'attributes': ['status', 'lang', 'remap', 'vendor', 'os', 'revisionflag', 'conformance', 'label', 'wordsize', 'role', 'dir', 'xreflabel', 'userlevel', 'xml:base', 'security', 'arch', 'id', 'condition', 'revision'], 'children': ['programlisting', 'subtitle', 'simplesect', 'figure', 'cmdsynopsis', 'mediaobject', 'titleabbrev', 'formalpara', 'informalequation', 'warning', 'caution', 'informalexample', 'table', 'fieldsynopsis', 'funcsynopsis', 'literallayout', 'glosslist', 'index', 'msgset', 'bibliography', 'destructorsynopsis', 'title', 'highlights', 'section', 'bridgehead', 'tip', 'segmentedlist', 'informalfigure', 'methodsynopsis', 'note', 'informaltable', 'screenco', 'constructorsynopsis', 'lot', 'toc', 'sectioninfo', 'indexterm', 'abstract', 'calloutlist', 'blockquote', 'screenshot', 'screen', 'graphicco', 'remark', 'qandaset', 'epigraph', 'task', 'important', 'para', 'address', 'orderedlist', 'beginpage', 'classsynopsis', 'sidebar', 'mediaobjectco', 'simpara', 'anchor', 'refentry', 'glossary', 'programlistingco', 'graphic', 'example', 'authorblurb', 'synopsis', 'bibliolist', 'variablelist', 'simplelist', 'itemizedlist', 'equation', 'procedure']}, 'tr': {'attributes': ['revisionflag', 'onmousedown', 'char', 'xml:base', 'id', 'style', 'title', 'bgcolor', 'wordsize', 'onmousemove', 'onclick', 'valign', 'conformance', 'revision', 'remap', 'vendor', 'xreflabel', 'onmouseout', 'onkeypress', 'onkeydown', 'onmouseover', 'userlevel', 'arch', 'class', 'condition', 'lang', 'charoff', 'align', 'xml:lang', 'onmouseup', 'onkeyup', 'security', 'ondblclick', 'os', 'dir'], 'children': ['td', 'th']}, 'informaltable': {'attributes': ['orient', 'revisionflag', 'rowsep', 'tabstyle', 'frame', 'remap', 'onmousedown', 'xml:base', 'tocentry', 'border', 'id', 'style', 'title', 'label', 'pgwide', 'xml:lang', 'onmousemove', 'xreflabel', 'role', 'conformance', 'revision', 'rowheader', 'vendor', 'onclick', 'onmouseout', 'onkeypress', 'rules', 'colsep', 'onkeydown', 'floatstyle', 'cellpadding', 'onmouseover', 'userlevel', 'arch', 'class', 'condition', 'lang', 'cellspacing', 'align', 'shortentry', 'bgcolor', 'summary', 'wordsize', 'onmouseup', 'onkeyup', 'security', 'ondblclick', 'os', 'width', 'dir'], 'children': ['tgroup', 'colgroup', 'mediaobject', 'tr', 'tbody', 'graphic', 'tfoot', 'textobject', 'blockinfo', 'col', 'thead']}, 'emphasis': {'attributes': ['lang', 'revisionflag', 'remap', 'vendor', 'os', 'conformance', 'wordsize', 'role', 'dir', 'xreflabel', 'userlevel', 'xml:base', 'security', 'arch', 'id', 'condition', 'revision'], 'children': ['code', 'keycombo', 'modespec', 'guiicon', 'guimenu', 'guisubmenu', 'userinput', 'errortext', 'methodsynopsis', 'footnoteref', 'inlineequation', 'structname', 'interfacename', 'mousebutton', 'envar', 'othercredit', 'ulink', 'methodname', 'guimenuitem', 'classsynopsis', 'systemitem', 'keycap', 'productname', 'token', 'citerefentry', 'medialabel', 'guilabel', 'termdef', 'wordasword', 'corpauthor', 'ooexception', 'destructorsynopsis', 'filename', 'errorcode', 'constructorsynopsis', 'computeroutput', 'subscript', 'email', 'acronym', 'replaceable', 'citetitle', 'exceptionname', 'oointerface', 'revhistory', 'interface', 'optional', 'keycode', 'remark', 'package', 'varname', 'errortype', 'ooclass', 'guibutton', 'structfield', 'funcsynopsis', 'productnumber', 'authorinitials', 'classname', 'fieldsynopsis', 'prompt', 'inlinegraphic', 'personname', 'trademark', 'literal', 'type', 'olink', 'function', 'option', 'corpcredit', 'link', 'foreignphrase', 'inlinemediaobject', 'glossterm', 'property', 'anchor', 'constant', 'menuchoice', 'footnote', 'citation', 'errorname', 'hardware', 'phrase', 'xref', 'author', 'orgname', 'synopsis', 'application', 'emphasis', 'returnvalue', 'indexterm', 'parameter', 'firstterm', 'sgmltag', 'quote', 'symbol', 'beginpage', 'cmdsynopsis', 'action', 'biblioref', 'database', 'markup', 'uri', 'abbrev', 'command', 'keysym', 'superscript']}, 'book': {'attributes': ['status', 'lang', 'remap', 'vendor', 'os', 'revisionflag', 'conformance', 'fpi', 'label', 'wordsize', 'role', 'dir', 'xreflabel', 'userlevel', 'xml:base', 'security', 'arch', 'id', 'condition', 'revision'], 'children': ['chapter', 'index', 'subtitle', 'colophon', 'reference', 'title', 'glossary', 'appendix', 'setindex', 'titleabbrev', 'article', 'bookinfo', 'bibliography', 'lot', 'preface', 'dedication', 'toc', 'part']}, 'listitem': {'attributes': ['lang', 'revisionflag', 'remap', 'vendor', 'os', 'conformance', 'userlevel', 'wordsize', 'role', 'dir', 'xreflabel', 'override', 'xml:base', 'security', 'arch', 'id', 'condition', 'revision'], 'children': ['programlisting', 'funcsynopsis', 'figure', 'cmdsynopsis', 'mediaobject', 'mediaobjectco', 'formalpara', 'informalequation', 'warning', 'caution', 'informalexample', 'fieldsynopsis', 'table', 'literallayout', 'glosslist', 'task', 'msgset', 'destructorsynopsis', 'authorblurb', 'highlights', 'bridgehead', 'tip', 'segmentedlist', 'informalfigure', 'methodsynopsis', 'note', 'informaltable', 'screenco', 'constructorsynopsis', 'indexterm', 'abstract', 'calloutlist', 'blockquote', 'screenshot', 'screen', 'graphicco', 'qandaset', 'epigraph', 'important', 'para', 'address', 'orderedlist', 'beginpage', 'classsynopsis', 'sidebar', 'remark', 'simpara', 'anchor', 'programlistingco', 'graphic', 'example', 'synopsis', 'bibliolist', 'variablelist', 'simplelist', 'itemizedlist', 'equation', 'procedure']}, 'sectioninfo': {'attributes': ['lang', 'revisionflag', 'remap', 'vendor', 'os', 'conformance', 'wordsize', 'role', 'dir', 'xreflabel', 'userlevel', 'xml:base', 'security', 'arch', 'id', 'condition', 'revision'], 'children': ['contractsponsor', 'isbn', 'contractnum', 'pubdate', 'productnumber', 'mediaobject', 'address', 'invpartnumber', 'itermset', 'printhistory', 'edition', 'modespec', 'pubsnumber', 'contrib', 'seriesvolnums', 'corpauthor', 'authorgroup', 'artpagenums', 'author', 'orgname', 'volumenum', 'confgroup', 'authorinitials', 'pagenums', 'editor', 'bibliorelation', 'honorific', 'corpname', 'indexterm', 'abstract', 'keywordset', 'subjectset', 'firstname', 'citebiblioid', 'title', 'issuenum', 'collab', 'othercredit', 'corpcredit', 'citetitle', 'biblioset', 'legalnotice', 'bibliomisc', 'date', 'othername', 'surname', 'lineage', 'publisher', 'biblioid', 'graphic', 'publishername', 'copyright', 'subtitle', 'affiliation', 'bibliocoverage', 'issn', 'bibliosource', 'productname', 'authorblurb', 'personname', 'abbrev', 'titleabbrev', 'releaseinfo', 'revhistory']}, 'chapterinfo': {'attributes': ['lang', 'revisionflag', 'remap', 'vendor', 'os', 'conformance', 'wordsize', 'role', 'dir', 'xreflabel', 'userlevel', 'xml:base', 'security', 'arch', 'id', 'condition', 'revision'], 'children': ['contractsponsor', 'isbn', 'contractnum', 'pubdate', 'productnumber', 'mediaobject', 'address', 'invpartnumber', 'itermset', 'printhistory', 'edition', 'modespec', 'pubsnumber', 'contrib', 'seriesvolnums', 'corpauthor', 'authorgroup', 'artpagenums', 'author', 'orgname', 'volumenum', 'confgroup', 'authorinitials', 'pagenums', 'editor', 'bibliorelation', 'honorific', 'corpname', 'indexterm', 'abstract', 'keywordset', 'subjectset', 'firstname', 'citebiblioid', 'title', 'issuenum', 'collab', 'othercredit', 'corpcredit', 'citetitle', 'biblioset', 'legalnotice', 'bibliomisc', 'date', 'othername', 'surname', 'lineage', 'publisher', 'biblioid', 'graphic', 'publishername', 'copyright', 'subtitle', 'affiliation', 'bibliocoverage', 'issn', 'bibliosource', 'productname', 'authorblurb', 'personname', 'abbrev', 'titleabbrev', 'releaseinfo', 'revhistory']}, 'math': {'attributes': [], 'children': []}, 'blockquote': {'attributes': ['lang', 'revisionflag', 'remap', 'vendor', 'os', 'conformance', 'wordsize', 'role', 'dir', 'xreflabel', 'userlevel', 'xml:base', 'security', 'arch', 'id', 'condition', 'revision'], 'children': ['programlisting', 'funcsynopsis', 'figure', 'cmdsynopsis', 'mediaobject', 'mediaobjectco', 'formalpara', 'informalequation', 'warning', 'caution', 'informalexample', 'fieldsynopsis', 'table', 'blockinfo', 'glosslist', 'literallayout', 'task', 'msgset', 'destructorsynopsis', 'title', 'highlights', 'bridgehead', 'tip', 'segmentedlist', 'informalfigure', 'methodsynopsis', 'note', 'informaltable', 'screenco', 'constructorsynopsis', 'indexterm', 'abstract', 'calloutlist', 'blockquote', 'attribution', 'screenshot', 'screen', 'graphicco', 'qandaset', 'epigraph', 'important', 'para', 'address', 'orderedlist', 'beginpage', 'classsynopsis', 'sidebar', 'remark', 'simpara', 'anchor', 'programlistingco', 'graphic', 'example', 'authorblurb', 'synopsis', 'bibliolist', 'variablelist', 'simplelist', 'itemizedlist', 'equation', 'procedure']}, 'para': {'attributes': ['lang', 'revisionflag', 'remap', 'vendor', 'os', 'conformance', 'wordsize', 'role', 'dir', 'xreflabel', 'userlevel', 'xml:base', 'security', 'arch', 'id', 'condition', 'revision'], 'children': ['mediaobjectco', 'code', 'keycombo', 'mediaobject', 'informalequation', 'modespec', 'guiicon', 'literallayout', 'guimenu', 'guisubmenu', 'userinput', 'errortext', 'methodsynopsis', 'footnoteref', 'inlineequation', 'structname', 'calloutlist', 'blockquote', 'interfacename', 'mousebutton', 'envar', 'othercredit', 'ulink', 'methodname', 'guimenuitem', 'classsynopsis', 'systemitem', 'keycap', 'productname', 'token', 'bibliolist', 'citerefentry', 'medialabel', 'guilabel', 'termdef', 'table', 'wordasword', 'corpauthor', 'ooexception', 'destructorsynopsis', 'segmentedlist', 'filename', 'errorcode', 'informaltable', 'screenco', 'constructorsynopsis', 'computeroutput', 'subscript', 'email', 'graphicco', 'acronym', 'screen', 'replaceable', 'citetitle', 'exceptionname', 'oointerface', 'revhistory', 'interface', 'optional', 'keycode', 'remark', 'itemizedlist', 'package', 'varname', 'programlistingco', 'errortype', 'example', 'glosslist', 'ooclass', 'guibutton', 'structfield', 'programlisting', 'funcsynopsis', 'productnumber', 'authorinitials', 'address', 'classname', 'fieldsynopsis', 'prompt', 'inlinegraphic', 'figure', 'personname', 'trademark', 'literal', 'type', 'olink', 'function', 'option', 'corpcredit', 'link', 'foreignphrase', 'orderedlist', 'graphic', 'equation', 'inlinemediaobject', 'glossterm', 'simplelist', 'property', 'anchor', 'constant', 'menuchoice', 'footnote', 'citation', 'errorname', 'hardware', 'warning', 'caution', 'informalexample', 'phrase', 'xref', 'author', 'orgname', 'tip', 'synopsis', 'informalfigure', 'note', 'application', 'emphasis', 'returnvalue', 'variablelist', 'indexterm', 'parameter', 'firstterm', 'sgmltag', 'screenshot', 'quote', 'symbol', 'beginpage', 'cmdsynopsis', 'action', 'important', 'biblioref', 'database', 'markup', 'uri', 'abbrev', 'command', 'keysym', 'superscript']}, 'quote': {'attributes': ['lang', 'revisionflag', 'remap', 'vendor', 'os', 'conformance', 'wordsize', 'role', 'dir', 'xreflabel', 'userlevel', 'xml:base', 'security', 'arch', 'id', 'condition', 'revision'], 'children': ['code', 'keycombo', 'modespec', 'guiicon', 'guimenu', 'guisubmenu', 'userinput', 'errortext', 'methodsynopsis', 'footnoteref', 'inlineequation', 'structname', 'interfacename', 'mousebutton', 'envar', 'othercredit', 'ulink', 'methodname', 'guimenuitem', 'classsynopsis', 'systemitem', 'keycap', 'productname', 'token', 'citerefentry', 'medialabel', 'guilabel', 'termdef', 'wordasword', 'corpauthor', 'ooexception', 'destructorsynopsis', 'filename', 'errorcode', 'constructorsynopsis', 'computeroutput', 'subscript', 'email', 'acronym', 'replaceable', 'citetitle', 'exceptionname', 'oointerface', 'revhistory', 'interface', 'optional', 'keycode', 'remark', 'package', 'varname', 'errortype', 'ooclass', 'guibutton', 'structfield', 'funcsynopsis', 'productnumber', 'authorinitials', 'classname', 'fieldsynopsis', 'prompt', 'inlinegraphic', 'personname', 'trademark', 'literal', 'type', 'olink', 'function', 'option', 'corpcredit', 'link', 'foreignphrase', 'inlinemediaobject', 'glossterm', 'property', 'anchor', 'constant', 'menuchoice', 'footnote', 'citation', 'errorname', 'hardware', 'phrase', 'xref', 'author', 'orgname', 'synopsis', 'application', 'emphasis', 'returnvalue', 'indexterm', 'parameter', 'firstterm', 'sgmltag', 'quote', 'symbol', 'beginpage', 'cmdsynopsis', 'action', 'biblioref', 'database', 'markup', 'uri', 'abbrev', 'command', 'keysym', 'superscript']}, 'object': {'attributes': [], 'children': []}, 'bookinfo': {'attributes': ['lang', 'revisionflag', 'remap', 'vendor', 'os', 'conformance', 'dir', 'wordsize', 'role', 'condition', 'xreflabel', 'userlevel', 'xml:base', 'security', 'arch', 'id', 'contents', 'revision'], 'children': ['contractsponsor', 'isbn', 'contractnum', 'pubdate', 'productnumber', 'mediaobject', 'address', 'invpartnumber', 'itermset', 'printhistory', 'edition', 'modespec', 'pubsnumber', 'contrib', 'seriesvolnums', 'corpauthor', 'authorgroup', 'artpagenums', 'author', 'orgname', 'volumenum', 'confgroup', 'authorinitials', 'pagenums', 'editor', 'bibliorelation', 'honorific', 'corpname', 'indexterm', 'abstract', 'keywordset', 'subjectset', 'firstname', 'citebiblioid', 'title', 'issuenum', 'collab', 'othercredit', 'corpcredit', 'citetitle', 'biblioset', 'legalnotice', 'bibliomisc', 'date', 'othername', 'surname', 'lineage', 'publisher', 'biblioid', 'graphic', 'publishername', 'copyright', 'subtitle', 'affiliation', 'bibliocoverage', 'issn', 'bibliosource', 'productname', 'authorblurb', 'personname', 'abbrev', 'titleabbrev', 'releaseinfo', 'revhistory']}, 'td': {'attributes': ['revisionflag', 'colspan', 'onmousedown', 'char', 'xml:base', 'nowrap', 'id', 'axis', 'style', 'rowspan', 'title', 'bgcolor', 'wordsize', 'onmousemove', 'onclick', 'valign', 'scope', 'conformance', 'revision', 'remap', 'vendor', 'xreflabel', 'onmouseout', 'onkeypress', 'onkeydown', 'onmouseover', 'userlevel', 'height', 'arch', 'class', 'condition', 'lang', 'charoff', 'align', 'headers', 'xml:lang', 'onmouseup', 'onkeyup', 'security', 'ondblclick', 'os', 'width', 'dir', 'abbr'], 'children': ['code', 'keycombo', 'mediaobject', 'modespec', 'guiicon', 'literallayout', 'guimenu', 'guisubmenu', 'userinput', 'errortext', 'methodsynopsis', 'footnoteref', 'inlineequation', 'structname', 'calloutlist', 'interfacename', 'mousebutton', 'envar', 'othercredit', 'ulink', 'methodname', 'guimenuitem', 'classsynopsis', 'systemitem', 'keycap', 'productname', 'token', 'bibliolist', 'citerefentry', 'medialabel', 'guilabel', 'termdef', 'table', 'wordasword', 'corpauthor', 'ooexception', 'destructorsynopsis', 'simpara', 'segmentedlist', 'filename', 'errorcode', 'informaltable', 'screenco', 'constructorsynopsis', 'computeroutput', 'subscript', 'email', 'acronym', 'screen', 'replaceable', 'citetitle', 'exceptionname', 'oointerface', 'revhistory', 'interface', 'optional', 'keycode', 'remark', 'itemizedlist', 'package', 'varname', 'programlistingco', 'errortype', 'glosslist', 'ooclass', 'guibutton', 'structfield', 'programlisting', 'funcsynopsis', 'productnumber', 'authorinitials', 'classname', 'fieldsynopsis', 'prompt', 'inlinegraphic', 'personname', 'trademark', 'formalpara', 'literal', 'type', 'olink', 'function', 'option', 'para', 'corpcredit', 'link', 'foreignphrase', 'orderedlist', 'graphic', 'inlinemediaobject', 'glossterm', 'simplelist', 'property', 'anchor', 'constant', 'menuchoice', 'footnote', 'citation', 'errorname', 'hardware', 'warning', 'caution', 'phrase', 'xref', 'author', 'orgname', 'tip', 'synopsis', 'note', 'application', 'emphasis', 'returnvalue', 'variablelist', 'indexterm', 'parameter', 'firstterm', 'sgmltag', 'screenshot', 'quote', 'symbol', 'beginpage', 'cmdsynopsis', 'action', 'important', 'biblioref', 'database', 'markup', 'uri', 'abbrev', 'command', 'keysym', 'superscript']}, 'link': {'attributes': ['lang', 'revisionflag', 'remap', 'vendor', 'os', 'arch', 'endterm', 'xrefstyle', 'linkend', 'wordsize', 'role', 'dir', 'xreflabel', 'userlevel', 'xml:base', 'security', 'revision', 'type', 'id', 'condition', 'conformance'], 'children': ['code', 'keycombo', 'modespec', 'guiicon', 'guimenu', 'guisubmenu', 'userinput', 'errortext', 'methodsynopsis', 'footnoteref', 'inlineequation', 'structname', 'interfacename', 'mousebutton', 'envar', 'othercredit', 'ulink', 'methodname', 'guimenuitem', 'classsynopsis', 'systemitem', 'keycap', 'productname', 'token', 'citerefentry', 'medialabel', 'guilabel', 'termdef', 'wordasword', 'corpauthor', 'ooexception', 'destructorsynopsis', 'filename', 'errorcode', 'constructorsynopsis', 'computeroutput', 'subscript', 'email', 'acronym', 'replaceable', 'citetitle', 'exceptionname', 'oointerface', 'revhistory', 'interface', 'optional', 'keycode', 'remark', 'package', 'varname', 'errortype', 'ooclass', 'guibutton', 'structfield', 'funcsynopsis', 'productnumber', 'authorinitials', 'classname', 'fieldsynopsis', 'prompt', 'inlinegraphic', 'personname', 'trademark', 'literal', 'type', 'olink', 'function', 'option', 'corpcredit', 'link', 'foreignphrase', 'inlinemediaobject', 'glossterm', 'property', 'anchor', 'constant', 'menuchoice', 'footnote', 'citation', 'errorname', 'hardware', 'phrase', 'xref', 'author', 'orgname', 'synopsis', 'application', 'emphasis', 'returnvalue', 'indexterm', 'parameter', 'firstterm', 'sgmltag', 'quote', 'symbol', 'beginpage', 'cmdsynopsis', 'action', 'biblioref', 'database', 'markup', 'uri', 'abbrev', 'command', 'keysym', 'superscript']}, 'article': {'attributes': ['status', 'lang', 'remap', 'vendor', 'os', 'revisionflag', 'conformance', 'xml:base', 'class', 'wordsize', 'role', 'dir', 'xreflabel', 'userlevel', 'parentbook', 'security', 'arch', 'id', 'condition', 'revision'], 'children': ['appendix', 'programlisting', 'subtitle', 'simplesect', 'figure', 'cmdsynopsis', 'mediaobject', 'titleabbrev', 'formalpara', 'informalequation', 'warning', 'caution', 'informalexample', 'table', 'fieldsynopsis', 'funcsynopsis', 'literallayout', 'glosslist', 'task', 'msgset', 'bibliography', 'destructorsynopsis', 'title', 'highlights', 'section', 'bridgehead', 'tip', 'segmentedlist', 'informalfigure', 'methodsynopsis', 'note', 'informaltable', 'screenco', 'constructorsynopsis', 'lot', 'ackno', 'sect1', 'indexterm', 'abstract', 'calloutlist', 'blockquote', 'screenshot', 'index', 'screen', 'graphicco', 'remark', 'qandaset', 'epigraph', 'important', 'para', 'address', 'toc', 'orderedlist', 'beginpage', 'classsynopsis', 'sidebar', 'mediaobjectco', 'simpara', 'anchor', 'colophon', 'refentry', 'tocchap', 'programlistingco', 'graphic', 'articleinfo', 'example', 'authorblurb', 'glossary', 'synopsis', 'bibliolist', 'variablelist', 'simplelist', 'itemizedlist', 'equation', 'procedure']}, 'orderedlist': {'attributes': ['lang', 'revisionflag', 'remap', 'vendor', 'os', 'continuation', 'spacing', 'dir', 'wordsize', 'role', 'condition', 'xreflabel', 'xml:base', 'userlevel', 'inheritnum', 'security', 'revision', 'arch', 'id', 'numeration', 'conformance'], 'children': ['programlisting', 'funcsynopsis', 'cmdsynopsis', 'mediaobject', 'titleabbrev', 'informalequation', 'fieldsynopsis', 'caution', 'informalexample', 'authorblurb', 'blockinfo', 'literallayout', 'destructorsynopsis', 'title', 'highlights', 'bridgehead', 'tip', 'formalpara', 'informalfigure', 'methodsynopsis', 'note', 'informaltable', 'screenco', 'constructorsynopsis', 'indexterm', 'abstract', 'listitem', 'blockquote', 'screenshot', 'screen', 'graphicco', 'remark', 'important', 'para', 'address', 'beginpage', 'classsynopsis', 'mediaobjectco', 'simpara', 'programlistingco', 'graphic', 'synopsis', 'warning', 'epigraph', 'anchor']}, 'subscript': {'attributes': ['lang', 'revisionflag', 'remap', 'vendor', 'os', 'conformance', 'wordsize', 'role', 'dir', 'xreflabel', 'userlevel', 'xml:base', 'security', 'arch', 'id', 'condition', 'revision'], 'children': ['remark', 'symbol', 'replaceable', 'inlinemediaobject', 'emphasis', 'ulink', 'link', 'subscript', 'inlinegraphic', 'anchor', 'olink', 'superscript']}, 'chapter': {'attributes': ['status', 'lang', 'remap', 'vendor', 'os', 'revisionflag', 'conformance', 'label', 'wordsize', 'role', 'dir', 'xreflabel', 'userlevel', 'xml:base', 'security', 'arch', 'id', 'condition', 'revision'], 'children': ['programlisting', 'subtitle', 'simplesect', 'figure', 'cmdsynopsis', 'mediaobject', 'titleabbrev', 'formalpara', 'sect1', 'informalequation', 'tocchap', 'caution', 'informalexample', 'table', 'fieldsynopsis', 'funcsynopsis', 'literallayout', 'glosslist', 'graphicco', 'index', 'msgset', 'bibliography', 'destructorsynopsis', 'title', 'highlights', 'section', 'bridgehead', 'tip', 'segmentedlist', 'informalfigure', 'methodsynopsis', 'note', 'informaltable', 'screenco', 'constructorsynopsis', 'lot', 'toc', 'indexterm', 'chapterinfo', 'abstract', 'calloutlist', 'blockquote', 'screenshot', 'screen', 'beginpage', 'remark', 'qandaset', 'epigraph', 'task', 'important', 'para', 'address', 'orderedlist', 'classsynopsis', 'sidebar', 'mediaobjectco', 'simpara', 'anchor', 'refentry', 'glossary', 'programlistingco', 'graphic', 'example', 'authorblurb', 'synopsis', 'bibliolist', 'variablelist', 'simplelist', 'itemizedlist', 'warning', 'equation', 'procedure']}, 'term': {'attributes': ['lang', 'revisionflag', 'remap', 'vendor', 'os', 'conformance', 'wordsize', 'role', 'dir', 'xreflabel', 'userlevel', 'xml:base', 'security', 'arch', 'id', 'condition', 'revision'], 'children': ['code', 'keycombo', 'modespec', 'guiicon', 'guimenu', 'guisubmenu', 'userinput', 'errortext', 'methodsynopsis', 'footnoteref', 'inlineequation', 'structname', 'interfacename', 'mousebutton', 'envar', 'othercredit', 'ulink', 'methodname', 'guimenuitem', 'classsynopsis', 'systemitem', 'keycap', 'productname', 'token', 'citerefentry', 'medialabel', 'guilabel', 'termdef', 'wordasword', 'corpauthor', 'ooexception', 'destructorsynopsis', 'filename', 'errorcode', 'constructorsynopsis', 'computeroutput', 'subscript', 'email', 'acronym', 'replaceable', 'citetitle', 'exceptionname', 'oointerface', 'revhistory', 'interface', 'optional', 'keycode', 'remark', 'package', 'varname', 'errortype', 'ooclass', 'guibutton', 'structfield', 'funcsynopsis', 'productnumber', 'authorinitials', 'classname', 'fieldsynopsis', 'prompt', 'inlinegraphic', 'personname', 'trademark', 'literal', 'type', 'olink', 'function', 'option', 'corpcredit', 'link', 'foreignphrase', 'inlinemediaobject', 'glossterm', 'property', 'anchor', 'constant', 'menuchoice', 'footnote', 'citation', 'errorname', 'hardware', 'phrase', 'xref', 'author', 'orgname', 'synopsis', 'application', 'emphasis', 'returnvalue', 'indexterm', 'parameter', 'firstterm', 'sgmltag', 'quote', 'symbol', 'beginpage', 'cmdsynopsis', 'action', 'biblioref', 'database', 'markup', 'uri', 'abbrev', 'command', 'keysym', 'superscript']}, 'imagedata': {'attributes': ['revisionflag', 'xml:base', 'id', 'srccredit', 'scale', 'width', 'contentdepth', 'role', 'xreflabel', 'valign', 'conformance', 'revision', 'remap', 'scalefit', 'vendor', 'format', 'userlevel', 'fileref', 'arch', 'condition', 'lang', 'align', 'depth', 'wordsize', 'entityref', 'contentwidth', 'security', 'os', 'dir'], 'children': []}, 'title': {'attributes': ['lang', 'revisionflag', 'remap', 'pagenum', 'os', 'conformance', 'xml:base', 'wordsize', 'role', 'dir', 'xreflabel', 'userlevel', 'vendor', 'security', 'arch', 'id', 'condition', 'revision'], 'children': ['code', 'keycombo', 'modespec', 'guiicon', 'guimenu', 'guisubmenu', 'userinput', 'errortext', 'footnoteref', 'inlineequation', 'structname', 'interfacename', 'mousebutton', 'envar', 'othercredit', 'ulink', 'methodname', 'guimenuitem', 'systemitem', 'keycap', 'productname', 'token', 'citerefentry', 'medialabel', 'guilabel', 'termdef', 'wordasword', 'corpauthor', 'ooexception', 'filename', 'errorcode', 'computeroutput', 'subscript', 'email', 'acronym', 'replaceable', 'citetitle', 'exceptionname', 'oointerface', 'revhistory', 'interface', 'optional', 'keycode', 'remark', 'package', 'varname', 'errortype', 'ooclass', 'guibutton', 'structfield', 'productnumber', 'authorinitials', 'classname', 'prompt', 'inlinegraphic', 'personname', 'trademark', 'literal', 'type', 'olink', 'function', 'option', 'corpcredit', 'link', 'foreignphrase', 'inlinemediaobject', 'glossterm', 'property', 'anchor', 'constant', 'menuchoice', 'footnote', 'citation', 'errorname', 'hardware', 'phrase', 'xref', 'author', 'orgname', 'application', 'emphasis', 'returnvalue', 'indexterm', 'parameter', 'firstterm', 'sgmltag', 'quote', 'symbol', 'action', 'biblioref', 'database', 'markup', 'uri', 'abbrev', 'command', 'keysym', 'superscript']}, 'articleinfo': {'attributes': ['lang', 'revisionflag', 'remap', 'vendor', 'os', 'conformance', 'wordsize', 'role', 'dir', 'xreflabel', 'userlevel', 'xml:base', 'security', 'arch', 'id', 'condition', 'revision'], 'children': ['contractsponsor', 'isbn', 'contractnum', 'pubdate', 'productnumber', 'mediaobject', 'address', 'invpartnumber', 'itermset', 'printhistory', 'edition', 'modespec', 'pubsnumber', 'contrib', 'seriesvolnums', 'corpauthor', 'authorgroup', 'artpagenums', 'author', 'orgname', 'volumenum', 'confgroup', 'authorinitials', 'pagenums', 'editor', 'bibliorelation', 'honorific', 'corpname', 'indexterm', 'abstract', 'keywordset', 'subjectset', 'firstname', 'citebiblioid', 'title', 'issuenum', 'collab', 'othercredit', 'corpcredit', 'citetitle', 'biblioset', 'legalnotice', 'bibliomisc', 'date', 'othername', 'surname', 'lineage', 'publisher', 'biblioid', 'graphic', 'publishername', 'copyright', 'subtitle', 'affiliation', 'bibliocoverage', 'issn', 'bibliosource', 'productname', 'authorblurb', 'personname', 'abbrev', 'titleabbrev', 'releaseinfo', 'revhistory']}, 'inlinemediaobject': {'attributes': ['lang', 'revisionflag', 'remap', 'vendor', 'os', 'conformance', 'wordsize', 'role', 'dir', 'xreflabel', 'userlevel', 'xml:base', 'security', 'arch', 'id', 'condition', 'revision'], 'children': ['audioobject', 'videoobject', 'imageobject', 'imageobjectco', 'textobject', 'objectinfo']}, 'variablelist': {'attributes': ['lang', 'revisionflag', 'remap', 'vendor', 'os', 'termlength', 'conformance', 'spacing', 'wordsize', 'role', 'dir', 'xreflabel', 'userlevel', 'xml:base', 'security', 'arch', 'id', 'condition', 'revision'], 'children': ['programlisting', 'funcsynopsis', 'varlistentry', 'cmdsynopsis', 'mediaobject', 'titleabbrev', 'informalequation', 'fieldsynopsis', 'caution', 'informalexample', 'authorblurb', 'blockinfo', 'literallayout', 'destructorsynopsis', 'title', 'highlights', 'bridgehead', 'tip', 'formalpara', 'informalfigure', 'methodsynopsis', 'note', 'informaltable', 'screenco', 'constructorsynopsis', 'indexterm', 'abstract', 'blockquote', 'screenshot', 'screen', 'graphicco', 'remark', 'important', 'para', 'address', 'beginpage', 'classsynopsis', 'mediaobjectco', 'simpara', 'programlistingco', 'graphic', 'synopsis', 'warning', 'epigraph', 'anchor']}, 'ulink': {'attributes': ['lang', 'revisionflag', 'remap', 'vendor', 'os', 'url', 'arch', 'xrefstyle', 'wordsize', 'role', 'dir', 'xreflabel', 'userlevel', 'xml:base', 'security', 'revision', 'type', 'id', 'condition', 'conformance'], 'children': ['code', 'keycombo', 'modespec', 'guiicon', 'guimenu', 'guisubmenu', 'userinput', 'errortext', 'methodsynopsis', 'footnoteref', 'inlineequation', 'structname', 'interfacename', 'mousebutton', 'envar', 'othercredit', 'ulink', 'methodname', 'guimenuitem', 'classsynopsis', 'systemitem', 'keycap', 'productname', 'token', 'citerefentry', 'medialabel', 'guilabel', 'termdef', 'wordasword', 'corpauthor', 'ooexception', 'destructorsynopsis', 'filename', 'errorcode', 'constructorsynopsis', 'computeroutput', 'subscript', 'email', 'acronym', 'replaceable', 'citetitle', 'exceptionname', 'oointerface', 'revhistory', 'interface', 'optional', 'keycode', 'remark', 'package', 'varname', 'errortype', 'ooclass', 'guibutton', 'structfield', 'funcsynopsis', 'productnumber', 'authorinitials', 'classname', 'fieldsynopsis', 'prompt', 'inlinegraphic', 'personname', 'trademark', 'literal', 'type', 'olink', 'function', 'option', 'corpcredit', 'link', 'foreignphrase', 'inlinemediaobject', 'glossterm', 'property', 'anchor', 'constant', 'menuchoice', 'footnote', 'citation', 'errorname', 'hardware', 'phrase', 'xref', 'author', 'orgname', 'synopsis', 'application', 'emphasis', 'returnvalue', 'indexterm', 'parameter', 'firstterm', 'sgmltag', 'quote', 'symbol', 'beginpage', 'cmdsynopsis', 'action', 'biblioref', 'database', 'markup', 'uri', 'abbrev', 'command', 'keysym', 'superscript']}, 'itemizedlist': {'attributes': ['lang', 'revisionflag', 'remap', 'vendor', 'os', 'conformance', 'spacing', 'mark', 'wordsize', 'role', 'dir', 'xreflabel', 'userlevel', 'xml:base', 'security', 'arch', 'id', 'condition', 'revision'], 'children': ['programlisting', 'funcsynopsis', 'cmdsynopsis', 'mediaobject', 'titleabbrev', 'informalequation', 'fieldsynopsis', 'caution', 'informalexample', 'authorblurb', 'blockinfo', 'literallayout', 'destructorsynopsis', 'title', 'highlights', 'bridgehead', 'tip', 'formalpara', 'informalfigure', 'methodsynopsis', 'note', 'informaltable', 'screenco', 'constructorsynopsis', 'indexterm', 'abstract', 'listitem', 'blockquote', 'screenshot', 'screen', 'graphicco', 'remark', 'important', 'para', 'address', 'beginpage', 'classsynopsis', 'mediaobjectco', 'simpara', 'programlistingco', 'graphic', 'synopsis', 'warning', 'epigraph', 'anchor']}, 'superscript': {'attributes': ['lang', 'revisionflag', 'remap', 'vendor', 'os', 'conformance', 'wordsize', 'role', 'dir', 'xreflabel', 'userlevel', 'xml:base', 'security', 'arch', 'id', 'condition', 'revision'], 'children': ['remark', 'symbol', 'replaceable', 'inlinemediaobject', 'emphasis', 'ulink', 'link', 'subscript', 'inlinegraphic', 'anchor', 'olink', 'superscript']}} diff --git a/helpcontent2/wiki-to-help/mwlib_mods/docbook_internLinks.py b/helpcontent2/wiki-to-help/mwlib_mods/docbook_internLinks.py new file mode 100644 index 0000000000..ab54dd0c16 --- /dev/null +++ b/helpcontent2/wiki-to-help/mwlib_mods/docbook_internLinks.py @@ -0,0 +1,67 @@ +""" +This enables the conversion of article links to internal links within the docbook output. + +Author: Timo Richter +""" + +# Set up nuwiki.adapt +import mwlib.nuwiki +class MyAdapt(mwlib.nuwiki.adapt): + def getParsedArticle(self, title, revision=None): + """ Add the original title to the attributes of each article """ + a = super(MyAdapt,self).getParsedArticle(title,revision) + if a: + a.title = title + return a + def getURL(self, name, revision=None, defaultns=None): + """ Returns raw link targets """ + return name + +mwlib.nuwiki.adapt = MyAdapt + + +# Set up docbookwriter.grammar +import mwlib.docbookwriter +import docbook45grammar +mwlib.docbookwriter.grammar = docbook45grammar.grammar + + +# Set up docbookwriter +import mwlib.docbookwriter +import lxml.etree +class MyDocBookWriter(mwlib.docbookwriter.DocBookWriter): + def getTargetId(self,title): + """ Transform "The first article" to "The_first_article" """ + return title.replace(" ","_") + + def dbwriteArticle(self, a): + """ + Add id-attribute with original title to all articles. + <article id="a.title"> + """ + e = super(MyDocBookWriter,self).dbwriteArticle(a) + targetId = self.getTargetId(a.title) + e.set("id",targetId) + return e + + def dbwriteArticleLink(self, obj): + Element = mwlib.docbookwriter.Element + a = Element("link") + if obj.target: + a.set("linkend", obj.target) + if not obj.children: + a.text = obj.target + return a + #dbwriteLink = dbwriteURL + #dbwriteNamedURL = dbwriteURL + #dbwriteSpecialLink = dbwriteURL + #dbwriteCategoryLink = dbwriteURL + #dbwriteLangLink = dbwriteURL + #dbwriteArticleLink = dbwriteLink + #dbwriteLangLink = dbwriteLink # FIXME + #dbwriteNamespaceLink = dbwriteLink# FIXME + #dbwriteInterwikiLink = dbwriteLink# FIXME + #dbwriteSpecialLink = dbwriteLink# FIXME + +mwlib.docbookwriter.DocBookWriter = MyDocBookWriter + diff --git a/helpcontent2/wiki-to-help/nfo.json b/helpcontent2/wiki-to-help/nfo.json new file mode 100644 index 0000000000..ae6b9c80ee --- /dev/null +++ b/helpcontent2/wiki-to-help/nfo.json @@ -0,0 +1,5 @@ +{ + "base_url": "http://help.libreoffice.org/", + "format": "nuwiki", + "script_extension": ".php" +} diff --git a/helpcontent2/wiki-to-help/test2.xml b/helpcontent2/wiki-to-help/test2.xml index ad0af7df8b..ed355e75bd 100644 --- a/helpcontent2/wiki-to-help/test2.xml +++ b/helpcontent2/wiki-to-help/test2.xml @@ -378,4 +378,54 @@ Sæt skriftstørrelsen for den markerede tekst. }}</text> </revision> </page> + <page> + <title>Writer/Welcome to the Writer Help</title> + <id>6009</id> + <revision> + <id>82722</id> + <timestamp>2011-01-19T15:11:59Z</timestamp> + <contributor> + <username>WikiSysop</username> + <id>1</id> + </contributor> + <text xml:space="preserve">{{OrigLang|Welcome to the {{ProductName}} Writer Help}} +<div id="bm_id3147244"></div> +<div id="bm_id3147247"></div> +=== Working With {{ProductName}} Writer === + +[[Writer/Writer_Features|{{ProductName}} Writer Features]] + +[[Writer/Instructions_for_Using_Writer|Instructions for Using {{ProductName}} Writer]] + +[[Chart/Charts_in|Using Charts in {{ProductName}}]] + +[[Common/Database_1|Using Databases in {{ProductName}} Base]] + +=== Menus, Toolbars, and Keys === + +[[Writer/Menus|Menus]] + +[[Writer/Toolbars|Toolbars]] + +[[Writer/Shortcut_Keys_for_Writer|Shortcut Keys for {{ProductName}} Writer]] + +=== Getting Help === + +<!-- this section is displayed on all module main pages above the other "Help about Help" links. -->The Help references the default settings of the program on a system that is set to defaults. Descriptions of colors, mouse actions, or other configurable items can be different for your program and system. + +[[Common/The_Help_Window|The {{ProductName}} Help Window]] + +[[Common/Help_Agent,_Tips_and_Extended_Tips|Help Agent, Tips and Extended Tips]] + +[[Common/Index_-_Keyword_Search_in_the_Help|Index - Keyword Search in the Help]] + +[[Common/Find_-_The_Full-Text_Search|Find - The Full-Text Search]] + +[[Common/Managing_Bookmarks|Managing Bookmarks]] + +[[Common/Contents_-_The_Main_Help_Topics|Contents - The Main Help Topics]] + +[[Common/Getting_Support|Getting Support]]</text> + </revision> + </page> </mediawiki> |