Colonial-Dev / inkjet

A batteries-included syntax highlighting library for Rust, based on tree-sitter.
https://docs.rs/inkjet
Apache License 2.0
63 stars 5 forks source link

[Proposal] Add extension to sample files and change snippets theme #28

Open leandrocp opened 1 month ago

leandrocp commented 1 month ago

Hey that file snippets.html is super useful and now I'm wondering if we could add the actual extension to each one of the sample files. The reason is to be able to see the colors on the local editor so we can compare the generated colors.

So we could use the github_light theme here to generate the snippets https://github.com/Colonial-Dev/inkjet/blob/c8f1968b94a1f13c56660afc84393608369f0bea/tests/snippets.rs#L15

And also rename the sample files, for eg rename Elixir to Elixir.ex

That would make it easier to validate the snippets by comparing against the preview on github.com, for eg we would be able to inspect https://github.com/Colonial-Dev/inkjet/blob/master/tests/samples/Elixir with colors or inspect the snippets.html file locally as well.

Wdyt?

Update

The sample file would look like https://github.com/leandrocp/inkjet/blob/lp-inspect-samples/tests/samples/Elixir.ex and the snippet as the screenshot below:

elixir
Colonial-Dev commented 1 month ago

Sure, sounds like a great idea! I'll probably generate a snippets_light and a snippets_dark, but that's neither here nor there.