summaryrefslogtreecommitdiff
path: root/src/bin/subplot.rs
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2021-11-12 10:59:10 +0000
committerDaniel Silverstone <dsilvers@digital-scurf.org>2021-11-19 20:19:00 +0000
commit03f4bff558807c3bf6b6ebd65aa1e547b9286461 (patch)
tree59c8b2ed142f7625916f2610713727f1537d03f2 /src/bin/subplot.rs
parent73e7188b2397d1afb5c550cf8863157c9174a4e5 (diff)
downloadsubplot-03f4bff558807c3bf6b6ebd65aa1e547b9286461.tar.gz
subplot: Rework for impls not template/functions
As the next step in polyglot documents, this reworks the internals to expect the metadata of documents to contain an impls mapping from template name to function filenames for that template. Sadly this does mean that if there're no function files, the document author will have to still specify an empty list, but that seems acceptable. Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
Diffstat (limited to 'src/bin/subplot.rs')
-rw-r--r--src/bin/subplot.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/bin/subplot.rs b/src/bin/subplot.rs
index 08c4713..25b73c2 100644
--- a/src/bin/subplot.rs
+++ b/src/bin/subplot.rs
@@ -160,7 +160,7 @@ impl Extract {
fn run(&self) -> Result<()> {
let span = span!(Level::TRACE, "extract");
let _enter = span.enter();
- let doc = load_document(&self.filename, Style::default())?;
+ let doc = load_document(&self.filename, Style::default(), None)?;
let files: Vec<&DataFile> = if self.embedded.is_empty() {
doc.files()
@@ -230,7 +230,7 @@ impl Filter {
Path::new(".")
};
let style = Style::default();
- let mut doc = Document::from_json(basedir, vec![], &buffer, style)?;
+ let mut doc = Document::from_json(basedir, vec![], &buffer, style, None)?;
doc.typeset();
let bytes = doc.ast()?.into_bytes();
if let Some(filename) = &self.output {
@@ -266,7 +266,7 @@ impl Metadata {
fn run(&self) -> Result<()> {
let span = span!(Level::TRACE, "metadata");
let _enter = span.enter();
- let mut doc = load_document(&self.filename, Style::default())?;
+ let mut doc = load_document(&self.filename, Style::default(), None)?;
let meta = cli::Metadata::try_from(&mut doc)?;
match self.output_format {
cli::OutputFormat::Plain => meta.write_out(),
@@ -314,7 +314,7 @@ impl Docgen {
event!(Level::TRACE, "PDF output chosen");
style.typeset_links_as_notes();
}
- let mut doc = load_document(&self.input, style)?;
+ let mut doc = load_document(&self.input, style, None)?;
event!(Level::TRACE, "Got doc, now linting it");
doc.lint()?;
event!(Level::TRACE, "Doc linted ok");