Skip to content

Commit

Permalink
make docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ickc committed May 21, 2019
1 parent 0268913 commit bf13871
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 12 deletions.
23 changes: 18 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,26 @@ csv-kwargs:

`pipe_tables`
If True, a pipe table will be constructed directly in markdown syntax
instead of via AST. `markdown` is implied to be True. This trades
correctness for speed. It won’t be correct if any of the cell is
multiline for example, resulting in an invalid pipe table. However, it
is much faster comparing to previous `markdown: True` case because
previously per cell a subprocess to execute pandoc the parse the
instead of via AST. `markdown` is implied to be True. `header` will be
overridden as true because `pipe_tables` must has header in pandoc.

This trades correctness for speed. It won’t be correct if any of the
cell is multiline for example, resulting in an invalid pipe table.
However, it is much faster comparing to previous `markdown: True` case
because previously per cell a subprocess to execute pandoc the parse the
markdown to AST is needed.

`grid_tables`
If True, a grid table will be constructed directly in markdown syntax
instead of via AST. `markdown` is implied to be True. `header` can be
used together with this.

This trades correctness for speed. This should be more robust than
`pipe_tables` since the `grid_tables` syntax supports everything the
pandoc AST supports. This however depends on an external dependency.
Install it by either `pip install terminaltables` or
`conda install terminaltables`.

`raw_markdown`
If True, force output the table as a pipe table (which is
tab-delimited.) This is sometimes useful if pandoc is very stubborn to
Expand Down
26 changes: 20 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,26 @@ keys are recognized:
``pipe_tables``
If True, a pipe table will be constructed directly in markdown syntax
instead of via AST. ``markdown`` is implied to be True. This trades
correctness for speed. It won’t be correct if any of the cell is
multiline for example, resulting in an invalid pipe table. However,
it is much faster comparing to previous ``markdown: True`` case
because previously per cell a subprocess to execute pandoc the parse
the markdown to AST is needed.
instead of via AST. ``markdown`` is implied to be True. ``header``
will be overridden as true because ``pipe_tables`` must has header in
pandoc.

This trades correctness for speed. It won’t be correct if any of the
cell is multiline for example, resulting in an invalid pipe table.
However, it is much faster comparing to previous ``markdown: True``
case because previously per cell a subprocess to execute pandoc the
parse the markdown to AST is needed.

``grid_tables``
If True, a grid table will be constructed directly in markdown syntax
instead of via AST. ``markdown`` is implied to be True. ``header``
can be used together with this.

This trades correctness for speed. This should be more robust than
``pipe_tables`` since the ``grid_tables`` syntax supports everything
the pandoc AST supports. This however depends on an external
dependency. Install it by either ``pip install terminaltables`` or
``conda install terminaltables``.

``raw_markdown``
If True, force output the table as a pipe table (which is
Expand Down
2 changes: 1 addition & 1 deletion pantable/pantable.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def regularize_table_list(raw_table_list):
for i, (n, row) in enumerate(zip(length_of_rows, raw_table_list)):
if n != n_col:
row += [''] * (n_col - n)
panflute.debug("pantable: the {}-th row is shorter than the longest row. Empty cells appended.")
panflute.debug("pantable: the {}-th row is shorter than the longest row. Empty cells appended.".format(i))
return n_col


Expand Down

0 comments on commit bf13871

Please sign in to comment.