Skip to content

Commit

Permalink
update document.
Browse files Browse the repository at this point in the history
  • Loading branch information
soranoba committed Dec 19, 2015
1 parent 45f6d85 commit 11185f8
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,35 @@ Eshell V6.3 (abort with ^G)
<<"hoge">>
2> bbmustache:render(<<"{{name}}">>, [{"name", "hoge"}]).
<<"hoge">>
%% auto http escape
3> bbmustache:render(<<"<h1>{{tag}}</h1>">>, #{"tag" => "I like Erlang & mustache"}).
<<"<h1>I like Erlang &amp; mustache</h1>">>
%% don't use http escape
4> bbmustache:render(<<"<h1>{{{tag}}}</h1>">>, #{"tag" => "I like Erlang & mustache"}).
<<"<h1>I like Erlang & mustache</h1>">>
%% change the symbol of the tag
5> bbmustache:render(<<"{{=<< >>=}} <<tag>>, <<={{ }}=>> {{tag}}">>, #{"tag" => "hi"}).
<<" hi, hi">>
```
Please refer to [the documentation for how to use the mustache](http://mustache.github.io/mustache.5.html) as the need arises.
### Use as a library
Add the following settings.
```erlang
%% rebar.config
%% rebar (rebar.config)
{deps,
[
{bbmustache, ".*", {git, "git://github.com/soranoba/bbmustache.git", {branch, "master"}}}
]}.
%% rebar3 (rebar.config)
{deps, [bbmustache]}.
```
If you don't use the rebar and use the OTP17 or later, this library should be compile with `-Dnamespaced_types`.
Expand Down
5 changes: 5 additions & 0 deletions doc/bbmustache.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ Binary pattern match Based Mustach template engine for Erlang/OTP.

Copyright (c) 2015 Hinagiku Soranoba All Rights Reserved.

<a name="description"></a>

## Description ##
This library support all of mustache syntax. <br />
Please refer to [the documentation for how to use the mustache](http://mustache.github.io/mustache.5.html) as the need arises.
<a name="types"></a>

## Data Types ##
Expand Down
4 changes: 4 additions & 0 deletions src/bbmustache.erl
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
%% @copyright 2015 Hinagiku Soranoba All Rights Reserved.
%%
%% @doc Binary pattern match Based Mustach template engine for Erlang/OTP.
%%
%% This library support all of mustache syntax. <br />
%% Please refer to [the documentation for how to use the mustache](http://mustache.github.io/mustache.5.html) as the need arises.

-module(bbmustache).

%%----------------------------------------------------------------------------------------------------------------------
Expand Down

0 comments on commit 11185f8

Please sign in to comment.