Better HN
topnewbestaskshowjobs
Log inSign up

gmasclet

28 karma · joined Jan 4, 2025 (1y ago) · 4 submissions

Submissions

comment 1y ago · link · parent

The DSL itself is pretty nice. However, one thing I found annoying is that the printing function itself is hard to unit test: there is no easy way to instantiate its parameters (in particular the `ASTPath` class). So I relied on testing it by calling `Prettier.format()`, which is more a end-to-end test of the whole plugin. Maybe I'll figure out another solution at some point.

comment 1y ago · link · parent

Thanks for the idea, I'd not considered it. LaTex may have some use, I'll take a look. Indeed, probably the best solution to publish a game with diagrams.

For personal notes, I would also consider embedding PGN into Markdown. Sadly, PGN rendering in Markdown isn't supported yet, as far as I know (something like Mermaid would be awesome).

comment 1y ago · link · parent

You're welcome!

By the way, something I've considered but not implemented yet are options to tweak the formatting (for instance, whether to indent or inline comments / variations). The Prettier approach is to be opinionated, but some language-specific options may be useful.

4.

Show HN: Pretty-print your chess games using Prettier(github.com ↗)

103 points · by gmasclet · 1y ago · 10 comments