diff options
author | Minijackson <minijackson@riseup.net> | 2021-11-28 00:19:12 +0100 |
---|---|---|
committer | Minijackson <minijackson@riseup.net> | 2021-11-28 00:21:46 +0100 |
commit | 17b10fab16bc5df3a969826150e92f50e88a99b9 (patch) | |
tree | 12a0c721e89ef17f07a9ede593d82a4c95bc7937 /src/utils.rs | |
parent | 517cabe8ec54d0bf5f5f9cc9089d76a1fad7bb6a (diff) | |
download | pandoc-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.rs | 18 |
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 @@ | |||
1 | use std::path::PathBuf; | 1 | use std::path::{Path, PathBuf}; |
2 | 2 | ||
3 | pub fn pandoc_stringify(inlines: &[pandoc_ast::Inline]) -> String { | 3 | pub 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 | ||
116 | pub type PandocMeta = pandoc_ast::Map<String, pandoc_ast::MetaValue>; | 116 | pub type PandocMeta = pandoc_ast::Map<String, pandoc_ast::MetaValue>; |
117 | |||
118 | pub trait PathExt { | ||
119 | fn to_string(&self) -> String; | ||
120 | } | ||
121 | |||
122 | impl 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 | |||
128 | impl PathExt for PathBuf { | ||
129 | fn to_string(&self) -> String { | ||
130 | self.to_str().expect("Path is not valid UTF-8").to_string() | ||
131 | } | ||
132 | } | ||