summaryrefslogtreecommitdiff
path: root/src/bin/cli/mod.rs
blob: 1bb5ea3a5418271fed0294bc84631ce9546f682b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//! CLI Functionality abstractions

use anyhow::Result;
use subplot::{Document, Style};

use std::path::Path;

pub fn load_document<P: AsRef<Path>>(filename: P, style: Style) -> Result<Document> {
    let filename = filename.as_ref();
    let base_path = subplot::get_basedir_from(filename)?;
    let doc = Document::from_file(&base_path, filename, style)?;

    Ok(doc)
}