~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to tools/doc_generate/autodoc_rstx.py

Help topics can now be loaded from files (based on Ian's patch, adapted to proper support various windows installers).

Show diffs side-by-side

added added

removed removed

Lines of Context:
64
64
    return "\n".join(result)
65
65
 
66
66
 
67
 
def _get_section(registry, section, title, hdg_level1="=", hdg_level2="-"):
 
67
def _get_section(registry, section, title, hdg_level1="#", hdg_level2="="):
68
68
    """Build the manual part from topics matching that section."""
69
69
    topics = sorted(registry.get_topics_for_section(section))
70
70
    lines = [title, hdg_level1 * len(title), ""]
86
86
        help = registry.get_detail(topic)
87
87
        heading,text = help.split("\n", 1)
88
88
        lines.append(heading)
89
 
        lines.append(hdg_level2 * len(heading))
 
89
        if not text.startswith(hdg_level2):
 
90
            lines.append(hdg_level2 * len(heading))
90
91
        lines.append(text)
91
92
        lines.append('')
92
93
        # check that topic match heading
100
101
    return "\n" + "\n".join(lines) + "\n"
101
102
 
102
103
 
103
 
def _get_commands_section(registry, title="Commands", hdg_level1="=",
104
 
                          hdg_level2="-"):
 
104
def _get_commands_section(registry, title="Commands", hdg_level1="#",
 
105
                          hdg_level2="="):
105
106
    """Build the comands reference section of the manual."""
106
107
    lines = [title, hdg_level1 * len(title), ""]
107
108
    cmds = sorted(bzrlib.commands.builtin_command_names())
132
133
 
133
134
 
134
135
rstx_head = """\
135
 
=====================
 
136
#####################
136
137
Bazaar User Reference
137
 
=====================
 
138
#####################
138
139
 
139
140
:Version:   %(version)s
140
141
:Generated: %(datestamp)s
141
142
 
142
 
.. contents::
 
143
.. contents:: :depth: 2
143
144
 
144
145
-----
145
146
 
146
147
About This Manual
147
 
=================
 
148
#################
148
149
 
149
150
This manual is generated from Bazaar's online help. To use
150
151
the online help system, try the following commands.