Skip to content

Commit

Permalink
Merge pull request #2 from fiji-flo/move-to-gtmpl-value
Browse files Browse the repository at this point in the history
Move to gtmpl value
  • Loading branch information
fiji-flo committed Nov 18, 2017
2 parents 9a3969d + b091121 commit 51f7a49
Show file tree
Hide file tree
Showing 12 changed files with 223 additions and 218 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here http://doc.crates.io/guide.html#cargotoml-vs-cargolock
Cargo.lock
.idea
9 changes: 4 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "gtmpl"
version = "0.1.3"
version = "0.2.0"
authors = ["Florian Merz <flomerz@gmail.com>"]
description = "The Golang Templating Language for Rust"
license = "MIT"
Expand All @@ -17,7 +17,6 @@ travis-ci = { repository = "fiji-flo/gtmpl-rust" }
[dependencies]
itertools = "0.6"
lazy_static = "0.2"
serde = "1.0"
serde_derive = "1.0"
serde_json = "1.0"
percent-encoding = "1.0.0"
percent-encoding = "1.0.0"
gtmpl_value = "0.1.0"
gtmpl_derive = "0.1.0"
22 changes: 14 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

```toml
[dependencies]
gtmpl = "0.1.2"
gtmpl = "0.2.0"
```

* [gtmpl at crates.io](https://crates.io/crate/gtmpl)
Expand All @@ -23,16 +23,9 @@ gtmpl = "0.1.2"
This is work in progress. Currently the following features are not supported:

* complex numbers
* comparing different number types
* `eq 1 1.0` will be `false`
* the following functions have not been implemented:
* `html`, `js`, `call` and `printf`

For now we use [serde_json](https://github.com/serde-rs/json)'s Value as internal
data type. However, this can not support passing functions to the context. In a
future release we will move to a custom data type that will be compatible with
serde_json.

## Usage

Basic template rendering can be achieved in a single line.
Expand All @@ -50,6 +43,19 @@ fn basic_template_rendering() {
For more examples please take a look at the
[gtmpl documentation](https://docs.rs/crate/gtmpl).

## Context

We use [gtmpl_value](https://github.com/fiji-flo/gtmpl_value)'s Value as internal
data type. [gtmpl_derive](https://github.com/fiji-flo/gtmpl_derive) provides a
handy `derive` marco to generate the `From` implmentation for `Value`.

See:

* [gtmpl_value at crates.io](https://crates.io/crate/gtmpl_value)
* [gtmpl_value documentation](https://docs.rs/crate/gtmpl_value)
* [gtmpl_derive at crates.io](https://crates.io/crate/gtmpl_derive)
* [gtmpl_derive documentation](https://docs.rs/crate/gtmpl_derive)

## Why do we need this?

The main motivation for this is to make it easier to write dev-ops tools in Rust
Expand Down

0 comments on commit 51f7a49

Please sign in to comment.