summaryrefslogtreecommitdiffstats
path: root/src/utils.rs
diff options
context:
space:
mode:
authorMinijackson <minijackson@riseup.net>2021-11-28 00:19:12 +0100
committerMinijackson <minijackson@riseup.net>2021-11-28 00:21:46 +0100
commit17b10fab16bc5df3a969826150e92f50e88a99b9 (patch)
tree12a0c721e89ef17f07a9ede593d82a4c95bc7937 /src/utils.rs
parent517cabe8ec54d0bf5f5f9cc9089d76a1fad7bb6a (diff)
downloadpandoc-docbook-17b10fab16bc5df3a969826150e92f50e88a99b9.tar.gz
pandoc-docbook-17b10fab16bc5df3a969826150e92f50e88a99b9.zip
add css and html template, refactor build
Diffstat (limited to 'src/utils.rs')
-rw-r--r--src/utils.rs18
1 files changed, 17 insertions, 1 deletions
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 @@
1use std::path::PathBuf; 1use std::path::{Path, PathBuf};
2 2
3pub fn pandoc_stringify(inlines: &[pandoc_ast::Inline]) -> String { 3pub fn pandoc_stringify(inlines: &[pandoc_ast::Inline]) -> String {
4 fn pandoc_stringify_(result: &mut String, inlines: &[pandoc_ast::Inline]) { 4 fn pandoc_stringify_(result: &mut String, inlines: &[pandoc_ast::Inline]) {
@@ -114,3 +114,19 @@ impl PandocOutputExt for pandoc::PandocOutput {
114} 114}
115 115
116pub type PandocMeta = pandoc_ast::Map<String, pandoc_ast::MetaValue>; 116pub type PandocMeta = pandoc_ast::Map<String, pandoc_ast::MetaValue>;
117
118pub trait PathExt {
119 fn to_string(&self) -> String;
120}
121
122impl PathExt for Path {
123 fn to_string(&self) -> String {
124 self.to_str().expect("Path is not valid UTF-8").to_string()
125 }
126}
127
128impl PathExt for PathBuf {
129 fn to_string(&self) -> String {
130 self.to_str().expect("Path is not valid UTF-8").to_string()
131 }
132}