diff --git a/resources/syntaxes/syntaxes.bin b/resources/syntaxes/syntaxes.bin new file mode 100644 index 0000000..9bd09ea Binary files /dev/null and b/resources/syntaxes/syntaxes.bin differ diff --git a/themes/ayu_dark.tmTheme b/resources/themes/ayu_dark.tmTheme similarity index 100% rename from themes/ayu_dark.tmTheme rename to resources/themes/ayu_dark.tmTheme diff --git a/src/models/pretty.rs b/src/models/pretty.rs index af5f5d5..20554d7 100644 --- a/src/models/pretty.rs +++ b/src/models/pretty.rs @@ -5,11 +5,15 @@ use syntect::highlighting::ThemeSet; use syntect::html::highlighted_html_for_string; use syntect::parsing::SyntaxSet; -pub fn get_pretty_body(path: &Path, ext: &str) -> String { - let ss = SyntaxSet::load_defaults_newlines(); +static SYNTAXES: &[u8] = + include_bytes!("../../resources/syntaxes/syntaxes.bin"); +static THEMES: &[u8] = + include_bytes!("../../resources/themes/ayu_dark.tmTheme"); - let mut theme_cursor = - std::io::Cursor::new(include_bytes!("../../themes/ayu_dark.tmTheme")); +pub fn get_pretty_body(path: &Path, ext: &str) -> String { + let ss: SyntaxSet = syntect::dumps::from_binary(SYNTAXES); + + let mut theme_cursor = std::io::Cursor::new(THEMES); let theme = ThemeSet::load_from_reader(&mut theme_cursor).unwrap(); let content = fs::read_to_string(path).unwrap(); diff --git a/static/css/pretty.css b/static/css/pretty.css index bafd56f..c29f270 100644 --- a/static/css/pretty.css +++ b/static/css/pretty.css @@ -29,6 +29,6 @@ color: #be7611; } -.rootBoot { +.rootBox { position: relative; } diff --git a/templates/index.html.tera b/templates/index.html.tera index a4b00f0..104b9ac 100644 --- a/templates/index.html.tera +++ b/templates/index.html.tera @@ -1,12 +1,8 @@ -{% extends "base.html" %} - -{% block styles %} - -{% endblock styles %} - -{% block body %} +{% extends "base.html" %} {% block styles %} + +{% endblock styles %} {% block body %}