Comments (4)
They run in parallel, which means they're running at the same time and likely hitting a race condition. Those are two separate examples, not meant to be used together like that.
If you want to run them sequentially, you can do it like this.
<%*
tp.hooks.on_all_templates_executed(async () => {
// Update frontmatter after template finishes executing
const file = tp.file.find_tfile(tp.file.path(true));
await app.fileManager.processFrontMatter(file, (frontmatter) => {
frontmatter["key"] = "value";
});
// Run a command from another plugin that modifies the current file, after Templater has updated the file
app.commands.executeCommandById("obsidian-linter:lint-file");
});
-%>
from templater.
Oops. Sadly, neither work for me (neither separate nor sequentially).
Still nothing in the console.
from templater.
Can you try it in the sandbox vault? Here's the steps I took to verify I didn't have anything weird on my system, worked for me.
- Open the sandbox vault.
- Install the Templater and Linter plugins.
- Create a folder to put your templates in.
- Add the code from my previous message as the note contents for the template.
- In Templater settings, add your templates folder as your template folder location.
- Open a note.
- Run the
Templater: Open Insert Template modal
comand and select your template from step 4.
Does it still not work for you after these steps?
If it does work after these steps, there must be a setting or another plugin that is causing it to not work for you.
from templater.
It's adding the frontmatter now, but not linting:
After linting manually:
The behavior is identical for Open Insert Template modal
and Create new note from template
.
from templater.
Related Issues (20)
- tp.file.create_new strange behaviour since 1.16.1 HOT 3
- Merge properties in the template with properties in the note HOT 2
- Note composer core plugin is no longer working with Templater triggering option enabled HOT 3
- Automatic jump to cursor scrolls down to position in file creation before naming file HOT 1
- tp.file.cursor expands all collapsed sections HOT 1
- Support Subfolders of Templates HOT 1
- I want to translate and share docs of this plug-in into Korean. HOT 1
- New Folder Template button sets Settings Menu view to the top wrong position HOT 3
- Template parsing error, aborting HOT 7
- Bug when creating a new note with a default template and start typing. HOT 4
- tp.file.cursor should change the mode to edit mode if in reading mode HOT 9
- Template file in templates directory disappears HOT 1
- Quick toggle between different custom checkboxes
- Broken template after updating Templater to v1.18.0 (still working fine with Templater 1.17.0)... HOT 3
- Interaction between Templater and Excalidraw resulting in file content change HOT 3
- Add commands to pallete for creating a note in a specific folder HOT 6
- Templater Syntax Highlight is broken on Obsidian 1.5.0 (Desktop - Catalyst/Insider release) HOT 15
- Templater Hides Properties on Obsidian 1.5.0 HOT 9
- Date variables are not updating to the current system time HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from templater.