docs: add guide for adding tested doc examples - #284
Open
Leokaufi wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Task
Closes #254
Description
Adds a short guide to
docs/development.mdexplaining how to add a newdocumentation page with a tested code example: where to put the snippet
file (
docs/examples/<category>/), how to include it in the.mdpage viapymdownx.snippets, how the snippet is picked up by the test(
tests/test_docs/test_doc_examples.py, run as a script viarunpy), and howto build/preview the docs with
mkdocs.Guide lives in
docs/development.mdfor 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 thepymdownx.snippetsescape so the markers render literally on the built docs site instead of being
interpreted and expanded at build time. The
;is stripped in the renderedHTML but is visible when reading the raw
.mdon 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 withouterrors, and both illustration blocks render literally as the intended syntax
(verified in the generated HTML).
prekhooks pass on the commit.Checklist
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.