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/utils.rs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/utils.rs') diff --git a/src/utils.rs b/src/utils.rs index 8928cfb..828ae46 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -1,4 +1,4 @@ -use std::path::PathBuf; +use std::path::{Path, PathBuf}; pub fn pandoc_stringify(inlines: &[pandoc_ast::Inline]) -> String { fn pandoc_stringify_(result: &mut String, inlines: &[pandoc_ast::Inline]) { @@ -114,3 +114,19 @@ impl PandocOutputExt for pandoc::PandocOutput { } pub type PandocMeta = pandoc_ast::Map; + +pub trait PathExt { + fn to_string(&self) -> String; +} + +impl PathExt for Path { + fn to_string(&self) -> String { + self.to_str().expect("Path is not valid UTF-8").to_string() + } +} + +impl PathExt for PathBuf { + fn to_string(&self) -> String { + self.to_str().expect("Path is not valid UTF-8").to_string() + } +} -- cgit v1.2.3