Skip to main content

Elm filter for webassets

Project description

Travis CI Covearge Status Latest release Python versions License

Elm filter for webassets

Filter for compiling Elm files using webassets.

Install

pip install webassets-elm

As of version 0.2.0, this plugin requires Elm 0.19 or newer (building with elm make).

If you need to build your Elm project with elm-make (Elm 0.18 and older), you can pin your webassets-elm package to version 0.1.7.

Basic usage

from webassets.filter import register_filter
from webassets_elm import Elm

register_filter(Elm)

Settings

Optionally as an evironment variable you can have:

  • ELM_BIN: alternative path to elm if it is not available globally (e.g. node_modules/.bin/elm).

  • ELM_OPTIMIZE: enable the Elm compiler optimization option. Recommended for production output.

  • ELM_DEBUG: enable the Elm compiler debug option.

Examples

Flask with flask-assets
from flask import Flask
from flask_assets import Bundle, Environment
from webassets.filter import register_filter
from webassets_elm import Elm

app = Flask(__name__)

register_filter(Elm)
assets = Environment(app)

elm_js = Bundle('elm/main.elm', filters=('elm',), output='app.js')
assets.register('elm_js', elm_js)
Django with django-assets
from django_assets import Bundle, register
from webassets.filter import register_filter
from webassets_elm import Elm

register_filter(Elm)

elm_js = Bundle('elm/main.elm', filters=('elm',), output='app.js')
register('elm_js', elm_js)

Contributing

Feel free to report an issue, open a pull request, or drop a line.

Don’t forget to write and run tests, and format code with Black:

python setup.py test
black .

Please note you need elm binary available to run tests, here you can find different ways to install Elm.

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

webassets-elm-0.2.0.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

webassets_elm-0.2.0-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file webassets-elm-0.2.0.tar.gz.

File metadata

  • Download URL: webassets-elm-0.2.0.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for webassets-elm-0.2.0.tar.gz
Algorithm Hash digest
SHA256 43e4daaa8520f950fce591e2d6c76603f2f7862d20a1a8bbf113b952dd9a82c0
MD5 21d56869b1b3d5a56e3a10b84aed6708
BLAKE2b-256 4366b8ec247d675a17fe3f05b91ee9db9626f6f94e04a7ff72ac873e608d3aa3

See more details on using hashes here.

File details

Details for the file webassets_elm-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: webassets_elm-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 3.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for webassets_elm-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8a0eb5905549a5718904d6bb57ca23beb63d4f6b3022961438b6c9553dbe3cf6
MD5 96bdcef0d335efd42c4d4ccb0b403281
BLAKE2b-256 1c560e7d65436b4b3c5cb3eda910f5a05a2d86655cc516e50862755b2250e071

See more details on using hashes here.

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