Merge lp:~vila/bzr/940164-native-texinfo into lp:bzr/2.5

Proposed by Vincent Ladeuil
Status: Merged
Approved by: Martin Packman
Approved revision: no longer in the source branch.
Merged at revision: 6489
Proposed branch: lp:~vila/bzr/940164-native-texinfo
Merge into: lp:bzr/2.5
Diff against target: 1649 lines (+123/-1286)
21 files modified
Makefile (+8/-0)
bzrlib/doc_generate/builders/__init__.py (+0/-20)
bzrlib/doc_generate/builders/texinfo.py (+0/-44)
bzrlib/doc_generate/conf.py (+1/-2)
bzrlib/doc_generate/writers/__init__.py (+0/-20)
bzrlib/doc_generate/writers/texinfo.py (+0/-534)
bzrlib/tests/__init__.py (+0/-1)
bzrlib/tests/doc_generate/__init__.py (+0/-113)
bzrlib/tests/doc_generate/builders/__init__.py (+0/-36)
bzrlib/tests/doc_generate/builders/test_texinfo.py (+0/-71)
bzrlib/tests/doc_generate/writers/__init__.py (+0/-36)
bzrlib/tests/doc_generate/writers/test_texinfo.py (+0/-359)
bzrlib/tests/features.py (+0/-1)
doc/developers/conf.py (+19/-9)
doc/en/Makefile (+3/-0)
doc/en/conf.py (+22/-12)
doc/en/release-notes/bzr-2.5.txt (+5/-1)
doc/en/whats-new/whats-new-in-2.5.txt (+7/-0)
doc/es/conf.py (+19/-9)
doc/ja/conf.py (+19/-9)
doc/ru/conf.py (+20/-9)
To merge this branch: bzr merge lp:~vila/bzr/940164-native-texinfo
Reviewer Review Type Date Requested Status
Martin Packman (community) Approve
Gordon Tyler Pending
Review via email: mp+96796@code.launchpad.net

Commit message

Sphinx now provides a texinfo builder better than ours.

Description of the change

While debugging the doc.canonical.bazaar.com issues I needed to reproduce
some doc generation locally and was faced with a Yak refusing to go away
without a shave...

It turned out disabling our texinfo sphinx builder was a one-liner but
digging only slightly revealed that the texinfo builder provided by sphinx
was far better than ours.

So, bitting the bullet I dug a bit further and this is the result: we can
now process all the documentation we processed for the latex builder
(i.e. the vast majority) and get some .info files that emacs seem quite
happy to process. I didn't check them all but this is a (very) significant
step.

This patch does mainly two things:

- remove our texinfo builder and its tests,

- better wire the Makefiles so one can use ``make texinfo-sphinx`` to
  produce both the ``.texi`` files and the ``.info`` ones.

I'm targetting 2.5 because there is a risk that our texinfo builder break
some builders running the test suite by being unlucky enough to have sphinx
installed.

This doesn't impact bzr/bzrlib themselves so I think it's a safe bet and
will avoid troubles during the whole 2.5 series life cycle.

To post a comment you must log in.
Revision history for this message
Martin Packman (gz) wrote :

Code changes seem reasonable, as does a 2.5 landing. Does anything need to be done when running against a too old sphinx to at least give a reasonable error?

Revision history for this message
Vincent Ladeuil (vila) wrote :

Well, against a too old sphinx, the error will be: 'texinfo ? What's that ?' which seems fine given that the files produced were aimed at debugging the proposed builder. The files produced by the sphinx's texinfo are not perfect yet, nor is our use of cross-references, so there is still work to be done but it should happen with the official builder, not ours.

Revision history for this message
Martin Packman (gz) wrote :

That's probably a clear enough error.

review: Approve
Revision history for this message
Vincent Ladeuil (vila) wrote :

sent to pqm by email

Revision history for this message
Vincent Ladeuil (vila) wrote :

