generated from obsidianmd/obsidian-sample-plugin
-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6c1f7c8
commit 578bd3e
Showing
14 changed files
with
178 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
## Data | ||
<%* | ||
const formApi = app.plugins.plugins.modalforms.api; | ||
const result = await formApi.exampleForm({ values: {dataview_example:'John', age: 32}}); | ||
tR += result.asDataviewProperties(); | ||
-%> |
10 changes: 10 additions & 0 deletions
10
EXAMPLE_VAULT/000 - Templates/basic frontmatter example.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
<%* | ||
const modalForm = app.plugins.plugins.modalforms.api; | ||
const result = await modalForm.openForm('example-form',{values: { | ||
second: 5, | ||
select: 'second' | ||
}}); | ||
tR += result.asFrontmatterString(); | ||
-%> | ||
--- |
5 changes: 5 additions & 0 deletions
5
EXAMPLE_VAULT/000 - Templates/format with template example.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<%* | ||
const modalForm = app.plugins.plugins.modalforms.api; | ||
const result = await modalForm.openForm('example-form'); | ||
tR += result.asString('{{Name}} is {{age}} years old and his/her favourite food is {{favorite_meal}}. Family status: {{is_family}}'); | ||
%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
<%* | ||
const modalForm = app.plugins.plugins.modalforms.api; | ||
const result1 = await modalForm.limitedForm('example-form',{pick:['second']}); | ||
tR += result1.asFrontmatterString(); | ||
const result2 = await modalForm.limitedForm('example-form',{omit:['second','toggle']}); | ||
tR += result2.asFrontmatterString(); | ||
-%> | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
<%* | ||
const modalForm = app.plugins.plugins.modalforms.api; | ||
const result = await modalForm.openForm('example-form'); | ||
tR += result.asFrontmatterString({ | ||
pick:['second'] | ||
}); | ||
-%> | ||
--- | ||
|
||
<%* | ||
tR += result.asDataviewProperties({ omit:['second','toggle'] }); | ||
tp.context = { parent: "parent" } | ||
await tp.file.include('[[02_sub_template]]') | ||
console.log("parent",tp.context, this.context) | ||
%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
tags: book | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
tags: book | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
fileClass: [Person] | ||
tags: person, person/Estudiante | ||
aliases: Fátima | ||
family: false | ||
company: Unknown | ||
roles: Estudiante | ||
name: Fátima | ||
|
||
--- | ||
|
||
## Information | ||
|
||
relations:: [[]] | ||
company:: [[Unknown]] | ||
introducer:: [[Alicia]] | ||
|
||
#some-tag |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
tag: person | ||
age: 29 | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
fileClass: [Person] | ||
tags: person, person/Amigo | ||
aliases: Jose | ||
family: false | ||
company: Unknown | ||
roles: Amigo | ||
name: Jose AliFriend | ||
|
||
--- | ||
|
||
## Information | ||
|
||
relations:: [[]] | ||
company:: [[Unknown]] | ||
introducer:: [[Alicia]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
tag: person | ||
age: 25 | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
tag: person | ||
age: 33 | ||
aliases: Jesus | ||
--- | ||
|
||
```js | ||
const x = 'lol' | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<%* | ||
const modalForm = app.plugins.plugins.modalforms.api; | ||
const result = await modalForm.openForm('simple', {values:{ | ||
list:['1984','Hello'], | ||
name: 'Fedever', | ||
number: 55 | ||
}}); | ||
%> | ||
|
||
## Simple values | ||
<% result.getV('name') %> | ||
### Upper | ||
<% result.getV('name').upper %> | ||
number | ||
<% result.getV('number') %> | ||
<% result.getV('number').toBullets() %> | ||
<%* console.log(result.getV('number')) %> | ||
## Shorthand | ||
<% result.getV('number').bullets %> | ||
## List | ||
<% result.getV('list') %> | ||
<% result.getV('list').toBullets() %> | ||
### Shorthand | ||
<% result.getV('list').bullets %> | ||
<% result.getV('list').upper.bullets %> | ||
<% result.getV('list').lower.bullets %> | ||
<% result.getV('list').toDv() %> | ||
<% result.getV('list').upper.toDv() %> | ||
## Invalid | ||
<% result.getV('invalid') %> | ||
<% result.getV('invalid').bullets %> | ||
<% result.getV('invalid').toBullets() %> | ||
|
||
```dataview | ||
table list | ||
where file.name = this.file.name | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<%* | ||
const modalForm = app.plugins.plugins.modalforms.api; | ||
const result = await modalForm.openForm('simple', {values:{ | ||
list:['1984','Hello'], | ||
name: 'Fedever', | ||
number: 55 | ||
}}); | ||
%> | ||
|
||
## Simple values | ||
<% result.name %> | ||
### Upper | ||
<% result.name.upper %> | ||
number | ||
<% result.number %> | ||
<% result.number.toBullets() %> | ||
<%* console.log(result.number) %> | ||
## Shorthand | ||
<% result.number.bullets %> | ||
## List | ||
<% result.list %> | ||
<% result.list.toBullets() %> | ||
### Shorthand | ||
<% result.list.bullets %> | ||
<% result.list.upper.bullets %> | ||
<% result.list.lower.bullets %> | ||
<% result.list.toDv() %> | ||
<% result.list.upper.toDv() %> | ||
## Invalid | ||
<% result.invalid -%> | ||
<% result.invalid.bullets -%> | ||
<% result.invalid.toBullets() -%> | ||
|
||
```dataview | ||
table list | ||
where file.name = this.file.name | ||
``` | ||
[[Fátima|Fátima]] |