Hacker News new | past | comments | ask | show | jobs | submit login
Using a self-rewriting README powered by GitHub Actions to track TILs (simonwillison.net)
205 points by pcr910303 on April 20, 2020 | hide | past | favorite | 31 comments

This was inspired by "I've been writing TILs for 5 years" from yesterday: https://news.ycombinator.com/item?id=22908044

What a coincidence. I implemented the exact same thing yesterday. It also happened to be my TIL for that day: how to create a Github Action.

My setup turned up much simpler, as I did not have some of the constraints that you wanted.


Hah, that IS a coincidence! Really nice solution you have there - very minimal, and achieves exactly the same job with regards to the README.

I find the hard dependency on Github a bit disconcerting.

Why not self host?

What happens if https://github.com/simonw/til drops away?

Love your work Simon.

My https://til.simonwillison.net/til site acts as a sort of off-site backup - but I should probably run a cron somewhere which pulls my repos. I have a Digital Ocean box I could do that on. Good idea!

If you want a recommendation, try out https://gitea.io/en-us/ - it has a mirror feature that can periodically pull down repos for you.

I've been using it to backup some of my repos on github/gitlab, without having to rely on any of my own custom scripts/crons.

I thought this was a pretty good idea so I make a little reusable Github Action anyone could drop into their TIL repo to get an autogenerated README: https://github.com/marketplace/actions/til-auto-format-readm...

Nice! Like the idea of tracking TILs with git. I've also made self-rewriting READMEs. I did something similar but using plain git hooks (post-commit) and sed. I had to run 'git --amend' in the hook though (to avoid generating double-commits) which is probably a bad idea.

Since when is programmatically generating a text file considered noteworthy / novel.

Or is this trending on HN because it has the "GitHub Actions" buzzword in the title?

Edit: This is a serious question.

Author here. I was really proud of this piece - it's a very detailed tutorial on how to use GitHub Actions, which for me fulfills exactly the kind of content I want to see on Hacker News.

It's the article I wish I had been able to read when I started working on this project.

Nice! I've been doing this for a while too -- https://github.com/raivivek/til

I actually built a little webapp for this recently: https://todayilearned.co

For tracking and sharing of personal TILs

Also as an iOS app

I started doing TIL too. I made a quick and dirty bash script to generate a new article with read/vim/sed and automatically fill the README files: https://github.com/kinoute/til/blob/master/contribute.sh

Also inspired by the same post, I set up a TIL repo. I went with a shell script where you pass the category and the filename and it creates the file and recreates the README: https://github.com/acdibble/til/blob/master/create_til.sh

Seems like many of us had this same idea. :)

Here's my TIL implementation using Github Actions: https://github.com/mlpetersen/til

Mine is quite simple, you add new TIL's in the develop branch and commit them. Then it's built and added to the master branch.

I actually wrote a tool like this that's aimed at storing and accessing information: https://mmap.it

The main difference is it provides full text search and global keyboard shortcuts so you can access it when you need it, without context switching.

To push back to GitHub, you can also use this action: https://github.com/ad-m/github-push-action

Alright, now I’m definitely going to build a little web app for this

I recently started, come join me! https://todayilearned.co

@littke on twitter

Thanks for sharing. I also recently started a TIL repo from the same inspiration and found it lame to write my first README entry. Will look at setting up what you described.

If there was a public place for posting these with peers, that was built for TILs rather than just a repo, would you use it? Especially if it included an easy way to export all to markdown for backup?

This would allow folks to see each other’s TILs, search them, browse by tag, like/favorite each other’s TILs, and some other fun stuff eventually

It's automatically updated, not aelf-rewriting.

This is cool stuff. But could someone explain how this is a self-rewriting README? It looks to me like a file updated by a commit hook.

That's exactly what it is. Maybe "self-rewriting" isn't the best summary - it's the repo that does the rewrite, not the README file itself.

Your version doesn't have the clickbait name.

Could this be implemented in emacs org-mode? How would one approach that task?

Nice. I imagine this could be used to list and track TODOs in code as well.

What's wrong with Pinboard notes?

My TIL for today is that I learnt what TIL stands for. How useless.

Actually that's wrong, in the morning I convinced myself that given a sequence of code points which forms a valid Unicode character (an extended grapheme cluster), any non-empty prefix of it also forms a valid Unicode character.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact