summaryrefslogtreecommitdiffstats
path: root/doc/xml2wiki.py
diff options
context:
space:
mode:
Diffstat (limited to 'doc/xml2wiki.py')
-rwxr-xr-xdoc/xml2wiki.py20
1 files changed, 6 insertions, 14 deletions
diff --git a/doc/xml2wiki.py b/doc/xml2wiki.py
index 96651c20f..2b7eb4827 100755
--- a/doc/xml2wiki.py
+++ b/doc/xml2wiki.py
@@ -16,7 +16,7 @@ class StreamEntry:
def __init__( self, object, isElement ):
self.object = object
self.isElement = isElement
-
+
###############################################################################
class Element:
@@ -64,10 +64,7 @@ class Document( Element ):
self._chapterLevel = 0
self._sectionLevel = 0
self._dividerCount = 0
-
- #self._pragmaSummary = PragmaElement( self, 'summary' )
- #self._pragmaLabels = PragmaElement( self, 'labels' )
- #self._pragmaLabels._addText( 'xml2wiki,Distribution,Featured' )
+ self._majorHeading = Element( self, delimBegin='= ', delimEnd=' =\n\n' )
def _pop( self ):
self._stack.pop()
@@ -94,13 +91,8 @@ class Document( Element ):
self._sectionLevel = self._sectionLevel - 1
def _write( self, file ):
- #self._pragmaSummary.write( file )
- #file.write( '\n' )
- #self._pragmaLabels.write( file )
if options.date:
file.write( "\n\n ===== `[`generated by xml2wiki on %s`]` =====" % (time.strftime( '%c' ) ))
- #if options.toc:
- # file.write( '\n\n<wiki:toc max_depth="3" />' )
Element._write( self, file )
file.write( '\n' )
@@ -135,9 +127,9 @@ class Document( Element ):
e = ItemizeElement( self._pending )
elif name == 'item':
e = ItemElement( self._pending )
- #elif name == 'majorheading':
- # e = self._pragmaSummary
- # shouldAdd = False
+ elif name == 'majorheading':
+ e = self._majorHeading
+ shouldAdd = False
elif name == 'para':
e = ParagraphElement( self._pending )
elif name == 'quotation':
@@ -388,8 +380,8 @@ with open( args[0], 'rb' ) as fin:
writer = IndentedWriter( 4, sys.stdout )
+doc._majorHeading.write( writer )
if options.toc:
for e in toc:
writer.write( '%s* [#%s %s]\n' % (' ' * e._level,e._anchor,e._stream[0].object) )
-
doc.write( writer )