A cli for tracking Things I Learned (TIL)
Project description
Tilly
CLI for easily creating Today I Learned posts, inspired by Simon Willison.
Check this tilly-pub.github.io website that was genereated using Tilly :)
Installation
uv venv .venv
source .venv/bin/activate
uv pip install tilly
tilly commands
Usage: tilly [OPTIONS] COMMAND [ARGS]...
TIL (Today I Learned) Command Line Interface.
Options:
--version Show the version and exit.
--help Show this message and exit.
Commands:
build Build database tils.db.
config List config.
copy-templates Copy default templates to current repo for customization.
gen-static Generate static site from tils.db using datasette.
hello Say hello.
list-plugins List all available plugins.
serve Serve tils.db using datasette or the generated static...
Usage
Create a repo (or clone a repo from github):
git init
Add a TIL:
mkdir example # this will be the topic of your TIL.
echo "# My first TIL with tilly" > example/first-til.md
Commit your work:
git add .
git commit -m "adding first til"
Build the local tils.db:
tilly build
Serve you tils locally:
tilly serve
Generate a static site in the docs folder:
tilly config -l --output-folder docs
tilly gen-static
The static site can also be served locally:
tilly serve --static
You can now publish your static site to Github.
Don't forget to configure the source folder docs in your repository's GitHub Pages settings.
Customize the default templates
Your can overwrite the default templates by first making a copy of the default templates:
tilly copy-templates
Change the templates to your liking, then generate your static site:
tilly gen-static --template-dir templates
Customized templates can also be served locally:
tilly serve --template-dir templates
Tilly plugins
Tilly's plugin system allows additional features to be implemented as Python code which can be wrapped up in a separate Python package. The underlying mechanism uses pluggy.
Available plugins
- tilly-sitemap: Generate
robots.txtandsitemap.xmlfor tilly sites.
Creating your own Tilly plugin
You can easily create your own plugin by running the following command:
uvx cookiecutter gh:tilly-pub/tilly-plugin
This command runs cookiecutter and will use our tilly-plugin cookiecutter to setup a new project.
Development, building and publishing
uv venv .venv --python=3.11
source .venv/bin/activate
uv pip install .
uv pip install -r requirements-dev.txt
./build.sh
./publish.sh
TODO
- add search to the static site
- document tilly-plugin creation
- add related article links using vector embeddings
- support TILs with multiple categories
- it should be possible to store the template folder in the config
DONE
- created cookiecutter tilly-plugin repo
- create plugin for generating sitemaps
- example github actions workflow for publishing tilly static pages
- add tests
- update
README.mdwith latesttillycli commands/options (python update_readme.py)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tilly-0.0.8a0.tar.gz.
File metadata
- Download URL: tilly-0.0.8a0.tar.gz
- Upload date:
- Size: 18.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f418017459957a0fb662b6ff8310d92cdcf12cd1e15d1a2cce06e849a74b5c4d
|
|
| MD5 |
40cd0353c6cf97567ad44f187551cea5
|
|
| BLAKE2b-256 |
1f985b2e0bf01235d125b45dcf6aed99d2281574729ce6e96393d242ef3cc425
|
File details
Details for the file tilly-0.0.8a0-py3-none-any.whl.
File metadata
- Download URL: tilly-0.0.8a0-py3-none-any.whl
- Upload date:
- Size: 20.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8be622c90172c96b2f17e79336a97671455a7629774f0d85feecbf71df1bf79b
|
|
| MD5 |
4b88f17f8fda0cb4947900e5a9854535
|
|
| BLAKE2b-256 |
6b782df5299813c465ce01d0f4990c7c2ca4920039742c1842829439d8f23dad
|