Topic or keyword help page.
(topic)
| 2673 | return 'Keywords', contents |
| 2674 | |
| 2675 | def html_topicpage(topic): |
| 2676 | """Topic or keyword help page.""" |
| 2677 | buf = io.StringIO() |
| 2678 | htmlhelp = Helper(buf, buf) |
| 2679 | contents, xrefs = htmlhelp._gettopic(topic) |
| 2680 | if topic in htmlhelp.keywords: |
| 2681 | title = 'KEYWORD' |
| 2682 | else: |
| 2683 | title = 'TOPIC' |
| 2684 | heading = html.heading( |
| 2685 | '<strong class="title">%s</strong>' % title, |
| 2686 | ) |
| 2687 | contents = '<pre>%s</pre>' % html.markup(contents) |
| 2688 | contents = html.bigsection(topic , 'index', contents) |
| 2689 | if xrefs: |
| 2690 | xrefs = sorted(xrefs.split()) |
| 2691 | |
| 2692 | def bltinlink(name): |
| 2693 | return '<a href="topic?key=%s">%s</a>' % (name, name) |
| 2694 | |
| 2695 | xrefs = html.multicolumn(xrefs, bltinlink) |
| 2696 | xrefs = html.section('Related help topics: ', 'index', xrefs) |
| 2697 | return ('%s %s' % (title, topic), |
| 2698 | ''.join((heading, contents, xrefs))) |
| 2699 | |
| 2700 | def html_getobj(url): |
| 2701 | obj = locate(url, forceload=1) |
no test coverage detected