Skip to content

docs: add guide for adding tested doc examples - #284

Open
Leokaufi wants to merge 1 commit into
developmentfrom
docs/issue-254-snippet-guide
Open

docs: add guide for adding tested doc examples#284
Leokaufi wants to merge 1 commit into
developmentfrom
docs/issue-254-snippet-guide

Conversation

@Leokaufi

@Leokaufi Leokaufi commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Task

Closes #254

Description

Adds a short guide to docs/development.md explaining how to add a new
documentation page with a tested code example: where to put the snippet
file (docs/examples/<category>/), how to include it in the .md page via
pymdownx.snippets, how the snippet is picked up by the test
(tests/test_docs/test_doc_examples.py, run as a script via runpy), and how
to build/preview the docs with mkdocs.

Guide lives in docs/development.md for now. The open question from the issue
(docs page vs. README vs. CONTRIBUTING) is not hard-decided — happy to move it
if reviewers prefer another location.

Note on the two illustration blocks: the snippet-marker and include
examples carry a leading ; (e.g. ;--8<--). This is the pymdownx.snippets
escape so the markers render literally on the built docs site instead of being
interpreted and expanded at build time. The ; is stripped in the rendered
HTML but is visible when reading the raw .md on GitHub — so it's intentional,
not a typo.

How Has This Been Tested?

Docs-only change, no code. Ran uv run --dev mkdocs build — builds without
errors, and both illustration blocks render literally as the intended syntax
(verified in the generated HTML). prek hooks pass on the commit.

Checklist

  • This Pull-Request goes to the development branch.
  • I have successfully run prek locally.
  • I have added tests to cover my changes.
  • I have linked the issue-id to the task-description.
  • I have performed a self-review of my own code.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@Leokaufi
Leokaufi requested a review from viktorbeck98 August 26, 2026 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant