coalesce syntect data structures into rendering::highlighting (Keats/gutenberg#89)
This commit is contained in:
parent
b759cf7681
commit
2109787625
|
@ -1,6 +1,16 @@
|
|||
use syntect::dumps::from_binary;
|
||||
use syntect::parsing::SyntaxSet;
|
||||
use syntect::highlighting::ThemeSet;
|
||||
|
||||
thread_local!{
|
||||
pub static SYNTAX_SET: SyntaxSet = {
|
||||
let mut ss: SyntaxSet = from_binary(include_bytes!("../../sublime_syntaxes/newlines.packdump"));
|
||||
ss.link_syntaxes();
|
||||
ss
|
||||
};
|
||||
}
|
||||
|
||||
lazy_static!{
|
||||
pub static ref THEME_SET: ThemeSet = from_binary(include_bytes!("../../sublime_themes/all.themedump"));
|
||||
}
|
||||
|
||||
|
|
|
@ -12,8 +12,7 @@ use errors::{Result};
|
|||
use site::resolve_internal_link;
|
||||
use front_matter::InsertAnchor;
|
||||
use rendering::context::Context;
|
||||
use rendering::highlighting::THEME_SET;
|
||||
use rendering::parsing::SYNTAX_SET;
|
||||
use rendering::highlighting::{SYNTAX_SET, THEME_SET};
|
||||
use rendering::short_code::{ShortCode, parse_shortcode, render_simple_shortcode};
|
||||
use content::{TempHeader, Header, make_table_of_contents};
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
pub mod highlighting;
|
||||
pub mod parsing;
|
||||
pub mod markdown;
|
||||
pub mod short_code;
|
||||
pub mod context;
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
use syntect::parsing::SyntaxSet;
|
||||
use syntect::dumps::from_binary;
|
||||
|
||||
thread_local! {
|
||||
pub static SYNTAX_SET: SyntaxSet = {
|
||||
let mut ss: SyntaxSet = from_binary(include_bytes!("../../sublime_syntaxes/newlines.packdump"));
|
||||
ss.link_syntaxes();
|
||||
ss
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue