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

Future-proofing the example code #17

Open
ISSOtm opened this issue Jul 10, 2022 · 1 comment
Open

Future-proofing the example code #17

ISSOtm opened this issue Jul 10, 2022 · 1 comment

Comments

@ISSOtm
Copy link
Member

ISSOtm commented Jul 10, 2022

Parts II and III will have the reader (and thus, the writer as well) working iteratively on a codebase. Where it gets iffy is that any change made to earlier lessons must be consistently reflected in later lessons. (This could happen for example because an earlier lesson is amended to make "room for" a later one, to update the syntax for a newer RGBDS version etc.)

Propagating these changes throughout the tutorial, where they would be presented "inline", would be a massive pain. Instead, I suggest the codebase should be checked out into Git, and inline code examples pulled from that repo.

This does get somewhat involved in several ways (e.g. ensuring that all referenced commits are reachable from the master branch, keeping referenced line numbers consistent when rebasing, etc.), but I think is essential if we want to avoid the tutorial irremediably bit-rotting in the longer term.

The concrete solution, I'd say, is to build a mdBook preprocessor (either stand-alone, or as part of the bundled one), that is able to include portions of files (like the default links preproc is able to), but picking a version of that file in a specific commit. libgit integration is desirable so as to avoid a ton of slow git checkouts, but not necessary—the priority is to it make work.

@avivace
Copy link
Sponsor Member

avivace commented Jul 10, 2022

Agree, a simple CI/CD set up could also check the code examples against the target versions of RGBDS

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

No branches or pull requests

2 participants