Skip to content
This repository was archived by the owner on Apr 7, 2025. It is now read-only.

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
Contributor

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
chore ⚙️ DX or minor infra. Not build, ci or release related.
Projects
None yet
Development

No branches or pull requests

2 participants