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

Chore: add ability to test code snippets from the docs #227

Open
talagluck opened this issue Feb 9, 2024 · 2 comments
Open

Chore: add ability to test code snippets from the docs #227

talagluck opened this issue Feb 9, 2024 · 2 comments
Labels
chore ⚙️ DX or minor infra. Not build, ci or release related.

Comments

@talagluck
Copy link
Contributor

Description

@talagluck talagluck added the chore ⚙️ DX or minor infra. Not build, ci or release related. label Feb 9, 2024
@tychoish
Copy link
Collaborator

this is pretty difficult to get right (because you need setup code in many cases that you don't want to display, and synchronization with upstream repos and versioning can be kind of hard.

I would:

  • see if mdbook (which I desire to use) has support for this kind of doctest/literate programming functionality.
  • if we have to implement it ourselves, the "best" solution is to put all of the "tested" documentation code samples in individual files, potentially in a separate repository, and then inline them in their entirity into the documentation.

@talagluck
Copy link
Contributor Author

I previously used Docusaurus, and this was possible. There were a bunch of gotchas to it, and we wound up writing some additional checkers to make sure the right code snippets were the ones that were embedded, but it was a really nice feature to have. I'll poke around and see if this might be possible with mdbook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore ⚙️ DX or minor infra. Not build, ci or release related.
Projects
None yet
Development

No branches or pull requests

2 participants