Ticket #7053 (new enhancement)

Opened 3 years ago

Last modified 6 months ago

Render text from repository

Reported by: simon@tardell.se Assigned to: rjollos
Priority: normal Component: PlantUmlMacro
Severity: normal Keywords:
Cc: hasienda 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

Change History

(follow-up: ↓ 6 ) 06/07/10 10:40:16 changed by airadier

  • owner changed from robert_martin to airadier.
  • status changed from new to assigned.

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

02/06/12 04:48:34 changed by rjollos

  • status changed from assigned to new.
  • owner changed from airadier to rjollos.

The CodeExampleMacro implements a similar feature.

02/06/12 06:02:12 changed by rjollos

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

(follow-up: ↓ 5 ) 06/08/12 10:28:56 changed by rjollos

  • cc set to hasienda.

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.

(in reply to: ↑ 4 ) 06/11/12 10:01:24 changed by rjollos

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.

(in reply to: ↑ 1 ) 06/11/12 10:19:27 changed by rjollos

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.

(follow-up: ↓ 9 ) 06/12/12 08:20:31 changed by rjollos

(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.

06/12/12 08:38:30 changed by rjollos

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

(in reply to: ↑ 7 ; follow-up: ↓ 10 ) 06/18/12 09:42:38 changed by tom.ghyselinck@excentis.com

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.

(in reply to: ↑ 9 ) 06/18/12 23:17:38 changed by rjollos

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, ...).

11/26/12 02:04:50 changed by rjollos

(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.

Add/Change #7053 (Render text from repository)




Change Properties
Action