From 61173c1b58efa79c0ba6b08348d2796a249d0186 Mon Sep 17 00:00:00 2001 From: Norbert Thiebaud Date: Sat, 1 Sep 2012 09:51:27 -0500 Subject: move help structure one directory up Change-Id: Ie970e39fbb6795a92d9fdd13510409d7dcd071bc --- wiki-to-help/HHC/htmlhelp.reg | 12 + wiki-to-help/HHC/install_hhc.sh | 69 ++++ wiki-to-help/README | 56 +++ wiki-to-help/call_convert.sh | 3 + wiki-to-help/convert.py | 222 ++++++++++ wiki-to-help/executor.py | 21 + wiki-to-help/hhc.py | 70 ++++ wiki-to-help/htmlhelp.xsl | 23 ++ wiki-to-help/metabook.json | 26 ++ wiki-to-help/metabook.py | 154 +++++++ wiki-to-help/metabook_translated.py | 118 ++++++ wiki-to-help/mw.py | 49 +++ wiki-to-help/mwlib_mods/__init__.py | 28 ++ wiki-to-help/mwlib_mods/custom_nfo.py | 19 + wiki-to-help/mwlib_mods/docbook45grammar.py | 2 + wiki-to-help/mwlib_mods/docbook_grammar.py | 11 + wiki-to-help/mwlib_mods/docbook_internLinks.py | 76 ++++ wiki-to-help/mwlib_mods/docbook_table_tags.py | 93 +++++ wiki-to-help/mwlib_mods/docbookwriter_options.py | 54 +++ wiki-to-help/mwlib_mods/indexterm_from_title.py | 24 ++ wiki-to-help/mwlib_mods/no_sections.py | 38 ++ wiki-to-help/nfo.json | 5 + wiki-to-help/test2.xml | 489 +++++++++++++++++++++++ 23 files changed, 1662 insertions(+) create mode 100644 wiki-to-help/HHC/htmlhelp.reg create mode 100755 wiki-to-help/HHC/install_hhc.sh create mode 100644 wiki-to-help/README create mode 100755 wiki-to-help/call_convert.sh create mode 100755 wiki-to-help/convert.py create mode 100644 wiki-to-help/executor.py create mode 100644 wiki-to-help/hhc.py create mode 100644 wiki-to-help/htmlhelp.xsl create mode 100644 wiki-to-help/metabook.json create mode 100644 wiki-to-help/metabook.py create mode 100644 wiki-to-help/metabook_translated.py create mode 100644 wiki-to-help/mw.py create mode 100644 wiki-to-help/mwlib_mods/__init__.py create mode 100644 wiki-to-help/mwlib_mods/custom_nfo.py create mode 100644 wiki-to-help/mwlib_mods/docbook45grammar.py create mode 100644 wiki-to-help/mwlib_mods/docbook_grammar.py create mode 100644 wiki-to-help/mwlib_mods/docbook_internLinks.py create mode 100644 wiki-to-help/mwlib_mods/docbook_table_tags.py create mode 100644 wiki-to-help/mwlib_mods/docbookwriter_options.py create mode 100644 wiki-to-help/mwlib_mods/indexterm_from_title.py create mode 100644 wiki-to-help/mwlib_mods/no_sections.py create mode 100644 wiki-to-help/nfo.json create mode 100644 wiki-to-help/test2.xml (limited to 'wiki-to-help') diff --git a/wiki-to-help/HHC/htmlhelp.reg b/wiki-to-help/HHC/htmlhelp.reg new file mode 100644 index 0000000000..e38e0ef828 --- /dev/null +++ b/wiki-to-help/HHC/htmlhelp.reg @@ -0,0 +1,12 @@ +REGEDIT4 + +[HKEY_CURRENT_USER\Software\Wine] +"Version"="win2k" + +[HKEY_CURRENT_USER\Software\Wine\AppDefaults\hhc.exe\DllOverrides] +"itircl"="native" +"itss"="native" + +[HKEY_CURRENT_USER\Software\Wine\AppDefaults\hhw.exe\DllOverrides] +"itircl"="native" +"itss"="native" diff --git a/wiki-to-help/HHC/install_hhc.sh b/wiki-to-help/HHC/install_hhc.sh new file mode 100755 index 0000000000..344ccbd5b0 --- /dev/null +++ b/wiki-to-help/HHC/install_hhc.sh @@ -0,0 +1,69 @@ +#!/bin/bash -e +# -e Exit immediately if a command exits with a non-zero status. + +# This installs Microsofts HHC (HTML Help Compiler) +# Copyright 2011 Timo Richter and others. +# Licensed under GNU GPLv3 +# Depends on: wine, wget, cabextract +# +# Usage of HHC: wine c:\\htmlhelp\\hhc.exe c:\\test\\htmlhelp.hhp +# +# Changes: Set installation directory to c:\htmlhelp +# Copy also itcc.dll, this is neccessary +# No execution of htmlhelp.exe installer needed +# Abortion of install if anything fails, e.g. the download of HHC. +# + +which wine > /dev/null 2>&1 || { echo "Please install 'wine'." ; exit 1 ; } +which cabextract > /dev/null 2>&1 || { echo "Please install 'cabextract'." ; exit 1 ; } +which wget > /dev/null 2>&1 || { echo "Please install 'wget'." ; exit 1 ; } + +echo "Going to install hhc.exe to your wine installation..." + +cd "$(dirname $0)" # cd to path of this script + +WINEPREFIX=${WINEPREFIX:=$HOME/.wine} +test -d "$WINEPREFIX" || winecfg +HHDIR="${WINEPREFIX}/dosdevices/c:/htmlhelp" +mkdir -p "$HHDIR" + +# Setup the registry +# Set Wine's Windows version to Windows 2000 (or above), and add an override to use the native itss.dll, both via winecfg. +wine regedit htmlhelp.reg + +cd "$HHDIR" + +# Install HTML Help Workshop +wget -O htmlhelp.exe 'http://go.microsoft.com/fwlink/?LinkId=14188' + +# unneccessary +#wine htmlhelp.exe + +cabextract -F hhc.exe htmlhelp.exe +cabextract -F HHA.dll htmlhelp.exe + +# Install ITSS.DLL +cabextract -F hhupd.exe htmlhelp.exe +cabextract -F itircl.dll hhupd.exe +cabextract -F itss.dll hhupd.exe +cabextract -F itcc.dll htmlhelp.exe +cabextract -F hhctrl.ocx hhupd.exe +cp -a itircl.dll "$WINEPREFIX/drive_c/windows/system32/" +cp -a itcc.dll "$WINEPREFIX/drive_c/windows/system32/" +cp -a itss.dll "$WINEPREFIX/drive_c/windows/system32/" +cp -a hhctrl.ocx "$WINEPREFIX/drive_c/windows/system32/" +wine regsvr32 'C:\WINDOWS\SYSTEM32\itcc.dll' +wine regsvr32 'C:\WINDOWS\SYSTEM32\itircl.dll' +wine regsvr32 'C:\WINDOWS\SYSTEM32\itss.dll' +wine regsvr32 'C:\WINDOWS\SYSTEM32\hhctrl.ocx' + +# Install MFC40.DLL +wget -N http://activex.microsoft.com/controls/vc/mfc40.cab +cabextract -F mfc40.exe mfc40.cab +cabextract -F mfc40.dll mfc40.exe +cp -a mfc40.dll "$WINEPREFIX/drive_c/windows/system32/" + +echo +echo Done, hhc.exe installed. + +exit 0 diff --git a/wiki-to-help/README b/wiki-to-help/README new file mode 100644 index 0000000000..2f254ac0a1 --- /dev/null +++ b/wiki-to-help/README @@ -0,0 +1,56 @@ + +Conversion of an XML-Dump to platformspecific help files +-------------------------------------------------------- + +1 INSTALLATION + +The following programs are required: + - mwlib + - python + - python-lxml + - xsltproc + - unzip + - docbook-xsl-stylesheets + +HHC-Installer depends on: + - wine + - cabextract + - wget + +1.1 On GNU and UNIX + + - Install wine + - Execute HHC/install_hhc.sh + +1.2 On Windows + + - Install HHC from http://go.microsoft.com/fwlink/?LinkId=14188 + +2 USAGE + +See ./convert.py -h + +For the correct operation, you need to modify htmlhelp.xsl to point to your +docbook-xsl-stylesheets installation, like: + +--- a/helpcontent2/wiki-to-help/htmlhelp.xsl ++++ b/helpcontent2/wiki-to-help/htmlhelp.xsl +@@ -16,8 +16,8 @@ + + ******************************************************************** --> + +- ++ + +- ++ + + + + +3 LICENSE + +The following applies to all files if not stated differently + + - Licensed under GNU LGPLv3 or later / MPL + - Copyright 2011 Timo Richter diff --git a/wiki-to-help/call_convert.sh b/wiki-to-help/call_convert.sh new file mode 100755 index 0000000000..c3ff714fcf --- /dev/null +++ b/wiki-to-help/call_convert.sh @@ -0,0 +1,3 @@ +#!/bin/bash +./convert.py test2.xml test/ + diff --git a/wiki-to-help/convert.py b/wiki-to-help/convert.py new file mode 100755 index 0000000000..323a834d19 --- /dev/null +++ b/wiki-to-help/convert.py @@ -0,0 +1,222 @@ +#!/usr/bin/env python +#!/usr/bin/python -i +""" +Convert an XML-Dump to platformspecific help files. +Copyright 2011 Timo Richter + +This program depends on: +mwlib +python +python-lxml +xsltproc +Microsoft HHC: http://go.microsoft.com/fwlink/?LinkId=14188 + + +""" + +import subprocess, tempfile, os, shutil, argparse + +#import mwlib_mods # is being imported. see below +from hhc import HHC +from mw import MW +from metabook_translated import MetabookTranslated +from metabook_translated import LanguageSeparator +from executor import Executor + +scriptpath=os.path.dirname(os.path.realpath(__file__) ) + +class Main(object): + ''' Defines program parameters and returns them as a dictionary ''' + def parseArgs(self): + parser = argparse.ArgumentParser(description='Conversion from a mediawiki xml-dumpfile to helpfiles') + parser.add_argument("--startpage", metavar="PATH", dest="startpage", default=None, type=str, help="Sets a HTML-file as the start page") + parser.add_argument("--images", metavar="PATH", dest="imgPath", default=None, type=str, help="Uses images from PATH. PATH is a zipfile or a directory.") + parser.add_argument("--keep", dest="keepTmp", default=False, action='store_true', help="Keeps temporary files in /tmp") + parser.add_argument("--only-en", dest="onlyEn", action='store_true', default=False, help="Converts only English articles") + parser.add_argument("--no-chm", dest="createChm", default=True, action='store_false', help="Avoids creation of a CHM file at the end") + parser.add_argument("-v", dest="verbose", default=False, action='store_true', help="Verbose") + parser.add_argument("input", type=str, help="XML input") + parser.add_argument("output", type=str, help="Directory for output") + + return parser.parse_args() + + def __init__(self): + args = self.parseArgs() + import mwlib_mods + r = Converter( + keepTmp=args.keepTmp, + createChm=args.createChm, + source=args.input, + dest=args.output, + startpage=args.startpage, + onlyEn=args.onlyEn, + imgPath=args.imgPath, + verbose=args.verbose, + )() + exit(int(not r)) + + +class Converter(object): + verbose=False + createChm = None # + keepTmp = None # + #style=os.path.join(scriptpath,'xsl/htmlhelp/htmlhelp.xsl') # final + style=os.path.join(scriptpath,'htmlhelp.xsl') # final + title="Book" # final + + tmp=None + includeFiles=[] + + def __init__(self,source,dest,onlyEn,imgPath,verbose, + keepTmp=False,createChm=True,startpage=None): + """ + Parameters are documented in Main.parseArgs() + """ + self.createChm = createChm + self.keepTmp=keepTmp + self.tmp = tempfile.mkdtemp() + self.style = os.path.abspath(self.style) + source = os.path.abspath(source) + dest = os.path.abspath(dest) + if startpage is not None: + startpage = os.path.abspath(startpage) + self.source=source + self.dest=dest + self.startpage=startpage + self.onlyEn = onlyEn + self.imgPath = imgPath + self.verbose = verbose + self.ex = Executor(showErr=verbose,showOutput=True,showCmd=verbose) + self.hhc = HHC(showErr=True,showOutput=verbose,showCmd=verbose) + self.title = self.getTitle(self.title) + + def getTitle(self,default=None): + """ + If given, return TEXT from TEXT + in xml file self.source. + Otherwise return @default + """ + import xml.dom.minidom + print "Loading title" + dom = xml.dom.minidom.parse(self.source) + try: + siteinfo = dom.getElementsByTagName("siteinfo")[0] + sitename = siteinfo.getElementsByTagName("sitename")[0] + name = sitename.childNodes[0].data + except IndexError: + return default + else: + return name + + def createDir(self,path): + try: + os.mkdir(path) + except OSError: + pass + + def setupImgPath(self): + """ + If --images is not given, the path will be in the format "images/name.jpg". + If --images is given a zipfile, it is being extracted to "images/". + If --images is a directory, it is being copied to "images/". + The filenames in images/ are being stored to self.includeFiles. + """ + imgDest = "images" # puts images to output/imgDest/ + if not self.imgPath: + self.imgPath = os.path.join(imgDest,"IMAGENAME") + return + extension = os.path.splitext(self.imgPath)[1].lower() + imgTmp = os.path.join(self.tmp,imgDest) + print "Copying images..." + if extension == ".zip": + self.ex("unzip","-q","-o","-j","-d",imgTmp,self.imgPath) + else: + shutil.copytree(self.imgPath,imgTmp) + shutil.copytree(imgTmp, os.path.join(self.dest,imgDest) ) + self.imgPath = os.path.join(imgDest,"IMAGENAME") + # Save filenames for inclusion in chm + for fname in os.listdir(imgTmp): + fpath = os.path.join(imgDest,fname) + self.includeFiles.append(fpath) + + def writeHhp(self): + """ + Writes changes to the .hhp-file. + self.includeFiles will be flushed to the hhp. + """ + hhp=os.path.join(self.tmp,"htmlhelp.hhp") + with open(hhp,"a") as f: + f.write("\n".join(self.includeFiles)) + + def __call__(self): + """ + Create the environment for conversion and call convert() + @return boolean Success + """ + tmp = self.tmp + self.createDir(self.dest) + + print "Working directory: "+tmp + + self.setupImgPath() + + shutil.copy(os.path.join(scriptpath,"nfo.json"),tmp) + metabook_template = os.path.join(scriptpath,"metabook.json") + ls = LanguageSeparator.fromFileToFiles(metabook_template,self.source,tmp) + MW.buildcdb(self.source,tmp) + + if self.onlyEn: + return self.convert("en",ls["en"]) + else: + + for lang, metabook in ls.iteritems(): + if not self.convert(lang,metabook): return False + + def convert(self,lang,metabook): + """ + Private. + This function executes the programs for the conversion. + @lang Language of book + @metabook Path to metabook-json-file + """ + print "Rendering language "+lang + tmp = self.tmp + docbookfile = os.path.join(tmp,"%s.xml"%lang) + chmDest = os.path.join(self.dest,lang+".chm") + + renderArgs = ("-L",lang,"-W","imagesrcresolver=%s"%self.imgPath, + "--config=%s/wikiconf.txt"%(tmp), + "-w","docbook","-o",docbookfile,"-m",metabook,"--title",self.title) + MW.quietCall(MW.render,renderArgs,showErr=self.verbose) + shutil.copy(docbookfile,self.dest) + print "Parsing docbook" + xsltreturn = self.ex("/usr/bin/xsltproc","--nonet","--novalid","-o",tmp+'/',self.style,docbookfile) + if not xsltreturn: return False + self.setStartpage(self.startpage) + self.writeHhp() + if self.createChm: + print("Compiling chm...") + self.hhc(tmp) + shutil.copy(os.path.join(tmp,'htmlhelp.chm'),chmDest) + return True + + def setStartpage(self,startpage): + """ + Private. + Copies @startpage to our tmp dir so that it will be used as the start page. + @return False if @startpage doesnt exist, otherwise True. + """ + if startpage is None: return True + filename="index.html" + if not os.path.exists(startpage): return False + os.remove(os.path.join(self.tmp,filename)) + shutil.copy(startpage, os.path.join(self.tmp,filename)) + return True + + def __del__(self): + if not self.keepTmp: + shutil.rmtree(self.tmp) # remove temp files + +if __name__ == '__main__': + Main() + diff --git a/wiki-to-help/executor.py b/wiki-to-help/executor.py new file mode 100644 index 0000000000..464ec222e4 --- /dev/null +++ b/wiki-to-help/executor.py @@ -0,0 +1,21 @@ +import subprocess, os + +class Executor(object): + def __init__(self,showErr=True,showOutput=True,showCmd=False): + self.showCmd=showCmd + if showErr: self.stderr = None + else: self.stderr=open(os.devnull,"w") + if showOutput: self.stdout = None + else: self.stdout=open(os.devnull,"w") + + def __call__(self,*cmd): + """ + Execute a program, e.g. Executor()("/bin/ls","/home") + @cmd Command, args + @return boolean True if succeed + """ + if self.showCmd: + print cmd + return (subprocess.Popen(list(cmd),stderr=self.stderr, + stdout=self.stdout).wait() == 0) + diff --git a/wiki-to-help/hhc.py b/wiki-to-help/hhc.py new file mode 100644 index 0000000000..dc7a54daaa --- /dev/null +++ b/wiki-to-help/hhc.py @@ -0,0 +1,70 @@ +import platform, os +from executor import Executor + +class HHC(object): + """ Class for execution of Html Help Compiler """ + hhcexe="c:\\htmlhelp\\hhc.exe" + + def __init__(self,**args): + """ + @args Arguments for Executor.__init__() + """ + self.args=args + + def exWindows(self,source): + """ Private. Compile @source calling HHC natively under Windows """ + cmd=[self.hhcexe,os.path.join(source,"htmlhelp.hhp")] + return Executor(**self.args).executor(*tuple(cmd)) + + def exWine(self,source): + """ Private. Compile @source calling HHC via Wine """ + #dirname = os.path.dirname(source) + wine = Wine(source,"j:",self.args) + r = wine(self.hhcexe,"j:\\htmlhelp.hhp") + del wine + return r + + def __call__(self,source): + """ + Converts @source with HHC + @source path to input directory that contains htmlhelp.hhp + """ + windows=(platform.system()=="Windows") + if windows is False: + self.exWine(source) + else: + self.exWindows(source) + +class Wine(object): + # TODO: this should be a singleton + def __init__(self,workingDir,driveletter,args={}): + """ + Setup the wine environment. Granting access so that wine is able + @workingDir will be accessable via @driveletter + @args Arguments for Executor as dict (**args) + E.g. Wine("/tmp/dir","j:") + """ + homedir = os.path.expanduser('~') + wineprefix=os.path.join(homedir,".wine") + drive=os.path.join(wineprefix,"dosdevices",driveletter) + if os.path.lexists(drive): + self.driveBak = drive+".bak" + shutil.move(drive,self.driveBak) + os.symlink(workingDir,drive) + self.drive = drive + #self.driveBak = driveBak + self.executor = Executor(**args) + + def ex(self,*cmd): + """ execute something with wine """ + cmd = [elem for elem in cmd] + cmd = ["/usr/bin/wine"]+cmd + return self.executor(*tuple(cmd)) + + def __call__(self,*cmd): + return self.ex(*cmd) + + def __del__(self): + os.remove(self.drive) + if hasattr(self,'driveBak'): + shutil.move(self.driveBak,self.drive) diff --git a/wiki-to-help/htmlhelp.xsl b/wiki-to-help/htmlhelp.xsl new file mode 100644 index 0000000000..ad815b6e1d --- /dev/null +++ b/wiki-to-help/htmlhelp.xsl @@ -0,0 +1,23 @@ + + + + + + + + + + diff --git a/wiki-to-help/metabook.json b/wiki-to-help/metabook.json new file mode 100644 index 0000000000..4f460a1e40 --- /dev/null +++ b/wiki-to-help/metabook.json @@ -0,0 +1,26 @@ +{ + "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" + } + ], + "images(deprecated)": { + "movedata.png": {"url": "http://path/movedata.png"} + + } +} diff --git a/wiki-to-help/metabook.py b/wiki-to-help/metabook.py new file mode 100644 index 0000000000..c6f05008cd --- /dev/null +++ b/wiki-to-help/metabook.py @@ -0,0 +1,154 @@ +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. + Sequence of usage: + m = Metabook() + m.loadTemplate(...) + m.loadArticles(xml input) + m.createBook() + m.write(output) + If template, in- and output are files, use fromFileToFile() + """ + ArticleClass = Article # final + artTags = ["title"] # final + + m = {} # Dict metabook + template = None + items = [] + #source = "" # String input file, xmldump + #dest = "" # FileObject destination of json metabook + + def getClone(self): + m = Metabook() + m.template = self.template # No copy() neccessary here + m.ArticleClass = self.ArticleClass + m.artTags = self.artTags + #m.m = self.m.copy() + #m.dest = self.dest + return m + + def getArtTags(self,filename,tagnames): + """ + Get Article Tags + Reads all specified tags from an xml file and returns a list of all tags. + @filename XML-file + @tagnames List of String Tagnames + @return List of Dict + """ + 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.template = json.load(jsonStruct) + #self.m = self.load_data(source) + + def loadArticles(self,source): + """ + Loads the articles and saves them as objects to self.items + """ + pages = self.getArtTags(source,self.artTags) + self.items = [self.ArticleClass(page) for page in pages] + """return + items=[] + for page in pages: + item = self.ArticleClass(page) + if item.getInclude(): + items.append(item.toDict()) + self.m["items"] = items + """ + + def createBook(self): + """ + Convert all article objects to dicts and merge them with the template. + The result is saved to self.m + """ + if self.template is None: + self.m = [] + else: + self.m = self.template.copy() + self.m["items"] = [] + for item in self.items: + if item.getInclude(): + self.m["items"].append(item.toDict()) + + def __call__(self,source): + """ + Creates a metabook for @source and writes it to self.m. To continue, + use write() + @source xml-dump + """ + self.loadArticles(source) + self.createBook() + + def write(self,dest): + json.dump(self.m,dest) + + def fromFileToFile(jsonStructFile,xmldump,output): + """ + Creates a Metabook from a file and writes it to a file. + Short cut Function. This loads a metabook template file, creates the + metabook content from @xmldump and writes the book to @output. + @jsonStructFile String path to Metabook template + @xmldump String path + @output String path + """ + #m = MetabookTranslated() + with open(jsonStructFile,"r") as f: + self.loadTemplate(f) + self.__call__(xmldump) + with open(output,"w") as f: + self.write(f) + + diff --git a/wiki-to-help/metabook_translated.py b/wiki-to-help/metabook_translated.py new file mode 100644 index 0000000000..a7f90dbcd1 --- /dev/null +++ b/wiki-to-help/metabook_translated.py @@ -0,0 +1,118 @@ +import metabook +import re, os + +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 metabook contains all articles with translated titles. + This concrete metabook expects article titles in this form: + Category/Title/lang + Comments include this: + {{Lang|translatedTitle}} + """ + ArticleClass=ArticleTranslated + artTags = ["title","comment"] + +class LanguageSeparator(object): + """ + A translated metabook is a metabook where all titles are in the destination + language. + This class splits a translated metabook into many books with homogenous languages. + """ + books={} # Dict + sortedItems={} # Dict> + items=[] # List + + def __init__(self, book): + self.book = book + self.items = book.items + + def splitItemsByLanguage(self): + """ + Sort the articles in self.items by language and put them to self.sortedItems + """ + sortedItems={} + for item in self.items: + if item.lang in sortedItems.keys(): + sortedItems[item.lang].append(item) + else: + sortedItems[item.lang] = [item] + self.sortedItems = sortedItems + #return sortedItems + + def createBooksByLanguage(self): + """ + Generate metabooks to self.books. + Create a metabook for each language from self.sortedItems. + """ + for lang, items in self.sortedItems.iteritems(): + m = self.book.getClone() + m.items = items + m.lang = lang + self.books[lang] = m + + @staticmethod + def fromFileToFiles(jsonStructFile,xmldump,output): + """ + Creates a Metabook from a file and writes it to one file per language. + Short cut Function. This loads a metabook template file, creates the + metabook content from @xmldump and writes the book to @output. + @jsonStructFile String path to Metabook template + @xmldump String path + @output String path to output directory + @return Dict + """ + m = MetabookTranslated() + with open(jsonStructFile,"r") as f: + m.loadTemplate(f) + + m.loadArticles(xmldump) + ls = LanguageSeparator(m) + ls.splitItemsByLanguage() + ls.createBooksByLanguage() + + pathlist={} + + for lang, book in ls.books.iteritems(): + book.createBook() + dest = os.path.join(output,"metabook_%s.json" % lang) + pathlist[lang] = dest + with open(dest,"w") as f: + book.write(f) + return pathlist + diff --git a/wiki-to-help/mw.py b/wiki-to-help/mw.py new file mode 100644 index 0000000000..f19ca15be8 --- /dev/null +++ b/wiki-to-help/mw.py @@ -0,0 +1,49 @@ +#import mwlib.cdbwiki, mwlib.apps.render, mwlib.apps +import mwlib.apps +import sys, os + +class MW(object): + """ + Use this adapter class to call mwlib within python. + Example: import mw; MW.buildcdb("in.xml","out") + """ + + @staticmethod + def quietCall(function,args=(),showErr=True,showOutput=True): + """ + Calls a python function and redirects parts to /dev/null. + This is platform independent. + """ + saveout = sys.stdout + saveerr = sys.stderr + + if not showErr: sys.stderr=nullerr=open(os.devnull,"w") + if not showOutput: sys.stdout=nullout=open(os.devnull,"w") + function(*args) + if not showErr: nullerr.close() + if not showOutput: nullout.close() + + sys.stdout=saveout + sys.stderr=saveerr + + @staticmethod + def _setArgs(function,args): + """ Set sys.argv for @function """ + bak = sys.argv + args=("nothing",)+args + dec=[x.encode() for x in args] + sys.argv=dec + r=function() + sys.argv=bak + return r + + @staticmethod + def buildcdb(source,dest): + args=("--input",source,"--output",dest) + return MW._setArgs(mwlib.apps.buildcdb,args) + #mwlib.cdbwiki.BuildWiki(*args) + + @staticmethod + def render(*args): + import mwlib.apps.render + return MW._setArgs(mwlib.apps.render.Main(),args) diff --git a/wiki-to-help/mwlib_mods/__init__.py b/wiki-to-help/mwlib_mods/__init__.py new file mode 100644 index 0000000000..c31bda4a9a --- /dev/null +++ b/wiki-to-help/mwlib_mods/__init__.py @@ -0,0 +1,28 @@ +""" +This package sets up modifications and bugfixes for mwlib. +Usage: import mwlib_mods +""" + +# The order of the imports is relevant! + +import docbook_grammar +docbook_grammar.apply() + +import docbook_table_tags +docbook_table_tags.apply() + +import docbookwriter_options +docbookwriter_options.apply() + +import no_sections +no_sections.apply() + +import docbook_internLinks +docbook_internLinks.apply() + +import custom_nfo +custom_nfo.apply() + +import indexterm_from_title +indexterm_from_title.apply() + diff --git a/wiki-to-help/mwlib_mods/custom_nfo.py b/wiki-to-help/mwlib_mods/custom_nfo.py new file mode 100644 index 0000000000..9d60fe6c8e --- /dev/null +++ b/wiki-to-help/mwlib_mods/custom_nfo.py @@ -0,0 +1,19 @@ +""" +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.") + self.nfo = self.get_data("nfo") or self.nfo + self.siteinfo = self.get_data("siteinfo") or self.siteinfo + +def apply(): + mwlib.cdbwiki.WikiDB=WikiDB + diff --git a/wiki-to-help/mwlib_mods/docbook45grammar.py b/wiki-to-help/mwlib_mods/docbook45grammar.py new file mode 100644 index 0000000000..e06b8879ca --- /dev/null +++ b/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']}, 'colspec': {'attributes': ['char', 'rowsep', 'colname', 'align', 'colsep', 'colnum', 'colwidth', 'charoff'], 'children': []}, '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']}, 'table': {'attributes': ['orient', 'revisionflag', 'rowsep', 'tabstyle', 'frame', 'remap', 'onmousedown', 'xml:base', 'tocentry', 'border', 'id', 'style', 'bgcolor', 'label', 'width', 'xml:lang', 'shortentry', 'xreflabel', 'onmousemove', 'cellspacing', 'revision', 'rowheader', 'vendor', 'onclick', 'onmouseout', 'onkeypress', 'rules', 'colsep', 'onkeydown', 'floatstyle', 'onkeyup', 'onmouseover', 'userlevel', 'role', 'arch', 'class', 'condition', 'lang', 'conformance', 'align', 'title', 'summary', 'wordsize', 'pgwide', 'onmouseup', 'cellpadding', 'security', 'ondblclick', 'os', 'dir'], 'children': ['graphic', 'title', 'mediaobject', 'colgroup', 'tr', 'titleabbrev', 'tbody', 'caption', 'tgroup', 'tfoot', 'textobject', 'blockinfo', 'indexterm', 'col', 'thead']}, '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']}, 'row': {'attributes': ['revisionflag', 'rowsep', 'onmousedown', 'xml:base', 'id', 'style', 'title', 'wordsize', 'onmousemove', 'xreflabel', 'valign', 'role', 'conformance', 'revision', 'remap', 'vendor', 'onclick', 'onmouseout', 'onkeypress', 'onkeydown', 'onmouseover', 'userlevel', 'arch', 'class', 'condition', 'lang', 'xml:lang', 'onmouseup', 'onkeyup', 'security', 'ondblclick', 'os', 'dir'], 'children': ['entry', 'entrytbl']}, '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']}, 'tbody': {'attributes': ['revisionflag', 'onmousedown', 'xml:base', 'id', 'style', 'title', 'wordsize', 'onmousemove', 'onclick', 'valign', 'role', 'conformance', 'revision', 'remap', 'vendor', 'xreflabel', 'onmouseout', 'onkeypress', 'onkeydown', 'onmouseover', 'userlevel', 'arch', 'class', 'condition', 'lang', 'xml:lang', 'onmouseup', 'onkeyup', 'security', 'ondblclick', 'os', 'dir'], 'children': ['tr', 'row']}, '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': []}, 'tfoot': {'attributes': ['revisionflag', 'onmousedown', 'xml:base', 'id', 'style', 'title', 'wordsize', 'onmousemove', 'onclick', 'valign', 'role', 'conformance', 'revision', 'remap', 'vendor', 'xreflabel', 'onmouseout', 'onkeypress', 'onkeydown', 'onmouseover', 'userlevel', 'arch', 'class', 'condition', 'lang', 'xml:lang', 'onmouseup', 'onkeyup', 'security', 'ondblclick', 'os', 'dir'], 'children': ['colspec', 'tr', 'row']}, 'tgroup': {'attributes': ['revisionflag', 'rowsep', 'cols', 'onmousedown', 'char', 'xml:base', 'id', 'style', 'title', 'xml:lang', 'onmousemove', 'xreflabel', 'role', 'charoff', 'revision', 'remap', 'vendor', 'onclick', 'onmouseout', 'onkeypress', 'colsep', 'onkeydown', 'onmouseover', 'userlevel', 'tgroupstyle', 'arch', 'class', 'condition', 'lang', 'conformance', 'align', 'wordsize', 'onmouseup', 'onkeyup', 'security', 'ondblclick', 'os', 'dir'], 'children': ['colspec', 'spanspec', 'tfoot', 'tbody', 'thead']}, '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']}, 'thead': {'attributes': ['revisionflag', 'onmousedown', 'xml:base', 'id', 'style', 'title', 'wordsize', 'onmousemove', 'onclick', 'valign', 'role', 'conformance', 'revision', 'remap', 'vendor', 'xreflabel', 'onmouseout', 'onkeypress', 'onkeydown', 'onmouseover', 'userlevel', 'arch', 'class', 'condition', 'lang', 'xml:lang', 'onmouseup', 'onkeyup', 'security', 'ondblclick', 'os', 'dir'], 'children': ['colspec', 'tr', 'row']}, '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']}, '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']}, 'entry': {'attributes': ['revisionflag', 'rowsep', 'spanname', 'remap', 'onmousedown', 'char', 'nameend', 'xml:base', 'id', 'style', 'title', 'xml:lang', 'morerows', 'xreflabel', 'valign', 'onmousemove', 'charoff', 'revision', 'namest', 'vendor', 'onclick', 'onmouseout', 'onkeypress', 'colname', 'colsep', 'onkeydown', 'onmouseover', 'userlevel', 'role', 'arch', 'class', 'condition', 'lang', 'rotate', 'conformance', 'align', 'wordsize', 'onmouseup', 'onkeyup', 'security', 'ondblclick', 'os', 'dir'], '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', 'wordasword', 'corpauthor', 'ooexception', 'destructorsynopsis', 'simpara', 'segmentedlist', 'filename', 'errorcode', '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']}, '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']}, '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']}, '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/wiki-to-help/mwlib_mods/docbook_grammar.py b/wiki-to-help/mwlib_mods/docbook_grammar.py new file mode 100644 index 0000000000..ebef889f49 --- /dev/null +++ b/wiki-to-help/mwlib_mods/docbook_grammar.py @@ -0,0 +1,11 @@ +""" +New docbook grammar enables more tags. +""" + +## Set up docbookwriter.grammar +import mwlib.docbookwriter +import docbook45grammar + +def apply(): + mwlib.docbookwriter.grammar = docbook45grammar.grammar + diff --git a/wiki-to-help/mwlib_mods/docbook_internLinks.py b/wiki-to-help/mwlib_mods/docbook_internLinks.py new file mode 100644 index 0000000000..2d22edd164 --- /dev/null +++ b/wiki-to-help/mwlib_mods/docbook_internLinks.py @@ -0,0 +1,76 @@ +""" +This enables the conversion of article links to internal links within the docbook output. +Usage: + import docbook_internLinks + docbook_internLinks.apply() +Requires: + docbook_grammar + +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 + +def setupAdapt(): + mwlib.nuwiki.adapt = MyAdapt + + +## Set up docbookwriter +import mwlib.docbookwriter +#import lxml.etree +Element = mwlib.docbookwriter.Element +SubElement = mwlib.docbookwriter.SubElement +class MyDocBookWriter(mwlib.docbookwriter.DocBookWriter): + def getTargetId(self,title): + """ Transform "The first article" to "The_first_article" """ + # See mwlib.zipwiki.normalize_title() + return title.replace(" ","_") + + def dbwriteArticle(self, a): + """ + Add id-attribute with original title to all articles. +
+ """ + e = super(MyDocBookWriter,self).dbwriteArticle(a) + targetId = self.getTargetId(a.title) + e.set("id",targetId) + return e + + def dbwriteArticleLink(self, obj): + 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 + +def setupDocBookWriter(): + mwlib.docbookwriter.DocBookWriter = MyDocBookWriter + +def apply(): + setupAdapt() + #setupGrammar() + setupDocBookWriter() + + diff --git a/wiki-to-help/mwlib_mods/docbook_table_tags.py b/wiki-to-help/mwlib_mods/docbook_table_tags.py new file mode 100644 index 0000000000..7ec527b753 --- /dev/null +++ b/wiki-to-help/mwlib_mods/docbook_table_tags.py @@ -0,0 +1,93 @@ +""" +Create docbook- instead of HTML-tables. + +Requires: + docbook_grammar + +Example of a docbook table: + +Sample Table + + + + + + + + Horizontal Span + a3 + a4 + a5 + + + + + f1 + f2 + f3 + f4 + f5 + + + + + b1 + b2 + b3 + b4 + + Vertical Span + + + c1 + Span Both + c4 + + + d1 + d4 + d5 + + + +
+ +Example from http://www.docbook.org/tdg/en/html/table.html +""" + +## Set up docbookwriter +import mwlib.docbookwriter +Element = mwlib.docbookwriter.Element +SubElement = mwlib.docbookwriter.SubElement +setVList=mwlib.docbookwriter.setVList +class MyDocBookWriter(mwlib.docbookwriter.DocBookWriter): + def dbwriteTable(self, t): + """ + rowspan & colspan are supported + nested tables not supported in DocBook V4.4 + """ + table = Element("informaltable") #border=1 + tgroup = SubElement(table,"tgroup",cols="1") # FIXME: cols=1 is not always correct + + tbody = SubElement(tgroup,"tbody") + setVList(table, t) + if t.caption: + #c = SubElement(table, "caption") + #self.writeText(t.caption, c) + pass + table.writeto = tbody + #docbookwriter.py l 220 + return table + + def dbwriteCell(self, cell): + td = Element("entry") + #setVList(td, cell) + return td + + def dbwriteRow(self, row): + return Element("row") + + +def apply(): + mwlib.docbookwriter.DocBookWriter = MyDocBookWriter + diff --git a/wiki-to-help/mwlib_mods/docbookwriter_options.py b/wiki-to-help/mwlib_mods/docbookwriter_options.py new file mode 100644 index 0000000000..e5b4350f96 --- /dev/null +++ b/wiki-to-help/mwlib_mods/docbookwriter_options.py @@ -0,0 +1,54 @@ +""" +This enables -L, --language and -W for docbook output. +Additionally the magic word IMAGENAME will contain the imagename instead of "IMAGE:imagename" + +Example: + mw-render -w docbook -L de -W debug=True;imagesrcresolver=/home/images/IMAGENAME + +The content of writer() belongs to the mwlib. + +""" + +from mwlib.docbookwriter import * +def writer(env, output, status_callback, **args): # changed + """ This is the function for external use. It is called by apps.render """ + if status_callback: + buildbook_status = status_callback.getSubRange(0, 50) + else: + buildbook_status = None + book = writerbase.build_book(env, status_callback=buildbook_status) + scb = lambda status, progress : status_callback is not None and status_callback(status=status, progress=progress) + scb(status='preprocessing', progress=50) + for c in book.children: + preprocess(c) + scb(status='rendering', progress=60) + + args["language"] = args["lang"] # changed + del args["lang"] # changed + mwlib.docbookwriter.DocBookWriter(env, status_callback=scb, documenttype="book", **args).writeBook(book, output=output) # changed + +def setupWriter(): + mwlib.docbookwriter.writer = writer + mwlib.docbookwriter.writer.options = \ + ["documenttype","lang","imagesrcresolver","debug"] + + + +import mwlib.docbookwriter +class MyDocBookWriter(mwlib.docbookwriter.DocBookWriter): + def dbwriteImageLink(self, obj): + if obj.target: + name = obj.target + obj.target = name[name.find(":") + 1:] + return super(MyDocBookWriter,self).dbwriteImageLink(obj) + +def setupDocBookWriter(): + mwlib.docbookwriter.DocBookWriter = MyDocBookWriter + + + +def apply(): + setupWriter() + setupDocBookWriter() + + diff --git a/wiki-to-help/mwlib_mods/indexterm_from_title.py b/wiki-to-help/mwlib_mods/indexterm_from_title.py new file mode 100644 index 0000000000..53d3cfdefa --- /dev/null +++ b/wiki-to-help/mwlib_mods/indexterm_from_title.py @@ -0,0 +1,24 @@ +""" +Adds +TITLE +to each
+""" + +## Set up docbookwriter +import mwlib.docbookwriter +#import lxml.etree +SubElement = mwlib.docbookwriter.SubElement +class MyDocBookWriter(mwlib.docbookwriter.DocBookWriter): + def dbwriteArticle(self, a): + """ + Add a.caption + """ + e = super(MyDocBookWriter,self).dbwriteArticle(a) + i = SubElement(e,"indexterm") + p = SubElement(i,"primary") + p.text = a.caption + return e + +def apply(): + mwlib.docbookwriter.DocBookWriter = MyDocBookWriter + diff --git a/wiki-to-help/mwlib_mods/no_sections.py b/wiki-to-help/mwlib_mods/no_sections.py new file mode 100644 index 0000000000..d01b7b9514 --- /dev/null +++ b/wiki-to-help/mwlib_mods/no_sections.py @@ -0,0 +1,38 @@ +""" +Writes
...
instead of
...
. + +""" + +import mwlib.docbookwriter +#import lxml.etree +Element = mwlib.docbookwriter.Element +SubElement = mwlib.docbookwriter.SubElement +class MyDocBookWriter(mwlib.docbookwriter.DocBookWriter): + def dbwriteArticle(self, a): + """ + this generates the root element if not available + """ + #e = super(MyDocBookWriter,self).dbwriteArticle(a) + #e.remove(e.find("section")) + #return e + # add head + title + e = Element("article", lang=self.language) + if self.root is None: + self.root = e + h = SubElement(e,"articleinfo") + t = SubElement(h, "title") + if a.caption: + t.text = a.caption + + # DONT add a section and heading for this article + #s = SubElement(e, "section") + #si = SubElement(s, "sectioninfo") + #h = SubElement(si, "title") + #h.text = a.caption + #e.writeto = s + return e + +def apply(): + mwlib.docbookwriter.DocBookWriter = MyDocBookWriter + + diff --git a/wiki-to-help/nfo.json b/wiki-to-help/nfo.json new file mode 100644 index 0000000000..ae6b9c80ee --- /dev/null +++ b/wiki-to-help/nfo.json @@ -0,0 +1,5 @@ +{ + "base_url": "http://help.libreoffice.org/", + "format": "nuwiki", + "script_extension": ".php" +} diff --git a/wiki-to-help/test2.xml b/wiki-to-help/test2.xml new file mode 100644 index 0000000000..6cda28dc08 --- /dev/null +++ b/wiki-to-help/test2.xml @@ -0,0 +1,489 @@ + + + LibreOffice Help + http://gimli/Main_Page + MediaWiki 1.16.0 + first-letter + + Media + Special + + Talk + User + User talk + LibreOffice Help + LibreOffice Help talk + File + File talk + MediaWiki + MediaWiki talk + Template + Template talk + Help + Help talk + Category + Category talk + + + + Main Page + 1 + + 120128 + 2011-02-17T21:54:02Z + + Kendy + 2 + + Added Basic help. + {{OrigLang|Welcome to {{ProductName}} Help!}} +Thank you for using the [http://www.documentfoundation.org/download/ {{ProductName}}] application help. Press F1 whenever you need help using the {{ProductName}} software, and you will be redirected to this site. Alternatively, you can install an off-line version of the help in your native language. + +If you only want to browse the help, please use the following entry points for easier navigation: + +* [[Writer/Welcome_to_the_Writer_Help|{{ProductName}} Writer]] (text processing) +* [[Calc/Welcome_to_the_Calc_Help|{{ProductName}} Calc]] (spreadsheets) +* [[Impress/Welcome_to_the_Impress_Help|{{ProductName}} Impress]] (presentations) +* [[Draw/Welcome_to_the_Draw_Help|{{ProductName}} Draw]] (drawing) +* [[Common/Database_1|{{ProductName}} Base]] (database processing) +* [[Math/Welcome_to_the_Math_Help|{{ProductName}} Math]] (formula editing) +* [[Basic/Basic_Help|{{ProductName}} Basic]] (programming using the Basic language) + +== How to Participate == + +At the moment, we are still fine-tuning the tools converting the off-line help to the on-line form. Later, you will be able to participate, and improve the help pages. The plans are described in [http://wiki.documentfoundation.org/Development/Wikihelp The Document Foundation wiki]. + +Consult the [http://meta.wikimedia.org/wiki/Help:Contents User's Guide] for information on using the wiki software. + + + + Swriter/.uno:GraphicFilterSolarize + 2 + + + 43159 + 2010-12-17T15:23:21Z + + WikiSysop + 1 + + Redirected page to [[Common/Graphic Filter Bar#bm id3154910]] + #REDIRECT [[Common/Graphic_Filter_Bar#bm_id3154910]] + + + + Swriter/59886 + 3 + + + 43160 + 2010-12-17T15:23:21Z + + WikiSysop + 1 + + Redirected page to [[Common/Presentation Wizard Page 1#bm id3155136]] + #REDIRECT [[Common/Presentation_Wizard_Page_1#bm_id3155136]] + + + + Swriter/704807947 + 4 + + + 43161 + 2010-12-17T15:23:22Z + + WikiSysop + 1 + + Redirected page to [[Common/Accessibility#bm id3153881]] + #REDIRECT [[Common/Accessibility#bm_id3153881]] + + + + Swriter/.uno:SelectTable + 5 + + + 43162 + 2010-12-17T15:23:22Z + + WikiSysop + 1 + + Redirected page to [[Writer/Table#bm id3954588]] + #REDIRECT [[Writer/Table#bm_id3954588]] + + + + Swriter/859636226 + 6 + + + 43163 + 2010-12-17T15:23:23Z + + WikiSysop + 1 + + Redirected page to [[Common/Address Data Source#bm id611896]] + #REDIRECT [[Common/Address_Data_Source#bm_id611896]] + + + + Swriter/546685977 + 7 + + + 43164 + 2010-12-17T15:23:24Z + + WikiSysop + 1 + + Redirected page to [[Common/General 2#bm id3145750]] + #REDIRECT [[Common/General_2#bm_id3145750]] + + + + Swriter/1417988121 + 8 + + + 43165 + 2010-12-17T15:23:24Z + + WikiSysop + 1 + + Redirected page to [[Writer/Caption#bm id7607959]] + #REDIRECT [[Writer/Caption#bm_id7607959]] + + + + Swriter/34666 + 9 + + + 43166 + 2010-12-17T15:23:25Z + + WikiSysop + 1 + + Redirected page to [[Common/Euro Converter Wizard#bm id3152960]] + #REDIRECT [[Common/Euro_Converter_Wizard#bm_id3152960]] + + + + Swriter/54892 + 10 + + + 43167 + 2010-12-17T15:23:25Z + + WikiSysop + 1 + + Redirected page to [[Writer/Define Bibliography Entry#bm id3149689]] + #REDIRECT [[Writer/Define_Bibliography_Entry#bm_id3149689]] + + + + Common/Size/da + 87185 + + 131455 + 2011-03-01T17:57:01Z + + WikiSysop + 1 + + Created page with "{{Lang|Størrelse}} <div id="bm_id3153391"></div> Sæt skriftstørrelsen for den markerede tekst. Åbn genvejsmenu - vælg '''Størrelse'''" + {{Lang|Størrelse}} +<div id="bm_id3153391"></div> +Sæt skriftstørrelsen for den markerede tekst. + +Åbn genvejsmenu - vælg '''Størrelse''' + + + + Common/Size/zh-TW + 87186 + + 131456 + 2011-03-01T17:57:02Z + + WikiSysop + 1 + + Created page with "{{Lang|大小}} <div id="bm_id3153391"></div> 設定所選文字的字型大小。 右鍵功能表'''「大小」'''" + {{Lang|大小}} +<div id="bm_id3153391"></div> +設定所選文字的字型大小。 + +右鍵功能表'''「大小」''' + + + + Common/Size/zh-CN + 87187 + + 131457 + 2011-03-01T17:57:03Z + + WikiSysop + 1 + + Created page with "{{Lang|大小}} <div id="bm_id3153391"></div> 设置选定文字的字体大小。 打开上下文菜单 - 选择'''大小'''" + {{Lang|大小}} +<div id="bm_id3153391"></div> +设置选定文字的字体大小。 + +打开上下文菜单 - 选择'''大小''' + + + + Common/Size/ko + 87188 + + 131458 + 2011-03-01T17:57:04Z + + WikiSysop + 1 + + Created page with "{{Lang|크기}} <div id="bm_id3153391"></div> 선택한 텍스트의 글꼴 크기를 설정합니다. '''크기''' 콘텍스트 메뉴" + {{Lang|크기}} +<div id="bm_id3153391"></div> +선택한 텍스트의 글꼴 크기를 설정합니다. + +'''크기''' 콘텍스트 메뉴 + + + + Common/Creating a New Database/sv + 87189 + + 131459 + 2011-03-01T17:57:05Z + + WikiSysop + 1 + + Created page with "{{Lang|Skapa en ny databas}} <div id="bm_id6911526"></div> <!-- mw deleted "creating;" -->#Välj '''Arkiv - Nytt - Databas'''.<br/><br/>Då öppnas [[Common/Database_Wizard/sv|Da..." + {{Lang|Skapa en ny databas}} +<div id="bm_id6911526"></div> +<!-- mw deleted "creating;" -->#Välj '''Arkiv - Nytt - Databas'''.<br/><br/>Då öppnas [[Common/Database_Wizard/sv|Databasguiden]] där du skapar en ny databasfil.<br/> +#I Databasguiden väljer du typ av databas och du kan välja att öppna Tabellguiden som nästa guide.<br/><br/>I [[Common/Table_Wizard/sv|Tabellguiden]] får du hjälp med att infoga en tabell i den nya databasfilen.<br/> + +{{RelatedTopics|[[Common/Database_1/sv|Använda databaser i {{ProductName}} Base]] + +[[Common/Database_Overview/sv|Databasöversikt]] + +}} + + + + Common/Creating a New Database/da + 87190 + + 131460 + 2011-03-01T17:57:06Z + + WikiSysop + 1 + + Created page with "{{Lang|Oprette en ny Database}} <div id="bm_id6911526"></div> <!-- mw deleted "creating;" -->#Vælg '''Filer - Ny(t) - Database'''.<br/><br/>Dette åbner [[Common/Database_Wizard..." + {{Lang|Oprette en ny Database}} +<div id="bm_id6911526"></div> +<!-- mw deleted "creating;" -->#Vælg '''Filer - Ny(t) - Database'''.<br/><br/>Dette åbner [[Common/Database_Wizard/da|Databaseguiden]], hvor du kan oprette en ny databasefil.<br/> +#I Databaseguiden vælges typen af database og vælg indstillingen for at åbne Tabelguiden som den næste guide.<br/><br/>[[Common/Table_Wizard/da|Tabelguiden]] hjælper dig med at tilføje en tabel til den nye databasefil.<br/> + +{{RelatedTopics|[[Common/Database_1/da|Brug af databaser i {{ProductName}} Base]] + +[[Common/Database_Overview/da|Databaseoversigt]] + +}} + + + + Common/Creating a New Database/zh-TW + 87191 + + 131461 + 2011-03-01T17:57:07Z + + WikiSysop + 1 + + Created page with "{{Lang|建立新的資料庫}} <div id="bm_id6911526"></div> <!-- mw deleted "creating;" -->#選擇 '''[檔案] - [開啟新檔] - [資料庫]'''。<br/><br/>這會開啟[[Common..." + {{Lang|建立新的資料庫}} +<div id="bm_id6911526"></div> +<!-- mw deleted "creating;" -->#選擇 '''[檔案] - [開啟新檔] - [資料庫]'''。<br/><br/>這會開啟[[Common/Database_Wizard/zh-TW|資料庫精靈]],您可在其中建立新的資料庫檔案。<br/> +#在「資料庫精靈」中,選取資料庫類型,然後選取要開啟「表格精靈」作為下一個精靈的選項。<br/><br/>[[Common/Table_Wizard/zh-TW|表格精靈]]可協助您在新的資料庫檔案中增加表格。<br/> + +{{RelatedTopics|[[Common/Database_1/zh-TW|在 {{ProductName}} Base 中使用資料庫]] + +[[Common/Database_Overview/zh-TW|資料庫簡介]] + +}} + + + + Common/Creating a New Database/zh-CN + 87192 + + 131462 + 2011-03-01T17:57:08Z + + WikiSysop + 1 + + Created page with "{{Lang|创建新数据库}} <div id="bm_id6911526"></div> <!-- mw deleted "creating;" -->#选择'''文件 - 新建 - 数据库'''。<br/><br/>这样可打开[[Common/Database_Wiz..." + {{Lang|创建新数据库}} +<div id="bm_id6911526"></div> +<!-- mw deleted "creating;" -->#选择'''文件 - 新建 - 数据库'''。<br/><br/>这样可打开[[Common/Database_Wizard/zh-CN|数据库向导]],利用该向导可创建新的数据库文件。<br/> +#在“数据库向导”中,选择数据库类型,然后选择此选项打开作为下一向导的“表格向导”。<br/><br/>[[Common/Table_Wizard/zh-CN|表格向导]]可帮助您在新数据库文件中添加表格。<br/> + +{{RelatedTopics|[[Common/Database_1/zh-CN|在 {{ProductName}} Base 中使用数据库]] + +[[Common/Database_Overview/zh-CN|数据源摘要]] + +}} + + + + Common/Creating a New Database/ko + 87193 + + 131463 + 2011-03-01T17:57:09Z + + WikiSysop + 1 + + Created page with "{{Lang|새 데이터베이스 만들기}} <div id="bm_id6911526"></div> <!-- mw deleted "creating;" -->#'''파일 - 새로 만들기 - 데이터베이스'''를 선택합니다.<b..." + {{Lang|새 데이터베이스 만들기}} +<div id="bm_id6911526"></div> +<!-- mw deleted "creating;" -->#'''파일 - 새로 만들기 - 데이터베이스'''를 선택합니다.<br/><br/>새 데이터베이스 파일을 만들 수 있는 [[Common/Database_Wizard/ko|데이터베이스 마법사]]가 열립니다.<br/> +#데이터베이스 마법사에서 데이터베이스 유형을 선택한 다음 테이블 마법사를 다음 마법사로 여는 옵션을 선택합니다.<br/><br/>[[Common/Table_Wizard/ko|테이블 마법사]]를 사용하면 새 데이터베이스 파일에 테이블을 추가할 수 있습니다.<br/> + +{{RelatedTopics|[[Common/Database_1/ko|{{ProductName}} Base에서 데이터베이스 사용]] + +[[Common/Database_Overview/ko|데이터베이스 개요]] + +}} + + + + Writer/Welcome to the Writer Help + 6009 + + 82722 + 2011-01-19T15:11:59Z + + WikiSysop + 1 + + {{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]] + + + + Common/Dragging and Dropping Within a Document + 40966 + + 86420 + 2011-01-19T16:04:35Z + + WikiSysop + 1 + + {{OrigLang|Dragging and Dropping Within a {{ProductName}} Document}} +<div id="bm_id3154927"></div> +There are many options for moving or copying objects using drag-and-drop. Text sections, drawing objects, graphics, form controls, hyperlinks, cell ranges, and many more can be moved or copied with the mouse. + +Note that the mouse pointer displays a plus sign when copying and an arrow when creating a link or hyperlink. + +{| border="1" +|- +! scope="col" | Mouse Pointer +! scope="col" | Description +|- +| [[Image:movedata.png|border|left|8.47mmx8.47mm|Mouse pointer moving data]] +| Moving +|- +| [[Image:copydata.png|border|left|8.47mmx8.47mm|Mouse pointer copying data]] +| Copying +|- +| [[Image:linkdata.png|border|left|8.47mmx8.47mm|Mouse pointer inserting link]] +| Creating a link +|} + +If you press {{System|default=Ctrl|mac=Command}} or Shift+{{System|default=Ctrl|mac=Command}} while releasing the mouse button, you can control whether the object is copied, moved, or a link is created. + +{| border="1" +|- +| [[Image:sc20238.png|border|left|5.64mmx5.64mm|Icon]] +| If you drag objects out of the [[Common/Navigator_for_Document_Overview|Navigator]], you can specify in the submenu of the Navigator's '''Drag Mode''' icon whether to copy the object, insert it as a link or insert it as a hyperlink. +|} + +{{Tip|You can cancel a drag-and-drop operation in {{ProductName}} at any time by pressing the Esc key before releasing the mouse button.}} + +'''Related Topics''' + +[[Common/Copying_Graphics_Between_Documents|Copying Graphics Between Documents]] + +[[Common/Copying_Spreadsheet_Areas_to_Text_Documents|Copying Spreadsheet Areas to Text Documents]] + +[[Common/Copying_Graphics_From_the_Gallery|Copying Graphics From the Gallery]] + +[[Common/Adding_Graphics_to_the_Gallery|Adding Graphics to the Gallery]] + +{{WhenInWriter|[[Writer/Moving_and_Copying_Text_in_Documents|Moving and Copying Text in Documents]] + +}}{{WhenInCalc|[[Calc/Referencing_Cells_by_Drag-and-Drop|Referencing Cells by Drag-and-Drop]] + +}} + + + -- cgit