From 17b10fab16bc5df3a969826150e92f50e88a99b9 Mon Sep 17 00:00:00 2001 From: Minijackson Date: Sun, 28 Nov 2021 00:19:12 +0100 Subject: add css and html template, refactor build --- src/filters.rs | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'src/filters.rs') diff --git a/src/filters.rs b/src/filters.rs index 1b06920..8dbe578 100644 --- a/src/filters.rs +++ b/src/filters.rs @@ -40,15 +40,13 @@ impl<'a> pandoc_ast::MutVisitor for RelativizeUrls<'a> { if output_path.exists() { // TODO: relativize from URL root - trace!("Relativizing link '{}'", link_path.display()); - *link = Path::new(link) .with_extension(&self.extension) .to_str() .expect("Path constructed from UTF-8 valid strings in not UTF-8 valid") .to_string(); - trace!("-> into '{}'", link); + trace!("Relativizing link '{}' -> into '{}'", link_path.display(), link); } } } @@ -94,22 +92,3 @@ pub fn relativize_summary(summary: &pandoc_ast::Pandoc, level: usize) -> pandoc_ }) .clone() } - -pub struct InsertSummary<'a> { - pub summary: &'a pandoc_ast::Pandoc, - pub level: usize, -} - -impl<'a> pandoc_ast::MutVisitor for InsertSummary<'a> { - fn walk_pandoc(&mut self, pandoc: &mut pandoc_ast::Pandoc) { - let summary = relativize_summary(self.summary, self.level); - - pandoc.blocks.insert( - 0, - pandoc_ast::Block::Div( - (String::new(), vec!["summary".to_string()], vec![]), - summary.blocks, - ), - ); - } -} -- cgit v1.2.3