Make onboarding simple and every feature easy to understand: - README: one-line value prop, "what you get" list, 60-second quick start, fixed install link (drop #LAST_RELEASE#), documentation hub. - Features.md: describe all 13 features in plain text with variants; add the missing Inline, Canvas and Backlink; expand Alias options. - Templates.md: simple -> composite learning curve plus recipes; add a "how to read" intro to TemplateExamples.md. - New Settings.md (Rules, Boot/Debug, commands) and FAQ.md. - Processor.md: clarify when to reach for it. Screenshot tooling (separate from the e2e test suite): - tools/screenshots: headless-Obsidian generator driven by its own wdio config; `npm run shots:pretty` captures every feature off/on, spotlights the changed element, and frames each shot carbon-style. - Regenerate all docs/img screenshots and add a before/after hero. - Add sharp devDependency for framing and a board.canvas fixture for the Canvas capture.
5.4 KiB
Examples
New to templates? Read Templates first — it explains the concepts. This page is the full reference.
How to read the table below: each row is one template you could enter in settings. Original filename is the name on disk; Displayed filename is what Obsidian shows for the example note. When a template can't be resolved (missing key, unsupported type), the displayed name stays the original filename. The numbered notes under the table explain each row.
Let's imagine that we have a file MyFolder/MyNote.md with the following content:
---
alias: [ 'MPI' ]
status: open
short: 'PI'
empty:
tags: [ '#project', '#improvement' ]
date_updated: '2022-03-04 22:42:50'
additional:
author: Snezhig
title: Project ideas
---
# MyHeading
Some content of the file
| # | Template | Original filename | Displayed filename |
|---|---|---|---|
| 1 | short |
MyNote | PI |
| 2 | additional.author |
MyNote | Snezhig |
| 3 | not_exists |
MyNote | MyNote |
| 4 | additional |
MyNote | MyNote |
| 5 | tags |
MyNote | #project |
| 6 | #heading |
MyNote | MyHeading |
| 7 | empty|status|short |
MyNote | open |
| 8 | prefix {{short}} - {{status}} |
MyNote | prefix PI - open |
| 9 | prefix{{ status }}-{{ short}} |
MyNote | prefix open - PI |
| 10 | {{tags}} - {{additional}} |
MyNote | #project - |
| 11 | {{tags }}-{{ additional }}-{{short}} |
MyNote | #project - PI |
| 12 | prefix{{ empty|additional|short|status }}suffix |
MyNote | prefix PI suffix |
| 13 | _basename |
MyNote | MyNote |
If you use the only one value, use
shortinstead of{{short}}to have a better performance
Explanation
short- plugin used value ofshortkey which isPIadditional.author- plugin used a value ofadditionalkey, then it used a value ofauthorkey, which isSnezhignot_exist- plugin tried to find a value ofnot_existkey, but it's not exist, so title was not changedadditional- plugin tried to useadditonalkey value, but it's an object, so title was not changedtags- plugin used a value oftagskey. The value is an array, so plugin used first value of list. You can tell plugin to split all values into a string byList valuesrule#heading- plugin used first found header of the file which isMyHeadingempty\|status\|short- plugin separated template into three valuesempty,status,shortand used first non-empty value which isopenfromstatuskeyprefix {{short}} - {{status}}- plugin used values of theshortandstatuskeys and keeps all values outside brackes including spaces.prefix{{ status }}-{{ short}}- plugin used values of theshortandstatuskeys, including spaces and keeps all values outside brackets{{tags}} - {{additional}}- plugin used values oftagsandadditional, butadditionalis object that is not supported and shown as an empty string.{{tags }}-{{ additional }}-{{short}}- plugin used values of thetags,additionalandshortkeys. Notice that spaces inside brackets ofadditionalkey are not kept because value of the key is empty.prefix{{ empty\|additional\|short\|status }}suffix- plugin used first non-empty value of the keys which isPIfromshortkey and kept spaces because value is not empty._basename- plugin used abasenamekey of File Info
Description
Values
Plugin can use extract values from meta-block, file info or headings.
Also, template can be set as path.to.value and plugin will try to get value from path field, then from to field
and, finally from value field. See more.
Meta block
Template is a string that will be used to resolve a title for file
Any value in the template is meant to be key from file's meta block
FileInfo
If you add _ prefix in your template, plugin will use values
from TFile object
For example: _basename means that plugin will use value from basename field
Heading
If you set template as #heading, plugin will use first heading from file
Logic
Template with sumbol "|" will be interpreted with "or" logic. For example template "foo|bar|baz" will be replaced with value from first non-empty key
Types
Simple template
Any string in you template will be used like a single key
Composite template
If you want to use some values for title you can use {{ }} to make plugin use each value inside {{ }} as an
individual key. Side spaces inside brackets {{ foo }} will be kept, if the value of foo key is not empty