Skip to content

Commit

Permalink
Improve docs for generated views
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Feb 7, 2024
1 parent 94854ee commit ab3351a
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
9 changes: 9 additions & 0 deletions installer/templates/phx_web/components/layouts.ex
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
defmodule <%= @web_namespace %>.Layouts do
@moduledoc """
This module holds different layouts used by your application.
See the `layouts` directory for all templates available.
The "root" layout is a skeleton rendered as part of the
application router. The "app" layout is set as the default
layout on both `use <%= @web_namespace %>, :controller` and
`use <%= @web_namespace %>, :live_view`.
"""
use <%= @web_namespace %>, :html

embed_templates "layouts/*"
Expand Down
5 changes: 5 additions & 0 deletions installer/templates/phx_web/controllers/error_html.ex
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
defmodule <%= @web_namespace %>.ErrorHTML do
@moduledoc """
This module is invoked by your endpoint in case of errors on HTML requests.
See config/config.exs.
"""
use <%= @web_namespace %>, :html

# If you want to customize your error pages,
Expand Down
6 changes: 6 additions & 0 deletions installer/templates/phx_web/controllers/error_json.ex
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
defmodule <%= @web_namespace %>.ErrorJSON do
@moduledoc """
This module is invoked by your endpoint in case of errors on JSON requests.
See config/config.exs.
"""

# If you want to customize a particular status code,
# you may add your own clauses, such as:
#
Expand Down
5 changes: 5 additions & 0 deletions installer/templates/phx_web/controllers/page_html.ex
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
defmodule <%= @web_namespace %>.PageHTML do
@moduledoc """
This module contains pages rendered by PageController.
See the `page_html` directory for all templates available.
"""
use <%= @web_namespace %>, :html

embed_templates "page_html/*"
Expand Down

0 comments on commit ab3351a

Please sign in to comment.