Releases: chrisgurney/obsidian-note-toolbar
v1.16-beta-01
Install the beta via BRAT (instructions).
Improvements 🚀
Improved upon how toolbars are rendered to:
- remove unneeded removal of existing toolbars (reduce flickering, speed up display);
- evaluate Templater/Dataview expressions used in the toolbar before displaying it (#198) ; and
- ensure the toolbar is shown if the view is switched between view modes (i.e., reading ←→ editing)
Help requested
Please give this beta a try (via BRAT) and let me know how your experience goes when:
- switching between notes with different toolbars;
- switching view modes; and/or
- trying out expressions (Dataview or Templater) in labels.
Thank you!
v1.15.4
Fixes
- Reduced the flickering that occurs if using Templater expressions in toolbar labels: The toolbar still blinks on render, but the effect should be reduced since the expression isn't displayed before being replaced. #198
Full Changelog: 1.15.3...1.15.4
v1.15.3
Fixes
- Fixed issue where notification was showing if Note Toolbar property referenced toolbar that didn't exist, but other properties on the same note were edited. Now it should only show when the Note Toolbar property is modified. #194 Thanks @laktiv
Full Changelog: 1.15.2...1.15.3
v1.15.2
Changes
Temporarily disabled showing the notice if the note toolbar property is not recognized, while I investigate a fix for #194 . Thanks @laktiv
Full Changelog: 1.15.0...1.15.2
v1.15.0
What's new in Note Toolbar v1.15?
New Feature: Scripting 🎉
Note Toolbar can now execute Dataview, JavaScript (via JS Engine), and Templater queries, expressions, and scripts from Note Toolbar buttons.
What's supported?
If these plugins are installed and enabled you can:
- Dataview → Run queries, evaluate expressions, and execute scripts (like
dv.view
). Learn more - JS Engine → Execute JavaScript. Learn more
- Templater → Insert templates, create new notes from templates, execute commands (including running user scripts), and execute template files. Learn more
If any of these return a value, they're output to the cursor position, or optionally to a note-toolbar-output
callout that you provide an ID for.
You can also use Dataview expressions and Templater commands in labels, tooltips, and URIs:
Note Toolbar Callouts + Scripting
You can share toolbars that include script items as links, and export/import to/from Note Toolbar Callouts.
Script items can also be used directly from Note Toolbar Callouts. See below for some examples; copy some toolbars with script items as callouts to see more attributes/examples.
> [!note-toolbar|right-mnbrder] Script Nav
> - [Create from Template]()<data data-templater-obsidian="createFrom" data-src="Templater/Basic Template.md" data-dest="<%"Basic " + tp.file.last_modified_date("yyyy-MM-dd")%>"/>
> - [Dataview Query Example]()<data data-dataview="query" data-expr="TABLE file.mtime AS "Last Modified" FROM "Templater" SORT file.mtime DESC" data-callout="asf"/>
> - [Hello World with JS Engine]()<data data-js-engine="exec" data-src="Scripts/JsEngine/HelloWorld.js"/>
Learn more 📖
Feedback wanted 💬
I would really appreciate your questions or feedback about scripting in this discussion thread, or using this Google feedback form ↗.
- Do your existing scripts work as expected? (If not, what changes did you have to make?)
- Does configuration make sense? (Should I add or change anything?)
- Try out the Note Toolbar Script components for output, and let me know what you think.
- Does the documentation and help text make sense? (Should I add or change anything?)
Thank you!
Improvements 🚀
- In a Note Toolbar property, if you've entered the name of a toolbar that doesn't exist, a message now appears with a prompt to click/tap on it to create the toolbar.
- Quick Tools: Added a scroll icon for JS + Dataview items, and the Templater icon for Templater items.
- All commands now show a notice if there's an error executing it, if the command provides an error.
- Note Toolbar Callouts: Data attributes in callouts no longer require the
ntb-
portion of the attribute name, though they're still supported in everything but the above new attributes for backwards compatibility. - Settings: The Style drop-downs now only show relevant styles based on other selected styles, and the toolbar's position. Also removed
float
styles, which don't work with standard toolbars. Thanks @laktiv for the suggestion! - Settings: Added a placeholder in the Style dropdown when nothing's selected to make it clearer what action the user should take with it; made the dropdown wider to accommodate localization of that text.
- Settings: Moved field help text closer to fields.
- Translations have been updated, thanks to @hartimd and @laktiv!
Fixes
- Settings: Item preview labels were disappearing when an icon was set, when there was no previous icon.
- Some commands existed but appeared unavailable. #170 Thanks @likemuuxi and @Moyf!
- Iconize icons in bookmarks had a thicker stroke width. #162 Thanks @laktiv!
- Editing a toolbar with no name set an incorrect modal title.
- If the button style was set for mobile, it was also applying to desktop as well, when it shouldn't have been.
In case you missed it...
v1.14 release: Share toolbars, and import/export as callouts
v1.13 release: What's New + Help windows, and access to toolbars for linked notes from file menus.
v1.12 release: Translations, and Quick Tools (fast access to all of your tools).
Full Changelog: 1.14.9...1.15.0
1.15-beta-18
New Features 🎉
Share toolbars with script items as links, and export/import to/from Note Toolbar Callouts.
Script items can now be used in Note Toolbar Callouts. See below for some examples; copy some toolbars with script items as callouts to see more attributes/examples.
> [!note-toolbar|right-mnbrder] Script Nav
> - [Create from Template]()<data data-templater-obsidian="createFrom" data-src="Templater/Basic Template.md" data-dest="<%"Basic " + tp.file.last_modified_date("yyyy-MM-dd")%>"/>
> - [Dataview Query Example]()<data data-dataview="query" data-expr="TABLE file.mtime AS "Last Modified" FROM "Templater" SORT file.mtime DESC" data-callout="asf"/>
> - [Hello World with JS Engine]()<data data-js-engine="exec" data-src="Scripts/JsEngine/HelloWorld.js"/>
Notes:
- Attributes used depend on what's supported by the function used in the first parameter. Refer to the documentation for each script type for a table listing the applicable parameters:
data-expr
= expression/querydata-src
= source file, if executing a file (as opposed to an expression/query)data-func
= source function, if your script uses a functiondata-args
= source arguments, if accepted by your script, in JSON formatdata-callout
= output callout, if outputting to an output calloutdata-dest
= output file, if outputting to a file
- Quotes and angle brackets must be escaped in attribute values (i.e., use
"
<
&rt;
).
Fixed
Changed
- Data attributes in callouts no longer require the
ntb-
portion of the attribute name, though they're still supported in everything but the above new attributes for backwards compatibility.
Full Changelog: 1.15-beta-17...1.15-beta-18
v1.15-beta-17
Fixed
- Import (from Share link) not working due TypeError (this.app). Thanks @laktiv!
Full Changelog: 1.15-beta-16...1.15-beta-17
v1.15-beta-16
Improvements 🚀
- Scripting: Available plugins for scripting are now checked on click, so toggling of the Scripting setting is no longer required when plugins (Dataview, JS Engine, or Templater) are enabled.
Fixes
- Some commands exist but appear unavailable #170 Thanks @likemuuxi and @Moyf!
- Iconize icons in bookmarks had a thicker stroke width #162 Thanks @laktiv!
Changes
- Added localized string for the Scripting setting.
Full Changelog: 1.15-beta-15...1.15-beta-16
v1.15-beta-15
Improvements 🎉
- In a Note Toolbar property, if you've entered the name of a toolbar that doesn't exist, a message now appears with a prompt to click/tap on it to create the toolbar.
Fixes
- Settings: Item preview labels were disappearing when an icon was set, when there was no previous icon.
Changes
- Changed
contains()
toincludes()
for compatibility. May help with #170 - Scripting: Localized strings.
Full Changelog: 1.15-beta-14...1.15-beta-15
v1.15-beta-14
Minor changes:
- Fixed: Editing a toolbar with no name sets incorrect modal title.
- Made Style dropdown wider to accommodate localization of new placeholder text.
Full Changelog: 1.15-beta-13...1.15-beta-14