Commit graph

252 commits

Author SHA1 Message Date
d1db62ef58 Merge remote-tracking branch 'upstream/main' 2023-08-06 18:29:06 +01:00
33642c15d3 update deps 2023-08-06 18:19:16 +01:00
1b1585657f fix tests 2023-08-06 18:12:51 +01:00
dependabot[bot]
cfb2a325b9
chore: Bump ex_doc from 0.29.1 to 0.30.0 (#206)
Bumps [ex_doc](https://github.com/elixir-lang/ex_doc) from 0.29.1 to 0.30.0.
- [Changelog](https://github.com/elixir-lang/ex_doc/blob/main/CHANGELOG.md)
- [Commits](https://github.com/elixir-lang/ex_doc/compare/v0.29.1...v0.30.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>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-07 08:48:37 -04:00
Mitchell Hanberg
da568bf84e
ci: fix release-please readme 2023-06-13 22:24:24 -04:00
Mitchell Hanberg
d81458562f
ci: release-please readme 2023-06-13 22:23:26 -04:00
Mitchell Hanberg
1ae81b1d90
chore: remove priv from release files 2023-06-12 23:52:25 -04:00
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
0c166da988
ci: only bump minor on breaking change 2023-06-12 23:42:04 -04:00
Mitchell Hanberg
dc57221bc9
feat!: configure runtime attributes function (#202) 2023-06-12 23:38:16 -04:00
Mitchell Hanberg
8a9e06448b
ci: release please (#203) 2023-06-12 23:17:40 -04:00
Mitchell Hanberg
842fc4d40a
chore: update README.md 2023-05-26 10:45:09 -04:00
Mitchell Hanberg
7a505875af
fix(docs): typos 2023-01-21 07:08:22 -05:00
Mitchell Hanberg
9a24ff85cb
chore: Bump v0.11.0 2023-01-21 07:02:11 -05:00
Mitchell Hanberg
0879bfb793
docs(changelog): Dynamic Attributes 2023-01-21 06:47:58 -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]
85eb81944e
Bump ex_doc from 0.29.0 to 0.29.1 (#191) 2022-11-22 08:13:45 -05:00
dependabot[bot]
f6c4340c98
Bump floki from 0.33.1 to 0.34.0 (#189)
Bumps [floki](https://github.com/philss/floki) from 0.33.1 to 0.34.0.
- [Release notes](https://github.com/philss/floki/releases)
- [Changelog](https://github.com/philss/floki/blob/main/CHANGELOG.md)
- [Commits](https://github.com/philss/floki/compare/v0.33.1...v0.34.0)

---
updated-dependencies:
- dependency-name: floki
  dependency-type: direct:production
  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-11-11 22:28:35 -05:00
Mitchell Hanberg
f4ce790411
fix: runtime boolean attributes (#188)
Closes #187
2022-11-11 22:28:05 -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
dependabot[bot]
d349b0992c
Bump ex_doc from 0.28.5 to 0.28.6 (#185)
Bumps [ex_doc](https://github.com/elixir-lang/ex_doc) from 0.28.5 to 0.28.6.
- [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.5...v0.28.6)

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

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-16 21:33:32 -04:00
Mitchell Hanberg
db231e7b6b
Align component model with HEEx/Surface (#182)
* Align component model with HEEx/Surface

This change aligns the component model with HEEx/Surface. This shoudl
allow one to interop components created in any syntax with any other
syntax.

The advantage of this is folks can utilize component packages created
using a different syntax.

This includes several enhancements and breaking changes, please see the changelog and the migration guide for further details.

Closes #130
2022-10-12 09:17:23 -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
dependabot[bot]
f9ccfbc718
Bump ex_doc from 0.28.4 to 0.28.5 (#179)
Bumps [ex_doc](https://github.com/elixir-lang/ex_doc) from 0.28.4 to 0.28.5.
- [Release notes](https://github.com/elixir-lang/ex_doc/releases)
- [Changelog](https://github.com/elixir-lang/ex_doc/blob/v0.28.5/CHANGELOG.md)
- [Commits](https://github.com/elixir-lang/ex_doc/compare/v0.28.4...v0.28.5)

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

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-09-11 22:41:28 -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
066a699ade remove all weird \n stuff 2022-08-18 10:07:36 +01:00
66735c51ba always use tight spacing 2022-08-18 10:04:30 +01:00
dependabot[bot]
21e3c7e3a2
Bump ex_doc from 0.28.3 to 0.28.4 (#178)
Bumps [ex_doc](https://github.com/elixir-lang/ex_doc) from 0.28.3 to 0.28.4.
- [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.3...v0.28.4)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-19 13:15:59 -04:00
Mitchell Hanberg
c8d3f446b0 Remove last remnants of Phoenix 2022-04-20 00:05:27 -04:00
Mitchell Hanberg
016e761346 Remove comment from README 2022-04-20 00:03:38 -04:00
Mitchell Hanberg
79fb98a722 Remove phx generator templates 2022-04-20 00:00:11 -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
ec484bcef6
Delete FUNDING.yml 2021-11-22 10:03:06 -05:00
dependabot[bot]
d8a19a20cc
Bump phoenix_live_view from 0.16.1 to 0.17.5 (#158)
Bumps [phoenix_live_view](https://github.com/phoenixframework/phoenix_live_view) from 0.16.1 to 0.17.5.
- [Release notes](https://github.com/phoenixframework/phoenix_live_view/releases)
- [Changelog](https://github.com/phoenixframework/phoenix_live_view/blob/master/CHANGELOG.md)
- [Commits](https://github.com/phoenixframework/phoenix_live_view/compare/v0.16.1...v0.17.5)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-22 08:54:13 -05:00
Mitchell Hanberg
9b4dc26a5d Update elixir/erlang versions in CI workflow 2021-08-29 18:17:55 -04:00
Mitchell Hanberg
c6d29e592b Bump v0.8.0 2021-08-29 18:11:24 -04:00
Mitchell Hanberg
c965048f40
Better whitespace handling and control (#145)
* Fine tune whitespace

The EEx outut now emits more human-readable and predictable formatting.
This includes proper indenting, at least for each "root" template.

* Internal whitespace control

You can now use a bang version of any nonvoid tag to emit the markup
witout the internal whitespace. This means that there will not be a
newline emitted after the opening tag and before the closing tag.
2021-08-29 17:45:07 -04:00
Mitchell Hanberg
87ddbaa6b5
Update README.md 2021-07-26 22:22:08 -04:00
Mitchell Hanberg
0715a514c5 Bump v0.7.0 2021-06-27 12:05:45 -04:00
Mitchell Hanberg
d9f00e5147
Class object syntax (#140)
* Class object syntax

Allows for conditionally setting classes on an element.

* Docs for class bindings
2021-06-27 12:04:19 -04:00
Mitchell Hanberg
9d05f74cdf
Properly emit boolean attributes (#139)
* Update some docs

* Properly emit boolean attributes.

* Account for quoted literals when compiling attributes

* Update changelog
2021-06-26 21:47:21 -04:00
Mitchell Hanberg
d307fe35de
Update dependabot.yml 2021-06-15 14:11:10 -04:00
dependabot-preview[bot]
68a1d5fdac
Upgrade to GitHub-native Dependabot (#123)
Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-06-15 14:10:26 -04:00
dependabot-preview[bot]
f79464dcde
Bump phoenix_live_view from 0.13.3 to 0.15.7 (#131)
Bumps [phoenix_live_view](https://github.com/phoenixframework/phoenix_live_view) from 0.13.3 to 0.15.7.
- [Release notes](https://github.com/phoenixframework/phoenix_live_view/releases)
- [Changelog](https://github.com/phoenixframework/phoenix_live_view/blob/v0.15.7/CHANGELOG.md)
- [Commits](https://github.com/phoenixframework/phoenix_live_view/compare/v0.13.3...v0.15.7)

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

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-06-15 14:08:06 -04:00
Mitchell Hanberg
fb5f0a99f4 Bump v0.6.2 2021-06-03 23:14:58 -04:00
Mitchell Hanberg
540692f7cd Void elements can be compiled with no attrs 2021-06-03 23:13:06 -04:00
Mitchell Hanberg
49ebe8c603 update readme 2021-05-26 10:11:08 -04:00