wiki:WikiTableMacro

Display a table in a wiki page

Description

This is a macro that enables you to place tables resulting from SQL queries into a Trac wiki page.

Use the SQLTable macro as follows:

{{{#!SQLTable
SELECT COUNT(id) AS "Number of Tickets"
FROM ticket
}}}

The result will be a table displayed in a html page.

You can also use wiki markup in the table:

{{{#!SQLTable
SELECT '[milestone:' || name || ' ' || name || ']' AS name, due, completed, description
FROM milestone 
}}}

Use the SQLScalar macro:

{{{#!SQLScalar
SELECT COUNT(id) AS "Number of Tickets"
FROM ticket
}}}

The result will be a single number.

It is similar to, but simpler than, SqlQueryMacro or SqlAlchemyQueryMacro. The main differences are that it has fewer dependencies and only queries the Trac database, rather than requiring you to set up a separate database connection.

See also WikiReportMacro.

Bugs/Feature Requests

Existing bugs and feature requests for WikiTableMacro are here.

If you have any issues, create a new ticket.

defect

6 / 6

enhancement

8 / 8

task

4 / 4

Download

Download the zipped source from here.

Source

You can check out WikiTableMacro from here using Subversion, or browse the source with Trac.

Installation

  1. Install globally:
    sudo easy_install https://trac-hacks.org/svn/wikitablemacro/trunk
    
  2. Enable the plugin by updating TracIni file (conf/trac.ini):
    [components]
    wikitable.* = enabled
    
  3. Restart web server on command line:
    sudo /etc/init.d/apache2 restart
    

Recent Changes

16994 by rjollos on 2017-11-20 00:43:24
WikiTableMacro 0.3: Release version 0.3

Fixes #13336.

16993 by rjollos on 2017-11-20 00:41:44
WikiTableMacro 0.3dev: Conform to PEP8

Refs #13336.

14734 by rjollos on 2015-06-22 22:53:59
0.3dev: Partial revert of [14524]. Refs #11708.

Reverts to format_to_html but adds CSS to shrink the cell margins.

(more)

Author/Contributors

Author: optilude
Maintainer: Ryan J Ollos
Contributors: jun66j5

Last modified 4 weeks ago Last modified on Nov 20, 2017, 12:51:13 AM