C4 standard library usage broken since 1.2019.5

+1 vote
asked Oct 30 in Bug by anonymous

I'm using the standard library c4 to render C4 diagrams with plantuml.

Since 1.2019.6 usage of the LAYOUT_AS_SKETCH or LAYOUT_WITH_LEGEND options breaks the rendering of the diagram. Replacing the include of the standard library via !include <c4/C4_Container> with one to the latest version on github via !includeurl https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/release/1-0/C4_Container.puml doesn't solve the issue.

These are !definelong elements in an included (base) plantuml file. I suspect either the !definelong functionality or the nested include are broken. Also manually including the dependant plantuml parts c4/C4 and c4/C4_Context from the standard library doesn't solve the issue.

A minimal example showing the error is http://www.plantuml.com/plantuml/png/SoWkIImgAStDuLBCp4lEAKr9LR19Dj5tDebtpiyhISpCIosou-BoSOpq3ms93_SCyOZtSNLtzNFXueBBQoGMPCOd5XJeA2Wv1dWgE1OKv6Gc9vPavkSf0OMy4iiITHI22ueoyz9ra_BpIvGqkHnIyrA0LW80

Commenting the LAYOUT_WITH_LEGEND will make it render.

1 Answer

0 votes
answered Oct 30 by mgrol (2,690 points)

Hi,

this is because the preprocessor was switched between 1.2019.5 and 1.2019.6. 

Your example will work if you add brackets to LAYOUT_WITH_LEGEND()

Please refer to http://plantuml.com/en/preprocessing which states:

"When calling a legacy !definelong macro with no arguments, you do have to use parenthesis. You have to use my_own_definelong() because my_own_definelong without parenthesis is not recognized by the new preprocessor."

There is already a pull request in the underlaying repo:

https://github.com/RicardoNiepel/C4-PlantUML/pull/20

BR,

Michael

...