You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can set a `Template folder location` to tell [Templater](https://github.com/SilentVoid13/Templater) to only check this folder for templates.
3
+
## General Settings
4
4
5
-
You can set a timeout for your system commands with the `Timeout` option. A system command that takes longer than what you defined will be canceled and considered as a failure.
5
+
-`Template folder location`: Files in this folder will be available as templates.
6
+
-`Syntax Highlighting on Desktop` adds syntax highlighting for [Templater](https://github.com/SilentVoid13/Templater) commands in edit mode.
7
+
-`Syntax Highlighting on Mobile` adds syntax highlighting for [Templater](https://github.com/SilentVoid13/Templater) commands in edit mode on mobile. Use with caution: this may break live preview on mobile platforms."
8
+
-`Automatic jump to cursor` automatically triggers `tp.file.cursor` after inserting a template. You can also set a hotkey to manually trigger `tp.file.cursor`.
9
+
-`Trigger Templater on new file creation`: [Templater](https://github.com/SilentVoid13/Templater) will listen for the new file creation event, and, if it matches a rule you've set, replace every command it finds in the new file's content. This makes [Templater](https://github.com/SilentVoid13/Templater) compatible with other plugins like the Daily note core plugin, Calendar plugin, Review plugin, Note refactor plugin, etc.
10
+
- Make sure to set up rules under either Folder Templates or File Regex Template below.
11
+
-**Warning:** This can be dangerous if you create new files with unknown / unsafe content on creation. Make sure that every new file's content is safe on creation."
12
+
-`Show icon in sidebar`: Show [Templater](https://github.com/SilentVoid13/Templater) icon in sidebar ribbon, allowing you to quickly use templates anywhere.
6
13
7
-
You can set [Templater](https://github.com/SilentVoid13/Templater) to be triggered on new file creation. It will listen for the new file creation event and replace every command it finds in the new file's content.
14
+
## Template Hotkeys
8
15
9
-
This makes Templater compatible with other plugins like the Daily note core plugin, Calendar plugin, Review plugin, Note refactor plugin, ...
16
+
Template Hotkeys allows you to bind a template to a hotkey.
10
17
11
-
## Security Warning
18
+
## Folder Templates
12
19
13
-
It can be dangerous if you create new files with unknown / unsafe content on creation. Make sure that every new file's content is safe on creation.
20
+
**Note**: This setting is hidden by default. To view it first enable the `Trigger Template on new file creation` setting. And since it's mutually exclusive with File Regex Templates, enabling one will disable the other.
14
21
15
-
## Folder Templates
22
+
You can specify a template that will automatically be used on a selected folder and children using the `Folder Templates` functionality. The deepest match will be used, so the order of the rules is irrelevant.
23
+
24
+
Add a rule for "`/`" if you need a catch-all.
25
+
26
+
## File Regex Templates
27
+
28
+
**Note**: This setting is hidden by default. To view it first enable the `Trigger Template on new file creation` setting. And since it's mutually exclusive with Folder Templates, enabling one will disable the other.
29
+
30
+
You can specify regex declarations that a new file's path will be tested against. If a regex matches, the associated template will automatically be used. Rules are tested top-to-bottom, and the first match will be used.
31
+
32
+
End with a rule for "`.*`" if you need a catch-all.
33
+
34
+
Use a tool like [Regex101](https://regex101.com/) to verify your regexes.
35
+
36
+
## Startup Templates
37
+
38
+
Startup Templates are templates that will get executed once when Templater starts.
39
+
40
+
These templates won't output anything.
41
+
42
+
This can be useful to set up templates adding hooks to obsidian events for example.
43
+
44
+
## User Script Functions
45
+
46
+
All JavaScript files in this folder will be loaded as CommonJS modules, to import custom [user functions](./user-functions/overview.md).
16
47
17
-
You can specify a template that will automatically be used on a selected folder and children using the `Folder Templates` functionality.
48
+
The folder needs to be accessible from the vault.
18
49
19
-
**Note**: This setting is hidden by default. To view it first enable the `Trigger Template on new file creation` setting.
50
+
Check the [documentation](./user-functions/script-user-functions.md) for more information.
20
51
21
-
## System Commands
52
+
## User System Command Functions
22
53
23
-
You can enable system commands. This allows you to create [user functions](./user-functions/overview.md) linked to system commands.
54
+
Allows you to create [user functions](./user-functions/overview.md) linked to system commands.
24
55
25
-
### Arbitrary system commands
56
+
Check the [documentation](./user-functions/system-user-functions.md) for more information.
26
57
27
-
It can be dangerous to execute arbitrary system commands from untrusted sources. Only run system commands that you understand, from trusted sources.
58
+
**Warning:**It can be dangerous to execute arbitrary system commands from untrusted sources. Only run system commands that you understand, from trusted sources.
@@ -174,9 +184,12 @@ export class TemplaterSettingTab extends PluginSettingTab {
174
184
add_trigger_on_new_file_creation_setting(): void{
175
185
constdesc=document.createDocumentFragment();
176
186
desc.append(
177
-
"Templater will listen for the new file creation event, and replace every command it finds in the new file's content.",
187
+
"Templater will listen for the new file creation event, and, if it matches a rule you've set, replace every command it finds in the new file's content. ",
188
+
"This makes Templater compatible with other plugins like the Daily note core plugin, Calendar plugin, Review plugin, Note refactor plugin, etc. ",
189
+
desc.createEl("br"),
190
+
desc.createEl("br"),
191
+
"Make sure to set up rules under either Folder Templates or File Regex Template below.",
178
192
desc.createEl("br"),
179
-
"This makes Templater compatible with other plugins like the Daily note core plugin, Calendar plugin, Review plugin, Note refactor plugin, ...",
180
193
desc.createEl("br"),
181
194
desc.createEl("b",{
182
195
text: "Warning: ",
@@ -343,7 +356,7 @@ export class TemplaterSettingTab extends PluginSettingTab {
"When enabled Templater will make use of the folder templates defined below."
359
+
"When enabled, Templater will make use of the folder templates defined below. This option is mutually exclusive with File Regex Templates below, so enabling one will disable the other."
347
360
);
348
361
349
362
newSetting(this.containerEl)
@@ -352,9 +365,12 @@ export class TemplaterSettingTab extends PluginSettingTab {
"When enabled, Templater will make use of the file regex templates defined below. This option is mutually exclusive with Folder Templates above, so enabling one will disable the other."
0 commit comments