summaryrefslogtreecommitdiff
path: root/src/bin/subplot.rs
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2022-10-20 18:32:30 +0300
committerLars Wirzenius <liw@liw.fi>2022-10-21 20:05:54 +0300
commitfd854872ce86f9ae5d07ec59e598fe85a8607d5c (patch)
tree13cbc60820d24ec6f797d839f3e40ea92d67ed91 /src/bin/subplot.rs
parentbc6ceda21f2b616d6bfedd9b5e2136e3b7b47e8d (diff)
downloadsubplot-fd854872ce86f9ae5d07ec59e598fe85a8607d5c.tar.gz
fix: look up markdown file relative to basedir of subplot
This allows running docgen on a subplot that isn't in the current directory. Sponsored-by: author
Diffstat (limited to 'src/bin/subplot.rs')
-rw-r--r--src/bin/subplot.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/bin/subplot.rs b/src/bin/subplot.rs
index a85ad62..8ede58d 100644
--- a/src/bin/subplot.rs
+++ b/src/bin/subplot.rs
@@ -278,7 +278,8 @@ impl Docgen {
} else if let Some(date) = doc.meta().date() {
date.to_string()
} else {
- Self::mtime_formatted(Self::mtime(doc.meta().markdown_filename())?)
+ let filename = doc.meta().basedir().join(doc.meta().markdown_filename());
+ Self::mtime_formatted(Self::mtime(&filename)?)
};
pandoc.add_option(pandoc::PandocOption::Meta("date".to_string(), Some(date)));
pandoc.add_option(pandoc::PandocOption::TableOfContents);