diff --git a/CHANGELOG.md b/CHANGELOG.md index ee84e10..2821998 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ This changelog documents all noteworthy changes in the project. The format adher ## Next +## v0.3.0 - 27th September 2023 + +### Changed + +- Renamed the old `render/1` function to `render_html/1` for clarity in naming. +- Introduced a new `render/1` function that returns HTML without the DOCTYPE declaration for flexibility in usage. + ## v0.2.0 - 26th September 2023 ### Added diff --git a/README.md b/README.md index c5307ee..21fdc83 100644 --- a/README.md +++ b/README.md @@ -17,14 +17,14 @@ Package can be installed by adding `e2h` to your list of dependencies: ### Rebar3 ```erlang -{deps, [{e2h, "0.2.0"}]}. +{deps, [{e2h, "0.3.0"}]}. ``` ### Mix ```elixir defp deps do - [{:e2h, "~> 0.2.0"}] + [{:e2h, "~> 0.3.0"}] end ``` @@ -33,22 +33,29 @@ end ```erlang UserStatus = <<"busy">>, UserProfileImage = <<"https://example.com/image.jpeg">>, -UserName = <<"adam">>, -UserBio = <<"some nonsense">>, +UserName = <<"joe">>, +UserJob = <<"data scientist">>, Document = [ {'div', [{class, <<"user">>}, {status, UserStatus}], [ {img, [{href, UserProfileImage}]}, {'div', [], [ {h1, [], [UserName]}, - {p, [], [UserBio]} + {p, [], [UserJob]} ]} ]} ], e2h:render(Document). -% -%

adam

some nonsense

+% (output is manually formatted for readme) +% +%
+% +%
+%

joe

+%

data scientist

+%
+%
``` ## Documentation diff --git a/src/e2h.app.src b/src/e2h.app.src index 9716901..ee28d79 100644 --- a/src/e2h.app.src +++ b/src/e2h.app.src @@ -1,6 +1,6 @@ {application, e2h, [ {description, "HTML generator for Erlang ecosystem"}, - {vsn, "0.2.0"}, + {vsn, "0.3.0"}, {registered, []}, {applications, [ kernel, diff --git a/test/e2h_tests.erl b/test/e2h_tests.erl index 1aba609..2eeb6b0 100644 --- a/test/e2h_tests.erl +++ b/test/e2h_tests.erl @@ -25,7 +25,11 @@ simple_render_test() -> ]} ], - Rendered = e2h:render(Elements), - Expected = + Rendered1 = e2h:render(Elements), + Expected1 = <<"

Hello, World!

">>, - ?assertEqual(Expected, Rendered). + ?assertEqual(Expected1, Rendered1), + + Rendered2 = e2h:render_html(Elements), + Expected2 = <<"\n", Expected1/binary>>, + ?assertEqual(Expected2, Rendered2).