From e299e34960cd8968f7a8a9914e47ea83ed9218c2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= <essen@ninenines.eu>
Date: Thu, 21 Nov 2024 15:55:37 +0100
Subject: Move templates outside the source .mk files

Templates now no longer use Make variables for substitution
but instead replace strings with their equivalent:

  template_name: Corresponds to n=template_name
  project_name:  Corresponds to $(PROJECT) or in=project_name

This allows defining templates outside of Makefiles. For
example an external plugin could define their templates
in templates/my_template.erl and then have the following
in the included Makefile:

  tpl_my_template = $(file < $(THIS)/templates/my_template.erl)

By default the created file will be in src/template_name.erl.
This can be overriden with the tplp_* variable:

  tplp_my_template = src/model/my_template.erl

Substitution is applied both to the template contents and
to its path.

In addition, attempting to overwrite an existing file when
creating a template will result in failure.
---
 doc/src/guide/getting_started.asciidoc | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

(limited to 'doc/src/guide/getting_started.asciidoc')

diff --git a/doc/src/guide/getting_started.asciidoc b/doc/src/guide/getting_started.asciidoc
index 5f782ca..c1e7589 100644
--- a/doc/src/guide/getting_started.asciidoc
+++ b/doc/src/guide/getting_started.asciidoc
@@ -271,8 +271,20 @@ You can list all available templates with the `list-templates`
 target:
 
 [source,bash]
+----
 $ make list-templates
-Available templates: cowboy_http cowboy_loop cowboy_rest cowboy_ws gen_fsm gen_server gen_statem ranch_protocol supervisor
+Available templates:
+    cowboy_http_h
+    cowboy_loop_h
+    cowboy_rest_h
+    cowboy_websocket_h
+    gen_fsm
+    gen_server
+    gen_statem
+    module
+    ranch_protocol
+    supervisor
+----
 
 To generate a module, let's say a `gen_server`, all you need to
 do is to call `make new` with the appropriate arguments:
-- 
cgit v1.2.3

