Releases: mihaiconstantin/obsidian-templater-scripts
Releases · mihaiconstantin/obsidian-templater-scripts
v2.5.0
What's Changed
- Add
tp
andconfig
arguments tocheck
andprocess
functions by @mihaiconstantin in #17
Added
- Update the
check
andprocess
function signature to(value, tp, config) => { ... }
. Thevalue
argument is the value of the configuration element, thetp
argument is theTemplater
object, and theconfig
argument is the configuration object. This change allows thecheck
andprocess
functions to access theTemplater
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
What's Changed
- Miscellaneous usability improvements by @mihaiconstantin in #16
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
What's Changed
- Add functionality to make notes without prompting by @mihaiconstantin in #15
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 thepath
andfilename
configuration elements.
Full Changelog: v2.2.0...v2.3.0
v2.2.0
What's Changed
- Add standalone script for automated prompting by @mihaiconstantin in #14
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 theTemplater
, 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 thevalue
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
- Update
makeNoteWithPrompting
user script to use the newprompt
user script. - Simplify documentation for
makeNoteWithPrompting
user script.
Full Changelog: v2.1.0...v2.2.0
v2.1.0
What's Changed
- Fix
{{ ... }}
delimiters escaping for GitHub Pages by @mihaiconstantin in #12 - Add processing modal for value processing feedback by @mihaiconstantin in #13
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 aJekyll
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
What's Changed
- Add type checks for optional config elements properties by @mihaiconstantin in #9
- Add value processing and template inserting by @mihaiconstantin in #10
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 theTemplater
invocation (i.e., the commandsTemplater: Create new note from template
andTemplater: 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 theprocess
property of the configuration element. The function is passed thevalue
property of the configuration element and should return a string
Changed
- Rename
createNoteWithPrompting
tomakeNoteWithPrompting
. This is a breaking change for users of thecreateNoteWithPrompting
user script. - Improve documentation for
makeNoteWithPrompting
user script. - Refactor code for
makeNoteWithPrompting
to improve readability and maintainability.
Full Changelog: v1.4.0...v2.0.0
v1.4.0
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 thevalue
property). An error is thrown if the function returnsfalse
. 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
What's Changed
- Add
TFile
return forcreateNoteWithPrompting
by @mihaiconstantin in #7
Added
- Update
createNoteWithPrompting
user script to return theTFile
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
What's Changed
- Add
Jeykll
config file for documentation website by @mihaiconstantin in #4 - Update title format in documentation files by @mihaiconstantin in #5
- Fix line break in website title by @mihaiconstantin in #6
Added
- Update
_config.yml
to remove default repository name<h1/>
heading in favor of custom heading. - Enable
GitHub
pages and addJeykll
configuration file.
Full Changelog: v1.1.0...v1.2.0
v1.1.0
What's Changed
- Allow mixing references with regular text by @mihaiconstantin in #3
Added
- Extend referencing functionality to allow mixing the
{{
and}}
syntax with regular text. For example, in the configurationbefore {{ filename }} after
, the{{ filename }}
part will be replaced in place, and thebefore
andafter
strings will be maintained.
Full Changelog: v1.0.0...v1.1.0