crowdagger/crowbook

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

Irvel opened this issue · 1 comments

Irvel commented

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.

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