Skip to content

Releases: mihaiconstantin/obsidian-templater-scripts

v2.5.0

04 Jun 18:15
09d1121
Compare
Choose a tag to compare

What's Changed

Added

  • Update the check and process function signature to (value, tp, config) => { ... }. The value argument is the value of the configuration element, the tp argument is the Templater object, and the config argument is the configuration object. This change allows the check and process functions to access the Templater object and the configuration object. This is useful for performing custom checks and processing that depend on the configuration object (e.g., disabling the configuration prompt after a processing step).

Full Changelog: v2.4.0...v2.5.0

v2.4.0

03 Jun 11:26
f6f6aca
Compare
Choose a tag to compare

What's Changed

Changed

  • Add a workaround to ensure the text prompt input is focused by default on mobile. This will likely be removed when SilentVoid13/Templater#1120 is resolved.
  • Update value processing functionality to only show the subsequent modal with the processed value only if the prompt was requested in the first place.

Full Changelog: v2.3.0...v2.4.0

v2.3.0

31 May 20:58
7cb461b
Compare
Choose a tag to compare

What's Changed

Added

  • Add user script makeNote that creates a new note from a template without prompting the user for input. This user script is useful when the template variables are known in advance and can be specified in the configuration object. The script correctly handles the file placement in the vault based on the path and filename configuration elements.

Full Changelog: v2.2.0...v2.3.0

v2.2.0

31 May 20:21
1dd4624
Compare
Choose a tag to compare

What's Changed

Added

  • Add support for setting the value to a function that returns a string or an array of strings. The function must be specified with two arguments that are automatically passed at the prompting stage. The first argument is the Templater, and the second argument represents the configuration object.
  • Add functionality to handle multiple references in the value property of a configuration element. This is useful when the value of a configuration element is composed of multiple references (e.g., {{title}} {{date}}).
  • Add documentation for the prompt user script.
  • Add standalone prompt user script to perform automatic prompting based on a configuration object.

Changed

Full Changelog: v2.1.0...v2.2.0

v2.1.0

30 May 11:16
2abde10
Compare
Choose a tag to compare

What's Changed

Added

  • Update the value processing functionality to display a user modal indicating that the value is being processed. This is useful for long-running value processing functions (e.g., fetching data from an external API). The modal is closed once the value processing function completes. After the model is closed, the user is presented with a prompt where the processed value can be further edited before being inserted into the template.

Fixed

  • Revert previous change and wrapped documentation of makeNoteWithPrompting with <!-- {% raw %} --> and <!-- {% endraw %} --> tags. This allows the documentation to be rendered properly on the GitHub Pages website and on GitHub.
  • Fixed the {{ ... }} not being escaped on the GitHub Pages website. This caused the {{ ... }} to be interpreted as a Jekyll tag and not rendered properly. Unfortunately, references of {{ ... }} on GitHub now include a \ as \{{ ... }}.

Full Changelog: v2.0.0...v2.1.0

v2.0.0

29 May 22:22
51ee4b6
Compare
Choose a tag to compare

What's Changed

Added

  • Add support for both inserting the template in the currently open note and creating a new note from the template for the makeNoteWithPrompting user script. This behavior is controlled via the the Templater invocation (i.e., the commands Templater: Create new note from template and Templater: Open insert Template modal).
  • Add functionality for running arbitrary functions on the value property of the configuration elements. This can be useful for performing custom processing on the user input before it is inserted into the template. The function is specified via the process property of the configuration element. The function is passed the value property of the configuration element and should return a string

Changed

Full Changelog: v1.4.0...v2.0.0

v1.4.0

26 May 21:14
206b8da
Compare
Choose a tag to compare

What's Changed

  • Allow custom checks for validating the content of the value property by @mihaiconstantin in #8

Added

  • Added support for custom checks via the check property in config elements. This property allows specifying a function that is executed after the prompt is submitted to validate the user's input (i.e., the contents of the value property). An error is thrown if the function returns false. This can be useful for enforcing constraints on the prompt input, such as requiring a certain format or disallowing certain values.

Full Changelog: v1.3.0...v1.4.0

v1.3.0

26 May 13:33
0f10733
Compare
Choose a tag to compare

What's Changed

Added

  • Update createNoteWithPrompting user script to return the TFile object of the newly created note. This can be handy for further processing of the note in the script.

Full Changelog: v1.2.0...v1.3.0

v1.2.0

26 May 12:38
14e0b84
Compare
Choose a tag to compare

What's Changed

Added

  • Update _config.yml to remove default repository name <h1/> heading in favor of custom heading.
  • Enable GitHub pages and add Jeykll configuration file.

Full Changelog: v1.1.0...v1.2.0

v1.1.0

25 May 21:17
92875a5
Compare
Choose a tag to compare

What's Changed

Added

  • Extend referencing functionality to allow mixing the {{ and }} syntax with regular text. For example, in the configuration before {{ filename }} after, the {{ filename }} part will be replaced in place, and the before and after strings will be maintained.

Full Changelog: v1.0.0...v1.1.0