joethei / obsidian-plantuml

Generate PlantUML Diagrams inside Obsidian.md
MIT License
368 stars 18 forks source link

How to include images? #59

Open DaRolla opened 2 months ago

DaRolla commented 2 months ago

I'd like to reference an image, a PNG file.

In general it works like this:

@startuml

!theme superhero

!RancherPNG = "<img:img/Rancher256.png{scale=0.5}>"

skinparam defaultTextAlignment center
left to right direction

package "Microsoft Windows 11 Pro" {
    label "RancherPNG\nRancher Desktop" as Rancher
}

@enduml

In my example the image file Rancher256.png is located in the subfolder img relative to the puml file.

I tried to put the image into the same folder within Obsidian, without any success.

Then I tried something like

!RancherPNG = "<img:[[[Rancher256.png]]]{scale=0.5}>"

without any success.

Can you please show me how this is done?

Cheers, DaRolla