File tree Expand file tree Collapse file tree 4 files changed +21
-4
lines changed Expand file tree Collapse file tree 4 files changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ images:
2121otherImages :
2222 - " [[Other/Images/img_flower.webp]]"
2323 - " [image](Other/Images/img_flower.webp)"
24+ remoteImage : https://picsum.photos/200/300
2425---
2526
2627` INPUT[number:number1] `
@@ -60,20 +61,32 @@ Self Loop Error: `VIEW[**{computed}**][text():computed]`
6061link with render markdown: ` VIEW[\[\[{file}|link\]\]][text(renderMarkdown)] `
6162link with link view field: ` VIEW[{file}|this is a link][link] `
6263
64+ ## Images
65+
66+ A single image works
67+
6368``` meta-bind
6469INPUT[imageSuggester(optionQuery("Other/Images")):image]
6570```
6671
6772` VIEW[{image}][image] `
6873
74+ View fields can also display a list of images.
75+
6976``` meta-bind
7077INPUT[imageListSuggester(optionQuery("Other/Images")):images]
7178```
7279
7380` VIEW[{images}][image] `
7481
82+ Both markdown link types are supported.
83+
7584` VIEW[{otherImages}][image] `
7685
86+ External images work as well.
87+
88+ ` VIEW[{remoteImage}][image] `
89+
7790## Arrays and Objects
7891
7992Plain Text:
Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ export class ImageVF extends AbstractViewField<string> {
8888 this . component = mount ( ImageGrid , {
8989 target : container ,
9090 props : {
91- images : linkList . map ( x => x . target ) ,
91+ images : linkList . map ( x => ( { link : x . target , internal : x . internal } ) ) ,
9292 plugin : this . mountable . plugin ,
9393 } ,
9494 } ) ;
Original file line number Diff line number Diff line change 44 const {
55 plugin,
66 image,
7+ internal = true ,
78 }: {
89 plugin: IPlugin ;
910 image: string ;
11+ internal? : boolean ;
1012 } = $props ();
13+
14+ let imageUri = $derived (internal ? plugin .internal .imagePathToUri (image ) : image );
1115 </script >
1216
1317<div class =" mb-image-card" >
14- <img class ="mb-image-card-image" src ={plugin . internal . imagePathToUri ( image ) } alt ={image } />
18+ <img class ="mb-image-card-image" src ={imageUri } alt ={image } />
1519</div >
Original file line number Diff line number Diff line change 77 images = [],
88 }: {
99 plugin: IPlugin ;
10- images: string [];
10+ images: { link : string ; internal : boolean } [];
1111 } = $props ();
1212 </script >
1313
1414<div class =" mb-image-card-grid" >
1515 {#each images as image }
16- <ImageCard plugin ={plugin } image ={image }></ImageCard >
16+ <ImageCard plugin ={plugin } image ={image . link } internal ={ image . internal }></ImageCard >
1717 {/each }
1818</div >
You can’t perform that action at this time.
0 commit comments