awslabs / aws-icons-for-plantuml

PlantUML sprites, macros, and other includes for Amazon Web Services services and resources
Other
911 stars 158 forks source link

Appstream2.0 is broken #16

Closed iwat closed 4 years ago

iwat commented 4 years ago

Definitions contain dot, I think they don't work.

!define Appstream2.0(e_alias, e_label, e_techn) ...
!define Appstream2.0(e_alias, e_label, e_techn, e_descr) ...
!define Appstream2.0Participant(p_alias, p_label, p_techn) ...
!define Appstream2.0Participant(p_alias, p_label, p_techn, p_descr) ...

I tried this:

@startuml
title EndUserComputing
!define AWSPuml https://raw.githubusercontent.com/awslabs/aws-icons-for-plantuml/master/dist
!include AWSPuml/AWSCommon.puml
!include AWSPuml/EndUserComputing/all.puml
Appstream2.0(Alias, "Label", "Tech")
@enduml

And I got this:

.0Participant(p_alias ... Syntex Error?
gadams999 commented 4 years ago

It looks like dots are used in different contexts in PlantUML. Didn't catch this one. I think the best approach is to have the script that generates the default names replace dots . with underscores _, and to modify the curated set of icons in the master and subsequent releases to include that also.

So in this case, Appstream2.0 will become Appstream2_0. I'll verify that this works for sprite names and usage in a definition and diagram.

gadams999 commented 4 years ago

Confirmed that the legacy preprocessor, which is still the one in use, follows the C language specification:

You can define constant using the !define directive. As in C language, a constant name can only use alphanumeric and underscore characters, and cannot start with a digit.

So I will add checks to convert any non-alphanumeric characters to underscores.

gadams999 commented 4 years ago

Resolve in master branch. AppStream2.0 is now AppStream2_0. This diagram now resolving:

@startuml
title EndUserComputing
!define AWSPuml https://raw.githubusercontent.com/awslabs/aws-icons-for-plantuml/master/dist
!include AWSPuml/AWSCommon.puml
!include AWSPuml/EndUserComputing/Appstream2_0.puml
Appstream2.0(Alias, "Label", "Tech")
@enduml

Active in master branch, will be incorporated into next icon set release tag.