Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
danceratopz opened this issue Sep 17, 2024 · 0 comments
Open
Labels
scope:docs Scope: Documentation type:chore Type: Chore

Comments

@danceratopz
Copy link
Member

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
    });
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope:docs Scope: Documentation type:chore Type: Chore
Projects
None yet
Development

No branches or pull requests

1 participant