Skip to content

Commit c1d622e

Browse files
authored
Merge pull request #2263 from jhult/theme-dir-warning-check
Remove warning check for theme directory as ./src/theme
2 parents b7f4621 + 91af1c3 commit c1d622e

File tree

1 file changed

+0
-29
lines changed

1 file changed

+0
-29
lines changed

src/renderer/html_handlebars/hbs_renderer.rs

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -478,25 +478,6 @@ impl HtmlHandlebars {
478478
}
479479
}
480480

481-
// TODO(mattico): Remove some time after the 0.1.8 release
482-
fn maybe_wrong_theme_dir(dir: &Path) -> Result<bool> {
483-
fn entry_is_maybe_book_file(entry: fs::DirEntry) -> Result<bool> {
484-
Ok(entry.file_type()?.is_file()
485-
&& entry.path().extension().map_or(false, |ext| ext == "md"))
486-
}
487-
488-
if dir.is_dir() {
489-
for entry in fs::read_dir(dir)? {
490-
if entry_is_maybe_book_file(entry?).unwrap_or(false) {
491-
return Ok(false);
492-
}
493-
}
494-
Ok(true)
495-
} else {
496-
Ok(false)
497-
}
498-
}
499-
500481
impl Renderer for HtmlHandlebars {
501482
fn name(&self) -> &str {
502483
"html"
@@ -529,16 +510,6 @@ impl Renderer for HtmlHandlebars {
529510
None => ctx.root.join("theme"),
530511
};
531512

532-
if html_config.theme.is_none()
533-
&& maybe_wrong_theme_dir(&src_dir.join("theme")).unwrap_or(false)
534-
{
535-
warn!(
536-
"Previous versions of mdBook erroneously accepted `./src/theme` as an automatic \
537-
theme directory"
538-
);
539-
warn!("Please move your theme files to `./theme` for them to continue being used");
540-
}
541-
542513
let theme = theme::Theme::new(theme_dir);
543514

544515
debug!("Register the index handlebars template");

0 commit comments

Comments
 (0)