Changes between Initial Version and Version 1 of FlatTableMacro


Ignore:
Timestamp:
Jul 14, 2008, 6:46:31 AM (16 years ago)
Author:
Ashish Kulkarni
Comment:

New hack FlatTableMacro, created by ashkulz

Legend:

Unmodified
Added
Removed
Modified
  • FlatTableMacro

    v1 v1  
     1= A Wiki Processor for displaying a table with the markup being entered in a flat form. =
     2
     3== Description ==
     4
     5This [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.
     6
     7The column definition for the table has to be specified immediately after the macro directive, eg.
     8{{{
     9{{{
     10#!flat-table
     11#! Name: key, Relation: relation, Comment: comment notes
     12 [... table data ...]
     13}}}
     14}}}
     15Alternatively, one can also create a macro alias via configuration in trac.ini
     16
     17{{{
     18[flat-table]
     19dbdoc = Name: key, Relation: relation, Comment: comment notes
     20dbdoc.description = <macro description goes here>
     21}}}
     22
     23For the above example, one can then directly use
     24{{{
     25{{{
     26#!dbdoc
     27 [... table data ...]
     28}}}
     29}}}
     30
     31== Markup ==
     32
     33The 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.
     34
     35A 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).
     36
     37
     38== Bugs/Feature Requests ==
     39
     40Existing bugs and feature requests for FlatTableMacro are
     41[report:9?COMPONENT=FlatTableMacro here].
     42
     43If you have any issues, create a
     44[http://trac-hacks.org/newticket?component=FlatTableMacro&owner=ashkulz new ticket].
     45
     46== Download ==
     47
     48Download the zipped source from [download:flattablemacro here].
     49
     50== Source ==
     51
     52You can check out FlatTableMacro from [http://trac-hacks.org/svn/flattablemacro here] using Subversion, or [source:flattablemacro browse the source] with Trac.
     53
     54== Example ==
     55
     56{{{
     57{{{
     58#!flat-table
     59#! Name: key, Relation: relation, Comment: comment notes
     60
     61id:
     62  @relation: PK
     63
     64desc:
     65  @comment: description
     66
     67other_table_id:
     68  @relation: FK to other table
     69  @notes:
     70    This is a reference to another table with a [WikiPedia:Wiki wiki] link.
     71    More than one line can be entered for a column.
     72}}}
     73}}}
     74
     75will result in a display like this
     76
     77|| '''Name''' || '''Relation''' || '''Comment''' ||
     78|| id   || PK  || ||
     79|| desc || || description ||
     80|| 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.||
     81
     82
     83== Recent Changes ==
     84
     85[[ChangeLog(flattablemacro, 3)]]
     86
     87== Author/Contributors ==
     88
     89'''Author:''' [wiki:ashkulz] [[BR]]
     90'''Contributors:'''