Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RST output: Generate simple-style tables if possible #4750

Closed
kaushalmodi opened this issue Jun 30, 2018 · 3 comments
Closed

RST output: Generate simple-style tables if possible #4750

kaushalmodi opened this issue Jun 30, 2018 · 3 comments

Comments

@kaushalmodi
Copy link

kaushalmodi commented Jun 30, 2018

See the original request on Google Groups for details.

Here's my original message copy/pasted from that thread:


I am trying to use Org mode to document few Nim (https://nim-lang.org) packages. Nim has an internal HTML documentation generator that parses ReST markup docs and doc-strings.

So I am doing:

pandoc foo.org -o foo.rst

to export Org docs to ReST.

This works mostly fine except that the Nim document generator doesn't parse the grid-style ReST tables generated by Pandoc.

Example:

This style of ReST tables is parsed fine by the Nim doc generator:

  =======  =========
  Option   Meaning
  -------  ---------
  ``+``    All numbers (including positive ones) are preceded by a sign.
  ``-``    Only negative numbers are preceded by a sign.
  *SPACE*  Negative numbers are preceded by a sign, positive numbers are preceded by a space.
  =======  =========

But this style (grid-style) is not:

    +-----------------------------------+-----------------------------------+
    | Option                            | Meaning                           |
    +===================================+===================================+
    | ``+``                             | All numbers (including positive   |
    |                                   | ones) are preceded by a sign.     |
    +-----------------------------------+-----------------------------------+
    | ``-``                             | Only negative numbers are         |
    |                                   | preceded by a sign.               |
    +-----------------------------------+-----------------------------------+
    | *SPACE*                           | Negative numbers are preceded by  |
    |                                   | a sign, positive numbers are      |
    |                                   | preceded by a space.              |
    +-----------------------------------+-----------------------------------+

Here is the Org source:

  | Option    | Meaning                                                                              |
  |-----------+--------------------------------------------------------------------------------------|
  | =+=       | All numbers (including positive ones) are preceded by a sign.                        |
  | =-=       | Only negative numbers are preceded by a sign.                                        |
  | /SPACE/   | Negative numbers are preceded by a sign, positive numbers are preceded by a space.   |

Is there a way to choose the former style of ReST table when exporting from Org?

If not, would you please add this feature?

Thanks!


To which, @jgm replied:

In principle, we could change the RST writer so it produces the simple tables when the contents of the table are simple enough (no block structure, no overly long lines).

@kaushalmodi
Copy link
Author

Ref: nim-lang/Nim#6429

@jgm jgm closed this as completed in bd8a663 Oct 7, 2018
@kaushalmodi
Copy link
Author

@jgm Thank you! Now I'm desperately waiting for a static binary including this commit. Many thanks!

@rpuntaie
Copy link

rpuntaie commented Mar 24, 2019

pandoc -f docx -t rst+grid_tables doc.docx does still produce simple table output.

What would be the command line to have grid_table output for RST, as it was before this change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants