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

Feature Request: Ability to provide custom files for syntect via the configuration file #44

Open
Irvel opened this issue Oct 30, 2017 · 1 comment

Comments

@Irvel
Copy link

Irvel commented Oct 30, 2017

Hi,

I wanted to render an EPUB of trpl2 with colored cargo output like this:
screen shot 2017-10-29 at 8 23 19 pm
I made a simple edit to syntax.rs to achieve this:

// Add custom syntaxes
let mut ss = syntect::parsing::SyntaxSet::new();
ss.load_syntaxes("/path/to/custom/syntaxes/", true).unwrap();
ss.link_syntaxes();

// Add custom theme
let theme_name = String::from("/path/to/custom_theme.tmTheme");
let theme_path = Path::new(&theme_name);
let theme = syntect::highlighting::ThemeSet::get_theme(theme_path).unwrap();

However I think it would be good to be able to set this via the configuration file. I can prepare a PR with these changes if you think this would be beneficial.

@crowdagger
Copy link
Owner

This looks like a great idea! If you can submit a PR i'll be happy to merge it.

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

No branches or pull requests

2 participants