Skip to content

Commit 5539d00

Browse files
committed
0.10.0 preperations
1 parent b4acb55 commit 5539d00

File tree

4 files changed

+45
-2
lines changed

4 files changed

+45
-2
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# Obsidian Meta Bind Changelog
22

3+
# 0.10.0
4+
5+
New Features
6+
7+
- Meta Bind Buttons: Create buttons inside your notes that can trigger actions on click. A spiritual successor to the discontinued Buttons Plugin.
8+
- Syntax Highlighting: Meta Bind now has syntax highlighting for all its syntaxes in source mode and in live preview.
9+
- Multiple Bind Target Storage Types: You can not choose to store intermediate inputs or view field outputs in memory. That way they won't clutter your frontmatter.
10+
11+
Changes
12+
13+
- The way to reference scope in the Meta Bind Table has changed from `^.property` to `scope^property`.
14+
15+
Bug Fixes
16+
17+
- Fixed a bug related to `null` and default values of input fields [#148](https://github.com/mProjectsCode/obsidian-meta-bind-plugin/issues/148)
18+
319
# 0.9.0
420

521
New Features

exampleVault/Button Example.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,3 +151,19 @@ actions:
151151
command: obsidian-meta-bind-plugin:open-help
152152
153153
```
154+
155+
156+
## Invalid Buttons
157+
158+
```meta-bind-button
159+
label: Test
160+
hidden: false
161+
id: ""
162+
style: default
163+
actions:
164+
- type: sl
165+
ms: 1000
166+
- type: command
167+
command: obsidian-meta-bind-plugin:open-help
168+
169+
```

src/renderChildren/ButtonMDRC.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { type ButtonConfig, ButtonConfigValidator } from '../config/ButtonConfig
66
import { ErrorLevel, MetaBindButtonError } from '../utils/errors/MetaBindErrors';
77
import ErrorIndicatorComponent from '../utils/errors/ErrorIndicatorComponent.svelte';
88
import ButtonComponent from '../utils/components/ButtonComponent.svelte';
9+
import { DocsUtils } from '../utils/DocsUtils';
910

1011
export class ButtonMDRC extends AbstractMDRC {
1112
content: string;
@@ -51,9 +52,11 @@ export class ButtonMDRC extends AbstractMDRC {
5152
if (!validationResult.success) {
5253
this.errorCollection.add(
5354
new MetaBindButtonError({
54-
errorLevel: ErrorLevel.CRITICAL,
55+
errorLevel: ErrorLevel.ERROR,
5556
effect: 'can not parse button config',
56-
cause: validationResult.error,
57+
cause: 'zod validation failed. Check your button syntax',
58+
positionContext: validationResult.error.message,
59+
docs: [DocsUtils.linkToButtonConfig()],
5760
}),
5861
);
5962
this.createErrorIndicator(this.containerEl);

src/utils/DocsUtils.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ export class DocsUtils {
3030
return `https://www.moritzjung.dev/obsidian-meta-bind-plugin-docs/guides/viewfields/`;
3131
}
3232

33+
static linkToButtons(): string {
34+
return `https://www.moritzjung.dev/obsidian-meta-bind-plugin-docs/guides/buttons/#button-configuration`;
35+
}
36+
37+
static linkToButtonConfig(): string {
38+
return `https://www.moritzjung.dev/obsidian-meta-bind-plugin-docs/guides/buttons/#button-configuration`;
39+
}
40+
3341
static linkToSearch(search: string): string {
3442
return `https://www.moritzjung.dev/obsidian-meta-bind-plugin-docs/?s=${encodeURIComponent(search)}`;
3543
}

0 commit comments

Comments
 (0)