Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Added classed HTML generator struct #235

Merged
merged 2 commits into from
Feb 18, 2019

Conversation

terhechte
Copy link
Contributor

This abstracts the necessary logic away that is required to
generated HTML tags with class names instead of colored
style tags.

It also fixes a bug where tokens_to_classed_html previously
did not add the remainder of a parsed line to the output.

This abstracts the necessary logic away that is required to
generated HTML tags with class names instead of colored
style tags.

It also fixes a bug where `tokens_to_classed_html` previously
did not add the remainder of a parsed line to the output.
Copy link
Owner

@trishume trishume left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! I like that you also made it more convenient to use. And thanks for the nice docs and test.

I just pushed a commit that factors out the raw function so that I can deprecate the old version and use the same implementation for it, while still exposing the same amount of control over the parsing flow so it can be a drop in replacement.

Should be in v3.1.0 when I release it. For now you can use a git dependency, but if it's noticeably more convenient for you to use a version from crates.io, just let me know and I can do a release.

@trishume trishume merged commit 6d6cf17 into trishume:master Feb 18, 2019
@terhechte
Copy link
Contributor Author

Thanks! I like the deprecation of the old function in your refactoring. I'm currently using syntect on a fork anyway because I need more built-in languages in the assets (particularly Swift), so I don't mind the git dependency :)

@trishume
Copy link
Owner

In case you didn't know and you want to, you can use your own built in language bundle without using a fork. The functions you need to generate and load your own bundle are public. Then you just use the cargo features to disable the default built-in bundle, then include your own in the binary the same way syntect does (check out the source).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants