Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Custom Chroma Highlighter Lexer #10421

Closed
septs opened this issue Nov 7, 2022 · 9 comments
Closed

Custom Chroma Highlighter Lexer #10421

septs opened this issue Nov 7, 2022 · 9 comments

Comments

@septs
Copy link
Contributor

septs commented Nov 7, 2022

Allow user add custom chroma lexer, can improve theme render specific language (or new language) effect

e.g: AT command set

discuss: https://discourse.gohugo.io/t/41302

simple implementation: see #10419

@serhack
Copy link

serhack commented Nov 10, 2022

I think it's better to submit PR to chroma project for improvements than having weird custom lexers on themes :)

@septs
Copy link
Contributor Author

septs commented Nov 10, 2022

I think it's better to submit PR to chroma project for improvements than having weird custom lexers on themes :)

Of course, chroma is obviously not willing to support small share of DSL (domain specific language)

@bep bep removed the NeedsTriage label Nov 10, 2022
@bep bep added this to the v0.106.0 milestone Nov 10, 2022
@bep bep modified the milestones: v0.106.0, v0.107.0 Nov 18, 2022
@serhack
Copy link

serhack commented Nov 24, 2022

Naturally I can not speak for the project, but I was curious to know what domain specific language you'd like to include with your theme :)

@septs
Copy link
Contributor Author

septs commented Nov 24, 2022

Naturally I can not speak for the project, but I was curious to know what domain specific language you'd like to include with your theme :)

I'm make a AT Command set ebook,
i want to pass custom highlight lexer improve at command example code reading experience

@michaeltlombardi
Copy link

michaeltlombardi commented Nov 30, 2022

This functionality would also be useful for custom lexers that don't have wide usage purpose beyond the project they're used in. For example, adding a lexer for code blocks with the myapp-output tag that colorize the output examples based on the application's needs is useful for that application's documentation and little else.

Similarly, this could be used for lexers of forked languages and those without enough adoption to make sense to maintain in chroma itself.

Finally, I can see value in this for custom lexers for data structure examples, colorizing required configuration keys differently or underlining invalid values to enable textual representation of that information instead of having to include (and update every instance of when a change effects them) screenshots.

@bep bep modified the milestones: v0.107.0, v0.108.0 Dec 3, 2022
@bep bep modified the milestones: v0.108.0, v0.109.0 Dec 14, 2022
@bep bep modified the milestones: v0.109.0, v0.111.0 Jan 26, 2023
@bep bep modified the milestones: v0.111.0, v0.112.0 Feb 15, 2023
@bep bep modified the milestones: v0.112.0, v0.113.0 Apr 15, 2023
@psybers
Copy link

psybers commented Apr 19, 2023

This would definitely be helpful! At the moment, I forked Hugo and hard coded loading my DSL's custom lexer in. This obviously works, but it makes things like CI/CD a bit more painful as now I need to ensure everything is using that custom fork of Hugo.

@bep bep modified the milestones: v0.113.0, v0.115.0 Jun 13, 2023
@bep bep modified the milestones: v0.115.0, v0.116.0 Jun 30, 2023
@premkumr
Copy link

premkumr commented Jul 1, 2023

Will be very useful for our custom clis & tools

@bep bep modified the milestones: v0.116.0, v0.117.0 Aug 1, 2023
@bep bep removed this from the v0.117.0 milestone Aug 30, 2023
@bep bep added this to the v0.118.0 milestone Aug 30, 2023
@bep bep modified the milestones: v0.118.0, v0.119.0 Sep 15, 2023
@jmooring
Copy link
Member

Closing in favor of #11496.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 17, 2023
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

7 participants