docs_text
¶
A page of the docs source as plain markdown, for a reader that is not the docs site (SensAI's docs agent reads the docs this way).
The pages in DOCS_SOURCE_DIR are written for the docs site, and read as plain text a few lines would mislead: the pictures are image files that do not ship, and some lines are site markup. This removes it:
- a
<figure>keeps its caption, as a line startingFigure:, and loses the image; any other image line, and any<video>block, is removed - HTML comments (notes for the people who maintain the docs) are removed
- a page's front matter (the
---block of site settings at its top) and its<style>and<script>blocks are removed - a row of linked images (the badges at the top of the home page) is removed
- attribute lists after a link (
{ .md-button }) and icon codes (:material-open-in-new:) are removed
Code blocks are left alone. The code the guides show is already in them: scripts/gen_docs_source.py replaces each --8<-- include with the lines it names when it writes the docs source. It uses only the standard library.
clean
¶
The text with the site markup removed outside its code blocks, and the blank lines left behind collapsed.