Bot releases are visible (Hide)
Published by mhanberg over 1 year ago
Full Changelog: https://github.com/mhanberg/temple/compare/v0.10.0...v0.11.0
Published by mhanberg about 2 years ago
Full Changelog: https://github.com/mhanberg/temple/compare/v0.9.0...v0.10.0
Published by mhanberg about 2 years ago
Full Changelog: https://github.com/mhanberg/temple/compare/v0.8.0...v0.9.0
Published by mhanberg over 2 years ago
do/end
or :do
syntax. The :do
syntax will render "tight" markup.c &my_component/1
.
render/1
macro for defining a component. Now all you need to do is define a function and have it take an assigns
parameter and call the temple/1
macro that is imported from Temple
.defcomp
macro has been removed, since now all you need is a function.EEx.SmartEngine
.Please see the guides for more in depth migration information.
Published by mhanberg about 3 years ago
Better whitespace handling and control (#145)
The EEx outut now emits more human-readable and predictable formatting.
This includes proper indenting, at least for each "root" template.
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.
Published by mhanberg over 3 years ago
Published by mhanberg over 3 years ago
Published by mhanberg over 3 years ago
Published by mhanberg over 3 years ago
Temple now is written to be fully compatible with Phoenix LiveView! This comes with substantial internal changes as well as a better component API.
Temple now outputs LiveView compatible EEx at compile time, which is fed right into the normal LiveView EEx engine (or the traditional HTML Engine if you are not using LiveView).
Temple now has a more complete component API.
Components work with anywhere, whether you are writing a little plug app, a vanilla Phoenix app, or a Phoenix LiveView app!
Please see the documenation for more information.
To migrate component from the 0.5.0 syntax to the 0.6.0 syntax, you can use the following as a guide
# 0.5.0
# definition
defmodule PageView do
defcomponent :flex do
div id: @id, class: "flex" do
@children
end
end
end
# usage
require PageView
# or
import PageView
temple do
PageView.flex id: "my-flex" do
div "Item 1"
div "Item 2"
div "Item 3"
end
# with import
flex id: "my-flex" do
div "Item 1"
div "Item 2"
div "Item 3"
end
end
to
# 0.6.0
# definition
defmodule Flex do
import Temple.Component
render do
div id: @id, class: "flex" do
slot :default
end
end
end
# usage
temple do
c Flex id: "my-flex" do
div do: "Item 1"
div do: "Item 2"
div do: "Item 3"
end
end
0.6.0 has been a year in the making and a lot has changed in that time (in many cases, several times over), and I honestly can't really remember everything that is different now, but I will list some things here that I think you'll need to change or look out for.
partial
macro is removed.
render
function like you normally would to render a phoenix partial.defcomponent
macro is removed.
text
macro is now removed.
span do: "foobar"
instead of span "foobar"
.:compact
reserved keyword option was removed.Phoenix.HTML
are removed as they are no longer needed.temple.convert
task has been removed, but I am working to bring it back.There might be some more, so if you run into any problems, please open a GitHub Discussion.
Published by mhanberg over 3 years ago
@inner_content
is removed in favor of invoking the default slot.compact
reserved keyword for elements has been removed. This is not really intentional, just a side effect of getting slots to a usable place. I expect to add it back, or at least similar functionality in the future.