~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/doc_generate/writers/texinfo.py

  • Committer: Jelmer Vernooij
  • Date: 2011-12-16 19:18:39 UTC
  • mto: This revision was merged to the branch mainline in revision 6391.
  • Revision ID: jelmer@samba.org-20111216191839-eg681lxqibi1qxu1
Fix remaining tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
123
123
    def depart_topic(self, node):
124
124
        pass
125
125
 
 
126
    def visit_compound(self, node):
 
127
        # compound is new in sphinx >= 1.0 and just add a optional layer so we
 
128
        # relay the text to the parent when it occurs. This may requires a
 
129
        # cleaner approach once we settle on which sphinx versions we want to
 
130
        # support.
 
131
        set_item_list_collector(node, 'text')
 
132
 
 
133
    def depart_compound(self, node):
 
134
        text = ''.join(node['text'])
 
135
        node.parent.collect_text(text)
 
136
 
126
137
    def visit_paragraph(self, node):
127
138
        set_item_list_collector(node, 'text')
128
139
 
143
154
        # FIXME: Using a different visitor specific to toctree may be a better
144
155
        # design and makes code clearer. -- vila 20100708
145
156
        if node.has_key('toctree'):
146
 
            node.parent.collect_text('@menu\n')
147
 
            node.parent.collect_text(''.join(node['text']))
148
 
            node.parent.collect_text('@end menu\n')
 
157
            if node['text']:
 
158
                node.parent.collect_text('@menu\n')
 
159
                node.parent.collect_text(''.join(node['text']))
 
160
                node.parent.collect_text('@end menu\n')
149
161
            self.in_toctree = False
150
162
        elif self.in_toctree:
151
163
            # * FIRST-ENTRY-NAME:(FILENAME)NODENAME.     DESCRIPTION