From ba84d4ed501e1ae10683c2edf72ef2d3944e1333 Mon Sep 17 00:00:00 2001 From: Timo Richter Date: Fri, 26 Aug 2011 14:03:25 +0200 Subject: Index is being created. Images are included in chm-files. --images accepts zip files Program output is more quiet Added -v for verbosity Call of "convert.py" -h is a lot faster --- helpcontent2/wiki-to-help/mwlib_mods/__init__.py | 4 ++-- .../mwlib_mods/indexterm_from_title.py | 24 ++++++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 helpcontent2/wiki-to-help/mwlib_mods/indexterm_from_title.py (limited to 'helpcontent2/wiki-to-help/mwlib_mods') diff --git a/helpcontent2/wiki-to-help/mwlib_mods/__init__.py b/helpcontent2/wiki-to-help/mwlib_mods/__init__.py index c9c59e96f9..ca93600d47 100644 --- a/helpcontent2/wiki-to-help/mwlib_mods/__init__.py +++ b/helpcontent2/wiki-to-help/mwlib_mods/__init__.py @@ -17,6 +17,6 @@ docbook_internLinks.apply() import custom_nfo custom_nfo.apply() -#import images_from_path -#images_from_path.apply() +import indexterm_from_title +indexterm_from_title.apply() diff --git a/helpcontent2/wiki-to-help/mwlib_mods/indexterm_from_title.py b/helpcontent2/wiki-to-help/mwlib_mods/indexterm_from_title.py new file mode 100644 index 0000000000..53d3cfdefa --- /dev/null +++ b/helpcontent2/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 + -- cgit