Current section
14 Versions
Jump to
Current section
14 Versions
Compare versions
4
files changed
+8
additions
-5
deletions
| @@ -21,7 +21,7 @@ A PoC for single-file components for [Phoenix](https://www.phoenixframework.org) | |
| 21 21 | ```elixir |
| 22 22 | def deps do |
| 23 23 | [ |
| 24 | - {:svx, "~> 0.1.0"} |
| 24 | + {:svx, "~> 0.1.4"} |
| 25 25 | ] |
| 26 26 | end |
| 27 27 | ``` |
| @@ -26,4 +26,4 @@ | |
| 26 26 | {<<"optional">>,false}, |
| 27 27 | {<<"repository">>,<<"hexpm">>}, |
| 28 28 | {<<"requirement">>,<<"~> 0.17.5">>}]]}. |
| 29 | - {<<"version">>,<<"0.1.3">>}. |
| 29 | + {<<"version">>,<<"0.1.4">>}. |
| @@ -47,10 +47,13 @@ defmodule Svx.Compiler do | |
| 47 47 | #{parsed.module} |
| 48 48 | |
| 49 49 | def render(assigns) do |
| 50 | - ~H\"#{parsed.content}\" |
| 50 | + ~H\"\"\" |
| 51 | + #{parsed.content} |
| 52 | + \"\"\" |
| 51 53 | end |
| 52 54 | end |
| 53 55 | """ |
| 56 | + IO.puts(module) |
| 54 57 | Code.compile_string(module, template_with_path) |
| 55 58 | {module_name, parsed} |
| 56 59 | end |
| @@ -163,7 +166,7 @@ defmodule Svx.Compiler do | |
| 163 166 | end |
| 164 167 | |
| 165 168 | defp is_module_tag?(attrs) do |
| 166 | - Enum.find(attrs, fn {key, {_, value, _}} -> key == "type" and value == "elixir" end) != nil |
| 169 | + Enum.find(attrs, fn {key, {_, value, _}} -> key == "language" and value == "elixir" end) != nil |
| 167 170 | end |
| 168 171 | |
| 169 172 | defp to_content(lst) when is_list(lst), |
| @@ -5,7 +5,7 @@ defmodule Svx.MixProject do | |
| 5 5 | [ |
| 6 6 | app: :svx, |
| 7 7 | name: "Svx", |
| 8 | - version: "0.1.3", |
| 8 | + version: "0.1.4", |
| 9 9 | description: "A PoC for single-file components for Phoenix LiveView", |
| 10 10 | elixir: "~> 1.12", |
| 11 11 | start_permanent: Mix.env() == :prod, |