MCPcopy Index your code
hub / github.com/python/cpython / html_topicpage

Function html_topicpage

Lib/pydoc.py:2579–2602  ·  view source on GitHub ↗

Topic or keyword help page.

(topic)

Source from the content-addressed store, hash-verified

2577 return 'Keywords', contents
2578
2579 def html_topicpage(topic):
2580 """Topic or keyword help page."""
2581 buf = io.StringIO()
2582 htmlhelp = Helper(buf, buf)
2583 contents, xrefs = htmlhelp._gettopic(topic)
2584 if topic in htmlhelp.keywords:
2585 title = 'KEYWORD'
2586 else:
2587 title = 'TOPIC'
2588 heading = html.heading(
2589 '<strong class="title">%s</strong>' % title,
2590 )
2591 contents = '<pre>%s</pre>' % html.markup(contents)
2592 contents = html.bigsection(topic , 'index', contents)
2593 if xrefs:
2594 xrefs = sorted(xrefs.split())
2595
2596 def bltinlink(name):
2597 return '<a href="topic?key=%s">%s</a>' % (name, name)
2598
2599 xrefs = html.multicolumn(xrefs, bltinlink)
2600 xrefs = html.section('Related help topics: ', 'index', xrefs)
2601 return ('%s %s' % (title, topic),
2602 ''.join((heading, contents, xrefs)))
2603
2604 def html_getobj(url):
2605 obj = locate(url, forceload=1)

Callers 1

get_html_pageFunction · 0.85

Calls 9

_gettopicMethod · 0.95
HelperClass · 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

Used in the wild real call sites across dependent graphs

searching dependent graphs…