Topic or keyword help page.
(topic)
| 2625 | return 'Keywords', contents |
| 2626 | |
| 2627 | def html_topicpage(topic): |
| 2628 | """Topic or keyword help page.""" |
| 2629 | buf = io.StringIO() |
| 2630 | htmlhelp = Helper(buf, buf) |
| 2631 | contents, xrefs = htmlhelp._gettopic(topic) |
| 2632 | if topic in htmlhelp.keywords: |
| 2633 | title = 'KEYWORD' |
| 2634 | else: |
| 2635 | title = 'TOPIC' |
| 2636 | heading = html.heading( |
| 2637 | '<strong class="title">%s</strong>' % title, |
| 2638 | ) |
| 2639 | contents = '<pre>%s</pre>' % html.markup(contents) |
| 2640 | contents = html.bigsection(topic , 'index', contents) |
| 2641 | if xrefs: |
| 2642 | xrefs = sorted(xrefs.split()) |
| 2643 | |
| 2644 | def bltinlink(name): |
| 2645 | return '<a href="topic?key=%s">%s</a>' % (name, name) |
| 2646 | |
| 2647 | xrefs = html.multicolumn(xrefs, bltinlink) |
| 2648 | xrefs = html.section('Related help topics: ', 'index', xrefs) |
| 2649 | return ('%s %s' % (title, topic), |
| 2650 | ''.join((heading, contents, xrefs))) |
| 2651 | |
| 2652 | def html_getobj(url): |
| 2653 | obj = locate(url, forceload=1) |
no test coverage detected