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

Update list-table #204

Merged
merged 9 commits into from
Dec 25, 2021
Merged

Update list-table #204

merged 9 commits into from
Dec 25, 2021

Conversation

not-my-profile
Copy link
Contributor

The new version introduces support for:

  • headless tables
  • tables with multiple header rows
  • tables with header columns
  • cell attributes (including colspan, rowspan and cell-specific alignment)

Furthermore the documentation has been improved.

Please don't squash my commits ;)

@mustafa0x
Copy link

Well, this is simply incredible.

@tarleb
Copy link
Member

tarleb commented Dec 25, 2021

This is great, thank you!

A heads-up: we are in the process of making tables a bit more user-friendly. E.g., we now have types and constructors pandoc.TableHead, pandoc.TableFoot, and pandoc.Row instead of using Attr-value pairs. This breaks backwards compatibility. See jgm/pandoc#7718 for some context. I'm open to add limited backwards compatibility so your filter won't break, but you'd probably want to update some code either way.

Since you put significant time into working with tables, it would be great to hear your ideas on how to make the Lua interface better. Please feel free to open new issues if anything comes to mind.

@tarleb tarleb merged commit d9562fb into pandoc:master Dec 25, 2021
@not-my-profile
Copy link
Contributor Author

not-my-profile commented Dec 25, 2021

Hey :) I don't mind updating my filter when the new Pandoc version with these constructors is released, so you don't have to add backwards compatibility just for my filter.

Since you put significant time into working with tables, it would be great to hear your ideas on how to make the Lua interface better.

I noticed something about SimpleTable, which I reported yesterday (jgm/pandoc#7776).

I am actually not very familiar with Lua so I don't think I can say much about the API design.

I think the formatting of the Lua API docs could be improved by making it more vertically compact (i.e. displaying parameter name and description next to each other). document.body.scrollHeight reports 75987px for me which I think translates to 20 meters ... that's a bit long. With all of this up and down scrolling it's easy to get lost. Apart from making the page more compact, adding some table of contents that shows your current position would also help.

h2 and h3 look very similar ... maybe if h2 were bold they were easier to spot and could help with orientation.

image

image

@mustafa0x
Copy link

mustafa0x commented Dec 25, 2021

Minor: this failed to produce any output on pandoc 2.14.2 (no error though). Upgrading to latest (2.16.2) fixed.

$>pandoc --lua-filter list-table.lua --verbose

:::list-table
   * - row 1, column 1
     - row 1, column 2
     - row 1, column 3

   * - row 2, column 1
     -
     - row 2, column 3

   * - row 3, column 1
     - row 3, column 2
:::



[INFO] Running filter list-table.lua
[INFO] Completed filter list-table.lua in 6 ms

@tarleb
Copy link
Member

tarleb commented Dec 26, 2021 via email

@mustafa0x
Copy link

Another minor issue: colspan doesn't work with headers unless a redundant field is added. Worse, it'll remove later fields (see how no "cell 2" in output).

::: list-table
*  - []{colspan=2}header
*  - cell 1
   - cell 2
:::
<table>
  <thead>
    <tr class="header">
      <th>header</th>
    </tr>
  </thead>
  <tbody>
    <tr class="odd">
      <td>cell 1</td>
    </tr>
  </tbody>
</table>

With redundant header field:

::: list-table
*  - []{colspan=2}header
   - IGNORED
*  - cell 1
   - cell 2
:::
<table>
  <thead>
    <tr class="header">
      <th colspan="2">header</th>
    </tr>
  </thead>
  <tbody>
    <tr class="odd">
      <td>cell 1</td>
      <td>cell 2</td>
    </tr>
  </tbody>
</table>

This problem doesn't occur when using colspan for later rows.

@not-my-profile
Copy link
Contributor Author

@mustafa0x ah yeah, my bad ... will be fixed by #205.

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.

3 participants