~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/doc_generate/autodoc_rstx.py

  • Committer: Danny van Heumen
  • Date: 2010-03-09 21:42:11 UTC
  • mto: (4634.139.5 2.0)
  • mto: This revision was merged to the branch mainline in revision 5160.
  • Revision ID: danny@dannyvanheumen.nl-20100309214211-iqh42x6qcikgd9p3
Reverted now-useless TODO list.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright 2006-2007 Canonical Ltd.
 
1
# Copyright (C) 2006-2007 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
"""Generate ReStructuredText source for the User Reference Manual.
18
18
Loosely based on the manpage generator autodoc_man.py.
22
22
 
23
23
import os
24
24
import sys
25
 
import textwrap
26
25
import time
27
26
 
28
27
import bzrlib
32
31
import bzrlib.osutils
33
32
 
34
33
 
 
34
# Set this to True to generate a file per topic.
 
35
# This probably ought to be an option. The files probably
 
36
# ought to be prefixed with their section name as well so
 
37
# there's zero risk of clashing with a standard sphinx
 
38
# topic (like search.html).
 
39
FILE_PER_TOPIC = False
 
40
 
 
41
 
35
42
def get_filename(options):
36
43
    """Provides name of manual"""
37
44
    return "%s_man.txt" % (options.bzr_name)
120
127
 
121
128
def _dump_text(filename, text):
122
129
    """Dump text to filename."""
 
130
    if not FILE_PER_TOPIC:
 
131
        return
123
132
    f =  open(filename, "w")
124
133
    f.writelines(text)
125
134
    f.close()
127
136
 
128
137
def _get_commands_section(registry, title="Commands", hdg_level1="#",
129
138
                          hdg_level2="="):
130
 
    """Build the comands reference section of the manual."""
 
139
    """Build the commands reference section of the manual."""
131
140
    lines = [title, hdg_level1 * len(title), ""]
132
141
    cmds = sorted(bzrlib.commands.builtin_command_names())
133
142
    for cmd_name in cmds:
161
170
Bazaar User Reference
162
171
#####################
163
172
 
164
 
:Version:   %(version)s
165
 
:Generated: %(datestamp)s
166
 
 
167
 
.. contents:: :depth: 2
168
 
 
169
 
-----
170
 
 
171
173
About This Manual
172
174
#################
173
175