From a60b042f534508c4f4a1d9931a147d095673b7c6 Mon Sep 17 00:00:00 2001 From: Katy Scott Date: Tue, 11 Feb 2025 17:01:57 -0500 Subject: [PATCH] feat: make all tables sortable --- docs/javascripts/tablesort.js | 6 ++++++ mkdocs.yml | 2 ++ 2 files changed, 8 insertions(+) create mode 100644 docs/javascripts/tablesort.js diff --git a/docs/javascripts/tablesort.js b/docs/javascripts/tablesort.js new file mode 100644 index 00000000..c916015f --- /dev/null +++ b/docs/javascripts/tablesort.js @@ -0,0 +1,6 @@ +document$.subscribe(function() { + var tables = document.querySelectorAll("article table:not([class])") + tables.forEach(function(table) { + new Tablesort(table) + }) + }) \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index d7b92a53..cd0f1f0b 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -61,6 +61,8 @@ extra: extra_javascript: - assets/js/extra.js + - https://unpkg.com/tablesort@5.3.0/dist/tablesort.min.js + - javascripts/tablesort.js theme: # logo: assets/bhklab_logo.png