Modify

Opened 9 years ago

Closed 5 years ago

Last modified 4 years ago

#4452 closed enhancement (fixed)

[Patch] Use wiki formatting in tables

Reported by: nangel@… Owned by: Ryan J Ollos
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@… 8 years ago.
Patch the essentially accomplishes the above

Download all attachments as: .zip

Change History (9)

Changed 8 years ago by nangel@…

Attachment: wikitable.patch added

Patch the essentially accomplishes the above

comment:1 Changed 8 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 8 years ago by Ryan J Ollos

Summary: Request for wiki formatting of result tables[Patch] Use wiki formatting in tables
Type: defectenhancement

comment:3 Changed 8 years ago by Ryan J Ollos

Owner: changed from Martin Aspeli to Ryan J Ollos

Changing ticket owner as maintainership will soon be transferred.

comment:4 Changed 5 years ago by Ryan J Ollos

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

comment:5 Changed 5 years ago by Ryan J Ollos

Status: newassigned

An example has been added to the project wiki page.

comment:6 Changed 5 years ago by Ryan J Ollos

Cc: falkb added; anonymous removed

comment:7 Changed 5 years ago by Ryan J Ollos

Resolution: fixed
Status: assignedclosed

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

comment:8 Changed 4 years ago by Ryan J Ollos

#10814 is a regression ticket against [12459].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted.

Add Comment


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

 
Note: See TracTickets for help on using tickets.