Skip to content

Commit

Permalink
docs: file input example
Browse files Browse the repository at this point in the history
  • Loading branch information
danielo515 committed Dec 11, 2024
1 parent 48b62af commit 0954d23
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions EXAMPLE_VAULT/000 - Templates/file input example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<%*
const modalForm = app.plugins.plugins.modalforms.api;
const result = await modalForm.openForm('file_input');
tR += result.asFrontmatterString();
console.log(result.file)
-%>

Here is the file manually rendered
![[<% result.file.value.name %>]]

And here is the file leveraging the shorthand to get a markdown link
<% result.file.link %>

Some TFile proxy properties:

- path: <% result.file.value.path %>
- name: <% result.file.value.name %>
- basename: <% result.file.value.basename %>
- extension: <% result.file.value.extension %>

Some TFile properties:

- ctime: <% result.file.value.TFile.stat.ctime %>
- mtime: <% result.file.value.TFile.stat.mtime %>
- size: <% result.file.value.TFile.stat.size %>

0 comments on commit 0954d23

Please sign in to comment.