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

Grid Tables #718

Merged
merged 8 commits into from Dec 26, 2017
Merged

Grid Tables #718

merged 8 commits into from Dec 26, 2017

Conversation

phadej
Copy link
Contributor

@phadej phadej commented Dec 21, 2017

Resolves #530

Based on RST Grid Tables http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#grid-tables,
which are more expressive then Emacs tables https://www.gnu.org/software/emacs/manual/html_node/emacs/Text-Based-Tables.html (AFAICS, strict superset)

Uses & supersedes #577: at least styles, and simple table test.

Trying to improve over #577

  • there are example-based tests using examples from RST spec, and few others.
  • spec: the same as RST Grid Table
  • I think you should provide some way to escape | in table cells. Otherwise typing | results in odd parser errors., you don't as you can add empty line to the cells or nudge contents a little (see RST spec and/or test examples)
  • I'll be happy to add documentation, but would prefer to do it as a separate PR after this one is merged. The spec is clear, so there won't be surprises in syntax description.

ATM the parser is quite lax, it would be handy to add warnings to haddock, so one can report them, but still don't fail (I guess it's possible by adding them to ParserState). However, that better done in a separate PR.

+------------------------+------------+----------+----------+
| Header row, column 1   | Header 2   | Header 3 | Header 4 |
| (header rows optional) |            |          |          |
+========================+============+==========+==========+
| body row 1, column 1   | column 2   | column 3 | column 4 |
+------------------------+------------+----------+----------+
| body row 2             | Cells may span columns.          |
+------------------------+------------+---------------------+
| body row 3             | Cells may  | \[                  |
+------------------------+ span rows. | f(n) = \sum_{i=1}   |
| body row 4             |            | \]                  |
+------------------------+------------+---------------------+

@hvr
Copy link
Member

hvr commented Dec 22, 2017

🏓

Simple parser is done by Giovanni Cappellotto (@potomak)
in haskell#577
It seems to support single fine full tables, so far from full
RST-grid tables, but it's good start.

Table type support row- and colspans, but obviously parser is lacking.

Still TODO:
- Latex backend. Should we use multirow package
  https://ctan.org/pkg/multirow?lang=en?
- Hoogle backend: ?
@phadej
Copy link
Contributor Author

phadej commented Dec 24, 2017

I got something working towards supporint colspan&rowspans based on ideas in http://docutils.sourceforge.net/docutils/parsers/rst/tableparser.py

There /will/ be a problem with UTF-8 as for tables we need to count characters. I won't do anything for that at this point.

@phadej
Copy link
Contributor Author

phadej commented Dec 25, 2017

screenshot from 2017-12-25 02-41-27

@phadej
Copy link
Contributor Author

phadej commented Dec 25, 2017

@hvr @alexbiehl this is ready for review.

EDIT I edited the PR description.

@phadej phadej changed the title WIP: Tables Grid Tables Dec 25, 2017
@alexbiehl
Copy link
Member

alexbiehl commented Dec 26, 2017

Oleg, this is looking good. I added a changelog entry and basic documentation. Let's make sure this ships with ghc-8.4.

@alexbiehl alexbiehl merged commit ad94ddf into haskell:master Dec 26, 2017
1 check passed
@phadej phadej deleted the table branch Dec 26, 2017
@phadej
Copy link
Contributor Author

phadej commented Dec 26, 2017

@alexbiehl thanks for writing the docs!

alexbiehl pushed a commit to alexbiehl/haddock that referenced this issue Feb 1, 2018
* Add table examples

* Add table types and adopt simple parser

Simple parser is done by Giovanni Cappellotto (@potomak)
in haskell#577
It seems to support single fine full tables, so far from full
RST-grid tables, but it's good start.

Table type support row- and colspans, but obviously parser is lacking.

Still TODO:
- Latex backend. Should we use multirow package
  https://ctan.org/pkg/multirow?lang=en?
- Hoogle backend: ?

* Implement grid-tables

* Refactor table parser

* Add two ill-examples

* Update CHANGES.md

* Basic documentation for tables

* Fix documentation example
alexbiehl pushed a commit that referenced this issue Feb 1, 2018
* Add table examples

* Add table types and adopt simple parser

Simple parser is done by Giovanni Cappellotto (@potomak)
in #577
It seems to support single fine full tables, so far from full
RST-grid tables, but it's good start.

Table type support row- and colspans, but obviously parser is lacking.

Still TODO:
- Latex backend. Should we use multirow package
  https://ctan.org/pkg/multirow?lang=en?
- Hoogle backend: ?

* Implement grid-tables

* Refactor table parser

* Add two ill-examples

* Update CHANGES.md

* Basic documentation for tables

* Fix documentation example
sjakobi pushed a commit to sjakobi/haddock that referenced this issue Jun 10, 2018
* Add table examples

* Add table types and adopt simple parser

Simple parser is done by Giovanni Cappellotto (@potomak)
in haskell#577
It seems to support single fine full tables, so far from full
RST-grid tables, but it's good start.

Table type support row- and colspans, but obviously parser is lacking.

Still TODO:
- Latex backend. Should we use multirow package
  https://ctan.org/pkg/multirow?lang=en?
- Hoogle backend: ?

* Implement grid-tables

* Refactor table parser

* Add two ill-examples

* Update CHANGES.md

* Basic documentation for tables

* Fix documentation example

(cherry picked from commit 088b199)
expipiplus1 added a commit to expipiplus1/pandoc that referenced this issue Mar 25, 2020
See this PR on Haddock for details on the table format:
haskell/haddock#718
expipiplus1 added a commit to expipiplus1/pandoc that referenced this issue Mar 25, 2020
See this PR on Haddock for details on the table format:
haskell/haddock#718
expipiplus1 added a commit to expipiplus1/pandoc that referenced this issue Apr 20, 2020
See this PR on Haddock for details on the table format:
haskell/haddock#718
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants