awslabs / aws-icons-for-plantuml

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

VSCODE Reder Errror #66

Closed rusticrajp closed 8 months ago

rusticrajp commented 8 months ago

Is it possible to render the AWS diagrams in VSCODE? all my other plantuml diagrams render correctly, but I keep getting errors with AWS architecture? Any thing I can try, Thanks.

hakanson commented 8 months ago

Yes. Here is a screenshot. I am using java -jar plantuml-mit-1.2023.12.jar -picoweb to run a local PlantUML server and https://marketplace.visualstudio.com/items?itemName=jebbs.plantuml for rendering.

  "plantuml.render": "PlantUMLServer",
  "plantuml.server": "http://localhost:8080/plantuml/",

Screen Shot 2023-11-09 at 17 54 44 PM

Can you try with https://github.com/awslabs/aws-icons-for-plantuml/blob/main/examples/Basic%20Usage.puml and post a screen shot?

rusticrajp commented 8 months ago

Appreciate the quick response. So In my current test.adoc file, I have a bunch of other diagrams and content. Only the AWS image block is giving error. I understand if you do it in a seperate file it may work.

Check this in VSCODE and you will see the error. = this i sthe heading tuheh

== section 1 thetuh is awesome

[plantuml,puml,svg]

@startuml

skin rose

nwdiag { network home { address = "192.x.x.x/24"

  venus [address = "192.x.x.1"];
  mars [address = "192.x.x.2"];

} } @enduml

== this is AWS diagram

[plantuml]

@startuml

!define AWSPuml https://raw.githubusercontent.com/awslabs/aws-icons-for-plantuml/v16.0/dist !include AWSPuml/AWSCommon.puml !include AWSPuml/MachineLearning/SageMakerModel.puml !include AWSPuml/Robotics/RoboMaker.puml

component "$SageMakerModelIMG()" as myMLModel database "$RoboMakerIMG()" as myRoboticService RoboMaker(mySecondFunction, "Reinforcement Learning", "Gazebo")

rectangle "$SageMakerModelIMG()" as mySecondML

myMLModel --> myRoboticService mySecondFunction --> mySecondML

@enduml

== this is kroki [plantuml]

nwdiag { network dmz { address = "210.x.x.x/24"

web01 [address = "210.x.x.1"];
web02 [address = "210.x.x.2"];

} network internal { address = "172.x.x.x/24";

web01 [address = "172.x.x.1"];
web02 [address = "172.x.x.2"];
db01;
db02;

} }

== this is mermaid [mermaid]

sequenceDiagram participant Alice participant Bob Alice->John: Hello John, how are you? loop Healthcheck John->John: Fight against hypochondria end Note right of John: Rational thoughts prevail... John-->Alice: Great! John->Bob: How about you? Bob-->John: Jolly good!

== this is gantt chart [mermaid]

gantt title A Gantt Diagram dateFormat YYYY-MM-DD section Section A task :a1, 2014-01-01, 30d Another task :after a1, 20d section Another Task in sec :2014-01-12, 12d another task :24d

[plantuml, aws-sdk-plantuml, format=png]

@startuml Hello World 'Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. 'SPDX-License-Identifier: MIT (For details, see https://github.com/awslabs/aws-icons-for-plantuml/blob/master/LICENSE)

' Uncomment the line below for "dark mode" styling '!$AWS_DARK = true

!define AWSPuml https://raw.githubusercontent.com/awslabs/aws-icons-for-plantuml/v16.0/dist !include AWSPuml/AWSCommon.puml !include AWSPuml/BusinessApplications/all.puml !include AWSPuml/Storage/SimpleStorageService.puml

actor "Person" as personAlias WorkDocs(desktopAlias, "Label", "Technology", "Optional Description") SimpleStorageService(storageAlias, "Label", "Technology", "Optional Description")

personAlias --> desktopAlias desktopAlias --> storageAlias

@enduml

rusticrajp commented 8 months ago

2023-11-09 13_28_02-Preview test adoc - docs - Visual Studio Code

hakanson commented 8 months ago
rusticrajp commented 8 months ago

test.txt

rusticrajp commented 8 months ago

1) rename the above test.txt to test.adoc and open in vscode. 2) I'm using Kroki to render 3) if you install the asciidoc extension, you can preview the asciidoc side by side

You can see the AWS section is giving error

where should I add the version?

rusticrajp commented 8 months ago

error

rusticrajp commented 8 months ago

You can see the Error 400 for the contents in test.txt file.

rusticrajp commented 8 months ago

If I just use only PLANTUML code without any other Asciidoc markup, I'm able to preview using ALT+D in Windows without issues. May be this cannot be rendered along side with ascidoc.

hakanson commented 8 months ago

I also get an error on https://kroki.io/ (which title %version() renders as 1.2023.11)

Error 400: Syntax Error? (line: 15)

Somehow it doesn't like these lines of code which official plantuml.jar does.

IoTRule(iotRule, "Action Error Rule", "error if Kinesis fails")
KinesisDataStreams(eventStream, "IoT Events", "2 shards")
SimpleQueueService(errorQueue, "Rule Error Queue", "failed Rule actions")
rusticrajp commented 8 months ago

ok thanks for trying. I can always render is separately and copy the image.