~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to tools/doc_generate/autodoc_rstx.py

  • Committer: Alexander Belchenko
  • Date: 2007-08-07 15:29:02 UTC
  • mto: This revision was merged to the branch mainline in revision 2685.
  • Revision ID: bialix@ukr.net-20070807152902-rqn8su318xq3jkwl
bzr_man: see also topics as cross-reference links

Show diffs side-by-side

added added

removed removed

Lines of Context:
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), ""]
 
71
    links_to_topics = []
71
72
    for topic in topics:
72
73
        help = registry.get_detail(topic)
73
74
        heading,text = help.split("\n", 1)
75
76
        lines.append(hdg_level2 * len(heading))
76
77
        lines.append(text)
77
78
        lines.append('')
 
79
        if topic != heading.lower():
 
80
            links_to_topics.append((topic, heading))
 
81
    lines.extend([".. _%s: `%s`_" % i for i in links_to_topics])
78
82
    return "\n" + "\n".join(lines) + "\n"
79
83
 
80
84
 
88
92
        if cmd_object.hidden:
89
93
            continue
90
94
        heading = cmd_name
91
 
        text = cmd_object.get_help_text(plain=False)
 
95
        text = cmd_object.get_help_text(plain=False, see_also_as_links=True)
92
96
        lines.append(heading)
93
97
        lines.append(hdg_level2 * len(heading))
94
98
        lines.append(text)