feat(docs): Add markdown-exec for executable code blocks#309
feat(docs): Add markdown-exec for executable code blocks#309
Conversation
Replace manually-written output blocks with code that runs at build time via markdown-exec, so docs always reflect the current API behavior. Converted pages: quickstart, acs-data, decennial-data, geography, margins-of-error, migration-flows, multi-year, spatial. Pages left unconverted due to pre-existing API bugs (get_pums 400s, load_variables wrong URL pattern, get_estimates 404s): variables, pums-microdata, population-estimates, survey-design. Also adds --extra spatial to .readthedocs.yaml so geometry=True blocks can execute during the docs build. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Claude finished @chekos's task in 2m 37s —— View job PR Review: feat(docs): Add markdown-exec for executable code blocks
Overall this is a well-structured PR that dramatically reduces manually-maintained output blocks. The approach (hidden exec blocks alongside annotated display blocks in quickstart.md; Issues🔴 Critical: known-broken APIs used in exec blocksThe PR description explicitly calls out
If the local 🟡 Bug: missing
|
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Claude finished @chekos's task in 2m 20s —— View job PR Review: feat(docs): Add markdown-exec for executable code blocks
Overall this is a well-executed PR. Replacing ~370 lines of manually-maintained output blocks with live execution is a clear quality-of-life win. The session-based approach, consistent use of Configuration — looks good
Issues foundBug: missing
|
| Severity | Issue | File |
|---|---|---|
| Bug | ca_flows.head() missing print() → no output rendered |
migration-flows.md:68 |
| Risk | get_estimates/get_flows tabs use exec="on" despite known API bugs |
spatial.md:62-88 |
| Style | "Common patterns" section uses different pattern than rest of file | decennial-data.md:411-495 |
| Minor | income DataFrame fetched but never used in significance example |
margins-of-error.md:118-135 |
The print() fix is a clear bug. The get_estimates/get_flows risk is worth addressing before merging to avoid a broken ReadTheDocs build. The rest are polish items.
Summary
markdown-execplugin so Python code blocks in docs execute at build time, replacing manually-written output blocksexec="on" source="tabbed-left"with per-page sessions--extra spatialto.readthedocs.yamlsogeometry=Trueblocks can run during docs buildCENSUS_API_KEYenvironment variable in ReadTheDocs admin (already configured)Pages left unconverted due to pre-existing API bugs (
get_pums400s,load_variableswrong URL pattern,get_estimates404s): variables, pums-microdata, population-estimates, survey-design.Test plan
uv run mkdocs build --strictpasses with no warningsCENSUS_API_KEYenv var set🤖 Generated with Claude Code