ttysvg
Internals

Contributing

The codebase is small on purpose, and good first issues are listed.

Contributions are genuinely welcome, including from people who have never written Rust before.

git clone https://github.com/Nuu-maan/ttysvg
cd ttysvg
cargo test
cargo run -- record --out demo.svg -- powershell -NoLogo

Good places to start

Roughly easiest first.

  • Add a theme. Copy a file in themes/, change the colors, add one line to the list in src/svg/theme.rs. No Rust knowledge needed beyond editing an array.
  • Add a tape directive. One arm in the match in src/tape/parse.rs, plus a test.
  • Measured font metrics. Character width is assumed rather than measured. This is the most valuable open problem in the project.
  • A GitHub Action that runs ttysvg build on every tag so demos never go stale.

Before opening a pull request

cargo test
cargo clippy --all-targets
cargo fmt

If you change the emitter, the snapshot test will fail on purpose. Review the diff, and if the new output is correct, accept it with cargo insta accept or by setting INSTA_UPDATE=always.

House style

The code leans on naming and structure rather than comments. Please keep new code in the same spirit, and put the explanation in the README or the pull request description where people will actually read it.

Bug reports

Just as useful as code. If a recording comes out wrong, attach the tape and the resulting SVG, and say which terminal and Windows version you are on.

On this page