MCPcopy Create free account
hub / github.com/pybind/pybind11 / prepare

Function prepare

docs/conf.py:342–354  ·  view source on GitHub ↗
(app)

Source from the content-addressed store, hash-verified

340
341
342def prepare(app):
343 with open(DIR.parent / "README.rst") as f:
344 contents = f.read()
345
346 if app.builder.name == "latex":
347 # Remove badges and stuff from start
348 contents = contents[contents.find(r".. start") :]
349
350 # Filter out section titles for index.rst for LaTeX
351 contents = re.sub(r"^(.*)\n[-~]{3,}$", r"**\1**", contents, flags=re.MULTILINE)
352
353 with open(DIR / "readme.rst", "w") as f:
354 f.write(contents)
355
356
357def clean_up(app, exception): # noqa: ARG001

Callers

nothing calls this directly

Calls 3

findMethod · 0.80
readMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected