sphinx-needs icon indicating copy to clipboard operation
sphinx-needs copied to clipboard

🛠️ Refactor Sphinx-Needs DataTables integration to use GridJS

Open iSOLveIT opened this issue 8 months ago • 3 comments

Changes for issue #122:

  • [x] Removed Data tables and all its dependencies
  • [x] Use GridJS to handle data table integration
  • [x] Fix some testcases
  • [x] Fix data table CSS to support both light and dark modes

Motivation for this change:

Our used DataTables version is quite old (>~4 years) and is still based on jQuery, which was also removed from Sphinx some long time ago. Also, the JS world has changed, docs get presented in React/Angular/Svelte apps, in which DataTables is causing some problems or at least is adding some unnecessary dependencies (jQuery). Therefore, this PR cleans up our used JS environment and feels more modern now.

iSOLveIT avatar Jun 21 '25 03:06 iSOLveIT

Here is a comparison of both. I guess the following could be changed:

  • No border around the table-element (incl. the buttons)
  • Buttons less prominent: Less rounded corners, a little smaller (size & font)
  • Pagination maybe also without border, or a more transparent border color.

The goal is to have the table data itself quite prominent, but all buttons and co. in a less prominent style.

But that's it, the diffs are already not so much. Good work.

image image

danwos avatar Jun 26 '25 06:06 danwos

@chrisjsewell what do you think? This PR is also some kind of a clean-up, as JS libs are reduced.

danwos avatar Jun 26 '25 06:06 danwos

Another finding: Row style seems not to work

image Source: https://sphinx-needs.readthedocs.io/en/latest/directives/needtable.html#style-row

image Source: local build via DOCS_THEME=furo sphinx-build -a -E docs docs/_build/html

danwos avatar Jun 26 '25 06:06 danwos