diff --git a/{{cookiecutter.project_name}}/mkdocs.yml b/{{cookiecutter.project_name}}/mkdocs.yml index 4a01fff..7aa016b 100644 --- a/{{cookiecutter.project_name}}/mkdocs.yml +++ b/{{cookiecutter.project_name}}/mkdocs.yml @@ -16,6 +16,13 @@ nav: - About: about.md site_url: https://{{cookiecutter.github_org}}.github.io/{{cookiecutter.project_name}} repo_url: https://github.com/{{cookiecutter.github_org}}/{{cookiecutter.project_name}} +markdown_extensions: + - tables +extra_javascript: + - https://unpkg.com/tablesort@5.3.0/dist/tablesort.min.js + - javascripts/tablesort.js + - https://unpkg.com/tablefilter@0.7.3/dist/tablefilter/tablefilter.js + - javascripts/tablefilter.js # Uncomment this block to enable use of Google Analytics. # Replace the property value with your own ID. diff --git a/{{cookiecutter.project_name}}/src/docs/javascripts/tablefilter.js b/{{cookiecutter.project_name}}/src/docs/javascripts/tablefilter.js new file mode 100644 index 0000000..b5e92cc --- /dev/null +++ b/{{cookiecutter.project_name}}/src/docs/javascripts/tablefilter.js @@ -0,0 +1,9 @@ +document$.subscribe(function() { + var tables = document.querySelectorAll("article table:not([class])") + tables.forEach(function(table) { + var tf = new TableFilter(table, { + base_path: "https://unpkg.com/tablefilter@0.7.3/dist/tablefilter/" + }) + tf.init() + }) + }) \ No newline at end of file diff --git a/{{cookiecutter.project_name}}/src/docs/javascripts/tablesort.js b/{{cookiecutter.project_name}}/src/docs/javascripts/tablesort.js new file mode 100644 index 0000000..c916015 --- /dev/null +++ b/{{cookiecutter.project_name}}/src/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