[Python-modules-team] Bug#953686: Add support for list-table :widths: and :header-rows: to rst2html?

Petter Reinholdtsen pere at hungry.com
Thu Mar 12 10:05:10 GMT 2020


Package: python3-docutils
Version: 0.14+dfsg-4

The rst2html tool in python3-docutils do not handle list-table the same
pandoc and xmlto, spesifically it do not understand the :widths: and
:header-rows: statements.  I found the format documented in
<URL: https://sublime-and-sphinx-guide.readthedocs.io/en/latest/tables.html >,
and the PDFs I generate look good using these statements, but the HTML
edition generated by rst2html do not.

Here is an RST example:

.. list-table:: **Overordnede krav til arkivstrukturen**
   :widths: 1 8 1 4
   :header-rows: 1

  * - Krav nr.
    - Overordnede krav til arkivstrukturen
    - Type
    - Merknad
  * - 2.1.1
    - For at en løsning skal kunne godkjennes etter Noark 5 må den
      koseptuelle modellen av arkivstrukturen og de funksjonelle
      mulighetene den gir, kunne implemenenteres i det aktuelle
      systemets (fysiske) datastrukturer.
    - O
    - Innebærer at det må implementeres slik at data skal kunne
      presenteres og hentes ut på den måten.
  * - 2.1.2
    - Arkivdokumenter skal inngå i en arkivstruktur som minst
      inneholder følgende arkivenheter:

      *arkiv*, *arkivdel*, *registrering*, *dokumentbeskrivelse* og
      *dokumentobjekt*.
    - O
    -

The generated HTML look like this:

<table border="1" class="docutils">
<caption><strong>Overordnede krav til arkivstrukturen</strong>
 :widths: 1 8 1 4
 :header-rows: 1</caption>
<colgroup>
<col width="25%" />
<col width="25%" />
<col width="25%" />
<col width="25%" />
</colgroup>
<tbody valign="top">
<tr><td>Krav nr.</td>
<td>Overordnede krav til arkivstrukturen</td>
<td>Type</td>
<td>Merknad</td>
</tr>
[...]

I expected the widths to be different and the first line to be handled
as a header.
-- 
Happy hacking
Petter Reinholdtsen



More information about the Python-modules-team mailing list