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

Tutorial helper scripts #224

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Tutorial helper scripts #224

wants to merge 4 commits into from

Conversation

LevFendi
Copy link
Member

@LevFendi LevFendi commented Aug 3, 2024

Adding scripts for making it easier to edit the tutorial files:

  1. Updated tutorial-to-markdown script
  2. Added tutorial step numbering cleanup script. Needs testing.
  3. Will add markdown-to-tutorial script.

The PR also includes changes to the tutorial structure:

  1. Chapters will be 99 steps long with step 0 being the title. Unused steps will be empty.
  2. The tutorial reader will skip empty steps.
  3. There will be a single info box at the top to explain how to make edits and use the scripts.

LevFendi added 2 commits July 21, 2024 15:37
Todo:
1. Test scripts and verify them.
2. make tutorial lua code react
according to the new system
3. Test and verify new tutorial system
@LevFendi LevFendi added the tutorial Suggestions/issues about the tutorial label Aug 3, 2024
@LevFendi LevFendi self-assigned this Aug 3, 2024
@ahicks92
Copy link
Member

ahicks92 commented Aug 4, 2024

I still think longterm we should maintain the tutorial in markdown, but for now why not. It does solve the problem.

Note that this is actually any Python 3.6 or greater because of the format strings.

Usually you want to do two things: start a script with #! /usr/bin/env python3 and chmod +x. This makes it "just work" on anything except Windows. On windows chmod is trickier: use git update-index --chmod=+x (which I a,ways have to look up, to be fair).

That said I don't really care and if it ever comes to matter I can just do it for you later. The place it could matter is whenever we double down more on CI.

Consider this approved or whatever, I just spotted it and it seemed worth dropping in. I haven't validated the script changes; I'm assuming that you tested, they work, and we'll find bugs later.

@LevFendi
Copy link
Member Author

LevFendi commented Aug 4, 2024

Added description to explain the intent for this draft PR.

@ahicks92
Copy link
Member

ahicks92 commented Aug 4, 2024

If we have markdown to tutorial aren't the others irrelevant? We'd convert to markdown once, which is basically just some find/replace in vscode, right? Then after that we'd just always go md->cfg and the other scripts become useless?

Might as well only maintain one if we can. I'd suggest scoping this such that the conversion happens in this PR< this PR lands as a deleter of the other scripts, and we can just not bother being super paranoid/etc about the new ones because there'd only be the one to review.

@LevFendi
Copy link
Member Author

LevFendi commented Aug 6, 2024

I suppose that markdown editing will be unequivocally easier so yes, the end goal might as well be keeping only the markdown to cfg script.

The only place where cfg has an advantage is keeping track of chapter lengths to see if you crossed 99. I suppose one can quickly open and close the cfg to check that.

Therefore yeah, when the third script is good to go we can remove the other two or at least not advertise them.

@ahicks92
Copy link
Member

ahicks92 commented Aug 7, 2024

Well as I've said before if that genuinely becomes a problem (it won't, 99 markdown paragraphs is a whole novella) then we can query that from the cfg I am reasonably sure.

I kind of care which way we go, because markdown is easier, but the most important thing is that we have one authoritative copy.

My idea for markdown is heading levels for chapters and steps and then paragraphs under those. Bit tricky to parse without a library. There are libraries, but I only know the Rust landscape.

@LevFendi
Copy link
Member Author

LevFendi commented Aug 7, 2024

I agree on the headings and paragraphs, as that is already what we do in the tutorial transcript.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tutorial Suggestions/issues about the tutorial
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants