Edgewall Software
Modify

Opened 15 years ago

Closed 8 years ago

#9165 closed enhancement (wontfix)

Render Wiki Content to Genshi Markup Stream

Reported by: Carsten Klein <carsten.klein@…> Owned by:
Priority: normal Milestone:
Component: rendering Version: 0.12dev
Severity: normal Keywords: wikiformatter genshi
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description (last modified by Peter Suter)

See the attached patch for a provable solution for this enhancement.

(I will attach the patch as soon as I have it ready.)

Attachments (1)

initial.patch (933 bytes ) - added by Carsten Klein <carsten.klein@…> 15 years ago.
initial patch to get things started

Download all attachments as: .zip

Change History (8)

by Carsten Klein <carsten.klein@…>, 15 years ago

Attachment: initial.patch added

initial patch to get things started

comment:1 by Carsten Klein <carsten.klein@…>, 15 years ago

The initial.patch seems to work. I have not found any side effects by it yet.

It will make it possible to select or transform content rendered by wiki_to_html (format_to_html).

comment:2 by Carsten Klein <carsten.klein@…>, 15 years ago

Small correction on behalf of the ticket:9165:initial.patch:

Where it simply reads HTML() it should read HTML(''), otherwise an exception will be raised since the HTML() function at least requires one parameter.

Last edited 15 years ago by Remy Blank (previous) (diff)

comment:3 by Christian Boos, 15 years ago

What kind of transformations do you want to support that way?

If you want to be able to do some analysis of the Wiki syntax, then I think going down to the HTML level is the wrong approach, rather target the future "WikiDOM" (#4431). For now, this can be done by sub-classing the wiki Formatter.

If you really want to alter the generated HTML, then in the future this will also be made easier by sub classing Formatters, which will be only formatters, not a combined parser/formatter.

But applying Genshi transforms to the generated Wiki markup is IMO going in the wrong direction, and I'd rather put more stuff in Markup blocks in order to minimize the Genshi overhead and slowness (see TracDev/Performance#Genshi) rather than doing the opposite, especially when this involves re-parsing the generated HTML like you do in this patch!

comment:4 by Carsten Klein <carsten.klein@…>, 15 years ago

Basically I wanted to access the nodes in the generated markup from wiki_to_html/format_to_html so I could change hyperlink targets for anchors of class 'ext-link' so that they will open up in a new window instead of opening in the same window.

However, this could also be done using a plugin which would introduce an extension to the wiki syntax.

If the future WikiDOM provides a programming interface to achive this kind of transformation, then it would also be fine with me.

comment:5 by Christian Boos, 14 years ago

Keywords: wikiformatter added
Milestone: next-major-0.1X
Version: 0.12dev

Keeping on the radar.

comment:6 by Peter Suter, 8 years ago

Description: modified (diff)
Keywords: genshi added

With the switch from Genshi to Jinja this seems unlikely?

comment:7 by Ryan J Ollos, 8 years ago

Milestone: next-major-releases
Resolution: wontfix
Status: newclosed

Agreed. If anyone want to implement this for Trac < 1.3.2, feel free to reopen.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The ticket will remain with no owner.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from (none) to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.