A Phoenix.LiveView.HTMLFormatter.TagFormatter implementation that formats
the contents of <script> and <style> tags with Biomine.
This is useful for formatting colocated
hooks
and colocated
CSS
embedded in .heex templates and ~H sigils.
Setup
Add it as a :tag_formatters entry alongside Phoenix.LiveView.HTMLFormatter
in your .formatter.exs file:
[
plugins: [Phoenix.LiveView.HTMLFormatter],
tag_formatters: %{script: Biomine.LiveView.TagFormatter, style: Biomine.LiveView.TagFormatter},
inputs: [
"{mix,.formatter}.exs",
"{config,lib,test}/**/*.{ex,exs,heex}"
]
]Formatter options can be passed under biomine: [js: ..., css: ...], same
as Biomine.Mix.JsFormatter and Biomine.Mix.CssFormatter:
[
plugins: [Phoenix.LiveView.HTMLFormatter],
tag_formatters: %{script: Biomine.LiveView.TagFormatter, style: Biomine.LiveView.TagFormatter},
biomine: [
js: [quote_style: :single, semicolons: :as_needed],
css: [quote_style: :single]
],
inputs: [
"{mix,.formatter}.exs",
"{config,lib,test}/**/*.{ex,exs,heex}"
]
]