crowbook icon indicating copy to clipboard operation
crowbook copied to clipboard

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

Open Irvel opened this issue 7 years ago • 1 comments

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.

Irvel avatar Oct 30 '17 02:10 Irvel

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

crowdagger avatar Oct 30 '17 21:10 crowdagger