til
til copied to clipboard
Automate creation of README.md
Hi!
I love the idea and am adopting it myself. I've created a script which will auto-generate the README.md file using the information already in the directory structure and the titles of each of the TIL markdown files. I've got it working and producing output that is close: the diffs are:
- alphabetization is different when python does it than some of your choices
- you missed a # in front of Webpack
- Someplaces you have custom capitalization (CSS instead of Css)
- You also missed this line:
- SSH With A Specific Key
As I said, I've got the generation script, but I'm still thinking about how to get it into the work-flow. The options I can think of tonight are:
- a git hook which runs on pre-commit which modifies the README.md
- just have it as a command in the project that can be run manually
Neither of these are making me happy this evening, so I'm asking you if you have any ideas, that is, if you're interested at all.
Either way, Thanks for the great idea! I really like what you did. I'll admit I created my own before I saw your instructions (or thought about) forking your starter repo.
Thanks again!
git-hook
seems reasonable for this use! What's your concern with using that?
Additionally I think it's useful to exit non-zero in the pre-commit
hook if the script detects a mistake in the README file.
I'm not sure I remember why I didn't like the git-hook. I suspect I was mis-remembering where that hook ran. It runs on the client and so it's easy to install (server side hooks take a bit more access, at least). Totally agree on the return code. I'll try to get that added in the next few days. :+1:
@prankymat - just added instructions on how to do it as a git hook to the template version of til over here: https://github.com/til-collective/til-collective/pull/6
Let me know if that's what you had in mind. Great idea!
A very handy script! Thanks :)