Skip to content

Commit

Permalink
prepare for v0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bunopnu committed Sep 26, 2023
1 parent 1910af6 commit 7c36768
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ This changelog documents all noteworthy changes in the project. The format adher

## Next

## v0.2.0 - 26th September 2023

### Added

- Allow passing atom for attributes and tags.

## v0.1.1 - 26th September 2023

### Added
Expand Down
27 changes: 25 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,40 @@ Package can be installed by adding `e2h` to your list of dependencies:
### Rebar3

```erlang
{deps, [{e2h, "0.1.1"}]}.
{deps, [{e2h, "0.2.0"}]}.
```

### Mix

```elixir
defp deps do
[{:e2h, "~> 0.1.1"}]
[{:e2h, "~> 0.2.0"}]
end
```

## Example

```erlang
UserStatus = <<"busy">>,
UserProfileImage = <<"https://example.com/image.jpeg">>,
UserName = <<"adam">>,
UserBio = <<"some nonsense">>,

Document = [
{'div', [{class, <<"user">>}, {status, UserStatus}], [
{img, [{href, UserProfileImage}]},
{'div', [], [
{h1, [], [UserName]},
{p, [], [UserBio]}
]}
]}
],

e2h:render(Document).
% <!DOCTYPE html>
% <div class="user" status="busy"><img href="https://example.com/image.jpeg" /><div><h1>adam</h1><p>some nonsense</p></div></div>
```

## Documentation

Please consult the [HexDocs](https://hexdocs.pm/e2h) for documentation.
Expand Down
2 changes: 1 addition & 1 deletion src/e2h.app.src
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{application, e2h, [
{description, "HTML generator for Erlang ecosystem"},
{vsn, "0.1.1"},
{vsn, "0.2.0"},
{registered, []},
{applications, [
kernel,
Expand Down
4 changes: 2 additions & 2 deletions src/e2h.erl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
-module(e2h).

-export([render/1, escape/1]).
-export_type([attributes/0, elements/0]).
-export_type([key/0, attributes/0, elements/0]).

%%%=============================================================================
%%% Public types
Expand All @@ -25,7 +25,7 @@
%% == Example ==
%%
%% ```
%% Attributes = [{<<"class">>, <<"container">>}, {<<"id">>, <<"my-element">>}].
%% Attributes = [{class, <<"container">>}, {<<"id">>, <<"my-element">>}].
%% % Represents attributes like: class="container" id="my-element"
%% '''
%%
Expand Down

0 comments on commit 7c36768

Please # to comment.