langs-in-rust icon indicating copy to clipboard operation
langs-in-rust copied to clipboard

Replace Python script w/ Cargo script.

Open alilleybrinker opened this issue 1 year ago • 3 comments

Fixes #102.

This replaces the Python script for updating data for the tracked languages and regenerating the README with a new Cargo script, which lets us use Rust code instead of Python!

alilleybrinker avatar Dec 27 '23 01:12 alilleybrinker

Quick design thing. Related to this, I'm thinking of the following:

  • Turning languages.json into languages.toml, so it's more human-writeable.
  • Moving the stars-caching thing into a file under a .data folder called stars.toml that just maps languages to stars data, along with an updated_on timestamp at the top to say when the file was last updated.
  • Updating the README to include a regeneration timestamp at the top.

So the workflow as a contributor would be:

  1. Add a language to languages.toml
  2. Running ./update.rs -u to update cached data for any langs on GitHub.
  3. Running ./update.rs -g to generate a new README.md file.

alilleybrinker avatar Dec 27 '23 02:12 alilleybrinker

In terms of commands, I'd like to replace the existing commands and rename the script, so it becomes: ./langs [add/remove/edit/update].

  • add would add a new language, sync with external API if necessary, update caches, and update the README
  • remove would remove an existing language, clear its data from the cache, and update the README
  • edit would edit an existing language, clear its data from the caches, and update the README
  • update would sync with external APIs, update the caches, and update the README

alilleybrinker avatar Dec 27 '23 04:12 alilleybrinker

Also probably just have one cache file. Maybe consider even making it SQLite

alilleybrinker avatar Dec 27 '23 05:12 alilleybrinker