Modify

Opened 7 years ago

Closed 2 years ago

#7053 closed enhancement (fixed)

Render text from repository

Reported by: simon@… 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 Changed 7 years ago by Álvaro Iradier

Owner: changed from robert_martin to Álvaro Iradier
Status: newassigned

Indeed it would be nice. I'll take a look to implement rendering from source: (repository) and from attach: too.

comment:2 Changed 6 years ago by Ryan J Ollos

Owner: changed from Álvaro Iradier to Ryan J Ollos
Status: assignednew

The CodeExampleMacro implements a similar feature.

comment:3 Changed 6 years ago by Ryan J Ollos

See also #1048 for a similar feature, different plugin.

comment:4 Changed 5 years ago by Ryan J Ollos

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 in reply to:  4 Changed 5 years ago by Ryan J Ollos

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 in reply to:  1 Changed 5 years ago by Ryan J Ollos

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 Changed 5 years ago by Ryan J Ollos

(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 5 years ago by Ryan J Ollos

(In [11638]) Refs #7053: Added support for translation of error messages.

comment:9 in reply to:  7 ; Changed 5 years ago by tom.ghyselinck@…

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 in reply to:  9 Changed 5 years ago by Ryan J Ollos

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 5 years ago by Ryan J Ollos

(In [12389]) Refs #10229, #7053:

  • Fixed error reported on Trac 0.11.7 in which calls containing the uml in the body of the wikiprocessor would fail with Path not specified.
  • A message with the file path is now reported when the file is not found in the repository.

comment:12 Changed 2 years ago by Ryan J Ollos

Resolution: fixed
Status: newclosed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.