Skip to content

Is new note creation triggered when plugin calls app.vault.create? #1262

Answered by Zachatoo
farling42 asked this question in Help
Discussion options

You must be logged in to vote

Here's the pseudocode logic for how Templater decides whether or not to execute when a new file is created.

  1. Trigger Templater on new file creation must be turned on.
  2. Templater listens to the app.vault.on("create") event, then checks a few conditions (must meet all of the following conditions):
    1. Must be a markdown file.
    2. Must not be in the templates folder.
    3. The file must meet one of the following conditions:
      1. Must be empty on creation and folder templates setup for the folder the file was created in.
      2. The file's contents must be smaller than 100000 (see #873).

Hopefully that helps. Let me know if you need any more guidance.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@farling42
Comment options

Answer selected by farling42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants