Skip to content

About

pre-commit hooks for repositories of TiLiA annotations

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

TiLiA pre-commit hooks

pre-commit hooks for repositories that keep TiLiA annotations (.tla files).

Usage

Copy this into the .pre-commit-config.yaml at the root of your repository (create the file if it doesn't exist yet):

repos:
  - repo: https://github.com/TimeLineAnnotator/pre-commit-hooks
    rev: v0.1.0
    hooks:
      - id: tla-export-json

Then, once per clone:

pip install pre-commit
pre-commit install

The first commit afterwards takes a while: pre-commit installs TiLiA, including PySide6, into an environment of its own.

Hooks

tla-export-json

Writes a JSON export next to every .tla file in the commit (piece.tla → piece.json), in the same format as TiLiA's File > Export > JSON.

  • If a JSON file was created or changed, the hook fails and the commit stops. Stage the JSON files (git add) and commit again.
  • If a JSON file is already up to date, it is left untouched.
  • If TiLiA would need to ask you something to open a file (for instance, what to do with a timeline kind it doesn't know), the export of that file fails instead. Open the file in TiLiA, resolve it there and save.
  • Media files are never opened, so they don't need to be in the repository, and YouTube links don't need a network connection. media_path in the JSON is whatever the .tla file records.

Under the hood, the hook runs TiLiA's command-line interface, so you can do the same for a single file by hand:

tilia -i cli -c 'open "piece.tla" --no-media; export "piece.json" --overwrite'

To export files by hand, outside of a commit:

pre-commit run tla-export-json --all-files

About

pre-commit hooks for repositories of TiLiA annotations

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages