Injection of interferes with documentation generator

Injection of interferes with documentation generator

echedey-lsechedey-ls Posts: 2Questions: 0Answers: 0

Sphinx is a documentation generation environment widely used. For example, a table can be rendered using:

.. csv-table:: Title
   :file: ./foo.csv
   :class: sphinx-datatable
   :widths: 10,5,50,5,25,5
   :header-rows: 1

where the input information comes from a CSV file. Other "directives" (like csv-table) also exist to generate tables. See this
As can be seen above, it allows a :widths: option, with the percentage each column should span.

When specified, it will add a custom <colgroup> to the table. Since DataTables v2.0.0, this node is also injected by default. Is there any way to turn it off, so as to avoid node duplication? As of now, DataTables node interferes with the Sphinx one.

We found a problem when including DataTables into Sphinx-rendered docs at https://github.com/sharm294/sphinx-datatables/issues/13, a Sphinx extension plugin that eases bundling DataTables.

Relevant forum post: https://datatables.net/forums/discussion/78311/no-longer-able-to-include-our-own-colgroup-tag-in-2-0-0

Users can also stop specifying the :widths:, but I guess some use cases may still like to use it.

Replies

  • echedey-lsechedey-ls Posts: 2Questions: 0Answers: 0

    This is the correct GitHub issue link: https://github.com/sharm294/sphinx-datatables/issues/13 (no trailing comma)

  • allanallan Posts: 64,971Questions: 1Answers: 10,759 Site admin

    Hi,

    Unfortunately no, at the moment there isn't an option for this. What I could do perhaps, is remove any pre-exiting colgroup elements (or emptying and then reusing it).

    When doing that work on 2.0 originally I did look into trying to merge an existing colgroup with my own, but it was going to be a signifiant amount of code for something that was (in my experience) rarely used.

    Would you be happy with a simple removal / replacement?

    Allan

Sign In or Register to comment.