Show HN: Gitorials – Tutorials as Git Repos
gitorials.com
gitorials.com
I think this approach has a lot of promise. Compared to normal blog posts, being able to see the diff and the entire snapshot of the code at this step is luxurious.
The biggest problem I always ran into was that it's brittle. Made a mistake creating the gitorial on step 3 of 10? You have to rebase, which throws off all your commit hashes down the road. You can get around this with automatically creating tags for the steps, but the fact of the matter is, it's brittle.
I also don't like that it's a CLI only tool. When I'm reading tutorials online, I don't want to have to leave my browser—on mobile, I can't leave my browser!
For the purposes of prototyping, these are the two attempts I've had at creating a similar experience in the past:
- https://github.com/jez/vim-as-an-ide (how to configure Vim & use plugins)
- https://scottylabs.org/wdw/frontend/lab/ (intro to JavaScript by making a simple board game)
Neither my two solutions nor the OP's solutions are perfect, but the idea in general holds a lot of promise.
https://bokub.github.io/git-history-editor/
In the future, I'd like to extend the shell tool to have a nice "edit mode" that runs git rebase underneath. I haven't thought through how to deal with merge conflicts, though.
Being able to run the tutorials online would be ideal, but that will require a full-fledged OS to run the project. That could be done server-side with a sandboxed OS ($$$) or, intriguingly, perhaps it could be done entirely client-side using an in-browser Linux emulator:
So, in order to make one of these tutorials, you feed the software the url to the repo, start/end commit hashes, and some JSON or whatever that contains your annotations—and it gives you back an interactive presentation of annotated diffs.
At some mass the algebra changes and it's all about making consumption seamless.
This is the right direction. I encourage the author of this to really think about the experience of making the tutorial for the next few months as the business grows.
Following the commit tree allows you to easily modify the code without breaking it, and then quickly test out the results by running it while you're looking at the gitorial.
If need be, the learner can easily find the important pieces of code to fiddle with, because they are presented in the diffs for each commit.
I have though about a properly designed "code-demo" branch for learning about a project. I have never tried it, but I think that maintaining a branch where you show the development of the core of the logic would be interesting. I was thinking that you could have all logging statements kept in a separate branch that you can merge into this "code-demo" branch. This way, you can easily get rid of the logging statements when you're looking at this code-demo branch, for example.
With all that being said I do like the concept though. It could work in classrooms where students could just git clone the days lab and get started.
This shows the commit as "being written in front of you"
How would they name a CLI tutorials site?