Discussion:
[Docutils-users] CSV table problems
Alan Isaac
2017-03-10 18:43:04 UTC
Permalink
Output for the first line of Test Table 1 is OK,
if the last line is deleted.
The last is not OK (because of the commas).

It *is* possible to put the expressions in quotes.
BUT:

Output for the first line of Test Table 2 is OK,
if the last line is deleted.
The last is not OK (because of the space before the comma).

Cheers,
Alan Isaac

Test CSV Tables
----------------

.. csv-table:: Test Table 1
:header: code, math

:code:`int` , :math:`33`
:code:`(int,int)` , :math:`(33,33)`

.. csv-table:: Test Table 2
:header: hthis, hthat

"test","this","that"
"test","this" , "that"


------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
_______________________________________________
Docutils-users mailing list
Docutils-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/docutils-users

Please use "Reply All" to reply to the list.
Guenter Milde
2017-03-11 20:32:38 UTC
Permalink
Post by Alan Isaac
Output for the first line of Test Table 1 is OK,
if the last line is deleted.
The last is not OK (because of the commas).
Yes, you need to have valid rST in every field.
The last line contains 4 fields (because of the commas).

How about setting a different deliminator?
(See docs/ref/rst/directives.html#id4)
Post by Alan Isaac
It *is* possible to put the expressions in quotes.
Output for the first line of Test Table 2 is OK,
if the last line is deleted.
The last is not OK (because of the space before the comma).
Yes, because you cannot put only a part of the expression in quotes and
whitespace is not stripped.

BUT, you can simply ensure that there is no whitespace between " and the
deliminator.


Test CSV Tables

.. csv-table:: Test Table 1
:delim: ;
:header: code; math

:code:`int` ; :math:`33`
:code:`(int,int)` ; :math:`(33,33)`

.. csv-table:: Test Table 2
:header: hthis, hthat

"test","this","that"
"test","this","that"


Günter


------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
_______________________________________________
Docutils-users mailing list
Docutils-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/docutils-users

Please use "Reply
Alan Isaac
2017-03-12 00:09:01 UTC
Permalink
Post by Guenter Milde
you cannot put only a part of the expression in quotes and
whitespace is not stripped.
Got it. I misread the following (by ignoring the "following"):
"Treat whitespace immediately following the delimiter as significant.
The default is to ignore such whitespace."

Thank you for the patient correction.

Alan

------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
_______________________________________________
Docutils-users mailing list
Docutils-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/docutils-users

Please use "Reply All" to reply to the list.

Continue reading on narkive:
Loading...