How to ignore "! define as" alias and display as a string instead

0 votes
asked Jan 3, 2020 in Question / help by Art

Hello,

if we use a the !define function below and later want to print the string of the alias myVar and not display the image, how do we tell the parser to ignore the alias? for example below in a legend we want to display the image in column 2, by print "myVar" as test in column 3.

Using the tide before the alias prints the url of the image.

!define MyVar <img:http://fa2png.io/media/icons/font-awesome/4-7-0/indent/24/0/ff001f_none.png{scale=0.5}>
legend right
|Color| image | reference to use |
|<#red>| <<shows image>>myVar | myVar |

1 Answer

0 votes
answered Jan 6, 2020 by plantuml (295,000 points)

I can think about 3 possibles workaround:

@startuml
!define MyVar <img:http://fa2png.io/media/icons/font-awesome/4-7-0/indent/24/0/ff001f_none.png{scale=0.5}>

Alice -> Bob

legend right
|Color| image | reference to use |
|<#red>| <<shows image>>MyVar | <U+004D>yVar |
end legend
@enduml


or

@startuml
!define MyVar <img:http://fa2png.io/media/icons/font-awesome/4-7-0/indent/24/0/ff001f_none.png{scale=0.5}>

Alice -> Bob

!define HiddenMyVar <img:http://fa2png.io/media/icons/font-awesome/4-7-0/indent/24/0/ff001f_none.png{scale=0.5}>
!undef MyVar
legend right
|Color| image | reference to use |
|<#red>| <<shows image>>HiddenMyVar | MyVar |
end legend
@enduml


of

@startuml
!define MyVar <img:http://fa2png.io/media/icons/font-awesome/4-7-0/indent/24/0/ff001f_none.png{scale=0.5}>

Alice -> Bob

!define HiddenMyVar MyVar
!undef MyVar
legend right
|Color| image | reference to use |
|<#red>| <<shows image>>HiddenMyVar | MyVar |
end legend
@enduml

Hope this help !

...