]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blob - doc/plugins/contrib/table.mdwn
rename and comments
[git.ikiwiki.info.git] / doc / plugins / contrib / table.mdwn
1 [[meta title="table (third-party plugin)"]]
3 This plugin allows build html tables from data in csv (comma-separated values) or dsv (delimiter-separated values) formats.
5 It need the perl module [[cpan Text::CSV]] for the csv data. 
7 ## usage
9 In any source page include the following:
11     The next table show the results:
13     \[[table class="myclass" format=dsv data="""
14     Custom|Amount|
15     Fulanito|134,34|
16     Menganito|234,56|
17     """]]
19     This is my last acquisition:
21     [[table class="book_record" format=csv file="data/books/record1"]]
23     And the record1 page should be similar to:
25     "Title","Perl Best Practices"
26     "Author","Damian Conway"
27     "Publisher","O’Reilly"
29 The parameters are:
31 - _data_: Contains the values for the table
32 - _file_: Wiki page whom contains the data.
33 - _format_ (optional): format name of the data. By default is `auto` and the options are `csv` or `dsv`.
34 - _delimiter_ (optional): Define the character used for separated the fields. By default is the vertical barr "|" in DSV format and the comma "," for the CSV format.
35 - _class_ (optional):  CSS class for the table html element
36 - _caption_ (optional):   Text string with the table caption.
37 - _no\_header_: This switch disable the generation of table header elements. By default this switch is enabled, and the header cells come from the firts data line.
39 Obviously, the _data_ and _file_ parameters are mutually exclusive. 
41 Note: the format detection mechanism is still very rudimentary. 
43 ## Changelog
45 ### version 0.5
47 * Remove a call to a inexistent Text::CSV method.
48 * Added the sep_char parameter.
49 * Parse CVS data in binary mode.
50 * Added a format detection mechanism.
51 * Default format now is 'auto'.
53 ## Links
55 - Information about the formats in Wikipedia:
56     - [[wikipedia CSV]]
57     - [[wikipedia DSV]]
59 - Download of the tar file from <http://taquiones.net/files/misc/>
60 - Debian package in <http://taquiones.net/files/debian/>