sent to pqm by email

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Makefile'
2--- Makefile 2011-12-08 19:00:14 +0000
3+++ Makefile 2012-03-12 14:56:53 +0000
4@@ -192,6 +192,14 @@
5 cd doc/developers && make htmlhelp
6
7
8+# Build the texinfo files using Sphinx.
9+texinfo-sphinx: $(SPHINX_DEPENDENCIES)
10+ cd doc/en && make texinfo
11+ cd doc/es && make texinfo
12+ cd doc/ru && make texinfo
13+ cd doc/ja && make texinfo
14+ cd doc/developers && make texinfo
15+
16 ### Documentation Website ###
17
18 # Where to build the website
19
20=== removed directory 'bzrlib/doc_generate/builders'
21=== removed file 'bzrlib/doc_generate/builders/__init__.py'
22--- bzrlib/doc_generate/builders/__init__.py 2011-12-19 13:23:58 +0000
23+++ bzrlib/doc_generate/builders/__init__.py 1970-01-01 00:00:00 +0000
24@@ -1,20 +0,0 @@
25-# Copyright (C) 2010 Canonical Ltd
26-#
27-# This program is free software; you can redistribute it and/or modify
28-# it under the terms of the GNU General Public License as published by
29-# the Free Software Foundation; either version 2 of the License, or
30-# (at your option) any later version.
31-#
32-# This program is distributed in the hope that it will be useful,
33-# but WITHOUT ANY WARRANTY; without even the implied warranty of
34-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
35-# GNU General Public License for more details.
36-#
37-# You should have received a copy of the GNU General Public License
38-# along with this program; if not, write to the Free Software
39-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
40-
41-"""Placeholder to allow sphinx builders imports."""
42-
43-from __future__ import absolute_import
44-
45
46=== removed file 'bzrlib/doc_generate/builders/texinfo.py'
47--- bzrlib/doc_generate/builders/texinfo.py 2012-02-24 13:35:31 +0000
48+++ bzrlib/doc_generate/builders/texinfo.py 1970-01-01 00:00:00 +0000
49@@ -1,44 +0,0 @@
50-# Copyright (C) 2010 Canonical Ltd
51-#
52-# This program is free software; you can redistribute it and/or modify
53-# it under the terms of the GNU General Public License as published by
54-# the Free Software Foundation; either version 2 of the License, or
55-# (at your option) any later version.
56-#
57-# This program is distributed in the hope that it will be useful,
58-# but WITHOUT ANY WARRANTY; without even the implied warranty of
59-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
60-# GNU General Public License for more details.
61-#
62-# You should have received a copy of the GNU General Public License
63-# along with this program; if not, write to the Free Software
64-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
65-
66-"""A sphinx builder producing texinfo output."""
67-
68-from __future__ import absolute_import
69-
70-from sphinx import builders
71-from sphinx.builders import text as _text_builder
72-
73-from bzrlib.doc_generate.writers import texinfo as texinfo_writer
74-
75-class TexinfoBuilder(_text_builder.TextBuilder):
76-
77- name = 'texinfo'
78- format = 'texinfo'
79- out_suffix = '.texi'
80-
81- def prepare_writing(self, docnames):
82- self.writer = texinfo_writer.TexinfoWriter(self)
83-
84- def get_target_uri(self, docname, typ=None):
85- # FIXME: Revisit when info file generation is defined (the suffix is
86- # left here for clarity but the final version may just get rid of
87- # it). And we probalby will join several files into bigger info files
88- # anyway. -- vila 20100506
89- return docname + '.info'
90-
91-
92-def setup(app):
93- app.add_builder(TexinfoBuilder)
94
95=== modified file 'bzrlib/doc_generate/conf.py'
96--- bzrlib/doc_generate/conf.py 2011-12-18 15:28:38 +0000
97+++ bzrlib/doc_generate/conf.py 2012-03-12 14:56:53 +0000
98@@ -21,8 +21,7 @@
99
100 # Add any Sphinx extension module names here, as strings. They can be extensions
101 # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
102-extensions = ['sphinx.ext.ifconfig',
103- 'bzrlib.doc_generate.builders.texinfo']
104+extensions = ['sphinx.ext.ifconfig',]
105
106 # Add any paths that contain templates here, relative to this directory.
107 templates_path = ['_templates']
108
109=== removed directory 'bzrlib/doc_generate/writers'
110=== removed file 'bzrlib/doc_generate/writers/__init__.py'
111--- bzrlib/doc_generate/writers/__init__.py 2011-12-19 13:23:58 +0000
112+++ bzrlib/doc_generate/writers/__init__.py 1970-01-01 00:00:00 +0000
113@@ -1,20 +0,0 @@
114-# Copyright (C) 2010 Canonical Ltd
115-#
116-# This program is free software; you can redistribute it and/or modify
117-# it under the terms of the GNU General Public License as published by
118-# the Free Software Foundation; either version 2 of the License, or
119-# (at your option) any later version.
120-#
121-# This program is distributed in the hope that it will be useful,
122-# but WITHOUT ANY WARRANTY; without even the implied warranty of
123-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
124-# GNU General Public License for more details.
125-#
126-# You should have received a copy of the GNU General Public License
127-# along with this program; if not, write to the Free Software
128-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
129-
130-"""Placeholder to allow sphinx writer imports."""
131-
132-from __future__ import absolute_import
133-
134
135=== removed file 'bzrlib/doc_generate/writers/texinfo.py'
136--- bzrlib/doc_generate/writers/texinfo.py 2011-12-19 13:23:58 +0000
137+++ bzrlib/doc_generate/writers/texinfo.py 1970-01-01 00:00:00 +0000
138@@ -1,534 +0,0 @@
139-# Copyright (C) 2010 Canonical Ltd
140-#
141-# This program is free software; you can redistribute it and/or modify
142-# it under the terms of the GNU General Public License as published by
143-# the Free Software Foundation; either version 2 of the License, or
144-# (at your option) any later version.
145-#
146-# This program is distributed in the hope that it will be useful,
147-# but WITHOUT ANY WARRANTY; without even the implied warranty of
148-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
149-# GNU General Public License for more details.
150-#
151-# You should have received a copy of the GNU General Public License
152-# along with this program; if not, write to the Free Software
153-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
154-
155-"""A sphinx/docutil writer producing texinfo output."""
156-
157-from __future__ import absolute_import
158-
159-from docutils import (
160- nodes,
161- writers,
162- )
163-
164-DEBUG = 0
165-
166-class TexinfoWriter(writers.Writer):
167-
168- supported = ('texinfo',)
169- settings_spec = ('No options here.', '', ())
170- settings_defaults = {}
171-
172- output = None
173-
174- def __init__(self, builder):
175- writers.Writer.__init__(self)
176- self.builder = builder
177-
178- def translate(self):
179- visitor = TexinfoTranslator(self.document, self.builder)
180- self.document.walkabout(visitor)
181- self.output = visitor.body
182-
183-
184-class TexinfoTranslator(nodes.NodeVisitor):
185-
186- section_names = ['chapter', 'section', 'subsection', 'subsubsection']
187- """texinfo section names differ from the sphinx ones.
188-
189- Since this can be confusing, the correspondences are shown below
190- (shpinx -> texinfo):
191- part -> chapter
192- chapter -> section
193- section -> subsection
194- subsection -> subsubsection
195-
196- Additionally, sphinx defines subsubsections and paragraphs which are
197- handled as @heading (unnumbered).
198- """
199-
200- def __init__(self, document, builder):
201- nodes.NodeVisitor.__init__(self, document)
202- self.builder = builder
203- # toctree uses some nodes for different purposes (namely:
204- # compact_paragraph, bullet_list) that needs to know when they are
205- # processing a toctree.
206- self.in_toctree = False
207- # sections can be embedded and produce different directives depending
208- # on the depth.
209- self.section_level = -1
210- # By default paragraghs are separated by newlines, but there are some
211- # exceptions that set it to '' for some subtrees instead
212- self.paragraph_sep = '\n'
213-
214- # The whole document
215-
216- def visit_document(self, node):
217- if DEBUG:
218- import sys
219- sys.stdout.write(node.pformat().encode('utf8'))
220- set_item_list_collector(node, 'text')
221-
222- def depart_document(self, node):
223- # FIXME: info requires a Top node for each info file, but unless we
224- # chose a global layout to divide the overall documentation into a set
225- # of info files, there is no criteria to decide for a title.
226- top_cmd = '''\
227-This file has been converted using a beta rst->texinfo converter.
228-Most of the info links are currently bogus, don't report bugs about them,
229-this is currently worked on.
230-@node Top
231-@top Placeholder
232-'''
233- self.body = top_cmd + ''.join(node['text'])
234-
235- # Layout
236-
237- def visit_section(self, node):
238- self.section_level += 1
239- set_item_list_collector(node, 'text')
240-
241- def depart_section(self, node):
242- title = node['title']
243- ids = node.get('ids', [])
244- try:
245- section_name = self.section_names[self.section_level]
246- except IndexError:
247- # Just use @heading, it's not numbered anyway
248- section_name = 'heading'
249- if ids:
250- # There shouldn't be different ids for a section, so until we
251- # encounter bugs, just take the first one.
252- node_cmd = '@node %s\n' % (ids[0],)
253- else:
254- node_cmd = ''
255- section_cmd = '@%s %s\n' % (section_name, title)
256- text = ''.join(node['text'])
257- node.parent.collect_text(node_cmd + section_cmd + text)
258- self.section_level -= 1
259-
260- def visit_topic(self, node):
261- pass
262-
263- def depart_topic(self, node):
264- pass
265-
266- def visit_compound(self, node):
267- # compound is new in sphinx >= 1.0 and just add a optional layer so we
268- # relay the text to the parent when it occurs. This may requires a
269- # cleaner approach once we settle on which sphinx versions we want to
270- # support.
271- set_item_list_collector(node, 'text')
272-
273- def depart_compound(self, node):
274- text = ''.join(node['text'])
275- node.parent.collect_text(text)
276-
277- def visit_paragraph(self, node):
278- set_item_list_collector(node, 'text')
279-
280- def depart_paragraph(self, node):
281- # End the paragraph with a new line (or '' depending on the parent) and
282- # leave a blank line after it.
283- text = ''.join(node['text']) + self.paragraph_sep * 2
284- node.parent.collect_text(text)
285-
286- def visit_compact_paragraph(self, node):
287- set_item_list_collector(node, 'text')
288- if node.has_key('toctree'):
289- self.in_toctree = True
290- elif self.in_toctree:
291- set_item_collector(node, 'reference')
292-
293- def depart_compact_paragraph(self, node):
294- # FIXME: Using a different visitor specific to toctree may be a better
295- # design and makes code clearer. -- vila 20100708
296- if node.has_key('toctree'):
297- if node['text']:
298- node.parent.collect_text('@menu\n')
299- node.parent.collect_text(''.join(node['text']))
300- node.parent.collect_text('@end menu\n')
301- self.in_toctree = False
302- elif self.in_toctree:
303- # * FIRST-ENTRY-NAME:(FILENAME)NODENAME. DESCRIPTION
304- # XXX: the file name should probably be adjusted to the targeted
305- # info file name
306- node_name, file_name, entry_name = node['reference']
307- if not node_name:
308- node_name = entry_name
309- description = '' # We can't specify a description in rest AFAICS
310- # XXX: What if :maxdepth: is not 1 ?
311- text = '* %s: (%s)%s. %s\n' % (entry_name, file_name,
312- node_name, description)
313- node.parent.collect_text(text)
314- else:
315- # End the paragraph with a new line (or '' depending on the parent)
316- # and leave a blank line after it.
317- text = ''.join(node['text']) + self.paragraph_sep * 2
318- node.parent.collect_text(text)
319-
320- def visit_literal_block(self, node):
321- set_item_collector(node, 'text')
322-
323- def depart_literal_block(self, node):
324- text = '@samp{%s}' % ''.join(node['text']) + self.paragraph_sep * 2
325- node.parent.collect_text(text)
326-
327- def visit_block_quote(self, node):
328- set_item_list_collector(node, 'text')
329-
330- def depart_block_quote(self, node):
331- node.parent.collect_text('@example\n')
332- node.parent.collect_text(''.join(node['text']))
333- node.parent.collect_text('@end example\n\n')
334-
335- def depart_warning(self, node):
336- pass
337-
338- def visit_warning(self, node):
339- raise nodes.SkipNode # Not implemented yet
340-
341- def visit_note(self, node):
342- raise nodes.SkipNode # Not implemented yet
343-
344- def depart_note(self, node):
345- pass
346-
347- def visit_footnote(self, node):
348- raise nodes.SkipNode # Not implemented yet
349-
350- def depart_footnote(self, node):
351- pass
352-
353- def visit_comment(self, node):
354- raise nodes.SkipNode # Not implemented yet
355-
356- # Attributes
357-
358- def visit_title(self, node):
359- set_item_collector(node, 'text')
360-
361- def depart_title(self, node):
362- node.parent['title'] = node['text']
363-
364- def visit_label(self, node):
365- raise nodes.SkipNode # Not implemented yet
366-
367- def visit_substitution_definition(self, node):
368- raise nodes.SkipNode # Not implemented yet
369-
370- # Plain text
371-
372- def visit_Text(self, node):
373- pass
374-
375- def depart_Text(self, node):
376- text = node.astext()
377- if '@' in text:
378- text = text.replace('@', '@@')
379- if '{' in text:
380- text = text.replace('{', '@{')
381- if '}' in text:
382- text = text.replace('}', '@}')
383- node.parent.collect_text(text)
384-
385-
386- # Styled text
387-
388- def visit_emphasis(self, node):
389- set_item_collector(node, 'text')
390-
391- def depart_emphasis(self, node):
392- text = '@emph{%s}' % node['text']
393- node.parent.collect_text(text)
394-
395- def visit_strong(self, node):
396- set_item_collector(node, 'text')
397-
398- def depart_strong(self, node):
399- text = '@strong{%s}' % node['text']
400- node.parent.collect_text(text)
401-
402- def visit_literal(self, node):
403- set_item_collector(node, 'text')
404-
405- def depart_literal(self, node):
406- text = '@code{%s}' % node['text']
407- node.parent.collect_text(text)
408-
409- # Lists
410-
411- def _decorate_list(self, item_list, collect, item_fmt='%s',
412- head=None, foot=None):
413- if head is not None:
414- collect(head)
415- for item in item_list:
416- collect(item_fmt % item)
417- if foot is not None:
418- collect(foot)
419-
420- def visit_bullet_list(self, node):
421- set_item_list_collector(node, 'list_item')
422-
423- def depart_bullet_list(self, node):
424- l = node['list_item']
425- if self.in_toctree:
426- self._decorate_list(node['list_item'], node.parent.collect_text)
427- else:
428- self._decorate_list(node['list_item'], node.parent.collect_text,
429- '@item\n%s',
430- # FIXME: Should respect the 'bullet' attribute
431- '@itemize @bullet\n', '@end itemize\n')
432-
433- def visit_enumerated_list(self, node):
434- set_item_list_collector(node, 'list_item')
435-
436- def depart_enumerated_list(self, node):
437- self._decorate_list(node['list_item'], node.parent.collect_text,
438- '@item\n%s',
439- '@enumerate\n', '@end enumerate\n')
440-
441- def visit_definition_list(self, node):
442- raise nodes.SkipNode # Not implemented yet
443-
444- def depart_definition_list(self, node):
445- raise nodes.SkipNode # Not implemented yet
446-
447- def visit_definition_list_item(self, node):
448- raise nodes.SkipNode # Not implemented yet
449-
450- def depart_definition_list_item(self, node):
451- pass
452-
453- def visit_term(self, node):
454- raise nodes.SkipNode # Not implemented yet
455-
456- def depart_term(self, node):
457- pass
458-
459- def visit_definition(self, node):
460- raise nodes.SkipNode # Not implemented yet
461-
462- def depart_definition(self, node):
463- pass
464-
465- def visit_field_list(self, node):
466- raise nodes.SkipNode # Not implemented yet
467-
468- def depart_field_list(self, node):
469- pass
470-
471- def visit_field(self, node):
472- raise nodes.SkipNode # Not implemented yet
473-
474- def depart_field(self, node):
475- pass
476-
477- def visit_field_name(self, node):
478- raise nodes.SkipNode # Not implemented yet
479-
480- def depart_field_name(self, node):
481- pass
482-
483- def visit_field_body(self, node):
484- raise nodes.SkipNode # Not implemented yet
485-
486- def depart_field_body(self, node):
487- pass
488-
489- def visit_list_item(self, node):
490- set_item_list_collector(node, 'text')
491-
492- def depart_list_item(self, node):
493- text = ''.join(node['text'])
494- node.parent.collect_list_item(text)
495-
496- def visit_option_list(self, node):
497- raise nodes.SkipNode # Not implemented yet
498-
499- def depart_option_list(self, node):
500- pass
501-
502- def visit_option_list_item(self, node):
503- pass
504-
505- def depart_option_list_item(self, node):
506- pass
507-
508- def visit_option_group(self, node):
509- pass
510-
511- def depart_option_group(self, node):
512- pass
513-
514- def visit_option(self, node):
515- pass
516-
517- def depart_option(self, node):
518- pass
519-
520- def visit_option_string(self, node):
521- pass
522- def depart_option_string(self, node):
523- pass
524-
525- def visit_option_argument(self, node):
526- pass
527-
528- def depart_option_argument(self, node):
529- pass
530-
531- def visit_description(self, node):
532- pass
533- def depart_description(self, node):
534- pass
535-
536- # Tables
537- def visit_table(self, node):
538- set_item_collector(node, 'table')
539-
540- def depart_table(self, node):
541- node.parent.collect_text(node['table'])
542-
543- def visit_tgroup(self, node):
544- set_item_list_collector(node, 'colspec')
545- set_item_collector(node, 'head_entries')
546- set_item_collector(node, 'body_rows')
547-
548- def depart_tgroup(self, node):
549- header = []
550- # The '@multitable {xxx}{xxx}' line
551- self._decorate_list(node['colspec'], header.append,
552- '{%s}', '@multitable ', '\n')
553- # The '@headitem xxx @tab yyy...' line
554- head_entries = node['head_entries']
555- if head_entries is not None:
556- # Not all tables define titles for the columns... rest parser bug ?
557- # FIXME: need a test
558- self._decorate_list(head_entries[1:], header.append,
559- ' @tab %s',
560- '@headitem %s' % head_entries[0], '\n')
561- header = ''.join(header)
562- # The '@item xxx\n @tab yyy\n ...' lines
563- body_rows = node['body_rows']
564- rows = []
565- for r in body_rows:
566- self._decorate_list(r[1:], rows.append,
567- '@tab %s\n', '@item %s\n' % r[0])
568- footer = '@end multitable\n'
569- node.parent.collect_table(header + ''.join(rows) + footer)
570-
571- def visit_colspec(self, node):
572- pass
573-
574- def depart_colspec(self, node):
575- node.parent.collect_colspec('x' * node['colwidth'])
576-
577- def visit_thead(self, node):
578- set_item_collector(node, 'row')
579-
580- def depart_thead(self, node):
581- node.parent.collect_head_entries(node['row'])
582-
583- def visit_tbody(self, node):
584- set_item_list_collector(node, 'row')
585-
586- def depart_tbody(self, node):
587- node.parent.collect_body_rows(node['row'])
588-
589- def visit_row(self, node):
590- set_item_list_collector(node, 'entry')
591-
592- def depart_row(self, node):
593- node.parent.collect_row(node['entry'])
594-
595- def visit_entry(self, node):
596- set_item_list_collector(node, 'text')
597- node['par_sep_orig'] = self.paragraph_sep
598- self.paragraph_sep = ''
599-
600- def depart_entry(self, node):
601- node.parent.collect_entry(''.join(node['text']))
602- self.paragraph_sep = node['par_sep_orig']
603-
604- # References
605-
606- def visit_reference(self, node):
607- for c in node.children:
608- if getattr(c, 'parent', None) is None:
609- # Bug sphinx
610- node.setup_child(c)
611- set_item_collector(node, 'text')
612-
613- def depart_reference(self, node):
614- anchorname = node.get('anchorname', None)
615- refuri = node.get('refuri', None)
616- refid = node.get('refid', None)
617- text = ''.join(node['text'])
618- collect = getattr(node.parent, 'collect_reference', None)
619- if collect is not None:
620- if not self.in_toctree:
621- raise AssertionError('collect_reference is specific to toctree')
622- if anchorname is None:
623- anchorname = ''
624- if refuri is None:
625- refuri = ''
626- collect((anchorname, refuri, text))
627- elif refuri is not None:
628- node.parent.collect_text('@uref{%s,%s}' % (refuri, text))
629- elif refid is not None:
630- # Info format requires that a reference is followed by some
631- # punctuation char ('.', ','. ')', etc). Rest is more liberal. To
632- # accommodate, we use pxref inside parenthesis.
633- node.parent.collect_text('%s (@pxref{%s})' % (text, refid))
634-
635- def visit_footnote_reference(self, node):
636- raise nodes.SkipNode # Not implemented yet
637-
638- def visit_citation_reference(self, node):
639- raise nodes.SkipNode # Not implemented yet
640-
641- def visit_title_reference(self, node):
642- raise nodes.SkipNode # Not implemented yet
643-
644- def depart_title_reference(self, node):
645- pass
646-
647- def visit_target(self, node):
648- raise nodes.SkipNode # Not implemented yet
649-
650- def depart_target(self, node):
651- pass
652-
653- def visit_image(self, node):
654- raise nodes.SkipNode # Not implemented yet
655-
656-# Helpers to collect data in parent node
657-
658-def set_item_collector(node, name):
659- node[name] = None
660- def set_item(item):
661- node[name] = item
662- setattr(node, 'collect_' + name, set_item)
663-
664-
665-def set_item_list_collector(node, name, sep=''):
666- node[name] = []
667- node[name + '_sep'] = sep
668- def append_item(item):
669- node[name].append(item)
670- setattr(node, 'collect_' + name, append_item)
671-
672-
673
674=== modified file 'bzrlib/tests/__init__.py'
675--- bzrlib/tests/__init__.py 2012-02-15 22:43:50 +0000
676+++ bzrlib/tests/__init__.py 2012-03-12 14:56:53 +0000
677@@ -3909,7 +3909,6 @@
678 'bzrlib.doc',
679 'bzrlib.tests.blackbox',
680 'bzrlib.tests.commands',
681- 'bzrlib.tests.doc_generate',
682 'bzrlib.tests.per_branch',
683 'bzrlib.tests.per_bzrdir',
684 'bzrlib.tests.per_controldir',
685
686=== removed directory 'bzrlib/tests/doc_generate'
687=== removed file 'bzrlib/tests/doc_generate/__init__.py'
688--- bzrlib/tests/doc_generate/__init__.py 2011-01-10 22:20:12 +0000
689+++ bzrlib/tests/doc_generate/__init__.py 1970-01-01 00:00:00 +0000
690@@ -1,113 +0,0 @@
691-# Copyright (C) 2010, 2011 Canonical Ltd
692-#
693-# This program is free software; you can redistribute it and/or modify
694-# it under the terms of the GNU General Public License as published by
695-# the Free Software Foundation; either version 2 of the License, or
696-# (at your option) any later version.
697-#
698-# This program is distributed in the hope that it will be useful,
699-# but WITHOUT ANY WARRANTY; without even the implied warranty of
700-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
701-# GNU General Public License for more details.
702-#
703-# You should have received a copy of the GNU General Public License
704-# along with this program; if not, write to the Free Software
705-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
706-
707-"""Documentation generation tests."""
708-
709-import os
710-from bzrlib import tests
711-from bzrlib.doc_generate import (
712- # FIXME: doc/en/conf.py should be used here, or rather merged into
713- # bzrlib/doc_generate/conf.py -- vila 20100429
714- conf,
715- )
716-from bzrlib.tests import features
717-
718-
719-def load_tests(basic_tests, module, loader):
720- suite = loader.suiteClass()
721- # add the tests for this module
722- suite.addTests(basic_tests)
723-
724- testmod_names = [
725- 'builders',
726- 'writers',
727- ]
728- # add the tests for the sub modules
729- suite.addTests(loader.loadTestsFromModuleNames(
730- ['bzrlib.tests.doc_generate.' + name
731- for name in testmod_names]))
732-
733- return suite
734-
735-
736-class TestSphinx(tests.TestCaseInTempDir):
737- """Base class for sphinx tests.
738-
739- This is used for both the builder and the writer until a better solution is
740- found to test at a lower level.
741- """
742-
743- _test_needs_features = [features.sphinx]
744-
745- def sphinx_version(self):
746- # Convert to a tuple to avoid traps in string comparison
747- # ( '1.12' < '1.6' but (1, 12) > (1, 6) )
748- return tuple(map(int, features.sphinx.module.__version__.split('.')))
749-
750- def make_sphinx(self):
751- out = tests.StringIOWrapper()
752- err = tests.StringIOWrapper()
753- from sphinx import application
754- app = application.Sphinx(
755- '.', confdir=os.path.dirname(conf.__file__), outdir='.',
756- doctreedir='.',
757- buildername='texinfo',
758- confoverrides={},
759- status=out, warning=err,
760- freshenv=True)
761- return app, out, err
762-
763- def build(self, app, all_files=True, file_names=None):
764- if file_names is None:
765- file_names = []
766- app.build(all_files, file_names)
767-
768- # FIXME: something smells wrong here as we can't process a single file
769- # alone. On top of that, it seems the doc tree must contain an index.txt
770- # file. We may need a texinfo builder ? -- vila 20100505
771-
772- def create_content(self, content):
773- """Put content into a single file.
774-
775- This is appropriate for simple tests about the content of a single file.
776- """
777- app, out, err = self.make_sphinx()
778- self.build_tree_contents([('index.txt', content),])
779- self.build(app)
780-
781- def assertContent(self, expected, header=None, end=None):
782- """Check the content of the file created with creste_content().
783-
784- Most texinfo constructs can be tested this way without caring for any
785- boilerplate that texinfo may require at the beginning or the end of the
786- file.
787- """
788- if header is None:
789- # default boilerplate
790- header = '''\
791-This file has been converted using a beta rst->texinfo converter.
792-Most of the info links are currently bogus, don't report bugs about them,
793-this is currently worked on.
794-@node Top
795-@top Placeholder
796-'''
797- if end is None:
798- # By default we test constructs that are embedded into a paragraph
799- # which always end with two \n (even if the input has none)
800- end = '\n\n'
801- self.assertFileEqual(header + expected + end, 'index.texi')
802-
803-
804
805=== removed directory 'bzrlib/tests/doc_generate/builders'
806=== removed file 'bzrlib/tests/doc_generate/builders/__init__.py'
807--- bzrlib/tests/doc_generate/builders/__init__.py 2010-04-29 16:10:59 +0000
808+++ bzrlib/tests/doc_generate/builders/__init__.py 1970-01-01 00:00:00 +0000
809@@ -1,36 +0,0 @@
810-# Copyright (C) 2010 Canonical Ltd
811-#
812-# This program is free software; you can redistribute it and/or modify
813-# it under the terms of the GNU General Public License as published by
814-# the Free Software Foundation; either version 2 of the License, or
815-# (at your option) any later version.
816-#
817-# This program is distributed in the hope that it will be useful,
818-# but WITHOUT ANY WARRANTY; without even the implied warranty of
819-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
820-# GNU General Public License for more details.
821-#
822-# You should have received a copy of the GNU General Public License
823-# along with this program; if not, write to the Free Software
824-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
825-
826-
827-"""Sphinx builders tests."""
828-
829-from bzrlib.tests import features
830-
831-def load_tests(basic_tests, module, loader):
832- suite = loader.suiteClass()
833- # add the tests for this module
834- suite.addTests(basic_tests)
835-
836- if features.sphinx.available():
837- testmod_names = [
838- 'texinfo',
839- ]
840- # add the tests for the sub modules
841- suite.addTests(loader.loadTestsFromModuleNames(
842- ['bzrlib.tests.doc_generate.builders.test_' + name
843- for name in testmod_names]))
844-
845- return suite
846
847=== removed file 'bzrlib/tests/doc_generate/builders/test_texinfo.py'
848--- bzrlib/tests/doc_generate/builders/test_texinfo.py 2011-05-13 12:51:05 +0000
849+++ bzrlib/tests/doc_generate/builders/test_texinfo.py 1970-01-01 00:00:00 +0000
850@@ -1,71 +0,0 @@
851-# Copyright (C) 2010, 2011 Canonical Ltd
852-#
853-# This program is free software; you can redistribute it and/or modify
854-# it under the terms of the GNU General Public License as published by
855-# the Free Software Foundation; either version 2 of the License, or
856-# (at your option) any later version.
857-#
858-# This program is distributed in the hope that it will be useful,
859-# but WITHOUT ANY WARRANTY; without even the implied warranty of
860-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
861-# GNU General Public License for more details.
862-#
863-# You should have received a copy of the GNU General Public License
864-# along with this program; if not, write to the Free Software
865-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
866-
867-"""sphinx texinfo builder tests."""
868-
869-from bzrlib import tests
870-from bzrlib.doc_generate import (
871- # FIXME: doc/en/conf.py should be used here, or rather merged into
872- # bzrlib/doc_generate/conf.py -- vila 20100429
873- conf,
874- )
875-from bzrlib.tests import (
876- doc_generate as test_dg, # Avoid clash with from bzrlib import doc_generate
877- )
878-
879-
880-class TestBuilderDefined(tests.TestCase):
881-
882- def test_builder_defined(self):
883- self.assertTrue('bzrlib.doc_generate.builders.texinfo'
884- in conf.extensions)
885-
886-class TestBuilderLoaded(test_dg.TestSphinx):
887-
888- def test_builder_loaded(self):
889- app, out, err = self.make_sphinx()
890- self.assertTrue('texinfo' in app.builderclasses)
891-
892-
893-class TestFileProduction(test_dg.TestSphinx):
894-
895- def test_files_generated(self):
896- self.build_tree_contents(
897- [('index.txt', """
898-Table of Contents
899-=================
900-
901-.. toctree::
902- :maxdepth: 1
903-
904- content
905-"""),
906- ('content.txt', """
907-
908-bzr 0.0.8
909-*********
910-
911-Improvements
912-============
913-
914-* Adding a file whose parent directory is not versioned will
915- implicitly add the parent, and so on up to the root.
916-"""),
917- ])
918- app, out, err = self.make_sphinx()
919- self.build(app)
920- self.assertPathExists('index.texi')
921- self.assertPathExists('content.texi')
922
923=== removed directory 'bzrlib/tests/doc_generate/writers'
924=== removed file 'bzrlib/tests/doc_generate/writers/__init__.py'
925--- bzrlib/tests/doc_generate/writers/__init__.py 2010-07-06 13:22:32 +0000
926+++ bzrlib/tests/doc_generate/writers/__init__.py 1970-01-01 00:00:00 +0000
927@@ -1,36 +0,0 @@
928-# Copyright (C) 2010 Canonical Ltd
929-#
930-# This program is free software; you can redistribute it and/or modify
931-# it under the terms of the GNU General Public License as published by
932-# the Free Software Foundation; either version 2 of the License, or
933-# (at your option) any later version.
934-#
935-# This program is distributed in the hope that it will be useful,
936-# but WITHOUT ANY WARRANTY; without even the implied warranty of
937-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
938-# GNU General Public License for more details.
939-#
940-# You should have received a copy of the GNU General Public License
941-# along with this program; if not, write to the Free Software
942-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
943-
944-
945-"""Sphinx writers tests."""
946-
947-from bzrlib.tests import features
948-
949-def load_tests(basic_tests, module, loader):
950- suite = loader.suiteClass()
951- # add the tests for this module
952- suite.addTests(basic_tests)
953-
954- if features.sphinx.available():
955- testmod_names = [
956- 'texinfo',
957- ]
958- # add the tests for the sub modules
959- suite.addTests(loader.loadTestsFromModuleNames(
960- ['bzrlib.tests.doc_generate.writers.test_' + name
961- for name in testmod_names]))
962-
963- return suite
964
965=== removed file 'bzrlib/tests/doc_generate/writers/test_texinfo.py'
966--- bzrlib/tests/doc_generate/writers/test_texinfo.py 2011-03-11 11:33:33 +0000
967+++ bzrlib/tests/doc_generate/writers/test_texinfo.py 1970-01-01 00:00:00 +0000
968@@ -1,359 +0,0 @@
969-# Copyright (C) 2010, 2011 Canonical Ltd
970-#
971-# This program is free software; you can redistribute it and/or modify
972-# it under the terms of the GNU General Public License as published by
973-# the Free Software Foundation; either version 2 of the License, or
974-# (at your option) any later version.
975-#
976-# This program is distributed in the hope that it will be useful,
977-# but WITHOUT ANY WARRANTY; without even the implied warranty of
978-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
979-# GNU General Public License for more details.
980-#
981-# You should have received a copy of the GNU General Public License
982-# along with this program; if not, write to the Free Software
983-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
984-
985-"""sphinx texinfo writer tests."""
986-
987-from bzrlib import tests
988-from bzrlib.tests import (
989- doc_generate as test_dg, # Avoid clash with from bzrlib import doc_generate
990- )
991-
992-
993-class TestTextGeneration(test_dg.TestSphinx):
994-
995- def test_special_chars(self):
996- self.create_content("A '@' a '{' and a '}'")
997- self.assertContent("A '@@' a '@{' and a '@}'")
998-
999- def test_emphasis(self):
1000- self.create_content('*important*')
1001- self.assertContent('@emph{important}')
1002-
1003- def test_strong(self):
1004- self.create_content('**very important**')
1005- self.assertContent('@strong{very important}')
1006-
1007- def test_literal(self):
1008- self.create_content('the command is ``foo``')
1009- self.assertContent('the command is @code{foo}')
1010-
1011- def test_paragraphs(self):
1012- self.create_content('''\
1013-This is a paragraph.
1014-
1015-This is another one.
1016-''')
1017- self.assertContent('''\
1018-This is a paragraph.
1019-
1020-This is another one.''')
1021-
1022- def test_literal_block(self):
1023- self.create_content('''\
1024-Do this::
1025-
1026- bzr xxx
1027- bzr yyy
1028-''')
1029- self.assertContent('''\
1030-Do this:
1031-
1032-@samp{bzr xxx
1033-bzr yyy}
1034-
1035-''',
1036- end='')
1037-
1038- def test_block_quote(self):
1039- self.create_content('''\
1040-This is an ordinary paragraph, introducing a block quote.
1041-
1042- "It is my business to know things. That is my trade."
1043-
1044-This is another ordinary paragraph.
1045-''')
1046- self.assertContent('''\
1047-This is an ordinary paragraph, introducing a block quote.
1048-
1049-@example
1050-"It is my business to know things. That is my trade."
1051-
1052-@end example
1053-
1054-This is another ordinary paragraph.
1055-
1056-''',
1057- # examples are not followed by an empty line
1058- end='')
1059-
1060-
1061-class TestDocumentAttributesGeneration(test_dg.TestSphinx):
1062-
1063- def test_title(self):
1064- self.create_content('''\
1065-####################
1066-Bazaar Release Notes
1067-####################
1068-''')
1069- self.assertContent('''\
1070-@node bazaar-release-notes
1071-@chapter Bazaar Release Notes
1072-''',
1073- end='')
1074-
1075-
1076-class TestListGeneration(test_dg.TestSphinx):
1077-
1078- def test_bullet_list(self):
1079- self.create_content('''\
1080-* This is a bulleted list.
1081-* It has two items, the second
1082- item uses two lines.
1083-''')
1084- self.assertContent('''\
1085-@itemize @bullet
1086-@item
1087-This is a bulleted list.
1088-
1089-@item
1090-It has two items, the second
1091-item uses two lines.
1092-
1093-@end itemize
1094-''',
1095- end='')
1096-
1097- def test_enumerated_list(self):
1098- self.create_content('''\
1099-#. This is a numbered list.
1100-#. It has two items, the second
1101- item uses two lines.
1102-''')
1103- self.assertContent('''\
1104-@enumerate
1105-@item
1106-This is a numbered list.
1107-
1108-@item
1109-It has two items, the second
1110-item uses two lines.
1111-
1112-@end enumerate
1113-''',
1114- end='')
1115-
1116-
1117-class TestTableGeneration(test_dg.TestSphinx):
1118-
1119- def test_table(self):
1120- self.create_content('''\
1121- =========== ================
1122- Prefix Description
1123- =========== ================
1124- first The first
1125- second The second
1126- last The last
1127- =========== ================
1128-''')
1129- # FIXME: Sphinx bug ? Why are tables enclosed in a block_quote
1130- # (translated as an @example).
1131- self.assertContent('''\
1132-@example
1133-@multitable {xxxxxxxxxxx}{xxxxxxxxxxxxxxxx}
1134-@headitem Prefix @tab Description
1135-@item first
1136-@tab The first
1137-@item second
1138-@tab The second
1139-@item last
1140-@tab The last
1141-@end multitable
1142-@end example''')
1143-
1144-
1145-class TestTocTreeGeneration(test_dg.TestSphinx):
1146-
1147- def test_toctree(self):
1148- self.build_tree_contents(
1149- [('index.txt', """
1150-Table of Contents
1151-=================
1152-
1153-.. toctree::
1154- :maxdepth: 1
1155-
1156- bzr 0.0.8 <bzr-0.0.8>
1157-"""),
1158- ('bzr-0.0.8.txt', """
1159-
1160-bzr 0.0.8
1161-*********
1162-
1163-Improvements
1164-============
1165-
1166-* Adding a file whose parent directory is not versioned will
1167- implicitly add the parent, and so on up to the root.
1168-"""),
1169- ])
1170- app, out, err = self.make_sphinx()
1171- self.build(app)
1172- self.assertFileEqual("""\
1173-This file has been converted using a beta rst->texinfo converter.
1174-Most of the info links are currently bogus, don't report bugs about them,
1175-this is currently worked on.
1176-@node Top
1177-@top Placeholder
1178-@node table-of-contents
1179-@chapter Table of Contents
1180-@menu
1181-* bzr 0.0.8: (bzr-0.0.8.info)bzr 0.0.8.
1182-@end menu
1183-""",
1184- 'index.texi')
1185- self.assertFileEqual("""\
1186-This file has been converted using a beta rst->texinfo converter.
1187-Most of the info links are currently bogus, don't report bugs about them,
1188-this is currently worked on.
1189-@node Top
1190-@top Placeholder
1191-@node bzr-0-0-8
1192-@chapter bzr 0.0.8
1193-@node improvements
1194-@section Improvements
1195-@itemize @bullet
1196-@item
1197-Adding a file whose parent directory is not versioned will
1198-implicitly add the parent, and so on up to the root.
1199-
1200-@end itemize
1201-""",
1202- 'bzr-0.0.8.texi')
1203-
1204- def test_toctree_empty(self):
1205- self.build_tree_contents(
1206- [('index.txt', """
1207-Table of Contents
1208-=================
1209-
1210-.. toctree::
1211- :maxdepth: 1
1212-""")])
1213- app, out, err = self.make_sphinx()
1214- self.build(app)
1215- self.assertFileEqual("""\
1216-This file has been converted using a beta rst->texinfo converter.
1217-Most of the info links are currently bogus, don't report bugs about them,
1218-this is currently worked on.
1219-@node Top
1220-@top Placeholder
1221-@node table-of-contents
1222-@chapter Table of Contents
1223-""",
1224- 'index.texi')
1225-
1226-
1227-class TestSections(test_dg.TestSphinx):
1228-
1229- def test_sections(self):
1230- self.create_content('''\
1231-###########
1232-Chapter one
1233-###########
1234-
1235-Chapter introduction.
1236-
1237-***********
1238-section one
1239-***********
1240-
1241-The first section.
1242-
1243-
1244-subsection one
1245-==============
1246-
1247-The first subsection.
1248-
1249-subsection two
1250-==============
1251-
1252-The second subsection.
1253-
1254-subsubsection one
1255------------------
1256-
1257-Here is sus sub section one.
1258-
1259-blob one
1260-^^^^^^^^
1261-
1262-Far tooo deep to get a name
1263-
1264-thing one
1265-"""""""""
1266-
1267-No idea how to call that, but sphinx says it's a paragraph.
1268-''')
1269- self.assertContent('''\
1270-@node chapter-one
1271-@chapter Chapter one
1272-Chapter introduction.
1273-
1274-@node section-one
1275-@section section one
1276-The first section.
1277-
1278-@node subsection-one
1279-@subsection subsection one
1280-The first subsection.
1281-
1282-@node subsection-two
1283-@subsection subsection two
1284-The second subsection.
1285-
1286-@node subsubsection-one
1287-@subsubsection subsubsection one
1288-Here is sus sub section one.
1289-
1290-@node blob-one
1291-@heading blob one
1292-Far tooo deep to get a name
1293-
1294-@node thing-one
1295-@heading thing one
1296-No idea how to call that, but sphinx says it's a paragraph.''')
1297-
1298-
1299-class TestReferences(test_dg.TestSphinx):
1300-
1301- def test_external_reference(self):
1302- self.create_content('''\
1303-The `example web site`_ is nice.
1304-
1305-.. _example web site: http://www.example.com/
1306-''')
1307- self.assertContent('''\
1308-The @uref{http://www.example.com/,example web site} is nice.''')
1309-
1310-
1311- def test_internal_reference(self):
1312- self.create_content('''\
1313-The `example web site`_ contains more examples.
1314-
1315-Example web site
1316-----------------
1317-
1318-Here we have a lot of nice examples.
1319-
1320-''')
1321- self.assertContent('''\
1322-The example web site (@pxref{example-web-site}) contains more examples.
1323-
1324-@node example-web-site
1325-@chapter Example web site
1326-Here we have a lot of nice examples.''')
1327-
1328
1329=== modified file 'bzrlib/tests/features.py'
1330--- bzrlib/tests/features.py 2011-12-05 14:21:55 +0000
1331+++ bzrlib/tests/features.py 2012-03-12 14:56:53 +0000
1332@@ -352,7 +352,6 @@
1333 paramiko = ModuleAvailableFeature('paramiko')
1334 pycurl = ModuleAvailableFeature('pycurl')
1335 pywintypes = ModuleAvailableFeature('pywintypes')
1336-sphinx = ModuleAvailableFeature('sphinx')
1337 subunit = ModuleAvailableFeature('subunit')
1338 testtools = ModuleAvailableFeature('testtools')
1339
1340
1341=== modified file 'doc/developers/conf.py'
1342--- doc/developers/conf.py 2010-07-07 15:03:14 +0000
1343+++ doc/developers/conf.py 2012-03-12 14:56:53 +0000
1344@@ -33,16 +33,26 @@
1345
1346 # Grouping the document tree into LaTeX files. List of tuples
1347 # (source start file, target name, title, author, documentclass [howto/manual]).
1348+bzr_documents = [
1349+ ('HACKING', 'bzr-en-developer-guide', u'Bazaar Developer Guide',
1350+ u'Bazaar Developers', 'manual'),
1351+ ('testing', 'bzr-en-testing-guide', u'Bazaar Testing Guide',
1352+ u'Bazaar Developers', 'manual'),
1353+ ('overview', 'bzr-en-architecture-overview', u'Bazaar Architecture Overview',
1354+ u'Bazaar Developers', 'howto'),
1355+ ('integration', 'bzr-en-integration-guide', u'Bazaar Integration Guide',
1356+ u'Bazaar Developers', 'howto'),
1357+]
1358+
1359 latex_documents = [
1360- ('HACKING', 'bzr-en-developer-guide.tex', u'Bazaar Developer Guide',
1361- u'Bazaar Developers', 'manual'),
1362- ('testing', 'bzr-en-testing-guide.tex', u'Bazaar Testing Guide',
1363- u'Bazaar Developers', 'manual'),
1364- ('overview', 'bzr-en-architecture-overview.tex', u'Bazaar Architecture Overview',
1365- u'Bazaar Developers', 'howto'),
1366- ('integration', 'bzr-en-integration-guide.tex', u'Bazaar Integration Guide',
1367- u'Bazaar Developers', 'howto'),
1368-]
1369+ (start, target+'.tex', title, author, doc_class)
1370+ for start, target, title, author, doc_class in bzr_documents
1371+ ]
1372+
1373+texinfo_documents = [
1374+ (start, target, title, author, doc_class)
1375+ for start, target, title, author, doc_class in bzr_documents
1376+ ]
1377
1378 # List of documents that shouldn't be included in the build.
1379 # Note: Maybe some of them *ought* to be linked in somewhere?
1380
1381=== modified file 'doc/en/Makefile'
1382--- doc/en/Makefile 2010-07-05 12:40:28 +0000
1383+++ doc/en/Makefile 2012-03-12 14:56:53 +0000
1384@@ -114,5 +114,8 @@
1385 "results in _build/doctest/output.txt."
1386
1387 texinfo:
1388+ $(make_output_dirs)
1389 $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) _build/texinfo
1390+ # Now build the info files using the Makefile provided by Sphinx
1391+ $(MAKE) -C _build/texinfo
1392
1393
1394=== modified file 'doc/en/conf.py'
1395--- doc/en/conf.py 2010-10-13 06:14:37 +0000
1396+++ doc/en/conf.py 2012-03-12 14:56:53 +0000
1397@@ -47,35 +47,45 @@
1398 # Output file base name for HTML help builder.
1399 htmlhelp_basename = 'bzr-%s' % (bzr_locale,)
1400
1401-# Grouping the document tree into LaTeX files. List of tuples
1402+# Grouping the document tree into files. List of tuples
1403 # (source start file, target name, title, author, documentclass [howto/manual]).
1404-latex_documents = [
1405+bzr_documents = [
1406 # Manuals
1407- ('user-guide/index', 'bzr-%s-user-guide.tex' % (bzr_locale,),
1408+ ('user-guide/index', 'bzr-%s-user-guide' % (bzr_locale,),
1409 bzr_title(u'Bazaar User Guide'), bzr_team, 'manual'),
1410- ('user-reference/index', 'bzr-%s-user-reference.tex' % (bzr_locale,),
1411+ ('user-reference/index', 'bzr-%s-user-reference' % (bzr_locale,),
1412 bzr_title(u'Bazaar User Reference'), bzr_team, 'manual'),
1413- ('release-notes/index', 'bzr-%s-release-notes.tex' % (bzr_locale,),
1414+ ('release-notes/index', 'bzr-%s-release-notes' % (bzr_locale,),
1415 bzr_title(u'Bazaar Release Notes'), bzr_team, 'manual'),
1416- ('upgrade-guide/index', 'bzr-%s-upgrade-guide.tex' % (bzr_locale,),
1417+ ('upgrade-guide/index', 'bzr-%s-upgrade-guide' % (bzr_locale,),
1418 bzr_title(u'Bazaar Upgrade Guide'), bzr_team, 'manual'),
1419- ('admin-guide/index', 'bzr-%s-admin-guide.tex' % (bzr_locale,),
1420+ ('admin-guide/index', 'bzr-%s-admin-guide' % (bzr_locale,),
1421 bzr_title(u"Bazaar System Administrator's Guide"), bzr_team, 'manual'),
1422 # Tutorials
1423- ('mini-tutorial/index', 'bzr-%s-tutorial-mini.tex' % (bzr_locale,),
1424+ ('mini-tutorial/index', 'bzr-%s-tutorial-mini' % (bzr_locale,),
1425 bzr_title(u'Bazaar in five minutes'), bzr_team, 'howto'),
1426- ('tutorials/tutorial', 'bzr-%s-tutorial.tex' % (bzr_locale,),
1427+ ('tutorials/tutorial', 'bzr-%s-tutorial' % (bzr_locale,),
1428 bzr_title(u'Bazaar Tutorial'), bzr_team, 'howto'),
1429 ('tutorials/using_bazaar_with_launchpad',
1430- 'bzr-%s-tutorial-with-launchpad.tex' % (bzr_locale,),
1431+ 'bzr-%s-tutorial-with-launchpad' % (bzr_locale,),
1432 bzr_title(u'Using Bazaar With Launchpad'), bzr_team, 'howto'),
1433 ('tutorials/centralized_workflow',
1434- 'bzr-%s-tutorial-centralized.tex' % (bzr_locale,),
1435+ 'bzr-%s-tutorial-centralized' % (bzr_locale,),
1436 bzr_title(u'Centralized Workflow Tutorial'), bzr_team, 'howto'),
1437- ('whats-new/whats-new-in-2.1', 'bzr-%s-whats-new.tex' % (bzr_locale,),
1438+ ('whats-new/whats-new-in-2.1', 'bzr-%s-whats-new' % (bzr_locale,),
1439 bzr_title(u"What's New in Bazaar 2.1?"), bzr_team, 'howto'),
1440 ]
1441
1442+latex_documents = [
1443+ (start, target+'.tex', title, author, doc_class)
1444+ for start, target, title, author, doc_class in bzr_documents
1445+ ]
1446+
1447+texinfo_documents = [
1448+ (start, target, title, author, doc_class)
1449+ for start, target, title, author, doc_class in bzr_documents
1450+ ]
1451+
1452 # List of documents that shouldn't be included in the build.
1453 unused_docs = [
1454 # Subtopics that get included
1455
1456=== modified file 'doc/en/release-notes/bzr-2.5.txt'
1457--- doc/en/release-notes/bzr-2.5.txt 2012-02-28 05:02:15 +0000
1458+++ doc/en/release-notes/bzr-2.5.txt 2012-03-12 14:56:53 +0000
1459@@ -38,7 +38,11 @@
1460 Documentation
1461 *************
1462
1463-.. Improved or updated documentation.
1464+* The alpha-quality texinfo sphinx builder has been deprecated. Sphinx >=
1465+ 1.1.2 now provides a better one. Most of the documentation can now be
1466+ generated to the texinfo format with ``make texinfo-sphinx``. This will
1467+ generate both the ``.texi`` files and the ``.info`` ones.
1468+ (Vincent Ladeuil, #940164)
1469
1470 API Changes
1471 ***********
1472
1473=== modified file 'doc/en/whats-new/whats-new-in-2.5.txt'
1474--- doc/en/whats-new/whats-new-in-2.5.txt 2012-03-09 11:22:08 +0000
1475+++ doc/en/whats-new/whats-new-in-2.5.txt 2012-03-12 14:56:53 +0000
1476@@ -134,6 +134,13 @@
1477 ``bzr help po_merge`` for documentation on how to
1478 enable it and what it can do.
1479
1480+Documentation in texinfo format
1481+*******************************
1482+
1483+Sphinx (>= 1.1.2) provides a better texinfo builder than the alpha-quality
1484+one provided with bzr sources. Most of the bzr documentation can be
1485+processed and produce valid ``.info`` files.
1486+
1487 Further information
1488 *******************
1489
1490
1491=== modified file 'doc/es/conf.py'
1492--- doc/es/conf.py 2010-07-07 15:03:14 +0000
1493+++ doc/es/conf.py 2012-03-12 14:56:53 +0000
1494@@ -52,29 +52,39 @@
1495
1496 # Grouping the document tree into LaTeX files. List of tuples
1497 # (source start file, target name, title, author, documentclass [howto/manual]).
1498-latex_documents = [
1499+bzr_documents = [
1500 # Manuals
1501- ('user-guide/index', 'bzr-%s-user-guide.tex' % (bzr_locale,),
1502+ ('user-guide/index', 'bzr-%s-user-guide' % (bzr_locale,),
1503 bzr_title(u'Bazaar User Guide'), bzr_team, 'manual'),
1504- #('user-reference/bzr_man', 'bzr-%s-user-reference.tex' % (bzr_locale,),
1505+ #('user-reference/bzr_man', 'bzr-%s-user-reference' % (bzr_locale,),
1506 # bzr_title(u'Bazaar User Reference'), bzr_team, 'manual'),
1507- #('release-notes/NEWS', 'bzr-%s-release-notes.tex' % (bzr_locale,),
1508+ #('release-notes/NEWS', 'bzr-%s-release-notes' % (bzr_locale,),
1509 # bzr_title(u'Bazaar Release Notes'), bzr_team, 'manual'),
1510- #('upgrade-guide/index', 'bzr-%s-upgrade-guide.tex' % (bzr_locale,),
1511+ #('upgrade-guide/index', 'bzr-%s-upgrade-guide' % (bzr_locale,),
1512 # bzr_title(u'Bazaar Upgrade Guide'), bzr_team, 'manual'),
1513 # Tutorials
1514- ('mini-tutorial/index', 'bzr-%s-tutorial-mini.tex' % (bzr_locale,),
1515+ ('mini-tutorial/index', 'bzr-%s-tutorial-mini' % (bzr_locale,),
1516 bzr_title(u'Bazaar in five minutes'), bzr_team, 'howto'),
1517- #('tutorials/tutorial', 'bzr-%s-tutorial.tex' % (bzr_locale,),
1518+ #('tutorials/tutorial', 'bzr-%s-tutorial' % (bzr_locale,),
1519 # bzr_title(u'Bazaar Tutorial'), bzr_team, 'howto'),
1520 #('tutorials/using_bazaar_with_launchpad',
1521- # 'bzr-%s-tutorial-with-launchpad.tex' % (bzr_locale,),
1522+ # 'bzr-%s-tutorial-with-launchpad' % (bzr_locale,),
1523 # bzr_title(u'Using Bazaar With Launchpad'), bzr_team, 'howto'),
1524 #('tutorials/centralized_workflow',
1525- # 'bzr-%s-tutorial-centralized.tex' % (bzr_locale,),
1526+ # 'bzr-%s-tutorial-centralized' % (bzr_locale,),
1527 # bzr_title(u'Centralized Workflow Tutorial'), bzr_team, 'howto'),
1528 ]
1529
1530+latex_documents = [
1531+ (start, target+'.tex', title, author, doc_class)
1532+ for start, target, title, author, doc_class in bzr_documents
1533+ ]
1534+
1535+texinfo_documents = [
1536+ (start, target, title, author, doc_class)
1537+ for start, target, title, author, doc_class in bzr_documents
1538+ ]
1539+
1540 # List of documents that shouldn't be included in the build.
1541 unused_docs = [
1542 # Subtopics that get included
1543
1544=== modified file 'doc/ja/conf.py'
1545--- doc/ja/conf.py 2010-07-07 15:03:14 +0000
1546+++ doc/ja/conf.py 2012-03-12 14:56:53 +0000
1547@@ -52,29 +52,39 @@
1548
1549 # Grouping the document tree into LaTeX files. List of tuples
1550 # (source start file, target name, title, author, documentclass [howto/manual]).
1551-latex_documents = [
1552+bzr_documents = [
1553 # Manuals
1554- ('user-guide/index', 'bzr-%s-user-guide.tex' % (bzr_locale,),
1555+ ('user-guide/index', 'bzr-%s-user-guide' % (bzr_locale,),
1556 bzr_title(u'Bazaar User Guide'), bzr_team, 'manual'),
1557- ('user-reference/bzr_man', 'bzr-%s-user-reference.tex' % (bzr_locale,),
1558+ ('user-reference/bzr_man', 'bzr-%s-user-reference' % (bzr_locale,),
1559 bzr_title(u'Bazaar User Reference'), bzr_team, 'manual'),
1560- #('release-notes/NEWS', 'bzr-%s-release-notes.tex' % (bzr_locale,),
1561+ #('release-notes/NEWS', 'bzr-%s-release-notes' % (bzr_locale,),
1562 # bzr_title(u'Bazaar Release Notes'), bzr_team, 'manual'),
1563- #('upgrade-guide/index', 'bzr-%s-upgrade-guide.tex' % (bzr_locale,),
1564+ #('upgrade-guide/index', 'bzr-%s-upgrade-guide' % (bzr_locale,),
1565 # bzr_title(u'Bazaar Upgrade Guide'), bzr_team, 'manual'),
1566 # Tutorials
1567- ('mini-tutorial/index', 'bzr-%s-tutorial-mini.tex' % (bzr_locale,),
1568+ ('mini-tutorial/index', 'bzr-%s-tutorial-mini' % (bzr_locale,),
1569 bzr_title(u'Bazaar in five minutes'), bzr_team, 'howto'),
1570- #('tutorials/tutorial', 'bzr-%s-tutorial.tex' % (bzr_locale,),
1571+ #('tutorials/tutorial', 'bzr-%s-tutorial' % (bzr_locale,),
1572 # bzr_title(u'Bazaar Tutorial'), bzr_team, 'howto'),
1573 #('tutorials/using_bazaar_with_launchpad',
1574- # 'bzr-%s-tutorial-with-launchpad.tex' % (bzr_locale,),
1575+ # 'bzr-%s-tutorial-with-launchpad' % (bzr_locale,),
1576 # bzr_title(u'Using Bazaar With Launchpad'), bzr_team, 'howto'),
1577 #('tutorials/centralized_workflow',
1578- # 'bzr-%s-tutorial-centralized.tex' % (bzr_locale,),
1579+ # 'bzr-%s-tutorial-centralized' % (bzr_locale,),
1580 # bzr_title(u'Centralized Workflow Tutorial'), bzr_team, 'howto'),
1581 ]
1582
1583+latex_documents = [
1584+ (start, target+'.tex', title, author, doc_class)
1585+ for start, target, title, author, doc_class in bzr_documents
1586+ ]
1587+
1588+texinfo_documents = [
1589+ (start, target, title, author, doc_class)
1590+ for start, target, title, author, doc_class in bzr_documents
1591+ ]
1592+
1593 # List of documents that shouldn't be included in the build.
1594 unused_docs = [
1595 # Subtopics that get included
1596
1597=== modified file 'doc/ru/conf.py'
1598--- doc/ru/conf.py 2010-07-07 15:03:14 +0000
1599+++ doc/ru/conf.py 2012-03-12 14:56:53 +0000
1600@@ -52,29 +52,40 @@
1601
1602 # Grouping the document tree into LaTeX files. List of tuples
1603 # (source start file, target name, title, author, documentclass [howto/manual]).
1604-latex_documents = [
1605+bzr_documents = [
1606 # Manuals
1607- #('user-guide/index', 'bzr-%s-user-guide.tex' % (bzr_locale,),
1608+ #('user-guide/index', 'bzr-%s-user-guide' % (bzr_locale,),
1609 # bzr_title(u'Bazaar User Guide'), bzr_team, 'manual'),
1610- #('user-reference/bzr_man', 'bzr-%s-user-reference.tex' % (bzr_locale,),
1611+ #('user-reference/bzr_man', 'bzr-%s-user-reference' % (bzr_locale,),
1612 # bzr_title(u'Bazaar User Reference'), bzr_team, 'manual'),
1613- #('release-notes/NEWS', 'bzr-%s-release-notes.tex' % (bzr_locale,),
1614+ #('release-notes/NEWS', 'bzr-%s-release-notes' % (bzr_locale,),
1615 # bzr_title(u'Bazaar Release Notes'), bzr_team, 'manual'),
1616- #('upgrade-guide/index', 'bzr-%s-upgrade-guide.tex' % (bzr_locale,),
1617+ #('upgrade-guide/index', 'bzr-%s-upgrade-guide' % (bzr_locale,),
1618 # bzr_title(u'Bazaar Upgrade Guide'), bzr_team, 'manual'),
1619 # Tutorials
1620- ('mini-tutorial/index', 'bzr-%s-tutorial-mini.tex' % (bzr_locale,),
1621+ ('mini-tutorial/index', 'bzr-%s-tutorial-mini' % (bzr_locale,),
1622 bzr_title(u'Bazaar in five minutes'), bzr_team, 'howto'),
1623- ('tutorials/tutorial', 'bzr-%s-tutorial.tex' % (bzr_locale,),
1624+ ('tutorials/tutorial', 'bzr-%s-tutorial' % (bzr_locale,),
1625 bzr_title(u'Bazaar Tutorial'), bzr_team, 'howto'),
1626 #('tutorials/using_bazaar_with_launchpad',
1627- # 'bzr-%s-tutorial-with-launchpad.tex' % (bzr_locale,),
1628+ # 'bzr-%s-tutorial-with-launchpad' % (bzr_locale,),
1629 # bzr_title(u'Using Bazaar With Launchpad'), bzr_team, 'howto'),
1630 #('tutorials/centralized_workflow',
1631- # 'bzr-%s-tutorial-centralized.tex' % (bzr_locale,),
1632+ # 'bzr-%s-tutorial-centralized' % (bzr_locale,),
1633 # bzr_title(u'Centralized Workflow Tutorial'), bzr_team, 'howto'),
1634 ]
1635
1636+latex_documents = [
1637+ (start, target+'.tex', title, author, doc_class)
1638+ for start, target, title, author, doc_class in bzr_documents
1639+ ]
1640+
1641+texinfo_documents = [
1642+ (start, target, title, author, doc_class)
1643+ for start, target, title, author, doc_class in bzr_documents
1644+ ]
1645+
1646+
1647 # List of documents that shouldn't be included in the build.
1648 unused_docs = [
1649 # Subtopics that get included

Subscribers

People subscribed via source and target branches