Opened 15 years ago
Closed 9 years ago
#7053 closed enhancement (fixed)
Render text from repository
Reported by: | Owned by: | Ryan J Ollos | |
---|---|---|---|
Priority: | normal | Component: | PlantUmlMacro |
Severity: | normal | Keywords: | |
Cc: | Steffen Hoffmann | Trac Release: | 0.11 |
Description
It would be nice if it would be possible to render a UML graph from text in the repository rather than text inlined in the wiki page.
Attachments (0)
Change History (12)
comment:1 follow-up: 6 Changed 14 years ago by
Owner: | changed from robert_martin to Álvaro Iradier |
---|---|
Status: | new → assigned |
comment:2 Changed 13 years ago by
Owner: | changed from Álvaro Iradier to Ryan J Ollos |
---|---|
Status: | assigned → new |
The CodeExampleMacro implements a similar feature.
comment:4 follow-up: 5 Changed 12 years ago by
Cc: | Steffen Hoffmann added; anonymous removed |
---|
I have a working implementation of this feature, which just needs some unit tests added. I also have some questions about the syntax. What is the proper way to pass arguments to WikiProcessors? The only example I could find in Trac 0.12 is the div
processor: t:WikiProcessors#Examples. Following that example, the proper syntax would be:
{{{ #!PlantUML path=/somepath }}}
but I'm not sure how the argument gets passed to the WikiProcessor, and whether this could be made to work with both Trac 0.11 and 0.12.
Maybe a better option would be to provide a WikiMacro for rendering text from the repository. For example,
[[PlantUML(somepath)]]
If we go that route, then I think #9906 should be implemented, and the WikiProcessor should be named plantuml
and the macro named PlantUml
.
comment:5 Changed 12 years ago by
Replying to rjollos:
but I'm not sure how the argument gets passed to the WikiProcessor, and whether this could be made to work with both Trac 0.11 and 0.12.
I found that this is actually clearly described in the documentation: trac/wiki/api.py.
comment:6 Changed 12 years ago by
Replying to airadier:
Indeed it would be nice. I'll take a look to implement rendering from source: (repository) and from attach: too.
It seems like the ideal approach here would be to pattern this after the ImageMacro syntax. As I'm writing the code for this, I'm finding it is very similar to code that I've recently written for the IncludeMacro.
comment:7 follow-up: 9 Changed 12 years ago by
(In [11637]) Refs #7053: Added support for rendering markup from the repository. NOTE: This is work in progress and the calling syntax will change as support for additional realms is added. Feedback is welcome and appreciated.
The following are supported:
[[PlantUml(/path/to/repository)]]
[[PlantUml(/repos/path/to/repository@rev)]]
(i.e. multi-repository installations and specific revisions are supported).
{{{ #!plantuml path="/path/to/repository" ... }}}
{{{ #!plantuml path="/repos/path/to/repository@rev" ... }}}
The Trac convention is to use camelcase names for macro calls and lowercase names for WikiProcessors, therefore PlantUml
and plantuml
have been added as valid casings. However, PlantUML
is still a valid casing, retained for backwards compatibility.
comment:8 Changed 12 years ago by
comment:9 follow-up: 10 Changed 12 years ago by
Hi,
I would be great if we could diversify between two figures in a single file.
e.g. /path/to/source/file.txt
contains:
@startuml{figure1.png} title figure1 @enduml ... @startuml{figure2.png} title figure2 @enduml
You could provide something like
[[PlantUml(/path/to/source/file.txt#figure1)]]
or [[PlantUml(/path/to/source/file.txt@rev#figure1)]]
?
I don't know by heart what's the correct (Trac) syntax for such references.
comment:10 Changed 12 years ago by
Replying to tom.ghyselinck@excentis.com:
I would be great if we could diversify between two figures in a single file.
Thanks for your feedback. That seems like a good feature to have, and I will see if I can add it after I add the other plantuml markup sources I have planned to support (wiki, attachment, ...).
comment:11 Changed 12 years ago by
comment:12 Changed 9 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Indeed it would be nice. I'll take a look to implement rendering from source: (repository) and from attach: too.