Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for PlantUML "newpage" command #195

Open
msgilligan opened this issue Sep 18, 2018 · 3 comments
Open

Support for PlantUML "newpage" command #195

msgilligan opened this issue Sep 18, 2018 · 3 comments

Comments

@msgilligan
Copy link
Member

msgilligan commented Sep 18, 2018

I'm creating a Use Case diagram with PlantUML inside an Asciidoctor document (I'm using inline Asciidoctor). When I use the PlantUML newpage command inside a diagram, I was hoping that the diagram would be split into two parts (pages) but still displayed as part of the same image in the rendered Asciidoc.

I don't want to duplicate the Actor and Use Case definitions in two separate diagrams. I'm willing to put the PlantUML markdown in a separate file if that will help render both "pages".

Is there a way to do this with the current code? If not, please consider this an enhancement request.

@pepijnve
Copy link
Member

At the moment I think you'll need to extract the shared bits to a separate file and then include that from the two separate diagrams where you make use of the shared parts. There's a pretty strong assumption in the code at the moment that only a single image will be generated per diagram block.

In theory it's possible to support this and even generate an asciidoc page break where the newpage is, but then asciidoctor-diagram would have to operate as an AST manipulator while now it's just a block generator.

@alonbl
Copy link

alonbl commented Nov 19, 2019

Hi,
I have a similar issue...
The plantuml has limitation of diagram size, in long sequence diagrams, the only method to see the hidden parts is to split into new pages.
Copying the participants is not sufficient as the grid is dynamic so the next diagram is not aligned.
Thanks,
Alon

@tpraxl
Copy link

tpraxl commented Dec 17, 2022

Personal background

I found it best to add a "legend" to a PlantUML diagram after newpage, which properly places the legend below the diagram.
I would very much appreciate the support of newpage.

Want to contribute

I am willing to look into solutions for this issue, and to support the implementation.

Problem

As far as I got the problem:

  • asciidoctor-diagram converts one block to one image -> 1:1
  • multiple images can thus not be inserted for one plantuml block

Alternative Approaches

I see two alternative approaches to support newpage:

  • a) The conversion merges the resulting images to one single image -> 1 block : 1 image
    • This may cause issues with maximum dimensions of plantuml images and page-breaks in asciidoctor
  • b) asciidoctor-diagram creates multiple images per block
    • This might have a huge impact on the architecture
    • It might cause problems with meta data, such as width, alternative text, title, etc.

Discussion wanted

I would appreciate a discussion with one of the maintainers on this topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants