Replace content CLI with Textual TUI
This commit is contained in:
1 parent
0d58ddd430
commit
737700a9a8
28 files changed
+2403
-167
No files matched your search
@@ -102,22 +102,33 @@ Copy `.env.example` to `.env` and fill in what you need. Every value is optional
|
||||
|
||||
Site content lives in `content/`.
|
||||
|
||||
### Content CLI
|
||||
### Content editor
|
||||
|
||||
A small Python tool (standard library only) edits the playlist, shows and movies without touching the JSON by hand.
|
||||
A terminal app built with [Textual](https://textual.textualize.io/) edits the playlist, shows, movies, books, portfolio, projects and themes without touching the JSON by hand. It uses the site's own themes.
|
||||
|
||||
```bash
|
||||
bun run content music list --titles
|
||||
bun run content music add https://www.youtube.com/watch?v=VIDEO_ID
|
||||
bun run content music remove VIDEO_ID
|
||||
bun run content movie add tt0816692 --rating 10
|
||||
bun run content show add https://www.imdb.com/title/tt14688458/ --rating 10 --name "Silo"
|
||||
bun run content show rate Silo 9
|
||||
bun run content movie remove Interstellar
|
||||
bun run content show list
|
||||
bun run content:setup
|
||||
bun run content
|
||||
```
|
||||
|
||||
Titles are looked up on OMDb with `OMDB_API_KEY` from `.env`; pass `--name` to skip the lookup. Run `bun run content --help` for every option.
|
||||
`content:setup` creates a virtual environment in `tools/content/.venv` and installs Textual. Run it once.
|
||||
|
||||
| Key | Action |
|
||||
| --- | --- |
|
||||
| `1` to `9` | Switch between Music, Shows, Movies, Books, Profile, Experience, Leadership, Projects and Themes |
|
||||
| `a` | Add (YouTube link, IMDb link or Goodreads link) |
|
||||
| `e` / `Enter` | Edit the selected entry (or change the rating for shows, movies and books) |
|
||||
| `f` | Toggle featured on a project |
|
||||
| `p` | Preview a theme in the editor |
|
||||
| `t` | Switch the editor to the next theme |
|
||||
| `s` | Move a book to another shelf, or make a theme the site default |
|
||||
| `d` | Delete |
|
||||
| `K` / `J` | Move a song or entry up or down |
|
||||
| `u` / `U` | Refresh the selected book, or every book, from Goodreads |
|
||||
| `r` | Reload from disk |
|
||||
| `q` | Quit |
|
||||
|
||||
Show and movie titles are looked up on OMDb with `OMDB_API_KEY` from `.env`; fill in the name field to skip the lookup. Books are scraped from Goodreads once when added and saved to `books.json`. To check a Goodreads link on its own, run `python3 tools/content/goodreads.py <url>`.
|
||||
|
||||
| File | Holds |
|
||||
| --- | --- |
|
||||
@@ -126,5 +137,7 @@ Titles are looked up on OMDb with `OMDB_API_KEY` from `.env`; pass `--name` to s
|
||||
| `experience.json` / `leadership.json` | Work experience and leadership roles |
|
||||
| `projects/*.json` | Open source, packages, hackathons, research groups and organizations |
|
||||
| `music.json` | YouTube links for the music player |
|
||||
| `desktop.json` | Workspaces, desktop icons and the startup command |
|
||||
| `books.json` | Books scraped from Goodreads for the about page |
|
||||
| `desktop.json` | Workspaces, desktop icons, the startup command and the default theme |
|
||||
| `themes.json` | Color themes for the site and the content editor |
|
||||
| `blog/*.md` | Blog posts |
|
||||
Reference in new issue
Block a user