Initial import to Tizen
[profile/ivi/python-twisted.git] / doc / lore / howto / listings / lore / spitters.py-2
1 from twisted.lore import latex
2 from twisted.lore.latex import processFile
3 import os.path
4
5 # 2. Create a new mixin that does what the old MyLatexSpitter used to do:
6 # process the new classes we defined
7 class MySpitterMixin:
8     def visitNode_span_productname(self, node):
9         self.writer('\\underline{')
10         self.visitNodeDefault(node) 
11         self.writer('}')
12
13     def visitNode_span_marketinglie(self, node):
14         self.writer('\\begin{bf}\\begin{Large}')
15         self.visitNodeDefault(node)
16         self.writer('\\end{Large}\\end{bf}')
17
18 # 3. inherit from the mixin class for each of the three sub-spitters
19 class MyLatexSpitter(MySpitterMixin, latex.LatexSpitter):
20     pass
21     
22 class MySectionLatexSpitter(MySpitterMixin, latex.SectionLatexSpitter):
23     pass
24
25 class MyChapterLatexSpitter(MySpitterMixin, latex.ChapterLatexSpitter):
26     pass