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

Function write_glossary_json

Doc/tools/extensions/glossary_search.py:45–52  ·  view source on GitHub ↗
(app: Sphinx, _exc: Exception)

Source from the content-addressed store, hash-verified

43
44
45def write_glossary_json(app: Sphinx, _exc: Exception) -> None:
46 if not getattr(app.env, 'glossary_terms', None):
47 return
48
49 logger.info('Writing glossary.json', color='green')
50 dest = Path(app.outdir, '_static', 'glossary.json')
51 dest.parent.mkdir(exist_ok=True)
52 dest.write_text(json.dumps(app.env.glossary_terms), encoding='utf-8')
53
54
55def setup(app: Sphinx) -> ExtensionMetadata:

Callers

nothing calls this directly

Calls 5

write_textMethod · 0.95
PathClass · 0.90
infoMethod · 0.45
mkdirMethod · 0.45
dumpsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…