update dependency versions
This commit is contained in:
parent
e53dcdcf4d
commit
f67ae7c71a
13
Cargo.toml
13
Cargo.toml
|
@ -15,13 +15,14 @@ exclude = [
|
||||||
]
|
]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clap = "2.2.1"
|
clap = "2.19.2"
|
||||||
handlebars = { version = "0.20.0", features = ["serde_type"] }
|
handlebars = { version = "0.23.0", features = ["serde_type"] }
|
||||||
serde = "0.8.17"
|
serde = "0.8"
|
||||||
serde_json = "0.8.3"
|
serde_json = "0.8"
|
||||||
pulldown-cmark = "0.0.8"
|
pulldown-cmark = "0.0.8"
|
||||||
log = "0.3"
|
log = "0.3"
|
||||||
env_logger = "0.3.4"
|
env_logger = "0.3"
|
||||||
|
toml = { version = "0.2", features = ["serde"] }
|
||||||
|
|
||||||
# Watch feature
|
# Watch feature
|
||||||
notify = { version = "2.5.5", optional = true }
|
notify = { version = "2.5.5", optional = true }
|
||||||
|
@ -33,12 +34,10 @@ iron = { version = "0.4", optional = true }
|
||||||
staticfile = { version = "0.3", optional = true }
|
staticfile = { version = "0.3", optional = true }
|
||||||
ws = { version = "0.5.1", optional = true}
|
ws = { version = "0.5.1", optional = true}
|
||||||
|
|
||||||
|
|
||||||
# Tests
|
# Tests
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
tempdir = "0.3.4"
|
tempdir = "0.3.4"
|
||||||
|
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["output", "watch", "serve"]
|
default = ["output", "watch", "serve"]
|
||||||
debug = []
|
debug = []
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use std::collections::BTreeMap;
|
use std::collections::{VecDeque, BTreeMap};
|
||||||
|
|
||||||
use serde_json;
|
use serde_json;
|
||||||
use serde_json::value::ToJson;
|
use serde_json::value::ToJson;
|
||||||
use handlebars::{Handlebars, RenderError, RenderContext, Helper, Context, Renderable};
|
use handlebars::{Handlebars, RenderError, RenderContext, Helper, Context, Renderable};
|
||||||
|
|
||||||
|
|
||||||
// Handlebars helper for navigation
|
// Handlebars helper for navigation
|
||||||
|
|
||||||
pub fn previous(c: &Context, _h: &Helper, r: &Handlebars, rc: &mut RenderContext) -> Result<(), RenderError> {
|
pub fn previous(c: &Context, _h: &Helper, r: &Handlebars, rc: &mut RenderContext) -> Result<(), RenderError> {
|
||||||
|
@ -14,9 +15,9 @@ pub fn previous(c: &Context, _h: &Helper, r: &Handlebars, rc: &mut RenderContext
|
||||||
// get value from context data
|
// get value from context data
|
||||||
// rc.get_path() is current json parent path, you should always use it like this
|
// rc.get_path() is current json parent path, you should always use it like this
|
||||||
// param is the key of value you want to display
|
// param is the key of value you want to display
|
||||||
let chapters = c.navigate(rc.get_path(), "chapters");
|
let chapters = c.navigate(rc.get_path(), &VecDeque::new(), "chapters");
|
||||||
|
|
||||||
let current = c.navigate(rc.get_path(), "path")
|
let current = c.navigate(rc.get_path(), &VecDeque::new(), "path")
|
||||||
.to_string()
|
.to_string()
|
||||||
.replace("\"", "");
|
.replace("\"", "");
|
||||||
|
|
||||||
|
@ -114,9 +115,9 @@ pub fn next(c: &Context, _h: &Helper, r: &Handlebars, rc: &mut RenderContext) ->
|
||||||
// get value from context data
|
// get value from context data
|
||||||
// rc.get_path() is current json parent path, you should always use it like this
|
// rc.get_path() is current json parent path, you should always use it like this
|
||||||
// param is the key of value you want to display
|
// param is the key of value you want to display
|
||||||
let chapters = c.navigate(rc.get_path(), "chapters");
|
let chapters = c.navigate(rc.get_path(), &VecDeque::new(), "chapters");
|
||||||
|
|
||||||
let current = c.navigate(rc.get_path(), "path")
|
let current = c.navigate(rc.get_path(), &VecDeque::new(), "path")
|
||||||
.to_string()
|
.to_string()
|
||||||
.replace("\"", "");
|
.replace("\"", "");
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use std::collections::BTreeMap;
|
use std::collections::{VecDeque, BTreeMap};
|
||||||
|
|
||||||
use serde_json;
|
use serde_json;
|
||||||
use handlebars::{Handlebars, HelperDef, RenderError, RenderContext, Helper, Context};
|
use handlebars::{Handlebars, HelperDef, RenderError, RenderContext, Helper, Context};
|
||||||
|
@ -15,8 +15,8 @@ impl HelperDef for RenderToc {
|
||||||
// get value from context data
|
// get value from context data
|
||||||
// rc.get_path() is current json parent path, you should always use it like this
|
// rc.get_path() is current json parent path, you should always use it like this
|
||||||
// param is the key of value you want to display
|
// param is the key of value you want to display
|
||||||
let chapters = c.navigate(rc.get_path(), "chapters");
|
let chapters = c.navigate(rc.get_path(), &VecDeque::new(), "chapters");
|
||||||
let current = c.navigate(rc.get_path(), "path").to_string().replace("\"", "");
|
let current = c.navigate(rc.get_path(), &VecDeque::new(), "path").to_string().replace("\"", "");
|
||||||
try!(rc.writer.write("<ul class=\"chapter\">".as_bytes()));
|
try!(rc.writer.write("<ul class=\"chapter\">".as_bytes()));
|
||||||
|
|
||||||
// Decode json format
|
// Decode json format
|
||||||
|
|
Loading…
Reference in New Issue