Skip to main content

a plugin for lkmlfmt

Project description

lkmlfmt-djhtml

A plugin for lkmlfmt.

Installation

pip install lkmlfmt lkmlfmt-djhtml

CLI

lkmlfmt --plugin lkmlfmt_djhtml

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 %}
    ;;
  }
}
"""

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lkmlfmt_djhtml-0.0.1.tar.gz (14.7 kB view hashes)

Uploaded Source

Built Distribution

lkmlfmt_djhtml-0.0.1-py3-none-any.whl (15.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page