Modify

Opened 6 years ago

Closed 21 months ago

Last modified 19 months ago

#4452 closed enhancement (fixed)

[Patch] Use wiki formatting in tables

Reported by: nangel@… Owned by: rjollos
Priority: normal Component: WikiTableMacro
Severity: normal Keywords:
Cc: falkb Trac Release: 0.11

Description

It would be nice to be able to use wiki rendering of the output; for example, if using the sqlite database backend, it would be nice to be able to make the links by using WikiFormatting:

  {{{
  #!SQLTable
   select '[milestone:' || name || ' ' || name || "]" as name,
   due,completed,description from milestone 
  }}}

right now, it displays a literal [milestone:milestone1 milestone1]

Attachments (1)

wikitable.patch (1.5 KB) - added by nangel@… 5 years ago.
Patch the essentially accomplishes the above

Download all attachments as: .zip

Change History (9)

Changed 5 years ago by nangel@…

Patch the essentially accomplishes the above

comment:1 Changed 5 years ago by nangel@…

Patch that essentially does this

  • 0.11/trunk/wikitable/htdocs/css/wikitable.css

    diff -ur wikitablemacro.orig/0.11/trunk/wikitable/htdocs/css/wikitable.css wikitablemacro/0.11/trunk/wikitable/htdocs/css/wikit
    able.css
    old new  
    11table.wikitable { 
    22    width: auto; 
    3 } 
    4  No newline at end of file 
     3} 
     4 
     5table.wikitable p { 
     6       display: inline; 
     7} 
  • 0.11/trunk/wikitable/table.py

    diff -ur wikitablemacro.orig/0.11/trunk/wikitable/table.py wikitablemacro/0.11/trunk/wikitable/table.py
    old new  
    55from trac.core import implements 
    66from trac.web.chrome import ITemplateProvider, add_stylesheet 
    77 
     8from trac.wiki import wiki_to_html 
     9 
    810from trac.wiki.macros import WikiMacroBase 
    911from trac.util.html import Markup 
    1012 
     
    5355            css_class = (idx % 2 == 0) and 'odd' or 'even' 
    5456            print >>out, "  <tr class='%s'>" % css_class 
    5557            for col in row: 
    56                 print >>out, "<td>%s</td>" % col 
     58               text = wiki_to_html (StringIO(col).getvalue(), self.env, req) 
     59               print >>out, "<td>%s</td>" % text 
    5760            print >>out, "  </tr>" 
    5861             
    5962        print >>out, " </tbody>" 

comment:2 Changed 5 years ago by rjollos

  • Summary changed from Request for wiki formatting of result tables to [Patch] Use wiki formatting in tables
  • Type changed from defect to enhancement

comment:3 Changed 5 years ago by rjollos

  • Owner changed from optilude to rjollos

Changing ticket owner as maintainership will soon be transferred.

comment:4 Changed 21 months ago by rjollos

(In [12459]) Refs #4452, #10724: Parse table data as wiki markup and format to HTML.

comment:5 Changed 21 months ago by rjollos

  • Status changed from new to assigned

An example has been added to the project wiki page.

comment:6 Changed 21 months ago by rjollos

  • Cc falkb added

comment:7 Changed 21 months ago by rjollos

  • Resolution set to fixed
  • Status changed from assigned to closed

Please follow-up here if you have any issues with the latest change.

comment:8 Changed 19 months ago by rjollos

#10814 is a regression ticket against [12459].

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.