til icon indicating copy to clipboard operation
til copied to clipboard

Automate creation of README.md

Open jima80525 opened this issue 7 years ago • 4 comments

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:

  1. a git hook which runs on pre-commit which modifies the README.md
  2. 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!

jima80525 avatar Sep 13 '17 03:09 jima80525

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.

matthewwo avatar Dec 28 '17 22:12 matthewwo

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:

jima80525 avatar Dec 29 '17 16:12 jima80525

@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!

jima80525 avatar Dec 31 '17 02:12 jima80525

A very handy script! Thanks :)

nirajpandkar avatar Jan 04 '18 11:01 nirajpandkar