diff --git a/src/dg-testVault/P Plugins/PD Dataview/PD2 Inline queries.md b/src/dg-testVault/P Plugins/PD Dataview/PD2 Inline queries.md index 199058d2..f57308fb 100644 --- a/src/dg-testVault/P Plugins/PD Dataview/PD2 Inline queries.md +++ b/src/dg-testVault/P Plugins/PD Dataview/PD2 Inline queries.md @@ -3,6 +3,6 @@ dg-publish: true --- - +`=this.file.name` `= [[PD0 - note with summary]].summary` diff --git a/src/dg-testVault/P Plugins/PD Dataview/PD3 Inline JS queries.md b/src/dg-testVault/P Plugins/PD Dataview/PD3 Inline JS queries.md new file mode 100644 index 00000000..a663b787 --- /dev/null +++ b/src/dg-testVault/P Plugins/PD Dataview/PD3 Inline JS queries.md @@ -0,0 +1,7 @@ +--- +dg-publish: true +--- + +`$=2+1` +`$=dv.pages().length + dv.pages().length` +`$=dv.paragraph("A paragraph")` diff --git a/src/dg-testVault/P Plugins/PD Dataview/PD4 DataviewJs queries.md b/src/dg-testVault/P Plugins/PD Dataview/PD4 DataviewJs queries.md new file mode 100644 index 00000000..2e33640e --- /dev/null +++ b/src/dg-testVault/P Plugins/PD Dataview/PD4 DataviewJs queries.md @@ -0,0 +1,20 @@ +--- +dg-publish: true +--- +```dataviewjs +dv.header(2, 'Header 2'); +let pg = dv.current().file.name; +dv.paragraph(pg) +``` + +```dataviewjs +dv.table(["mtime", "link"], + dv.pages() + .where(p => p.file.name.includes("Custom")) + .map(p => [ + p.file.mtime, + p.file.link + ]) +) +``` + diff --git a/src/test/snapshot/snapshot.md b/src/test/snapshot/snapshot.md index 2eaa13a9..b7d0a08c 100644 --- a/src/test/snapshot/snapshot.md +++ b/src/test/snapshot/snapshot.md @@ -605,6 +605,8 @@ I'm a list of all files in this folder: - [[P Plugins/PD Dataview/PD0 - note with summary\|PD0 - note with summary]] - [[P Plugins/PD Dataview/PD1 Dataview\|PD1 Dataview]] - [[P Plugins/PD Dataview/PD2 Inline queries\|PD2 Inline queries]] +- [[P Plugins/PD Dataview/PD3 Inline JS queries\|PD3 Inline JS queries]] +- [[P Plugins/PD Dataview/PD4 DataviewJs queries\|PD4 DataviewJs queries]] - [[P Plugins/PE Excalidraw/PE1 Transcluded excalidraw\|PE1 Transcluded excalidraw]] - [[P Plugins/PE Excalidraw/PE2 excalidraw with image\|PE2 excalidraw with image]] @@ -622,10 +624,40 @@ P Plugins/PD Dataview/PD2 Inline queries.md - +PD2 Inline queries this note is about foo +/img/user/A Assets/travolta.png +,/img/user/A Assets/unused_image.png +,/img/user/A Assets/travolta.webp +========== +P Plugins/PD Dataview/PD3 Inline JS queries.md +========== +--- +{"dg-publish":true,"permalink":"/p-plugins/pd-dataview/pd-3-inline-js-queries/"} +--- + + +3 +92 +

A paragraph

+ +/img/user/A Assets/travolta.png +,/img/user/A Assets/unused_image.png +,/img/user/A Assets/travolta.webp +========== +P Plugins/PD Dataview/PD4 DataviewJs queries.md +========== +--- +{"dg-publish":true,"permalink":"/p-plugins/pd-dataview/pd-4-dataview-js-queries/"} +--- + +

Header 2

PD4 DataviewJs queries

+ +
mtime4link
9:33 pm - September 20, 2023005 Custom filters
9:20 pm - September 25, 2023006 Custom title
9:20 pm - September 25, 2023007 Custom permalink
9:27 pm - October 01, 2023011 Custom updatedAt
+ + /img/user/A Assets/travolta.png ,/img/user/A Assets/unused_image.png ,/img/user/A Assets/travolta.webp