Create links after creating a diagram

0 votes
asked Feb 2 in Closed feature request by hhhannes (190 points)

Let's say I would like to use the link feature to reference from sequence diagram messages to a more detailed description somewhere.

I can do it like that:

a -> b: [[/messages.html#010 write(a)]]

Now, assume the target of a link is a document where the anchors correspond to the auto-numbered messages. But the numbering is only available at rendering time.

Is there a way to hook into diagram creation and use a templating mechanism to create the links dynamically? 

Bye,

Jo

2 Answers

0 votes
answered Feb 5 by plantuml (160,740 points)
selected Mar 21 by Anthony-Gaudino
 
Best answer

So with last beta http://beta.plantuml.net/plantuml.jar

You can have:

@startuml
autonumber 10
Alice -> Bob: [[/messages.html#%autonumber% write(a)]]
note left
  the autonumber works everywhere.
  Here, its value is %autonumber%
end note
Bob --> Alice: Response %autonumber%
@enduml

This has not been highly tested, so feedback welcome!

0 votes
answered Feb 4 by plantuml (160,740 points)

Sorry, it's not possible yet.

But we are thinking about allowing something like:

@startuml
autonumber 10
Alice -> Bob: [[/messages.html#%autonumber% write(a)]]
Bob --> Alice: Response
@enduml

The %autonumber% variable would be replaced by the corresponding value. Would this meet your expectations ?

commented Feb 5 by hhhannes (190 points)
That sounds amazing!
...