From 5955d10a7f2106c5ae1275fadacf2945626ca008 Mon Sep 17 00:00:00 2001 From: Zethus Suen Date: Tue, 8 Dec 2020 17:22:33 -0500 Subject: [PATCH] feat(docs): add table sorting (#1258) --- docs/javascripts/tables.js | 6 ++ docs/reference/filter.md | 170 ++++++++++++++++++------------------- mkdocs.yml | 4 + package.json | 1 + 4 files changed, 96 insertions(+), 85 deletions(-) create mode 100644 docs/javascripts/tables.js diff --git a/docs/javascripts/tables.js b/docs/javascripts/tables.js new file mode 100644 index 0000000000..4081247fd3 --- /dev/null +++ b/docs/javascripts/tables.js @@ -0,0 +1,6 @@ +app.document$.subscribe(function() { + var tables = document.querySelectorAll("article table") + tables.forEach(function(table) { + new Tablesort(table) + }) +}) \ No newline at end of file diff --git a/docs/reference/filter.md b/docs/reference/filter.md index 83cf056c9a..11f37c5f97 100644 --- a/docs/reference/filter.md +++ b/docs/reference/filter.md @@ -27,91 +27,91 @@ Used with the `STORES` variable. -| Stores | Environment variable | -|:---:|:---:| -| Adorama | `adorama`| -| Alternate (DE) | `alternate`| -| Alternate (NL) | `alternate-nl`| -| Amazon | `amazon`| -| Amazon (CA) | `amazon-ca`| -| Amazon (DE) | `amazon-de`| -| Amazon (DE) Warehouse | `amazon-de-warehouse`| -| Amazon (ES) | `amazon-es`| -| Amazon (FR) | `amazon-fr`| -| Amazon (IT) | `amazon-it`| -| Amazon (NL) | `amazon-nl`| -| Amazon (UK) | `amazon-uk`| -| AMD | `amd`| -| AMD (CA) | `amd-ca`| -| AMD (DE) | `amd-de`| -| AMD (IT) | `amd-it`| -| AntOnline | `antonline`| -| Argos (UK) | `argos`| -| Aria PC (UK) | `aria`| -| ARLT (DE) | `arlt`| -| ASUS | `asus` | -| ASUS (DE) | `asus-de` | -| Azerty (NL) | `azerty`| -| B&H | `bandh`| -| Best Buy | `bestbuy`| -| Best Buy (CA) | `bestbuy-ca`| -| Box (UK) | `box`| -| CanadaComputers (CA) | `canadacomputers` | -| Caseking (DE) | `caseking`| -| CCL (UK) | `ccl`| -| Comet (IT) | `comet`| -| Computeruniverse (DE) | `computeruniverse` | -| Coolblue (NL) | `coolblue`| -| Coolmod (ES) | `coolmod`| -| Corsair | `corsair`| -| Currys (UK) | `currys`| -| Cyberport (DE) | `cyberport` | -| eBuyer (UK) | `ebuyer`| -| El Corte Inglés | `elcorteingles`| -| ePrice (IT) | `eprice`| -| Euronics (IT) | `euronics`| -| Euronics (DE) | `euronics-de`| -| EVGA | `evga`| -| EVGA (EU) | `evga-eu`| -| Expert | `expert`| -| Galaxus (DE) | `galaxus`| -| Game (UK) | `game`| -| Gamestop | `gamestop`| -| Gamestop (DE) | `gamestop-de`| -| Kabum (BR) | `kabum`| -| Mediamarkt (DE) | `mediamarkt`| -| Medimax | `medimax`| -| Megekko (NL) | `megekko`| -| MemoryExpress (CA) | `memoryexpress`| -| Micro Center | `microcenter`| -| Mindfactory (DE) | `mindfactory` | -| Newegg | `newegg`| -| Newegg (CA) | `newegg-ca`| -| Notebooksbilliger (DE) |`notebooksbilliger`| -| Novatech (UK) | `novatech`| -| Nvidia | `nvidia`| -| Nvidia (API) | `nvidia-api`| -| Office Depot | `officedepot`| -| Otto | `otto`| -| Overclockers (UK) | `overclockers`| -| PCComponentes (ES) | `pccomponentes`| -| PlayStation | `playstation`| -| PNY | `pny`| -| Proshop (DE) | `proshop-de`| -| Proshop (DK) | `proshop-dk`| -| Saturn (DE) | `saturn`| -| Scan (UK) | `scan`| -| Smyths Toys (UK) | `smythstoys`| -| Spielegrotte | `spielegrotte`| -| Target | `target`| -| Toys R Us | `toysrus` | -| Unieuro (IT) | `unieuro`| -| Very (UK) | `very`| -| Walmart | `walmart`| -| Walmart (CA) | `walmart-ca` | -| Wipoid | `wipoid`| -| Zotac | `zotac`| -| TopAchat | `topachat`| +| Stores | Country | Environment variable | +|---|---|---| +| Adorama | US | `adorama`| +| Alternate | DE | `alternate`| +| Alternate | NL | `alternate-nl`| +| Amazon | US | `amazon`| +| Amazon | CA | `amazon-ca`| +| Amazon | DE | `amazon-de`| +| Amazon Warehouse | DE | `amazon-de-warehouse`| +| Amazon | ES | `amazon-es`| +| Amazon | FR | `amazon-fr`| +| Amazon | IT | `amazon-it`| +| Amazon | NL | `amazon-nl`| +| Amazon | UK | `amazon-uk`| +| AMD | US | `amd`| +| AMD | CA | `amd-ca`| +| AMD | DE | `amd-de`| +| AMD | IT | `amd-it`| +| AntOnline | US | `antonline`| +| Argos | UK | `argos`| +| Aria PC | UK | `aria`| +| ARLT | DE | `arlt`| +| ASUS | US | `asus` | +| ASUS | DE | `asus-de` | +| Azerty | NL | `azerty`| +| B&H | US | `bandh`| +| Best Buy | US | `bestbuy`| +| Best Buy | CA | `bestbuy-ca`| +| Box | UK | `box`| +| CanadaComputers | CA | `canadacomputers` | +| Caseking | DE | `caseking`| +| CCL | UK | `ccl`| +| Comet | IT | `comet`| +| Computeruniverse | DE | `computeruniverse` | +| Coolblue | NL | `coolblue`| +| Coolmod | ES | `coolmod`| +| Corsair | US | `corsair`| +| Currys | UK | `currys`| +| Cyberport | DE | `cyberport` | +| eBuyer | UK | `ebuyer`| +| El Corte Inglés | US | `elcorteingles`| +| ePrice | IT | `eprice`| +| Euronics | IT | `euronics`| +| Euronics | DE | `euronics-de`| +| EVGA | US | `evga`| +| EVGA | EU | `evga-eu`| +| Expert | DE | `expert`| +| Galaxus | DE | `galaxus`| +| Game | UK | `game`| +| Gamestop | US | `gamestop`| +| Gamestop | DE | `gamestop-de`| +| Kabum | BR | `kabum`| +| Mediamarkt | DE | `mediamarkt`| +| Medimax | US | `medimax`| +| Megekko | NL | `megekko`| +| MemoryExpress | CA | `memoryexpress`| +| Micro Center | US | `microcenter`| +| Mindfactory | DE | `mindfactory` | +| Newegg | US | `newegg`| +| Newegg | CA | `newegg-ca`| +| Notebooksbilliger | DE |`notebooksbilliger`| +| Novatech | UK | `novatech`| +| Nvidia | US | `nvidia`| +| Nvidia API | | `nvidia-api`| +| Office Depot | US | `officedepot`| +| Otto | DE | `otto`| +| Overclockers | UK | `overclockers`| +| PCComponentes | ES | `pccomponentes`| +| PlayStation | US | `playstation`| +| PNY | US | `pny`| +| Proshop | DE | `proshop-de`| +| Proshop | DK | `proshop-dk`| +| Saturn | DE | `saturn`| +| Scan | UK | `scan`| +| Smyths Toys | UK | `smythstoys`| +| Spielegrotte | DE | `spielegrotte`| +| Target | US | `target`| +| Toys R Us | US | `toysrus` | +| Unieuro | IT | `unieuro`| +| Very | UK | `very`| +| Walmart | US | `walmart`| +| Walmart | CA | `walmart-ca`| +| Wipoid | ES | `wipoid`| +| Zotac | US | `zotac`| +| TopAchat | GR | `topachat`| ### Micro Center stores diff --git a/mkdocs.yml b/mkdocs.yml index 700a134376..8bc0cf2c85 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -45,6 +45,10 @@ extra: - icon: fontawesome/brands/linkedin link: https://www.linkedin.com/in/jeflecompte/ +extra_javascript: + - https://cdnjs.cloudflare.com/ajax/libs/tablesort/5.2.1/tablesort.min.js + - javascripts/tables.js + # Extensions markdown_extensions: - admonition diff --git a/package.json b/package.json index 16eff2040b..479251af8d 100644 --- a/package.json +++ b/package.json @@ -71,6 +71,7 @@ }, "xo": { "prettier": true, + "ignores": "docs/javascripts", "rules": { "no-warning-comments": "off", "sort-imports": "error",