Skip to content

Commit 7e1248d

Browse files
committed
add API guide
1 parent 3d3afd1 commit 7e1248d

File tree

72 files changed

+4129
-107
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+4129
-107
lines changed

astro.config.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export default defineConfig({
3535

3636
{ label: 'Examples', link: '/guides/examples/' },
3737
{ label: 'Advanced Use-Cases', link: '/guides/advancedusecases/' },
38+
{ label: 'API', link: '/guides/api/' },
3839

3940
{ label: 'Styling and CSS', link: '/guides/stylingandcss/' },
4041
{ label: 'Obsidian Publish', link: '/guides/obsidianpublish/' },
@@ -66,6 +67,7 @@ export default defineConfig({
6667
shiki: {
6768
langs: [...Object.entries(bundledLanguages).map(([_, langFn]) => langFn), MetaBind, CustomMD],
6869
},
70+
tabWidth: 4,
6971
},
7072
plugins: [
7173
starlightLinksValidator({

bun.lockb

12 KB
Binary file not shown.

obsidian-meta-bind-plugin

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
"format": "prettier --plugin prettier-plugin-astro --plugin prettier-plugin-svelte --write ."
1212
},
1313
"dependencies": {
14-
"@astrojs/starlight": "0.25.3",
15-
"astro": "4.13.1",
14+
"@astrojs/starlight": "0.26.1",
15+
"astro": "4.14.2",
1616
"starlight-links-validator": "^0.9.1",
1717
"starlight-typedoc": "^0.14.0",
1818
"typedoc": "^0.26.5",
19-
"typedoc-plugin-markdown": "^4.2.3",
20-
"typedoc-plugin-mdn-links": "^3.2.7"
19+
"typedoc-plugin-markdown": "^4.2.5",
20+
"typedoc-plugin-mdn-links": "^3.2.8"
2121
},
2222
"devDependencies": {
2323
"prettier": "^3.3.3",

src/content/docs/api/README.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,80 @@ title: "meta-bind-obsidian"
77

88
## Enumerations
99

10+
- [BindTargetStorageType](/obsidian-meta-bind-plugin-docs/api/enumerations/bindtargetstoragetype/)
11+
- [ButtonActionType](/obsidian-meta-bind-plugin-docs/api/enumerations/buttonactiontype/)
12+
- [ButtonStyleType](/obsidian-meta-bind-plugin-docs/api/enumerations/buttonstyletype/)
1013
- [FieldType](/obsidian-meta-bind-plugin-docs/api/enumerations/fieldtype/)
14+
- [InputFieldArgumentType](/obsidian-meta-bind-plugin-docs/api/enumerations/inputfieldargumenttype/)
15+
- [InputFieldType](/obsidian-meta-bind-plugin-docs/api/enumerations/inputfieldtype/)
1116
- [RenderChildType](/obsidian-meta-bind-plugin-docs/api/enumerations/renderchildtype/)
17+
- [ViewFieldArgumentType](/obsidian-meta-bind-plugin-docs/api/enumerations/viewfieldargumenttype/)
18+
- [ViewFieldType](/obsidian-meta-bind-plugin-docs/api/enumerations/viewfieldtype/)
1219

1320
## Classes
1421

22+
- [FieldMountable](/obsidian-meta-bind-plugin-docs/api/classes/fieldmountable/)
23+
- [Mountable](/obsidian-meta-bind-plugin-docs/api/classes/mountable/)
1524
- [NotePosition](/obsidian-meta-bind-plugin-docs/api/classes/noteposition/)
1625
- [ObsidianAPI](/obsidian-meta-bind-plugin-docs/api/classes/obsidianapi/)
1726

1827
## Interfaces
1928

29+
- [BindTargetDeclaration](/obsidian-meta-bind-plugin-docs/api/interfaces/bindtargetdeclaration/)
30+
- [ButtonConfig](/obsidian-meta-bind-plugin-docs/api/interfaces/buttonconfig/)
31+
- [ButtonDeclaration](/obsidian-meta-bind-plugin-docs/api/interfaces/buttondeclaration/)
32+
- [ButtonGroupDeclaration](/obsidian-meta-bind-plugin-docs/api/interfaces/buttongroupdeclaration/)
2033
- [ButtonGroupOptions](/obsidian-meta-bind-plugin-docs/api/interfaces/buttongroupoptions/)
2134
- [ButtonOptions](/obsidian-meta-bind-plugin-docs/api/interfaces/buttonoptions/)
35+
- [CommandButtonAction](/obsidian-meta-bind-plugin-docs/api/interfaces/commandbuttonaction/)
2236
- [ComponentLike](/obsidian-meta-bind-plugin-docs/api/interfaces/componentlike/)
37+
- [CreateNoteButtonAction](/obsidian-meta-bind-plugin-docs/api/interfaces/createnotebuttonaction/)
2338
- [EmbedOptions](/obsidian-meta-bind-plugin-docs/api/interfaces/embedoptions/)
39+
- [FieldDeclaration](/obsidian-meta-bind-plugin-docs/api/interfaces/fielddeclaration/)
2440
- [FieldOptionMap](/obsidian-meta-bind-plugin-docs/api/interfaces/fieldoptionmap/)
41+
- [InlineJsButtonAction](/obsidian-meta-bind-plugin-docs/api/interfaces/inlinejsbuttonaction/)
42+
- [InputButtonAction](/obsidian-meta-bind-plugin-docs/api/interfaces/inputbuttonaction/)
43+
- [InputFieldDeclaration](/obsidian-meta-bind-plugin-docs/api/interfaces/inputfielddeclaration/)
2544
- [InputFieldOptions](/obsidian-meta-bind-plugin-docs/api/interfaces/inputfieldoptions/)
45+
- [InsertIntoNoteButtonAction](/obsidian-meta-bind-plugin-docs/api/interfaces/insertintonotebuttonaction/)
46+
- [JSButtonAction](/obsidian-meta-bind-plugin-docs/api/interfaces/jsbuttonaction/)
47+
- [JsViewFieldBindTargetMapping](/obsidian-meta-bind-plugin-docs/api/interfaces/jsviewfieldbindtargetmapping/)
48+
- [JsViewFieldDeclaration](/obsidian-meta-bind-plugin-docs/api/interfaces/jsviewfielddeclaration/)
2649
- [JsViewFieldOptions](/obsidian-meta-bind-plugin-docs/api/interfaces/jsviewfieldoptions/)
2750
- [LinePosition](/obsidian-meta-bind-plugin-docs/api/interfaces/lineposition/)
51+
- [OpenButtonAction](/obsidian-meta-bind-plugin-docs/api/interfaces/openbuttonaction/)
52+
- [PartialUnvalidatedInputFieldDeclaration](/obsidian-meta-bind-plugin-docs/api/interfaces/partialunvalidatedinputfielddeclaration/)
53+
- [PartialUnvalidatedJsViewFieldDeclaration](/obsidian-meta-bind-plugin-docs/api/interfaces/partialunvalidatedjsviewfielddeclaration/)
54+
- [PartialUnvalidatedViewFieldDeclaration](/obsidian-meta-bind-plugin-docs/api/interfaces/partialunvalidatedviewfielddeclaration/)
55+
- [RegexpReplaceInNoteButtonAction](/obsidian-meta-bind-plugin-docs/api/interfaces/regexpreplaceinnotebuttonaction/)
56+
- [ReplaceInNoteButtonAction](/obsidian-meta-bind-plugin-docs/api/interfaces/replaceinnotebuttonaction/)
57+
- [ReplaceSelfButtonAction](/obsidian-meta-bind-plugin-docs/api/interfaces/replaceselfbuttonaction/)
58+
- [SimpleButtonGroupDeclaration](/obsidian-meta-bind-plugin-docs/api/interfaces/simplebuttongroupdeclaration/)
59+
- [SimpleFieldArgument](/obsidian-meta-bind-plugin-docs/api/interfaces/simplefieldargument/)
60+
- [SimpleInputFieldDeclaration](/obsidian-meta-bind-plugin-docs/api/interfaces/simpleinputfielddeclaration/)
61+
- [SimpleJsViewFieldBindTargetMapping](/obsidian-meta-bind-plugin-docs/api/interfaces/simplejsviewfieldbindtargetmapping/)
62+
- [SimpleJsViewFieldDeclaration](/obsidian-meta-bind-plugin-docs/api/interfaces/simplejsviewfielddeclaration/)
63+
- [SimplePropAccess](/obsidian-meta-bind-plugin-docs/api/interfaces/simplepropaccess/)
64+
- [SimpleViewFieldDeclaration](/obsidian-meta-bind-plugin-docs/api/interfaces/simpleviewfielddeclaration/)
65+
- [SleepButtonAction](/obsidian-meta-bind-plugin-docs/api/interfaces/sleepbuttonaction/)
2866
- [TableOptions](/obsidian-meta-bind-plugin-docs/api/interfaces/tableoptions/)
67+
- [TemplaterCreateNoteButtonAction](/obsidian-meta-bind-plugin-docs/api/interfaces/templatercreatenotebuttonaction/)
68+
- [UnvalidatedBindTargetDeclaration](/obsidian-meta-bind-plugin-docs/api/interfaces/unvalidatedbindtargetdeclaration/)
69+
- [UnvalidatedFieldArgument](/obsidian-meta-bind-plugin-docs/api/interfaces/unvalidatedfieldargument/)
70+
- [UnvalidatedInputFieldDeclaration](/obsidian-meta-bind-plugin-docs/api/interfaces/unvalidatedinputfielddeclaration/)
71+
- [UnvalidatedJsViewFieldBindTargetMapping](/obsidian-meta-bind-plugin-docs/api/interfaces/unvalidatedjsviewfieldbindtargetmapping/)
72+
- [UnvalidatedJsViewFieldDeclaration](/obsidian-meta-bind-plugin-docs/api/interfaces/unvalidatedjsviewfielddeclaration/)
73+
- [UnvalidatedPropAccess](/obsidian-meta-bind-plugin-docs/api/interfaces/unvalidatedpropaccess/)
74+
- [UnvalidatedViewFieldDeclaration](/obsidian-meta-bind-plugin-docs/api/interfaces/unvalidatedviewfielddeclaration/)
75+
- [UpdateMetadataButtonAction](/obsidian-meta-bind-plugin-docs/api/interfaces/updatemetadatabuttonaction/)
76+
- [ViewFieldDeclaration](/obsidian-meta-bind-plugin-docs/api/interfaces/viewfielddeclaration/)
2977
- [ViewFieldOptions](/obsidian-meta-bind-plugin-docs/api/interfaces/viewfieldoptions/)
3078

3179
## Type Aliases
3280

81+
- [ButtonAction](/obsidian-meta-bind-plugin-docs/api/type-aliases/buttonaction/)
3382
- [InlineFieldType](/obsidian-meta-bind-plugin-docs/api/type-aliases/inlinefieldtype/)
83+
84+
## Variables
85+
86+
- [EMBED\_MAX\_DEPTH](/obsidian-meta-bind-plugin-docs/api/variables/embed_max_depth/)
Lines changed: 275 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,275 @@
1+
---
2+
editUrl: false
3+
next: false
4+
prev: false
5+
title: "FieldMountable"
6+
---
7+
8+
## Extends
9+
10+
- [`Mountable`](/obsidian-meta-bind-plugin-docs/api/classes/mountable/)
11+
12+
## Constructors
13+
14+
### new FieldMountable()
15+
16+
> **new FieldMountable**(`plugin`, `uuid`, `filePath`): [`FieldMountable`](/obsidian-meta-bind-plugin-docs/api/classes/fieldmountable/)
17+
18+
#### Parameters
19+
20+
<table>
21+
<thead>
22+
<tr>
23+
<th>Parameter</th>
24+
<th>Type</th>
25+
</tr>
26+
</thead>
27+
<tbody>
28+
<tr>
29+
<td>
30+
31+
`plugin`
32+
33+
</td>
34+
<td>
35+
36+
`IPlugin`
37+
38+
</td>
39+
</tr>
40+
<tr>
41+
<td>
42+
43+
`uuid`
44+
45+
</td>
46+
<td>
47+
48+
`string`
49+
50+
</td>
51+
</tr>
52+
<tr>
53+
<td>
54+
55+
`filePath`
56+
57+
</td>
58+
<td>
59+
60+
`string`
61+
62+
</td>
63+
</tr>
64+
</tbody>
65+
</table>
66+
67+
#### Returns
68+
69+
[`FieldMountable`](/obsidian-meta-bind-plugin-docs/api/classes/fieldmountable/)
70+
71+
#### Overrides
72+
73+
[`Mountable`](/obsidian-meta-bind-plugin-docs/api/classes/mountable/).[`constructor`](/obsidian-meta-bind-plugin-docs/api/classes/mountable/#constructors)
74+
75+
#### Defined in
76+
77+
[packages/core/src/fields/FieldMountable.ts:9](https://github.com/mProjectsCode/obsidian-meta-bind-plugin/blob/4b16a75fb63dfdb34e3ccf2756a324a84dd8fd85/packages/core/src/fields/FieldMountable.ts#L9)
78+
79+
## Properties
80+
81+
### plugin
82+
83+
> `readonly` **plugin**: `IPlugin`
84+
85+
#### Defined in
86+
87+
[packages/core/src/fields/FieldMountable.ts:5](https://github.com/mProjectsCode/obsidian-meta-bind-plugin/blob/4b16a75fb63dfdb34e3ccf2756a324a84dd8fd85/packages/core/src/fields/FieldMountable.ts#L5)
88+
89+
## Methods
90+
91+
### getFilePath()
92+
93+
> **getFilePath**(): `string`
94+
95+
#### Returns
96+
97+
`string`
98+
99+
#### Defined in
100+
101+
[packages/core/src/fields/FieldMountable.ts:21](https://github.com/mProjectsCode/obsidian-meta-bind-plugin/blob/4b16a75fb63dfdb34e3ccf2756a324a84dd8fd85/packages/core/src/fields/FieldMountable.ts#L21)
102+
103+
***
104+
105+
### getTargetEl()
106+
107+
> **getTargetEl**(): `undefined` \| [`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement)
108+
109+
Get the element that the mountable is currently mounted to.
110+
111+
#### Returns
112+
113+
`undefined` \| [`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement)
114+
115+
#### Inherited from
116+
117+
[`Mountable`](/obsidian-meta-bind-plugin-docs/api/classes/mountable/).[`getTargetEl`](/obsidian-meta-bind-plugin-docs/api/classes/mountable/#gettargetel)
118+
119+
#### Defined in
120+
121+
[packages/core/src/utils/Mountable.ts:22](https://github.com/mProjectsCode/obsidian-meta-bind-plugin/blob/4b16a75fb63dfdb34e3ccf2756a324a84dd8fd85/packages/core/src/utils/Mountable.ts#L22)
122+
123+
***
124+
125+
### getUuid()
126+
127+
> **getUuid**(): `string`
128+
129+
#### Returns
130+
131+
`string`
132+
133+
#### Defined in
134+
135+
[packages/core/src/fields/FieldMountable.ts:17](https://github.com/mProjectsCode/obsidian-meta-bind-plugin/blob/4b16a75fb63dfdb34e3ccf2756a324a84dd8fd85/packages/core/src/fields/FieldMountable.ts#L17)
136+
137+
***
138+
139+
### isMounted()
140+
141+
> **isMounted**(): `boolean`
142+
143+
Check if the mountable is currently mounted.
144+
145+
#### Returns
146+
147+
`boolean`
148+
149+
#### Inherited from
150+
151+
[`Mountable`](/obsidian-meta-bind-plugin-docs/api/classes/mountable/).[`isMounted`](/obsidian-meta-bind-plugin-docs/api/classes/mountable/#ismounted)
152+
153+
#### Defined in
154+
155+
[packages/core/src/utils/Mountable.ts:15](https://github.com/mProjectsCode/obsidian-meta-bind-plugin/blob/4b16a75fb63dfdb34e3ccf2756a324a84dd8fd85/packages/core/src/utils/Mountable.ts#L15)
156+
157+
***
158+
159+
### mount()
160+
161+
> **mount**(`targetEl`): `void`
162+
163+
Mount the mountable to the given element.
164+
Will throw an error if the mountable is already mounted.
165+
166+
#### Parameters
167+
168+
<table>
169+
<thead>
170+
<tr>
171+
<th>Parameter</th>
172+
<th>Type</th>
173+
<th>Description</th>
174+
</tr>
175+
</thead>
176+
<tbody>
177+
<tr>
178+
<td>
179+
180+
`targetEl`
181+
182+
</td>
183+
<td>
184+
185+
[`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement)
186+
187+
</td>
188+
<td>
189+
190+
</td>
191+
</tr>
192+
</tbody>
193+
</table>
194+
195+
#### Returns
196+
197+
`void`
198+
199+
#### Inherited from
200+
201+
[`Mountable`](/obsidian-meta-bind-plugin-docs/api/classes/mountable/).[`mount`](/obsidian-meta-bind-plugin-docs/api/classes/mountable/#mount)
202+
203+
#### Defined in
204+
205+
[packages/core/src/utils/Mountable.ts:50](https://github.com/mProjectsCode/obsidian-meta-bind-plugin/blob/4b16a75fb63dfdb34e3ccf2756a324a84dd8fd85/packages/core/src/utils/Mountable.ts#L50)
206+
207+
***
208+
209+
### registerUnmountCb()
210+
211+
> **registerUnmountCb**(`cb`): `void`
212+
213+
Register a callback that will be called when the mountable is unmounted.
214+
215+
#### Parameters
216+
217+
<table>
218+
<thead>
219+
<tr>
220+
<th>Parameter</th>
221+
<th>Type</th>
222+
<th>Description</th>
223+
</tr>
224+
</thead>
225+
<tbody>
226+
<tr>
227+
<td>
228+
229+
`cb`
230+
231+
</td>
232+
<td>
233+
234+
() => `void`
235+
236+
</td>
237+
<td>
238+
239+
</td>
240+
</tr>
241+
</tbody>
242+
</table>
243+
244+
#### Returns
245+
246+
`void`
247+
248+
#### Inherited from
249+
250+
[`Mountable`](/obsidian-meta-bind-plugin-docs/api/classes/mountable/).[`registerUnmountCb`](/obsidian-meta-bind-plugin-docs/api/classes/mountable/#registerunmountcb)
251+
252+
#### Defined in
253+
254+
[packages/core/src/utils/Mountable.ts:85](https://github.com/mProjectsCode/obsidian-meta-bind-plugin/blob/4b16a75fb63dfdb34e3ccf2756a324a84dd8fd85/packages/core/src/utils/Mountable.ts#L85)
255+
256+
***
257+
258+
### unmount()
259+
260+
> **unmount**(): `void`
261+
262+
Unmount the mountable from the current element.
263+
Will throw an error if the mountable is not mounted.
264+
265+
#### Returns
266+
267+
`void`
268+
269+
#### Inherited from
270+
271+
[`Mountable`](/obsidian-meta-bind-plugin-docs/api/classes/mountable/).[`unmount`](/obsidian-meta-bind-plugin-docs/api/classes/mountable/#unmount)
272+
273+
#### Defined in
274+
275+
[packages/core/src/utils/Mountable.ts:65](https://github.com/mProjectsCode/obsidian-meta-bind-plugin/blob/4b16a75fb63dfdb34e3ccf2756a324a84dd8fd85/packages/core/src/utils/Mountable.ts#L65)

0 commit comments

Comments
 (0)