Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

find a way to run doc tests against code snippets #4

Open
clux opened this issue Feb 11, 2022 · 1 comment
Open

find a way to run doc tests against code snippets #4

clux opened this issue Feb 11, 2022 · 1 comment
Labels
question Further information is requested

Comments

@clux
Copy link
Member

clux commented Feb 11, 2022

as explored in #1 - we tried using mdbook as the nice rust-native markdown book webpage generator for its killer feature: being able to run doc tests.

unfortunately, the feature as it stands is extremely limited: rust-lang/mdBook#706 , and the book ui also leaves a lot to be desired.

therefore, this is an exploration issue (possibly for the far future) to find a way to do this externally.

some potentials:

  • having a docs/SUMMARY.md + book.toml present in the repo just for doc tests (if they fix 706)
  • create a local crate with doc-comment pull-ins / rust-skeptic that's tested via cargo test --doc on ci here

i explored the latter approach within kube-rs repo a few months ago and found it very painful (needed a lot of doc comments that cannot be hidden except through shell hackery - which did not work for the root README.md)

@clux clux added the question Further information is requested label Feb 11, 2022
clux added a commit that referenced this issue Feb 11, 2022
@clux
Copy link
Member Author

clux commented Jan 8, 2024

LucaP has done this for materialize-mkdocs using an mkdocs plugin with a generator that inlines snippets: https://www.lpalmieri.com/posts/this-month-in-pavex-08/

It currently lives in https://github.com/LukeMathWalker/pavex/blob/db8fb67210e242d6ca81aafe14f66f1217f49085/doc_examples/tutorial_generator/src/main.rs

maybe something like this could be factored out of pavex and made general purpose?

mastodon thread

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant