MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / html_topicpage

Function html_topicpage

tools/python-3.11.9-amd64/Lib/pydoc.py:2675–2698  ·  view source on GitHub ↗

Topic or keyword help page.

(topic)

Source from the content-addressed store, hash-verified

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)

Callers 1

get_html_pageFunction · 0.85

Calls 10

_gettopicMethod · 0.95
HelperClass · 0.85
sortedFunction · 0.85
bigsectionMethod · 0.80
multicolumnMethod · 0.80
headingMethod · 0.45
markupMethod · 0.45
splitMethod · 0.45
sectionMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected