Til is a command line tool written in Swift
to manage a Today-I-Learned
repository.
If you don't know what "Today I Learned" is, then lmgtfy
A til repository is a place to store things you have learned or read or stumbled upon.
With a repository, you can go back in time and search for something that you know for sure you have seen before but probably can't find it again, such as in Google.
Using public git repositories to store your tils enable you to share your tils with other peers easily.
This movement has been adopted also by many organisations to provide a bite size information to their audiences, such as:
In Software development, we collect over the time so many code snippet, tips, tricks for our jobs. But it is not an easy task to manage such information so that you can easily find them again.
It's also not so easy to share such information with others if you only save them locally on your computers.
I've accidently found this discussion in Hacker News about a guy who have been managing his TIL repository for over 5 years
His TIL repository is full of interesting and useful information.
Then I take look in github, the til
topic is full of interesting repositories.
I'm totally convinced by the idea and also starting to create a TIL repository for myself:
But after some days, I find it is hard to mange it, and also to find the snippet that I'm looking for again.
So I have started to build a command-line tool to help me managing this TIL respository more easily.
The command line tool can basically:
- Add a new topic: create a markdown file with some pre-filled meta data and open a markdown editor for you to add information
- Generate a README.md by aggregating all Tils in the repo and list them in a table view organized by topics.
- Deploy all changes to the remote repository.
Sorry, I'm iOS developer.
You should actually try! Swift. It is a relatively easy to learn and powerful programming language.
- MacOS
- Visual Studio Code (including the command line)
I've just tested the tool on my Mac, but theoritically it should also work on Linux (Ubuntu). And soon you should be able to use the tool on Windows and additinal Linux distributions.
mkdir til
git checkout https://github.com/antranapp/Til.git
cd Til
chmod +x release.sh
./release.sh
You can add a Til.yaml
to customise the settings:
root: temp
editor:
name: code
gui: /usr/bin/open -b com.microsoft.VSCode
console: code
Available commands:
Til add <topic> <title>
Til generate-readme
Til deploy
I'm working on an easy setup for the tool, such as using brew
OVERVIEW: A Swift command-line tool to manage a Today-I-Learned repository
USAGE: Til <subcommand>
OPTIONS:
-h, --help Show help information.
SUBCOMMANDS:
add Add a new Today-I-Learned entry using a default
MarkDown editor.
generate-readme Generate a README.md from the content.
deploy Deploy the content to the remote repository.
Some ideas I have in mind now:
- A command create a static website so that we can display the tils in Github Pages and also add some Full-Text-Search to that.
- A command to create a PDF from a remote site and attach it to the til to preventing the information going away when the remote sites are not reachable or changed.
- Automatic summarize remote data sources.
If you have any interesting ideas, please tell me what you want to add by creating new issues or new PRs
There are some similar tools already existed if you want some alternatives:
- An electron app: https://github.com/seokju-na/geeks-diary
- Using Github issues for tils (👌👍): https://github.com/tieubao/til/issues
- A VSCode extension: https://github.com/rahuldhawani/TILed
- A Python script: https://github.com/khanhicetea/today-i-learned
- Tilex - Today I Learned in Elixir: https://github.com/hashrocket/tilex
- Using VuePress: https://github.com/MarcLoupias/memo-dev