ex_unpoly
A Plug adapter and helpers for Unpoly, the unobtrusive JavaScript framework.
Built by
The Webstronauts, go-to agency for challenging ideas and ambitious organisations.
Installation
To use Unpoly, you can add it to your application's dependencies.
def deps do [ {:unpoly, "~> 3.0"} ] end
Usage
You can use the plug within your pipeline.
defmodule MyApp.Endpoint do plug Logger plug Unpoly plug MyApp.Router end
Phoenix Components
If you're using Phoenix Components (HEEx templates), you'll need to configure the global attribute prefixes to allow up- attributes on HTML elements. Add the following to your lib/my_app_web.ex file:
def html do quote do use Phoenix.Component, global_prefixes: ~w(up-) # ... rest of your configuration end end
This tells Phoenix.Component to accept attributes with the up- prefix (like up-target, up-layer, etc.) in your function components. See the Phoenix.Component documentation for more details.
To find out more, head to the online documentation.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Clone the repository and run mix test. To generate docs, run mix docs.
Credits
As it's just a simple port of Ruby to Elixir. All credits should go to the Unpoly team and their unpoly library.
License
The MIT License (MIT). Please see License File for more information.