gen_template_phx_live_view v0.1.0 Mix.Gen.Template.PhxLiveView

PhxLiveView

A Phoenix Live View Kickstarter. Basically a fresh Phoenix project without ecto and with live view fully setup.

Prerequisites

You'll need to install the mix_templates and mix_generator packages by Dave Thomas

mix archive.install hex mix_templates
mix archive.install hex mix_generator

Install

Install this template:

mix template.install gen_template_phx_live_view

Usage

Then create your project:

mix gen phx_live_view MyAwesomeLiveViewProject

After this cd into the project directory and:

mix deps.get
cd assets && yarn

Fire it up

mix phx.server

There is an example clock on the homepage that is implemented in lib/your_project_web/live/clock.ex

Link to this section Summary

Functions

Return the name or path of a template that this template is based upon. That template will be processed first, and then this one will be executed

Override this function to do any cleanup after your template has been copied into the user project. One use of this is to remove unwanted files created by a template upon which this template is based

Return the name of this template as an atom. This is the name passed to the gen command

Return the list of options supported by this template

Return the short description of this template, or nil

Return the absolute path to the tree that is to be copied when instantiating this template. This top-level dir will typically just contain a directory called $APP_NAME$

Link to this section Functions

Return the name or path of a template that this template is based upon. That template will be processed first, and then this one will be executed.

Link to this function

clean_up(assigns)

Override this function to do any cleanup after your template has been copied into the user project. One use of this is to remove unwanted files created by a template upon which this template is based.

Return the name of this template as an atom. This is the name passed to the gen command.

Return the list of options supported by this template.

Return the short description of this template, or nil.

Return the absolute path to the tree that is to be copied when instantiating this template. This top-level dir will typically just contain a directory called $APP_NAME$.