Skip to content

Commit d9d27f3

Browse files
authored
Merge pull request #2625 from GuillaumeGomez/simplify-resources-location
Simplify resources location
2 parents 4946c78 + 4886c92 commit d9d27f3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+24
-24
lines changed

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"eslint": "^8.57.1"
55
},
66
"scripts": {
7-
"lint": "eslint src/theme/*js src/theme/**/*js",
8-
"lint-fix": "eslint --fix src/theme/*js src/theme/**/*js"
7+
"lint": "eslint src/front-end/*js src/front-end/**/*js",
8+
"lint-fix": "eslint --fix src/front-end/*js src/front-end/**/*js"
99
}
1010
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/theme/mod.rs renamed to src/front-end/mod.rs

+21-22
Original file line numberDiff line numberDiff line change
@@ -13,32 +13,31 @@ use std::path::{Path, PathBuf};
1313

1414
use crate::errors::*;
1515
use log::warn;
16-
pub static INDEX: &[u8] = include_bytes!("index.hbs");
17-
pub static HEAD: &[u8] = include_bytes!("head.hbs");
18-
pub static REDIRECT: &[u8] = include_bytes!("redirect.hbs");
19-
pub static HEADER: &[u8] = include_bytes!("header.hbs");
20-
pub static TOC_JS: &[u8] = include_bytes!("toc.js.hbs");
21-
pub static TOC_HTML: &[u8] = include_bytes!("toc.html.hbs");
16+
pub static INDEX: &[u8] = include_bytes!("templates/index.hbs");
17+
pub static HEAD: &[u8] = include_bytes!("templates/head.hbs");
18+
pub static REDIRECT: &[u8] = include_bytes!("templates/redirect.hbs");
19+
pub static HEADER: &[u8] = include_bytes!("templates/header.hbs");
20+
pub static TOC_JS: &[u8] = include_bytes!("templates/toc.js.hbs");
21+
pub static TOC_HTML: &[u8] = include_bytes!("templates/toc.html.hbs");
2222
pub static CHROME_CSS: &[u8] = include_bytes!("css/chrome.css");
2323
pub static GENERAL_CSS: &[u8] = include_bytes!("css/general.css");
2424
pub static PRINT_CSS: &[u8] = include_bytes!("css/print.css");
2525
pub static VARIABLES_CSS: &[u8] = include_bytes!("css/variables.css");
26-
pub static FAVICON_PNG: &[u8] = include_bytes!("favicon.png");
27-
pub static FAVICON_SVG: &[u8] = include_bytes!("favicon.svg");
28-
pub static JS: &[u8] = include_bytes!("book.js");
29-
pub static HIGHLIGHT_JS: &[u8] = include_bytes!("highlight.js");
30-
pub static TOMORROW_NIGHT_CSS: &[u8] = include_bytes!("tomorrow-night.css");
31-
pub static HIGHLIGHT_CSS: &[u8] = include_bytes!("highlight.css");
32-
pub static AYU_HIGHLIGHT_CSS: &[u8] = include_bytes!("ayu-highlight.css");
33-
pub static CLIPBOARD_JS: &[u8] = include_bytes!("clipboard.min.js");
34-
pub static FONT_AWESOME: &[u8] = include_bytes!("FontAwesome/css/font-awesome.min.css");
35-
pub static FONT_AWESOME_EOT: &[u8] = include_bytes!("FontAwesome/fonts/fontawesome-webfont.eot");
36-
pub static FONT_AWESOME_SVG: &[u8] = include_bytes!("FontAwesome/fonts/fontawesome-webfont.svg");
37-
pub static FONT_AWESOME_TTF: &[u8] = include_bytes!("FontAwesome/fonts/fontawesome-webfont.ttf");
38-
pub static FONT_AWESOME_WOFF: &[u8] = include_bytes!("FontAwesome/fonts/fontawesome-webfont.woff");
39-
pub static FONT_AWESOME_WOFF2: &[u8] =
40-
include_bytes!("FontAwesome/fonts/fontawesome-webfont.woff2");
41-
pub static FONT_AWESOME_OTF: &[u8] = include_bytes!("FontAwesome/fonts/FontAwesome.otf");
26+
pub static FAVICON_PNG: &[u8] = include_bytes!("images/favicon.png");
27+
pub static FAVICON_SVG: &[u8] = include_bytes!("images/favicon.svg");
28+
pub static JS: &[u8] = include_bytes!("js/book.js");
29+
pub static HIGHLIGHT_JS: &[u8] = include_bytes!("js/highlight.js");
30+
pub static TOMORROW_NIGHT_CSS: &[u8] = include_bytes!("css/tomorrow-night.css");
31+
pub static HIGHLIGHT_CSS: &[u8] = include_bytes!("css/highlight.css");
32+
pub static AYU_HIGHLIGHT_CSS: &[u8] = include_bytes!("css/ayu-highlight.css");
33+
pub static CLIPBOARD_JS: &[u8] = include_bytes!("js/clipboard.min.js");
34+
pub static FONT_AWESOME: &[u8] = include_bytes!("css/font-awesome.min.css");
35+
pub static FONT_AWESOME_EOT: &[u8] = include_bytes!("fonts/fontawesome-webfont.eot");
36+
pub static FONT_AWESOME_SVG: &[u8] = include_bytes!("fonts/fontawesome-webfont.svg");
37+
pub static FONT_AWESOME_TTF: &[u8] = include_bytes!("fonts/fontawesome-webfont.ttf");
38+
pub static FONT_AWESOME_WOFF: &[u8] = include_bytes!("fonts/fontawesome-webfont.woff");
39+
pub static FONT_AWESOME_WOFF2: &[u8] = include_bytes!("fonts/fontawesome-webfont.woff2");
40+
pub static FONT_AWESOME_OTF: &[u8] = include_bytes!("fonts/FontAwesome.otf");
4241

4342
/// The `Theme` struct should be used instead of the static variables because
4443
/// the `new()` method will look if the user has a theme directory in their
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ pub mod book;
8787
pub mod config;
8888
pub mod preprocess;
8989
pub mod renderer;
90+
#[path = "front-end/mod.rs"]
9091
pub mod theme;
9192
pub mod utils;
9293

0 commit comments

Comments
 (0)