Opened 15 years ago
Closed 8 years ago
#9165 closed enhancement (wontfix)
Render Wiki Content to Genshi Markup Stream
Reported by: | 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 )
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)
Change History (8)
by , 15 years ago
Attachment: | initial.patch added |
---|
comment:1 by , 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 , 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.
comment:3 by , 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 , 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 , 14 years ago
Keywords: | wikiformatter added |
---|---|
Milestone: | → next-major-0.1X |
Version: | → 0.12dev |
Keeping on the radar.
comment:6 by , 8 years ago
Description: | modified (diff) |
---|---|
Keywords: | genshi added |
With the switch from Genshi to Jinja this seems unlikely?
comment:7 by , 8 years ago
Milestone: | next-major-releases |
---|---|
Resolution: | → wontfix |
Status: | new → closed |
Agreed. If anyone want to implement this for Trac < 1.3.2, feel free to reopen.
initial patch to get things started