gen_template_dino_live_view v0.2.22 GenTemplateDinoLiveView
Dino LiveView Boilerplate
An opinionated template to create phoenix apps, using live view and tailwind.
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 the gen_template_dino_live_view using the following command:
mix template.install hex gen_template_dino_live_view
Usage
mix gen gen_template_dino_live_view project
Then go to into the project
created and execute the following commands:
cd project
mix deps.get # get elixir dependencies
cd assets
yarn # install assets if you prefer npm just run; npm install
cd - # go back to the project root directory
iex -S mix phx.server # start the server
Troubles during the bootstrap
see issue #1
Please note you can easy remove the Example LiveView:
- lib/
project
_web/live/example.exremove this file
- lib/
project
_web/templates/layout/app.html.eexremove the line with the pattern <%= *Web.Live.Example %>
Remember replace project
with the name of your project
.
If you want self-signed trusted certs (only-locally) use mkcert
- Created: 2019-09-22
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
based_on()
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.
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.
copy_github_action(assigns)
name()
Return the name of this template as an atom. This is the name passed to the gen command.
options()
Return the list of options supported by this template.
short_desc()
Return the short description of this template, or nil.
source_dir()
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$
.