From: David G. <go...@us...> - 2004-06-14 12:15:49
|
Update of /cvsroot/docutils/sandbox/dpriest/csvtable In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16322 Modified Files: csvtable.txt Log Message: updated Index: csvtable.txt =================================================================== RCS file: /cvsroot/docutils/sandbox/dpriest/csvtable/csvtable.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- csvtable.txt 14 Jun 2004 11:52:15 -0000 1.2 +++ csvtable.txt 14 Jun 2004 12:15:40 -0000 1.3 @@ -7,16 +7,46 @@ :Directive Options: Possible. :Directive Content: A CSV (comma-separated values) table. -The "csvtable" directive is used to create a table:: +The "csvtable" directive is used to create a table from +CSV (comma-separated values) data:: .. csvtable:: Frozen Delights! :headers: "Treat", "Quantity", "Description" :widths: 15, 10, 30 "Albatross", 2.99, "On a stick!" - "Crunchy Frog", 1.49, "If we took the bones out, it wouldn't be crunchy now, would it?" + "Crunchy Frog", 1.49, "If we took the bones out, it wouldn't be + crunchy, now would it?" "Gannet Ripple", 1.99, "On a stick!" +Block markup and inline markup within cells is supported. Line ends +are recognized within cells. + +Supports CSV generators that do not insert "empty" entries at the end +of short rows. + +Working Limitations:: + +* Whitespace delimiters are supported only for external CSV files. + +* When using the ``hex ##`` character definition there must be only a + single space before the hexadecimal number. + +* There is no support for checking that the number of columns in each + row is the same. + + .. [This is of benefit to some types of tables. The results of + non-standard column counts is unpredictable, and will depend on + the particular Writer you are using.] + + .. Add "strict" option to verify input? + +* Due to limitations of the CSV parser, this directive is not Unicode + compatible. It may also have problems with ASCII NUL characters. + Accordingly, CSV tables should be ASCII-printable safe. + + .. Test with Unicode; see if that's really so. "encoding" option? + The following options are recognized: ``class`` : text @@ -38,42 +68,22 @@ ``file`` | ``url`` : path Path or URL to CSV file. Optional. -``delim`` : [char | tab | space | lf | ff | vt | hex ##] +``delim`` : [char | "tab" | "space" | "lf" | "ff" | "vt" | "hex ##"] A one-character string used to separate fields. Optional: defaults to ``,`` (comma). -``quote`` : [char | tab | space | lf | ff | vt | hex ##] +``quote`` : [char | "tab" | "space" | "lf" | "ff" | "vt" | "hex ##"] A one-character string used to quote elements containing the delimiter or which start with the quote character. Optional: defaults to ``"`` (quote). -``lineend`` : [cr | lf | crlf] +``lineend`` : ["cr" | "lf" | "crlf"] The string used to terminate lines in the CSV file. Useful only for external CSV files. Optional: defaults to ``crlf`` (carriage return + linefeed). -``escape`` : [char | tab | space | lf | ff | vt | hex ##] +``escape`` : [char | "tab" | "space" | "lf" | "ff" | "vt" | "hex ##"] A one-character string used to escape the delimiter or quote characters. Used when the delimiter is used in an unquoted field, or when quote characters are used within a field. Optional: defaults is to double-up the character, ie) "He said, ""Hi!""" - -Working Limitations:: - - Inline formatting within cells is supported. Line ends are not recognized - within a cell, thus block formatting within cells is largely unsupported. - (Block formatting works only for the first line of the cell.) - - Whitespace delimiters are supported only for external CSV files. - - When using the ``hex ##`` character definition there must be only a single - space before the hexadecimal number. - - There is no support for checking that the number of columns in each row is - the same. This is of benefit to some types of tables. The results of - non-standard column counts is unpredictable, and will depend on the - particular Writer you are using. - - This directive is not Unicode compatible. It may also have problems with - ASCII NUL characters. Accordingly, CSV tables should be ASCII-printable - safe. |