summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Hult <Jonathan@JonathanHult.com>2023-12-09 16:53:57 -0600
committerJonathan Hult <Jonathan@JonathanHult.com>2023-12-09 16:53:57 -0600
commit91af1c3b548d52cee9be5d37c507ad6bb001cbde (patch)
tree5b5708b77f7efaadab63094b2a7e8ad1e36e63a4
parentb7f46213c7df8f499eca0c82e7b41804cc15e369 (diff)
Remove warning check for theme directory as ./src/theme
This was causing an unnecessary warning if &src_dir was the same as ctx.root
-rw-r--r--src/renderer/html_handlebars/hbs_renderer.rs29
1 files changed, 0 insertions, 29 deletions
diff --git a/src/renderer/html_handlebars/hbs_renderer.rs b/src/renderer/html_handlebars/hbs_renderer.rs
index 8ea2f49e..69f9082d 100644
--- a/src/renderer/html_handlebars/hbs_renderer.rs
+++ b/src/renderer/html_handlebars/hbs_renderer.rs
@@ -478,25 +478,6 @@ impl HtmlHandlebars {
}
}
-// TODO(mattico): Remove some time after the 0.1.8 release
-fn maybe_wrong_theme_dir(dir: &Path) -> Result<bool> {
- fn entry_is_maybe_book_file(entry: fs::DirEntry) -> Result<bool> {
- Ok(entry.file_type()?.is_file()
- && entry.path().extension().map_or(false, |ext| ext == "md"))
- }
-
- if dir.is_dir() {
- for entry in fs::read_dir(dir)? {
- if entry_is_maybe_book_file(entry?).unwrap_or(false) {
- return Ok(false);
- }
- }
- Ok(true)
- } else {
- Ok(false)
- }
-}
-
impl Renderer for HtmlHandlebars {
fn name(&self) -> &str {
"html"
@@ -529,16 +510,6 @@ impl Renderer for HtmlHandlebars {
None => ctx.root.join("theme"),
};
- if html_config.theme.is_none()
- && maybe_wrong_theme_dir(&src_dir.join("theme")).unwrap_or(false)
- {
- warn!(
- "Previous versions of mdBook erroneously accepted `./src/theme` as an automatic \
- theme directory"
- );
- warn!("Please move your theme files to `./theme` for them to continue being used");
- }
-
let theme = theme::Theme::new(theme_dir);
debug!("Register the index handlebars template");