docs: expand README with detailed script documentation

- Add installation section with copy commands
- Document each script with features, requirements, config examples
- Add practical configuration examples for common use cases
- Update CLAUDE.md with shared library documentation
This commit is contained in:
2025-12-18 17:20:17 +01:00
parent b890a4efcd
commit 613d28db90
2 changed files with 235 additions and 5 deletions

View File

@@ -13,7 +13,7 @@ just check # fmt-check + lint (pre-commit gate)
## Architecture
This repository holds standalone Lua scripts for mpv (0.36+, bundled Lua 5.2). Each script in `scripts/` is self-contained with no external Lua dependencies.
This repository holds Lua scripts for mpv (0.36+, bundled Lua 5.2).
Script structure convention:
1. Header comment block explaining features, requirements, and configuration
@@ -21,6 +21,17 @@ Script structure convention:
3. Note indicating no edits are needed below the config block
4. Implementation code
### Shared Library
`scripts/lib/utils.lua` contains common utilities (trim, clamp, ASS color helpers). Scripts load it via:
```lua
package.path = mp.command_native({ "expand-path", "~~/scripts/lib/?.lua;" }) .. package.path
local lib = require("utils")
```
When adding new shared functions, prefer adding to this module over duplicating code.
## Code Style
- 2-space indentation, 100-column width, double quotes preferred (enforced by stylua)