Ticket #4452 (closed enhancement: fixed)

Opened 4 years ago

Last modified 3 months ago

[Patch] Use wiki formatting in tables

Reported by: nangel@nothome.org Assigned to: 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

wikitable.patch (1.5 kB) - added by nangel@nothome.org on 07/09/09 18:28:20.
Patch the essentially accomplishes the above

Change History

07/09/09 18:28:20 changed by nangel@nothome.org

  • attachment wikitable.patch added.

Patch the essentially accomplishes the above

07/09/09 18:29:57 changed by nangel@nothome.org

Patch that essentially does this

diff -ur wikitablemacro.orig/0.11/trunk/wikitable/htdocs/css/wikitable.css wikitablemacro/0.11/trunk/wikitable/htdocs/css/wikit
able.css
--- wikitablemacro.orig/0.11/trunk/wikitable/htdocs/css/wikitable.css   2008-10-30 13:34:46.000000000 -0500
+++ wikitablemacro/0.11/trunk/wikitable/htdocs/css/wikitable.css        2009-07-09 11:13:08.000000000 -0500
@@ -1,3 +1,7 @@
 table.wikitable {
     width: auto;
-}
\ No newline at end of file
+}
+
+table.wikitable p {
+       display: inline;
+}
diff -ur wikitablemacro.orig/0.11/trunk/wikitable/table.py wikitablemacro/0.11/trunk/wikitable/table.py
--- wikitablemacro.orig/0.11/trunk/wikitable/table.py   2008-10-30 13:34:46.000000000 -0500
+++ wikitablemacro/0.11/trunk/wikitable/table.py        2009-07-09 10:33:08.000000000 -0500
@@ -5,6 +5,8 @@
 from trac.core import implements
 from trac.web.chrome import ITemplateProvider, add_stylesheet
 
+from trac.wiki import wiki_to_html
+
 from trac.wiki.macros import WikiMacroBase
 from trac.util.html import Markup
 
@@ -53,7 +55,8 @@
             css_class = (idx % 2 == 0) and 'odd' or 'even'
             print >>out, "  <tr class='%s'>" % css_class
             for col in row:
-                print >>out, "<td>%s</td>" % col
+               text = wiki_to_html (StringIO(col).getvalue(), self.env, req)
+               print >>out, "<td>%s</td>" % text
             print >>out, "  </tr>"
             
         print >>out, " </tbody>"

01/04/10 09:21:35 changed by rjollos

  • type changed from defect to enhancement.
  • summary changed from Request for wiki formatting of result tables to [Patch] Use wiki formatting in tables.

02/07/10 04:24:36 changed by rjollos

  • owner changed from optilude to rjollos.

Changing ticket owner as maintainership will soon be transferred.

12/21/12 17:08:10 changed by rjollos

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

12/21/12 17:12:48 changed by rjollos

  • status changed from new to assigned.

An example has been added to the project wiki page.

12/21/12 17:13:16 changed by rjollos

  • cc set to falkb.

12/21/12 17:36:29 changed by rjollos

  • status changed from assigned to closed.
  • resolution set to fixed.

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

02/21/13 22:18:51 changed by rjollos

#10814 is a regression ticket against [12459].


Add/Change #4452 ([Patch] Use wiki formatting in tables)




Change Properties
Action