ethereum / execution-spec-tests

A Python framework and collection of test cases to generate test vectors for Ethereum execution clients
https://ethereum.github.io/execution-spec-tests
MIT License
118 stars 74 forks source link

fix(docs): move initialization js from jinja2 template to site.js #813

Closed danceratopz closed 1 month ago

danceratopz commented 2 months ago

Currently, the datatable behaviour in the test function parameter overview tables are customized directly in the jinja2 template (i.e., in the each site page separately). It would be cleaner to have this in docs/javascripts/site.js.

While I could get mkdocs to take the config from site.js (e.g, scrollX, e.g.) was available, it only worked upon hard reload, not upon navigating from page to page. The table was available but no styling was applied.

Tried messing about with site.js and various delays, but

mkdocs.yml:

extra_javascript:
  - https://code.jquery.com/jquery-3.5.1.js
  - https://cdn.datatables.net/1.10.21/js/jquery.dataTables.js
  - javascripts/site.js

extra_css:
  - https://cdn.datatables.net/1.10.21/css/jquery.dataTables.css

site.js (we should use a better selector)

$(document).ready(function () {
    $('#test_table').DataTable({
        pageLength: -1,
        scrollX: true,
        autoWidth: false
    });
});
danceratopz commented 1 month ago

This is fixed, will be part of an upcoming PR :slightly_smiling_face: