Skip to content

Commit 5633140

Browse files
committed
add documentation
1 parent 038cde4 commit 5633140

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

docs/CUSTOM-TEMPLATES.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22

33
With this library you can create your own templates and use them to generate your components in a second!
44

5+
`create-component-app` offers 4 replacement keys which can be used in the names of the files in your template, as well as within the templates themselves. Each key corresponds to a formatted transformation of the component name that you enter when running `create-component-app`.
6+
7+
#### Keys and Replacements
8+
Replacement Key | Description
9+
--- | ---
10+
`COMPONENT_NAME` | Each instance of the string is replaced with the component name that you entered without modification. This is the standard behavior. (eg: `MyComponent` => `MyComponent` and replaces all instances of `COMPONENT_NAME` in files and file names.)
11+
`COMPONENT_CAP_NAME` | Each instance of the string is replaced with an uppercased transformation of the component name that you entered. (eg: `MyComponent` => `MYCOMPONENTNAME` and replaces all instances of `COMPONENT_CAP_NAME` in files and file names.)
12+
`component_name` | Each instance of the string is replaced with a lowercased transformation of the component name that you entered. (eg: `MyComponent` => `mycomponentname` and replaces all instances of `component_name` in files and file names.)
13+
`cOMPONENT_NAME` | Each instance of the string is replaced with a lower camel case transformation of the component name that you entered. For clarity, the first letter is simply lowercased. (eg: `MyComponent` => `myComponent` and replaces all instances of `cOMPONENT_NAME` in files and file names.)
14+
15+
516
### 1) Create your custom template folder
617

718
Create a folder to contain all your custom templates.

0 commit comments

Comments
 (0)