tmorin/plantuml-libs

include remotely fail

Closed this issue ยท 3 comments

Thank you for creating a great tool. ๐Ÿ™

I tried to write the file as follows, but I got an error and it did not work correctly

https://github.com/tmorin/plantuml-libs/blob/8978f181caf319de48f5e1bcb35c41b24a55997f/distribution/aws-20210730/Group/GroupAutoScaling.md

@startuml
' configures the library
!global $LIB_BASE_LOCATION="https://github.com/tmorin/plantuml-libs/distribution"

' loads the library's bootstrap
!include $LIB_BASE_LOCATION/bootstrap.puml

' loads the package bootstrap
include('aws-20210730/bootstrap')

' loads the Item which embeds the element GroupAutoScaling
include('aws-20210730/Group/GroupAutoScaling')

GroupAutoScaling('GroupAutoScaling', 'Group Auto Scaling', 'an optional tech label') {
  note as note
  the content of the boundary
  end note
}
@enduml

The error message is as follows

PlantUML 1.2021.7
<b>This version of PlantUML is 184 days old, so you should
<b>consider upgrading from https://plantuml.com/download
[From string (line 6) ]
@startuml
' configures the library
!global $LIB_BASE_LOCATION="https://github.com/tmorin/plantuml-libs/distribution"
' loads the library's bootstrap
!include $LIB_BASE_LOCATION/bootstrap.puml
Cannot open URL

I couldn't seem to open the URL, so I rewrote it and tried again.

@startuml
- ' configures the library
- !global $LIB_BASE_LOCATION="https://github.com/tmorin/plantuml-libs/distribution"
- 
- ' loads the library's bootstrap
- !include $LIB_BASE_LOCATION/bootstrap.puml

+ !include https://raw.githubusercontent.com/tmorin/plantuml-libs/master/distribution/bootstrap.puml

' loads the package bootstrap
include('aws-20210730/bootstrap')

' loads the Item which embeds the element GroupAutoScaling
include('aws-20210730/Group/GroupAutoScaling')

GroupAutoScaling('GroupAutoScaling', 'Group Auto Scaling', 'an optional tech label') {
  note as note
  the content of the boundary
  end note
}
@enduml

The error message is as follows

PlantUML 1.2021.7
<b>This version of PlantUML is 184 days old, so you should
<b>consider upgrading from https://plantuml.com/download
[From https://raw.githubusercontent.com/tmorin/plantuml-libs/master/distribution/bootstrap.puml (line 79) ]
@startuml
' configures the library
' loads the library's bootstrap
!include https://raw.githubusercontent.com/tmorin/plantuml-libs/master/distribution/bootstrap.puml
...
... ( skipping 156 lines )
...
!procedure GroupElement($id, $stereotype, $name="", $tech="")
!local $V=""
!if ($name != "") && ($tech != "")
!$V=$V + $name + "\n" + "<size:" + $FONT_SIZE_XS + "><color:" + $FONT_COLOR_LIGHT + ">[" + $tech + "]</color></s ...
!elseif ($name != "")
!$V=$V + $name
!elseif ($tech != "")
!$V=$V + "<size:" + $FONT_SIZE_XS + "><color:" + $FONT_COLOR_LIGHT + ">[" + $tech + "]</color></size>"
!endif
!if ($V != "")
Rectangle $id <<$stereotype>> as "$V"
!else
Rectangle $id <<$stereotype>>
!endif
!endprocedure
' loads the package bootstrap
include('aws-20210730/bootstrap')
!include $LIB_BASE_LOCATION/$resource.puml
Cannot open URL

Will this be solved by rewriting https://github.com to https://raw.githubusercontent.com in all code ?

I'm sorry if I'm missing the point.

Hi @utamori
Thank you for the feedback.
You're right the URL should be "https://raw.githubusercontent.com/tmorin/plantuml-libs/master/distribution".
I will fix it.
Best regards

thank you! ๐Ÿ˜„