
Using a self-rewriting README powered by GitHub Actions to track TILs - pcr910303
https://simonwillison.net/2020/Apr/20/self-rewriting-readme/
======
simonw
This was inspired by "I've been writing TILs for 5 years" from yesterday:
[https://news.ycombinator.com/item?id=22908044](https://news.ycombinator.com/item?id=22908044)

------
aicioara
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.

[https://github.com/aicioara/til/blob/master/github/github-
ac...](https://github.com/aicioara/til/blob/master/github/github-actions.md)

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

------
hendry
I find the hard dependency on Github a bit disconcerting.

Why not self host?

What happens if [https://github.com/simonw/til](https://github.com/simonw/til)
drops away?

Love your work Simon.

~~~
simonw
My [https://til.simonwillison.net/til](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!

~~~
johntash
If you want a recommendation, try out [https://gitea.io/en-
us/](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.

------
cflynnus
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...](https://github.com/marketplace/actions/til-auto-format-readme)

------
vklar
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.

------
simonw
I've added an Atom feed now:
[https://til.simonwillison.net/til/feed.atom?_feed_title=Simo...](https://til.simonwillison.net/til/feed.atom?_feed_title=Simon+Willison+TIL)

Implementation details here:
[https://github.com/simonw/til/compare/95d99f5bb7206948257195...](https://github.com/simonw/til/compare/95d99f5bb720694825719580fa15311fd0889475...a65c04955cc3b2112b9ab21b736b8bf55004034a)

------
factorialboy
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.

~~~
simonw
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.

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

------
littke
I actually built a little webapp for this recently:
[https://todayilearned.co](https://todayilearned.co)

For tracking and sharing of personal TILs

Also as an iOS app

------
hivacruz
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](https://github.com/kinoute/til/blob/master/contribute.sh)

------
acdibble
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](https://github.com/acdibble/til/blob/master/create_til.sh)

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

Here's my TIL implementation using Github Actions:
[https://github.com/mlpetersen/til](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.

------
pdepip
I actually wrote a tool like this that's aimed at storing and accessing
information: [https://mmap.it](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.

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

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

~~~
littke
I recently started, come join me!
[https://todayilearned.co](https://todayilearned.co)

@littke on twitter

------
kenrose
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.

~~~
dchuk
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

------
lonelappde
It's automatically updated, not aelf-rewriting.

------
jmartinpetersen
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.

~~~
simonw
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.

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

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

------
chx
What's wrong with Pinboard notes?

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

~~~
auggierose
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.

