= A Wiki Processor for displaying a table with the markup being entered in a flat form. = == Description == This [WikiProcessors Wiki processor] allows you to enter the data for a table in an alternative markup, which is very useful when there are a lot of columns and/or when some of the columns are optional. This markup also has the advantage of being much more readable and diff-friendly, at the expense of requiring more markup. The column definition for the table has to be specified immediately after the macro directive, eg. {{{ {{{ #!flat-table #! Name: key, Relation: relation, Comment: comment notes [... table data ...] }}} }}} Alternatively, one can also create a macro alias via configuration in trac.ini {{{ [flat-table] dbdoc = Name: key, Relation: relation, Comment: comment notes dbdoc.description = macro description goes here }}} For the above example, one can then directly use {{{ {{{ #!dbdoc [... table data ...] }}} }}} == Markup == The markup is loosely based on a very simplified YAML/JSON-like syntax. At least one column is always assumed to be mandatory per table, which is the '''key''' column. The order and name of the generated columns is controlled by the metadata line, as shown above. For each column, one can define one or more '''aliases''' which can be used in the markup to define the column data. A line with no leading spaces and ending in a colon defines the start of a new row, with the line content representing the value of the '''key''' column. A line with some leading spaces followed by an '''@alias:''' defines the column within the row. Any other content on that line or any subsequent lines is assumed to be the content of that column (basic Wiki syntax can be used). == Bugs/Feature Requests == Existing bugs and feature requests for FlatTableMacro are [report:9?COMPONENT=FlatTableMacro here]. If you have any issues, create a [http://trac-hacks.org/newticket?component=FlatTableMacro&owner=ashkulz new ticket]. == Download == Download the zipped source from [download:flattablemacro here]. == Source == You can check out FlatTableMacro from [http://trac-hacks.org/svn/flattablemacro here] using Subversion, or [source:flattablemacro browse the source] with Trac. == Example == {{{ {{{ #!flat-table #! Name: key, Relation: relation, Comment: comment notes id: @relation: PK desc: @comment: description other_table_id: @relation: FK to other table @notes: This is a reference to another table with a [WikiPedia:Wiki wiki] link. More than one line can be entered for a column. }}} }}} will result in a display like this || '''Name''' || '''Relation''' || '''Comment''' || || id || PK || || || desc || || description || || other_table_id || FK to other table || This is a reference to another table with a [WikiPedia:Wiki wiki] link. [[BR]]More than one line can be entered for a column.|| == Recent Changes == [[ChangeLog(flattablemacro, 3)]] == Author/Contributors == '''Author:''' [wiki:ashkulz] [[BR]] '''Contributors:'''