News for hackers. Stuff that matters.
Re:Show HN: A plain-text file format for todos and check lists by jotaen on Friday April 01, 2022 @07:21PM (#30884315)
That’s how it works in Sublime, yes. You have a regex-based parsing engine that you configure via a YAML file, and there you assign scopes to the tokens.[1]

As a default, the [x]it! Sublime Package uses the available default scopes. The user can choose to override the associated colours in their local settings.[2]

[1]: https://github.com/jotaen/xit-sublime/blob/main/xit.sublime-...

[2]: https://github.com/jotaen/xit-sublime#syntax-highlighting--c...

Re:Show HN: A plain-text file format for todos and check lists by ZYinMD on Friday April 01, 2022 @07:51PM (#30884522)
Thanks, just to confirm: if you want the users to see nice colors out of the box (no matter what theme they use) without needing to customizing anything in their settings, then you'd have to utilize common scopes like variables / functions / errors in a hacky way, correct?
Re:Show HN: A plain-text file format for todos and check lists by jotaen on Saturday April 02, 2022 @05:00AM (#30886838)
Yes. What I did is try to choose default (common) scopes that have a high chance of being coloured the way I want, e.g. for the `[x]` token I use `markup.inserted` which is for markup diffs, so it should be green. Or `markup.underline` for the headlines. But the options are pretty limited.