Commit graph

54 commits

Author SHA1 Message Date
github-actions[bot] a991e71851
chore(main): release 0.12.0 (#204)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-06-12 23:49:12 -04:00
Mitchell Hanberg 9a24ff85cb
chore: Bump v0.11.0 2023-01-21 07:02:11 -05:00
Mitchell Hanberg 07c82e21d3
Dynamic Attributes (#190)
* Move directories for ast tests to match convention

* feat!: Rename `:let` to `:let!`

We use the "bang" style as the reserved keyword to differentiate it from
other possible attributes.

* feat: use Phoenix.HTML as the default engine

I am choosing to leverage this library in order to quickly get dynamic
attributes (see #183) up and running.

This also ensures that folks who wish to use Temple outside of a Phoenix
project with get some nice HTML functions as well as properly escaped
HTML out of the box.

This can be made optional if Temple becomes decoupled from the render
and it including HTML specific packages becomes a strange.

* feat: Allow user to make their own Component module

The component module is essentially to defer compiling functions that the
user might not need. The component, render_slot, and inner_block functions
are only mean to be used when there isn't another implementation.

In the case of a LiveView application, LiveView is providing the
component runtime implementation. This was causing some compile time
warnings for temple, because it was using the LiveView engine at compile
time (for Temple, not the user's application) and LiveView hadn't been
compiled or loaded.

So, now we defer this to the user to make their own module and import it
where necessary.

* feat: Pass dynamic attributes with the :rest! attribute

The :rest! attribute can be used to pass in a dynamic list of attributes
to be mixed into the static ones at runtime.

Since this cannot be properly escaped by any engine, we have to mark it
as safe and then allow the function to escape it for us. I decided to
leverage the `attributes_escape/1` function from `phoenix_html`. There
isn't really any point in making my own version of this or vendoring it.

Now you can also pass a variable as the attributes as well if you only
want to pass through attributes from a calling component.

The :rest! attribute also works with components, allowing you to pass
a dynamic list of args into them.

Fixes #183

* Move test components to their own file.

* docs(components): Update documentation on Temple.Components

* docs(guides): Mention attributes_escape/1 function in the guides

* chore(test): Move helper to it's own module

* feat: rest! support for slots

* docs(guides): Dynamic attributes

* ci: downgrade runs-on to support OTP 23
2023-01-21 06:44:29 -05:00
dependabot[bot] 61aea98d9e
Bump ex_doc from 0.28.6 to 0.29.0 (#186)
Bumps [ex_doc](https://github.com/elixir-lang/ex_doc) from 0.28.6 to 0.29.0.
- [Release notes](https://github.com/elixir-lang/ex_doc/releases)
- [Changelog](https://github.com/elixir-lang/ex_doc/blob/main/CHANGELOG.md)
- [Commits](https://github.com/elixir-lang/ex_doc/compare/v0.28.6...v0.29.0)

---
updated-dependencies:
- dependency-name: ex_doc
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-26 23:20:17 -04:00
Mitchell Hanberg dca47b9802 Bump v0.10.0 2022-09-19 20:37:10 -04:00
Mitchell Hanberg 99cbb42962
SVG (#181)
This basically just adds svg elements as void and nonvoid element
aliases and it works, will test on a real proejct before releasing the
next release.

Also, fixed the weird behaviour problem by defining types for each of the ast
nodes and then referencing those types when defining the ast type.

Unclear why this works, but I imagine it has to do with the types not
being a big part of the compilation process or something.

This also uses the typed_struct library to do so. Seems pretty slick and
does what it claims it does.
2022-09-19 20:35:45 -04:00
Mitchell Hanberg 2f042506b6
feat: Mix task to convert HTML into Temple (#180) 2022-09-11 22:39:31 -04:00
Mitchell Hanberg e28504a037 Bump v0.9.0 2022-09-01 14:32:01 -06:00
Mitchell Hanberg c8d3f446b0 Remove last remnants of Phoenix 2022-04-20 00:05:27 -04:00
Mitchell Hanberg f942817994
Utilize the EEx Engine instead of creating an EEx string (#177) 2022-04-19 23:56:46 -04:00
dependabot[bot] ece4cb8a26
Bump ex_doc from 0.24.2 to 0.28.3 (#174) 2022-03-23 08:44:44 -04:00
Mitchell Hanberg c6d29e592b Bump v0.8.0 2021-08-29 18:11:24 -04:00
Mitchell Hanberg 0715a514c5 Bump v0.7.0 2021-06-27 12:05:45 -04:00
Mitchell Hanberg fb5f0a99f4 Bump v0.6.2 2021-06-03 23:14:58 -04:00
Mitchell Hanberg 006886fa5e Bump v0.6.1 2021-05-23 14:01:25 -04:00
Mitchell Hanberg 301963f06b Bump v0.6.0 2021-05-22 01:13:58 -04:00
Mitchell Hanberg 0b55cf1cec Bump v0.6.0-rc.1 2021-05-13 00:31:00 -04:00
Mitchell Hanberg 5150a93e38 emit live view compatible component and slot markup
- requires the development branch of live_view currently, if you are
  going to be using live view

ci

Docs

Raise minimum elixir version to 1.9

There is some bug in EEx that was fixed in 1.9 and I can't be bothered
to make it backwards compatible with the bug.

ugh

Remove commented out line
2021-05-13 00:21:43 -04:00
Mitchell Hanberg c4059b3a6e Bump v0.6.0-rc.0 2021-01-02 13:24:49 -05:00
Mitchell Hanberg ced2f6ab66 feat: New Component API 2021-01-02 13:22:03 -05:00
Mitchell Hanberg 265c413960 Allow element attrs to be evaluated at runtime
Before this change, only keyword list literals could be passed to
elements. If they had non-literals as values, then those would compile
to EEx expressions.

This allows a non-literal to be passed as attrs and have the entire thing
compile to an EEx expression, which will pass the non-literal to a
"runtime_attrs" function, which evaluates a keyword list into a safe
string.

That last part might need to be reworked if the user is not using
the Phoenix.HTML.Engine EEx Engine.
2020-08-09 10:07:27 -04:00
Mitchell Hanberg 2206aa62fe Bump v0.6.0-alpha.4 2020-07-16 00:21:25 -04:00
Mitchell Hanberg bd403a2037 Bump v0.6.0-alpha-3 2020-07-15 23:23:41 -04:00
Mitchell Hanberg 1b02dc86db Bump v0.6.0-alpha.2 2020-07-15 22:42:45 -04:00
Mitchell Hanberg edb023fd9a Bump v0.6.0-alpha.1 2020-06-30 20:48:08 -04:00
Mitchell Hanberg 33c95186fb
Compile to EEx (#80)
Code is gross
2020-06-16 15:28:21 -04:00
Mitchell Hanberg 25284988bb Bump v0.5.0 2020-04-14 10:40:19 -04:00
dependabot-preview[bot] e379b46ffc Bump floki from 0.23.1 to 0.26.0 (#50)
Bumps [floki](https://github.com/philss/floki) from 0.23.1 to 0.26.0.
- [Release notes](https://github.com/philss/floki/releases)
- [Changelog](https://github.com/philss/floki/blob/master/CHANGELOG.md)
- [Commits](https://github.com/philss/floki/compare/v0.23.1...v0.26.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-04-14 10:40:17 -04:00
Mitchell Hanberg 916a9469d6 Remove mdn docs
They became broken at some point, and are probably not too useful
anyway. We can bring them back in the future.
2020-04-14 10:39:58 -04:00
Mitchell Hanberg 7376ce5d34 Bump v0.4.4 2020-04-14 10:39:47 -04:00
Michał Łępicki 997b62b9f4
Remove unnecessary dependency on Plug (#61)
The plug dependency is not needed since Phoenix provides it.
2020-03-19 11:02:08 -04:00
Mitchell Hanberg fb0359fa8c Bump v0.4.3 2020-01-07 23:49:51 -05:00
Mitchell Hanberg 71bddc6346 Bump v0.4.2 2019-11-22 22:55:57 -05:00
Mitchell Hanberg d2e8a45094 Bump v0.4.1 2019-09-25 19:23:00 -04:00
Shritesh d1fceaf75f Don't depend on floki in prod (#28)
* Set @preferred_cli_env for Convert Task to :dev

* Set floki dep to :dev and :test, bump nimble_parsec
2019-09-25 15:16:56 -04:00
Mitchell Hanberg 86f5656b46 Bump v0.4.0 2019-09-13 21:38:53 -04:00
Mitchell Hanberg 5acd6fc079
Svg module (#25)
* Temple.Svg

- scopes update_mdn_task to the temple namespace
- introduces new temple.convert mix task to convert plain HTML and SVG to
  Temple syntax

* Rename Temple.Tags to Temple.Html

* Remove hackney

I'm not sure why it was even in there ¯\_(ツ)_/¯

* Update floki

* Document temple.convert in README
2019-09-13 21:36:16 -04:00
Mitchell Hanberg b01ec03362 Remove dialyzer
Temple is mostly macros ¯\_(ツ)_/¯. All dialyzer was doing was taking
forever on CI.
2019-08-27 22:22:56 -04:00
Mitchell Hanberg 9e4f56dd95 Bump v0.3.1 2019-08-27 22:09:22 -04:00
Mitchell Hanberg 451f5d4859 Bump v0.3.0 2019-08-20 23:32:14 -04:00
Mitchell Hanberg a20900a281 Bump v0.2.0 2019-08-13 18:28:28 -04:00
Mitchell Hanberg 408dfdc6c7 Bump v0.1.2 2019-08-10 01:10:45 -04:00
Mitchell Hanberg 030e0f9d3c Bump v0.1.1 2019-08-08 09:01:28 -04:00
Mitchell Hanberg 03e35f858c Finishing touches 2019-07-03 20:57:19 -04:00
Mitchell Hanberg 6dece3165f Add description to mix.exs 2019-07-03 19:52:40 -04:00
Mitchell Hanberg 9278f7fb4e Rename to Temple 2019-07-01 22:48:51 -04:00
Mitchell Hanberg fb5147ff97 Improve doc generation
- Downloads all the mdn documentation in parallel
- Enables the `--silent` flag for curl
- Aliases the docs mix task to run update_mdn_docs first
2019-06-30 21:59:38 -04:00
Mitchell Hanberg 883f0966ea Add .travis.yml 2019-06-29 18:33:33 -04:00
Mitchell Hanberg 6b55fc7665 Implement remaining from helpers 2019-06-01 00:02:49 -04:00
Mitchell Hanberg 06cbdd80ff form_for and text_input macros 2019-05-10 15:06:03 -04:00