Provide public hooks and variables
We need to provide some hooks via hook library:
tabularray/begin
tabularray/end
tabularray/trial/before
tabularray/trial/after
tabularray/table/before
tabularray/table/after
tabularray/row/before
tabularray/row/after
tabularray/cell/before
tabularray/cell/after
See #27, #29, #146, #159, #179.
Good idea! Is there any reason to put them in a library? Why not provide them by default?
Hooks make the package run slower. And hooks can not work in TeX Live 2020 on Overleaf.
For the HTML conversion with TeX4ht, I need to be able to detect features like colspan, rowspan, cell alignment, colors and borders. It seems that most of these information (except for borders, probably?) are available in the \__tblr_build_cell_content:NN macro, where I can use them for inline CSS for each table cell.
The one problem that I have found so far is how to detect a cell that shouldn't be displayed. In HTML, when you use
<td collspan="2">, you shouldn't include next <td>, because it would be spurious. The same is true for rowspan, the <td> that is bellow the one that uses rowspan, shouldn't be used. So we need to detect somehow that the current cell is hidden. It shouldn't be hard to do that on the TeX4ht side, but I wonder if it already isn't available in tabularray and I just missed it. It is also possible that tagged PDF will need such functionality as well.
For example:
\documentclass{article}
\usepackage{tabularray}
\begin{document}
\begin{tblr}{|c|c|c|c|c|}
\hline
\SetCell[r=2]{c} 2 Rows
& \SetCell[c=2]{c} 2 Columns
& & \SetCell[r=2,c=2]{c} 2 Rows 2 Columns & \\
\hline
& 2-2 & 2-3 & & \\
\hline
3-1 & 3-2 & 3-3 & 3-4 & 3-5 \\
\hline
\end{tblr}
\end{document}
I need to solve issue #179 first before starting to handle this issue. So hooks will not arrive soon.
For the HTML conversion with TeX4ht, I need to be able to detect features like colspan, rowspan, cell alignment, colors and borders. It seems that most of these information (except for borders, probably?) are available in the
\__tblr_build_cell_content:NNmacro, where I can use them for inline CSS for each table cell.
Why not get cell colors and others at the time of their settings? When an user writes \cellcolor{blue} in tabular, tex4ht gets the style. Then when an user writes \SetCell{blue} in tabularray, tex4ht should be able to do the same job.