Skip to content

docs: remove rustdoc hidden lines from markdown examples - #26

Merged
hmziqrs merged 6 commits into
freeoxide:masterfrom
hmziqagent:docs/dehash-markdown-snippets
Oct 12, 2026
Merged

hmziqrs merged 6 commits into
freeoxide:masterfrom
hmziqagent:docs/dehash-markdown-snippets

Conversation

@hmziqagent

Copy link
Copy Markdown
Contributor

Problem

The repo's markdown used rustdoc's # hidden-line idiom to tuck example scaffolding out of sight. That only works on docs.rs, where the READMEs are embedded via #[doc = include_str!]. GitHub and the Starlight site render those lines literally as # use gpui::... comment noise. A repo-wide fence-aware scan found 55 such lines across 14 files (15 counting the yaml fix below).

Separately, the gpui-query skill pack's frontmatter description: value contained an unquoted (v0.3.0): sequence. That breaks yaml parsers; github's preview refused the file with "mapping values are not allowed in this context at line 2 column 78".

Changes

  • skills/gpui-query/SKILL.md: quote the description: value. No wording change; 750 chars, under the 1024 limit.
  • READMEs (root + 3 published crates): all 14 snippets rewritten as self-contained visible code. Imports merged into the visible use groups; hidden fn doc(...) wrappers become real named functions; same code otherwise.
  • Starlight docs pages (9 files, 40 lines): same treatment. unimplemented!() context stubs replaced with visible function signatures (observers, installation, quick-start, query-keys) or a plain leading comment (select-pattern).
  • skills/gpui-query-extensions/SKILL.md: one hidden fetch_users stub line made visible.
  • crates/gpui-query-persist/README.md: [`tempfile`] had no link reference definition and rendered as literal brackets; now a real link to docs.rs/tempfile.
  • web/README.md: the URLs section claimed build.format: "file"; web/astro.config.mjs uses "directory" + trailingSlash: "ignore". Corrected to match.

Verification

  • Fence-aware scan over all 45 repo markdown files: 0 remaining # lines inside rust fences; all 24 frontmatters parse clean under yaml.safe_load.
  • cargo test --all-features: 760 unit tests and all 37 doctests green. Every rewritten README fence compiles as a doctest, so the examples stay machine-checked.
  • cargo clippy --all-features --all-targets -- -D warnings: clean.
  • cargo doc --all-features --no-deps: clean.

Tradeoff

docs.rs now shows the example boilerplate (imports, scaffold structs) that the # lines used to hide. GitHub and docs.rs render identical, complete examples.

The unquoted (v0.3.0): sequence in the description value breaks yaml
frontmatter parsers; github's preview refused the file outright.
The # line idiom only hides on docs.rs; github and the starlight site
render it as literal '#' comment noise. Snippets in the four published
readmes, the root readme, nine docs pages, and the extensions skill are
now self-contained on every surface. unimplemented!() stubs are replaced
with visible function signatures. Also fixes a dangling [`tempfile`]
reference-style link in the persist readme (docs.rs now shows the
example boilerplate that was previously hidden there).
astro.config.mjs uses directory output with trailingSlash ignore, not
flat file output.
Follow-up to the judge defers: commented-out hydrate call compressed to
a 3-line constraint note, trailing enumeration labels removed from the
retry/query-key/observer/persister fences, and now-unread closure params
renamed to _signal/_entity. No fact loss: the tolerant-load contract
lives in the prose above the fence, the retry defaults in the api docs.
@hmziqrs
hmziqrs merged commit 014f2f9 into freeoxide:master Oct 12, 2026
5 checks passed
@hmziqagent
hmziqagent deleted the docs/dehash-markdown-snippets branch October 12, 2026 06:05
@hmziqagent hmziqagent mentioned this pull request Oct 23, 2026
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.

2 participants