File: Synopsis/Formatters/HTML/Parts/Detail.py 1
2
3
4
5
6
7
8
9from Synopsis import ASG
10from Synopsis.Processor import Parameter
11from Synopsis.Formatters.HTML.Part import Part
12from Synopsis.Formatters.HTML.Fragments import *
13from Synopsis.Formatters.HTML.Tags import *
14
15class Detail(Part):
16
17 fragments = Parameter([DeclarationDetailFormatter(), DetailCommenter()],
18 '')
19
20 def write_section_start(self, heading):
21 """Start a 'detail' section and write an appropriate heading."""
22
23 self.write('<div class="detail">\n')
24 self.write(div('heading', heading) + '\n')
25
26 def write_section_end(self, heading):
27 """Close the section."""
28
29 self.write('</div><!-- detail -->\n')
30
31 def write_section_item(self, text):
32 """Add an item."""
33
34 self.write(div('item',text) + '\n')
35
36 def process(self, decl):
37 "Print out the details for the children of the given decl"
38
39 if type(decl) == ASG.Forward:
40 return
41
42 doc = self.processor.documentation
43 sorter = self.processor.sorter.clone(decl.declarations)
44
45
46 self.write_start()
47 for section in sorter:
48
49 heading = section+' Details:'
50 started = 0
51
52 for child in sorter[section]:
53
54 if not doc.details(child, self.view()):
55 continue
56
57 if not started:
58 started = 1
59 self.write_section_start(heading)
60 child.accept(self)
61
62 if started: self.write_section_end(heading)
63 self.write_end()
64
Generated on Thu Apr 16 16:27:16 2009 by
synopsis (version devel)