Skip to content

Commit

Permalink
Merge pull request #82 from out-of-cheese-error/feat/handlebars_misc_…
Browse files Browse the repository at this point in the history
…helpers

feat(template): added handlebars_misc_helpers
  • Loading branch information
Ninjani committed Apr 13, 2021
2 parents 04ad83e + 1464919 commit 736ccc9
Show file tree
Hide file tree
Showing 4 changed files with 212 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
### Fixed
- markdown preview in search (Issue [#74](https://github.com/out-of-cheese-error/gooseberry/issues/74))

### Added
- handlebars_misc_helpers (Issue [#81](https://github.com/out-of-cheese-error/gooseberry/issues/66))

## [0.8.0] - 2021-03-14
### Fixed
* All w3 selectors (partially) supported (Issue [#66](https://github.com/out-of-cheese-error/gooseberry/issues/66))
Expand Down
207 changes: 207 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ handlebars = "3.5.4"

# Sanitizing filenames
sanitize-filename = "0.3.0"
handlebars_misc_helpers = "0.11.2"

[dev-dependencies]
assert_cmd = "1.0.3"
Expand Down
1 change: 1 addition & 0 deletions src/gooseberry/knowledge_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ impl<'a> Default for Templates<'a> {

pub(crate) fn get_handlebars(templates: Templates) -> color_eyre::Result<Handlebars> {
let mut hbs = Handlebars::new();
handlebars_misc_helpers::register(&mut hbs);
hbs.register_escape_fn(handlebars::no_escape);
hbs.register_helper("date_format", Box::new(date_format));
hbs.register_template_string("annotation", templates.annotation_template)?;
Expand Down

0 comments on commit 736ccc9

Please sign in to comment.