tempestphp / highlight

🎨 Fast, extensible, server-side code highlighting for web and terminal
https://tempest.stitcher.io/highlight/01-getting-started
MIT License
624 stars 36 forks source link

Add NUMBER and BOOLEAN tokens #123

Closed bogdancondorachi closed 3 months ago

bogdancondorachi commented 4 months ago

Hey @brendt, I know you said in #96 that you don't plan on adding new tokens so this might be pointless.

But I'm still taking my shoot on implementing NUMBER and BOOLEAN tokens because:

If approved, I'm happy to do another PR on updating the themes/classes with these new tokens.

coveralls commented 4 months ago

Pull Request Test Coverage Report for Build 9206597206

Details


Totals Coverage Status
Change from base Build 9205225309: 0.02%
Covered Lines: 1503
Relevant Lines: 1575

💛 - Coveralls
brendt commented 3 months ago

I'm fine merging this in, but we cannot update existing languages without it being a breaking change: if a specific word changes to use a new class while people don't have this CSS class present in their stylesheet, their highlighting will break.

So I'm fine merging this in, and you can use it in newly added languages like #121, but we won't be able to update new languages until a later point.

We should also update LightTerminalTheme to include these changes, can you add those changes to this PR as well?

brendt commented 3 months ago

Thanks!

brendt commented 3 months ago

Tagged: https://github.com/tempestphp/highlight/releases/tag/2.5.0

bogdancondorachi commented 3 months ago

@brendt I've updated the LightTerminalTheme with the added tokens.

So I'm fine merging this in, and you can use it in newly added languages like https://github.com/tempestphp/highlight/pull/121, but we won't be able to update new languages until a later point.

Now this is perfectly fine for me, though I believe it's not really a breaking change if we are to update current languages to include these tokens as well as it all depends on the user CSS, basically if token CSS is missing it would simply not add the respective color, leaving it with a blank class if I'm correct. I see it more as a missing feature if they don't update their CSS.

Steps I'm seeing are as follows:

You can ping me on Discord to discuss more on this if you want. :)

brendt commented 3 months ago

Tagged: https://github.com/tempestphp/highlight/releases/tag/2.6.0