Replies: 3 comments 8 replies
-
I would be grateful if I could be given the opportunity to open a pull request. |
Beta Was this translation helpful? Give feedback.
-
This is not correct. The source state is computed from the source directory, but they are not the same thing. Please read the section on concepts. |
Beta Was this translation helpful? Give feedback.
-
I plan to do changes like this: From
|
Fields | Usage |
---|---|
filename | The file name you wish to use to include. |
data | Optional, data to pass to the template. |
includeTemplate
returns the result of executing the contents of filename with the optional data. Relative paths are first searched for in .chezmoitemplates
and, if not found, are interpreted relative to the source directory.
EDIT: Is the word path
better than filename
? since it can be a relative path.
Just example, trying to make it easier to understand.
Also, I think we should move some contents like Usage and Syntax from User guide
to Reference
, like this:
From
.chezmoiroot
If a file called .chezmoiroot exists in the root of the source directory then the source state is read from the directory specified in .chezmoiroot interpreted as a relative path to the source directory. .chezmoiroot is read before all other files in the source directory.
To
.chezmoiroot
file
Should be placed in the root of the source directory.
If this file exists, then the source state is read from the directory specified in this file, and interpreted as a relative path to the source directory. .chezmoiroot is read before all other files in the source directory.
*Placeholder for examples and explains, like Advanced/Customize your source directory*
Meanwhile, remove the section Use a subdirectory of your dotfiles repo as the root of the source state
from Advanced/Customize your source directory
It may be not necessary, but if possible, write a page to explain words like source directory
working tree
source state
to avoid confusion.
Beta Was this translation helpful? Give feedback.
-
Bad
Okay
The phrase
source state
may be replaced withsource directory
, just as the variablesourceDir
in configuration file.My solution example:
.chezmoi.$FORMAT.tmpl
This file should be placed in the source directory.
This file will be used by
chezmoi init
to create an initial config file. $FORMAT must be one of the supported config file formats, e.g. json, jsonc, toml, or yaml. Templates defined in .chezmoitemplates are not available because the template is executed before the source state is read.Beta Was this translation helpful? Give feedback.
All reactions