Skip to content

Commit

Permalink
feat(doc): Update to handlebars 1.0.0-beta.4
Browse files Browse the repository at this point in the history
Closes #582
  • Loading branch information
Marwes committed Jul 6, 2018
1 parent 34fff8d commit 78880eb
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
17 changes: 9 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ tokio-core = "0.1"
rand = { version = "0.4", optional = true }

[build-dependencies]
little-skeptic = { version = "0.14.0", optional = true }
little-skeptic = { version = "0.15.0", optional = true }
walkdir = { version = "2", optional = true }

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion doc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ log = "0.4"
env_logger = "0.5"
walkdir = "1"
failure = { version = "0.1", features = ["backtrace"] }
handlebars = "=1.0.0-beta.1"
handlebars = "1.0.0-beta.4"
clap = "2.22.0"
itertools = "0.7"
structopt = "0.2"
Expand Down
19 changes: 9 additions & 10 deletions doc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use failure::ResultExt;

use itertools::Itertools;

use handlebars::{Handlebars, Helper, Output, RenderContext, RenderError};
use handlebars::{Context, Handlebars, Helper, Output, RenderContext, RenderError};

use serde::Deserialize;

Expand Down Expand Up @@ -243,13 +243,11 @@ fn handlebars() -> Result<Handlebars> {
fn module_link_helper(
h: &Helper,
_: &Handlebars,
context: &Context,
rc: &mut RenderContext,
out: &mut Output,
) -> ::std::result::Result<(), RenderError> {
let current_module = &rc.context().data()["name"]
.as_str()
.expect("name")
.to_string();
let current_module = &context.data()["name"].as_str().expect("name").to_string();

let param = String::deserialize(h.param(0).unwrap().value())?;
let index = rc.get_root_template_name().map(|s| &s[..]) == Some(INDEX_TEMPLATE);
Expand All @@ -261,6 +259,7 @@ fn handlebars() -> Result<Handlebars> {
fn breadcrumbs(
h: &Helper,
_: &Handlebars,
_: &Context,
_: &mut RenderContext,
out: &mut Output,
) -> ::std::result::Result<(), RenderError> {
Expand Down Expand Up @@ -289,13 +288,11 @@ fn handlebars() -> Result<Handlebars> {
fn style(
_: &Helper,
_: &Handlebars,
rc: &mut RenderContext,
context: &Context,
_: &mut RenderContext,
out: &mut Output,
) -> ::std::result::Result<(), RenderError> {
let current_module = &rc.context().data()["name"]
.as_str()
.expect("name")
.to_string();
let current_module = &context.data()["name"].as_str().expect("name").to_string();
let relative_path = current_module.split('.').map(|_| "../").format("");

out.write(&format!(r#"
Expand All @@ -309,6 +306,7 @@ fn handlebars() -> Result<Handlebars> {
fn markdown(
h: &Helper,
_: &Handlebars,
_: &Context,
_: &mut RenderContext,
out: &mut Output,
) -> ::std::result::Result<(), RenderError> {
Expand Down Expand Up @@ -340,6 +338,7 @@ fn handlebars() -> Result<Handlebars> {
fn markdown_first_paragraph(
h: &Helper,
_: &Handlebars,
_: &Context,
_: &mut RenderContext,
out: &mut Output,
) -> ::std::result::Result<(), RenderError> {
Expand Down

0 comments on commit 78880eb

Please sign in to comment.