Unverified Commit 33e76a42 authored by Jake Howard's avatar Jake Howard
Browse files

Add some additional config

parent ffbb4ca8
......@@ -276,6 +276,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
name = "md-pdf"
version = "0.1.0"
dependencies = [
"chrono 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"clap 2.25.0 (registry+https://github.com/rust-lang/crates.io-index)",
"include_dir 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"mktemp 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
......
......@@ -15,6 +15,7 @@ serde_yaml = "0.7.1"
wkhtmltopdf = "0.3.0"
zip = "0.2.6"
tera = "0.10.10"
chrono = "0.4.0"
[build-dependencies]
include_dir = "0.1.3"
......
......@@ -10,6 +10,7 @@ extern crate sciter;
extern crate zip;
extern crate mktemp;
extern crate tera;
extern crate chrono;
use std::io::{self, Write};
use std::process::exit;
......
use tera::{Tera, Context};
use config::Config;
use tera::Result;
use chrono::{Local, DateTime};
const TEMP_TEMPLATE_FILENAME: &str = "index.html";
fn build_context(config: &Config) -> Context {
let mut context = Context::new();
let now: DateTime<Local> = Local::now();
context.add("config", &config);
context.add("now", &now.to_rfc3339());
context.add("version", &String::from(crate_version!()));
return context;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment