Skip to content

kitta65/lkmlfmt-djhtml

Repository files navigation

lkmlfmt-djhtml

A plugin for lkmlfmt.

Installation

pip install lkmlfmt lkmlfmt-djhtml

CLI

lkmlfmt --plugin lkmlfmt_djhtml [FILE]...

API

from lkmlfmt import fmt

lkml = fmt("""\
view: view_name {
  dimension: column_name {
    html:
{% if value == "foo" %}
<img src="https://example.com/foo"/>
{% else %}
<img src="https://example.com/bar"/>
{% endif %} ;;
  }
}
""", plugins=["lkmlfmt_djhtml"])

assert lkml == """\
view: view_name {
  dimension: column_name {
    html:
      {% if value == "foo" %}
        <img src="https://example.com/foo"/>
      {% else %}
        <img src="https://example.com/bar"/>
      {% endif %}
    ;;
  }
}
"""

About

a plugin for lkmlfmt

Resources

License

Stars

Watchers

Forks

Packages

No packages published