I am using 0.10.2. I realized my mistake, I was putting the text in a
macro that does formatting and the block was big I forgot I wasn't in
wiki text. The macro we made makes tables (since Trac table syntax is
not convenient to us)... maybe I should modify it to call some
wikification function on the cells in the table... Isn't there a
function to do that in my macro if I have plain text I want to convert
wiki text to HTML?

from trac.util import escape
from StringIO import StringIO
import csv

def execute(hdf, txt, env):
    sniffer = csv.Sniffer()
    enc = txt.encode('ascii', 'replace')
    reader = csv.reader( StringIO(enc), sniffer.sniff(enc) )
    out = StringIO()
    rowTemplate = '<th>%s</th>' #start with header row
    out.write('<table class="wiki">\n')
    for row in reader:
        out.write('<tr>')
        for col in row:
            out.write(rowTemplate % escape(col))
        out.write('</tr>\n')
        rowTemplate = '<td>%s</td>' #go back to normal rows
    out.write('</table>\n')
    return out.getvalue()

Jason

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED]
On Behalf Of Christian Boos
Sent: Friday, January 12, 2007 4:06 PM
To: [email protected]
Subject: [Trac] Re: Linking To Sections


Christian Boos wrote:
> Jason Winnebeck wrote:
>   
>> How can I easily link to sections in the current page? I have a wiki
>> page that we plan to have a large number of cross links. The only way
I
>> have discovered is to use the full path, but this is longer to type
and
>> is verbose if using pages in a depth of hierarchies.
>>
>> I've tried:
>>
>> [./#SourceModule SourceModule]
>> [#SourceModule SourceModule]
>> [#SourceModule]
>>   
>>     
>
> All of these work in 0.11dev.
>   

Whoops, I was too prompt to send the mail: the last two forms should 
also work in 0.10. Which version are you using?

-- Christian




--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"Trac Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to