Merge pull request #2308 from squidfunk/refactor/webpack
Prototype non-Webpack build
2
.github/workflows/build.yml
vendored
@@ -24,7 +24,7 @@ on:
|
|||||||
- pull_request
|
- pull_request
|
||||||
|
|
||||||
env:
|
env:
|
||||||
NODE_VERSION: 12.x
|
NODE_VERSION: 14.x
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|||||||
17
.gitignore
vendored
@@ -23,19 +23,18 @@
|
|||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
|
|
||||||
# Dependencies
|
# Dependencies
|
||||||
node_modules
|
/node_modules
|
||||||
__pycache__
|
/__pycache__
|
||||||
venv
|
/venv
|
||||||
|
|
||||||
# Build files
|
# Build files
|
||||||
build
|
/build
|
||||||
MANIFEST
|
/MANIFEST
|
||||||
manifest.json
|
/site
|
||||||
site
|
|
||||||
|
|
||||||
# Distribution files
|
# Distribution files
|
||||||
dist
|
/dist
|
||||||
mkdocs_material.egg-info
|
/mkdocs_material.egg-info
|
||||||
|
|
||||||
# Caches and logs
|
# Caches and logs
|
||||||
*.cpuprofile
|
*.cpuprofile
|
||||||
|
|||||||
@@ -27,4 +27,4 @@ src/**/*.html
|
|||||||
src/assets/stylesheets/_shame.scss
|
src/assets/stylesheets/_shame.scss
|
||||||
|
|
||||||
# Prevent stylelint from constantly complaining
|
# Prevent stylelint from constantly complaining
|
||||||
webpack.config.ts
|
*.ts
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M224 224a32 32 0 1032.007 32 32.064 32.064 0 00-32.008-32zm214.171-96c-10.877-19.5-40.51-50.75-116.275-41.875C300.392 34.875 267.634 0 223.999 0s-76.39 34.875-97.896 86.125C50.337 77.375 20.706 108.5 9.829 128-6.55 157.375-5.175 201.125 34.958 256-5.175 310.875-6.55 354.625 9.829 384c29.13 52.375 101.647 43.625 116.274 41.875C147.608 477.125 180.364 512 223.999 512s76.393-34.875 97.897-86.125c14.629 1.75 87.144 10.5 116.275-41.875 16.379-29.375 15.004-73.125-25.13-128 40.134-54.875 41.509-98.625 25.13-128zM63.34 352c-4-7.25-.125-24.75 15.004-48.25a368.519 368.519 0 0021.88 19.125c1.626 13.75 4 27.125 6.75 40.125-24.628.875-39.882-4.375-43.634-11zm36.885-162.875a368.506 368.506 0 00-21.881 19.125c-15.13-23.5-19.004-41-15.004-48.25 3.377-6.125 16.379-11.5 37.885-11.5 1.75 0 3.875.375 5.75.375a443.175 443.175 0 00-6.75 40.25zM223.999 64c9.502 0 22.256 13.5 33.883 37.25a435.24 435.24 0 00-33.883 12.875 434.638 434.638 0 00-33.883-12.875C201.746 77.5 214.497 64 224 64zm0 384c-9.502 0-22.254-13.5-33.883-37.25 11.254-3.75 22.506-8 33.883-12.875a435.23 435.23 0 0033.883 12.875C246.255 434.5 233.5 448 223.999 448zm0-112a80 80 0 1180-80 80 80 0 01-80 80zm160.66 16c-3.625 6.625-19.004 11.875-43.634 11 2.752-13 5.127-26.375 6.752-40.125a367.856 367.856 0 0021.878-19.125c15.13 23.5 19.004 41 15.004 48.25zm-15.004-143.75a367.869 367.869 0 00-21.879-19.125 442.488 442.488 0 00-6.752-40.25c1.875 0 4.002-.375 5.752-.375 21.504 0 34.508 5.375 37.883 11.5 4 7.25.125 24.75-15.004 48.25z"/></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M224 224a32 32 0 1 0 32.007 32 32.064 32.064 0 0 0-32.008-32zm214.171-96c-10.877-19.5-40.51-50.75-116.275-41.875C300.392 34.875 267.634 0 223.999 0s-76.39 34.875-97.896 86.125C50.337 77.375 20.706 108.5 9.829 128-6.55 157.375-5.175 201.125 34.958 256-5.175 310.875-6.55 354.625 9.829 384c29.13 52.375 101.647 43.625 116.274 41.875C147.608 477.125 180.364 512 223.999 512s76.393-34.875 97.897-86.125c14.629 1.75 87.144 10.5 116.275-41.875 16.379-29.375 15.004-73.125-25.13-128 40.134-54.875 41.509-98.625 25.13-128zM63.34 352c-4-7.25-.125-24.75 15.004-48.25a368.519 368.519 0 0 0 21.88 19.125c1.626 13.75 4 27.125 6.75 40.125-24.628.875-39.882-4.375-43.634-11zm36.885-162.875a368.506 368.506 0 0 0-21.881 19.125c-15.13-23.5-19.004-41-15.004-48.25 3.377-6.125 16.379-11.5 37.885-11.5 1.75 0 3.875.375 5.75.375a443.175 443.175 0 0 0-6.75 40.25zM223.999 64c9.502 0 22.256 13.5 33.883 37.25-11.252 3.75-22.504 8-33.883 12.875a434.638 434.638 0 0 0-33.883-12.875C201.746 77.5 214.497 64 224 64zm0 384c-9.502 0-22.254-13.5-33.883-37.25 11.254-3.75 22.506-8 33.883-12.875a435.23 435.23 0 0 0 33.883 12.875C246.255 434.5 233.5 448 223.999 448zm0-112a80 80 0 1 1 80-80 80 80 0 0 1-80 80zm160.66 16c-3.625 6.625-19.004 11.875-43.634 11 2.752-13 5.127-26.375 6.752-40.125a367.856 367.856 0 0 0 21.878-19.125c15.13 23.5 19.004 41 15.004 48.25zm-15.004-143.75a367.869 367.869 0 0 0-21.879-19.125 442.488 442.488 0 0 0-6.752-40.25c1.875 0 4.002-.375 5.752-.375 21.504 0 34.508 5.375 37.883 11.5 4 7.25.125 24.75-15.004 48.25z"/></svg>
|
||||||
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.6 KiB |
@@ -1 +1,6 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 89 89"><path d="M3.136 17.387v42.932l42.932 21.467L3.136 17.387z"/><path d="M21.91 8l42.933 64.398-18.775 9.388L3.136 17.387 21.91 8z" fill-opacity=".5"/><path d="M67.535 17.387L40.273 35.543l21.878 32.818 5.384 2.691V17.387z"/><path d="M67.535 17.387v53.666l18.774-9.388V8l-18.774 9.387z" fill-opacity=".25"/></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 89 89">
|
||||||
|
<path d="M3.136,17.387l0,42.932l42.932,21.467l-42.932,-64.399Z" />
|
||||||
|
<path d="M21.91,8l42.933,64.398l-18.775,9.388l-42.932,-64.399l18.774,-9.387Z" style="fill-opacity: 0.5" />
|
||||||
|
<path d="M67.535,17.387l-27.262,18.156l21.878,32.818l5.384,2.691l0,-53.665Z" />
|
||||||
|
<path d="M67.535,17.387l0,53.666l18.774,-9.388l0,-53.665l-18.774,9.387Z" style="fill-opacity: 0.25" />
|
||||||
|
</svg>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 369 B After Width: | Height: | Size: 433 B |
@@ -1 +1 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 13.5a.5.5 0 00-.5.5.5.5 0 00.5.5.5.5 0 00.5-.5.5.5 0 00-.5-.5M6 17a1 1 0 00-1 1 1 1 0 001 1 1 1 0 001-1 1 1 0 00-1-1m4 3.5a.5.5 0 00-.5.5.5.5 0 00.5.5.5.5 0 00.5-.5.5.5 0 00-.5-.5m-7-11a.5.5 0 00-.5.5.5.5 0 00.5.5.5.5 0 00.5-.5.5.5 0 00-.5-.5M6 13a1 1 0 00-1 1 1 1 0 001 1 1 1 0 001-1 1 1 0 00-1-1m15 .5a.5.5 0 00-.5.5.5.5 0 00.5.5.5.5 0 00.5-.5.5.5 0 00-.5-.5M10 17a1 1 0 00-1 1 1 1 0 001 1 1 1 0 001-1 1 1 0 00-1-1M2.5 5.27l3.78 3.78L6 9a1 1 0 00-1 1 1 1 0 001 1 1 1 0 001-1c0-.1-.03-.19-.06-.28l2.81 2.81c-.71.11-1.25.73-1.25 1.47a1.5 1.5 0 001.5 1.5c.74 0 1.36-.54 1.47-1.25l2.81 2.81A.875.875 0 0014 17a1 1 0 00-1 1 1 1 0 001 1 1 1 0 001-1c0-.1-.03-.19-.06-.28l3.78 3.78L20 20.23 3.77 4 2.5 5.27M14 20.5a.5.5 0 00-.5.5.5.5 0 00.5.5.5.5 0 00.5-.5.5.5 0 00-.5-.5M18 7a1 1 0 001-1 1 1 0 00-1-1 1 1 0 00-1 1 1 1 0 001 1m0 4a1 1 0 001-1 1 1 0 00-1-1 1 1 0 00-1 1 1 1 0 001 1m0 4a1 1 0 001-1 1 1 0 00-1-1 1 1 0 00-1 1 1 1 0 001 1m-8-8a1 1 0 001-1 1 1 0 00-1-1 1 1 0 00-1 1 1 1 0 001 1m11 3.5a.5.5 0 00.5-.5.5.5 0 00-.5-.5.5.5 0 00-.5.5.5.5 0 00.5.5m-11-7a.5.5 0 00.5-.5.5.5 0 00-.5-.5.5.5 0 00-.5.5.5.5 0 00.5.5m4 0a.5.5 0 00.5-.5.5.5 0 00-.5-.5.5.5 0 00-.5.5.5.5 0 00.5.5m-.2 8h.2a1.5 1.5 0 001.5-1.5A1.5 1.5 0 0014 8.5a1.5 1.5 0 00-1.5 1.5v.2c.11.67.63 1.19 1.3 1.3M14 7a1 1 0 001-1 1 1 0 00-1-1 1 1 0 00-1 1 1 1 0 001 1z"/></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 13.5a.5.5 0 0 0-.5.5.5.5 0 0 0 .5.5.5.5 0 0 0 .5-.5.5.5 0 0 0-.5-.5M6 17a1 1 0 0 0-1 1 1 1 0 0 0 1 1 1 1 0 0 0 1-1 1 1 0 0 0-1-1m4 3.5a.5.5 0 0 0-.5.5.5.5 0 0 0 .5.5.5.5 0 0 0 .5-.5.5.5 0 0 0-.5-.5m-7-11a.5.5 0 0 0-.5.5.5.5 0 0 0 .5.5.5.5 0 0 0 .5-.5.5.5 0 0 0-.5-.5M6 13a1 1 0 0 0-1 1 1 1 0 0 0 1 1 1 1 0 0 0 1-1 1 1 0 0 0-1-1m15 .5a.5.5 0 0 0-.5.5.5.5 0 0 0 .5.5.5.5 0 0 0 .5-.5.5.5 0 0 0-.5-.5M10 17a1 1 0 0 0-1 1 1 1 0 0 0 1 1 1 1 0 0 0 1-1 1 1 0 0 0-1-1M2.5 5.27l3.78 3.78L6 9a1 1 0 0 0-1 1 1 1 0 0 0 1 1 1 1 0 0 0 1-1c0-.1-.03-.19-.06-.28l2.81 2.81c-.71.11-1.25.73-1.25 1.47a1.5 1.5 0 0 0 1.5 1.5c.74 0 1.36-.54 1.47-1.25l2.81 2.81c-.09-.03-.18-.06-.28-.06a1 1 0 0 0-1 1 1 1 0 0 0 1 1 1 1 0 0 0 1-1c0-.1-.03-.19-.06-.28l3.78 3.78L20 20.23 3.77 4 2.5 5.27M14 20.5a.5.5 0 0 0-.5.5.5.5 0 0 0 .5.5.5.5 0 0 0 .5-.5.5.5 0 0 0-.5-.5M18 7a1 1 0 0 0 1-1 1 1 0 0 0-1-1 1 1 0 0 0-1 1 1 1 0 0 0 1 1m0 4a1 1 0 0 0 1-1 1 1 0 0 0-1-1 1 1 0 0 0-1 1 1 1 0 0 0 1 1m0 4a1 1 0 0 0 1-1 1 1 0 0 0-1-1 1 1 0 0 0-1 1 1 1 0 0 0 1 1m-8-8a1 1 0 0 0 1-1 1 1 0 0 0-1-1 1 1 0 0 0-1 1 1 1 0 0 0 1 1m11 3.5a.5.5 0 0 0 .5-.5.5.5 0 0 0-.5-.5.5.5 0 0 0-.5.5.5.5 0 0 0 .5.5m-11-7a.5.5 0 0 0 .5-.5.5.5 0 0 0-.5-.5.5.5 0 0 0-.5.5.5.5 0 0 0 .5.5m4 0a.5.5 0 0 0 .5-.5.5.5 0 0 0-.5-.5.5.5 0 0 0-.5.5.5.5 0 0 0 .5.5m-.2 8h.2a1.5 1.5 0 0 0 1.5-1.5A1.5 1.5 0 0 0 14 8.5a1.5 1.5 0 0 0-1.5 1.5v.2c.11.67.63 1.19 1.3 1.3M14 7a1 1 0 0 0 1-1 1 1 0 0 0-1-1 1 1 0 0 0-1 1 1 1 0 0 0 1 1z"/></svg>
|
||||||
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.5 KiB |
@@ -1 +1 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 3H5a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2V5a2 2 0 00-2-2m-3.4 14L12 13.4 8.4 17 7 15.6l3.6-3.6L7 8.4 8.4 7l3.6 3.6L15.6 7 17 8.4 13.4 12l3.6 3.6-1.4 1.4z"/></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 3H5a2 2 0 0 0-2 2V19a2 2 0 0 0 2 2H19a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2m-3.4 14L12 13.4 8.4 17 7 15.6l3.6-3.6L7 8.4 8.4 7l3.6 3.6L15.6 7 17 8.4 13.4 12l3.6 3.6-1.4 1.4z"/></svg>
|
||||||
|
Before Width: | Height: | Size: 240 B After Width: | Height: | Size: 246 B |
@@ -1 +1 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.21 12l-1.33.89v-1.78l1.33.89m3.26-2.18V7.34l-4.16 2.78 1.85 1.24 2.31-1.54m5.23.3l-4.17-2.78v2.48l2.31 1.54 1.86-1.24m-9.39 3.76l4.16 2.78v-2.48l-2.31-1.54-1.85 1.24m5.22.3v2.48l4.17-2.78-1.86-1.24-2.31 1.54M12 10.74L10.12 12 12 13.26 13.88 12 12 10.74M22 12c0 5.5-4.5 10-10 10S2 17.5 2 12 6.5 2 12 2s10 4.5 10 10m-3.82-1.88v-.07l-.01-.05-.01-.05c-.01-.01-.01-.02-.02-.04l-.01-.02-.02-.04-.01-.02-.02-.03-.02-.03-.03-.03-.03-.02V9.7l-.04-.02-.01-.01-5.65-3.76a.528.528 0 00-.59 0L6.05 9.67v.01L6 9.7v.02l-.03.02-.03.03-.01.03-.03.03-.01.02-.02.04-.01.02-.02.04V10h-.01l-.01.05v3.9l.01.05h.01v.05c.01.01.01.02.02.04l.01.02.02.04.01.02.02.03.02.03.03.03.03.02v.02l.04.02.01.01 5.66 3.77c.08.06.19.08.29.08.1 0 .21-.03.3-.08l5.65-3.77.01-.01.04-.02v-.02l.03-.02.03-.03.02-.03.02-.03.01-.02.02-.04.01-.02.02-.04V14h.01l.01-.05v-3.83m-1.06 2.77v-1.78l-1.33.89 1.33.89z"/></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.21 12l-1.33.89v-1.78l1.33.89m3.26-2.18V7.34l-4.16 2.78 1.85 1.24 2.31-1.54m5.23.3l-4.17-2.78v2.48l2.31 1.54 1.86-1.24m-9.39 3.76l4.16 2.78v-2.48l-2.31-1.54-1.85 1.24m5.22.3v2.48l4.17-2.78-1.86-1.24-2.31 1.54M12 10.74L10.12 12 12 13.26 13.88 12 12 10.74M22 12c0 5.5-4.5 10-10 10S2 17.5 2 12 6.5 2 12 2s10 4.5 10 10m-3.82-1.88v-.07l-.01-.05-.01-.05c-.01-.01-.01-.02-.02-.04l-.01-.02-.02-.04-.01-.02-.02-.03-.02-.03-.03-.03-.03-.02V9.7l-.04-.02-.01-.01-5.65-3.76a.528.528 0 0 0-.59 0L6.05 9.67v.01L6 9.7v.02l-.03.02-.03.03-.01.03-.03.03-.01.02-.02.04-.01.02-.02.04V10h-.01l-.01.05V13.95l.01.05h.01v.05c.01.01.01.02.02.04l.01.02.02.04.01.02.02.03.02.03.03.03.03.02v.02l.04.02.01.01 5.66 3.77c.08.06.19.08.29.08.1 0 .21-.03.3-.08l5.65-3.77.01-.01.04-.02v-.02l.03-.02.03-.03.02-.03.02-.03.01-.02.02-.04.01-.02.02-.04V14h.01l.01-.05V10.12m-1.06 2.77v-1.78l-1.33.89 1.33.89z"/></svg>
|
||||||
|
Before Width: | Height: | Size: 944 B After Width: | Height: | Size: 947 B |
@@ -1 +1 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 3a9 9 0 000 18c2 0 3.92-.66 5.5-1.86l-1.44-1.44A6.995 6.995 0 015 12c0-3.87 3.13-7 7-7s7 3.13 7 7h-3l4 4 4-4h-3a9 9 0 00-9-9M7.71 13.16c-.09.07-.12.19-.07.29l.9 1.55c.06.12.18.12.28.12l1.13-.45c.24.16.49.3.75.42l.18 1.19c.02.11.12.19.22.19h1.8c.1.03.21-.06.23-.17l.18-1.18c.27-.12.53-.27.76-.45l1.12.45c.11.04.23-.01.28-.12l.9-1.5c.05-.12.02-.24-.06-.31l-1-.74c.03-.3.03-.6 0-.9l1-.76c.09-.07.11-.18.06-.29l-.9-1.55a.226.226 0 00-.28-.1l-1.12.45c-.24-.17-.5-.3-.77-.42l-.17-1.19a.244.244 0 00-.23-.19h-1.76c-.1 0-.19.07-.21.17l-.17 1.18c-.26.12-.53.27-.76.45l-1.15-.42a.234.234 0 00-.29.12l-.91 1.5c-.05.12-.02.24.06.31l1 .74c-.02.15-.02.3 0 .45-.01.15-.01.3 0 .45l-1 .74m4.29.31c-.84 0-1.5-.68-1.5-1.5 0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5-.67 1.5-1.5 1.5"/></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 3a9 9 0 0 0 0 18c2 0 3.92-.66 5.5-1.86l-1.44-1.44A6.995 6.995 0 0 1 5 12c0-3.87 3.13-7 7-7s7 3.13 7 7h-3l4 4 4-4h-3a9 9 0 0 0-9-9M7.71 13.16c-.09.07-.12.19-.07.29l.9 1.55c.06.12.18.12.28.12l1.13-.45c.24.16.49.3.75.42l.18 1.19c.02.11.12.19.22.19h1.8c.1.03.21-.06.23-.17l.18-1.18c.27-.12.53-.27.76-.45l1.12.45c.11.04.23-.01.28-.12l.9-1.5c.05-.12.02-.24-.06-.31l-1-.74c.03-.3.03-.6 0-.9l1-.76c.09-.07.11-.18.06-.29l-.9-1.55c-.06-.1-.17-.14-.28-.1l-1.12.45c-.24-.17-.5-.3-.77-.42l-.17-1.19a.244.244 0 0 0-.23-.19h-1.76c-.1 0-.19.07-.21.17l-.17 1.18c-.26.12-.53.27-.76.45l-1.15-.42a.234.234 0 0 0-.29.12l-.91 1.5c-.05.12-.02.24.06.31l1 .74c-.02.15-.02.3 0 .45-.01.15-.01.3 0 .45l-1 .74m4.29.31c-.84 0-1.5-.68-1.5-1.5 0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5-.67 1.5-1.5 1.5"/></svg>
|
||||||
|
Before Width: | Height: | Size: 836 B After Width: | Height: | Size: 845 B |
@@ -1 +1 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M16.79 23c-.42-.17-.72-.55-.79-1-.05-.26 0-.44.4-1.16 1.5-2.7 2.27-5.75 2.23-8.84.04-3-.69-5.93-2.13-8.56-.21-.44-.4-.86-.56-1.31.06-.38.25-.73.56-.94.45-.24 1-.19 1.41.09.28.36.52.72.72 1.14A21.4 21.4 0 0120.8 9c.23 1.81.26 3.65.09 5.47-.31 2.34-1 4.6-2.06 6.71-.64 1.28-1 1.82-1.38 1.82h-.66m-4.36-2.21c-.57-.16-.93-.74-.81-1.32 0-.12.31-.67.59-1.23 1.18-2.27 1.69-4.83 1.46-7.38-.14-1.83-.67-3.61-1.54-5.22-.63-1.26-.67-1.46-.3-2 .44-.49 1.17-.56 1.71-.14.72 1.06 1.29 2.22 1.71 3.44 1.28 3.79 1.08 7.92-.56 11.56-.84 1.89-1.43 2.5-2.26 2.24v.05m-4.5-2.23a1.31 1.31 0 01-.73-.86c0-.2 0-.46.45-1.26a8.986 8.986 0 000-8.68C7 6.5 7 6.24 7.53 5.76c.19-.22.47-.33.77-.29.64 0 1 .31 1.54 1.44A10.51 10.51 0 0111.12 12c.04 1.81-.4 3.61-1.27 5.2-.54 1.05-.81 1.3-1.35 1.39-.19.02-.39 0-.57-.09v.06m-4.21-2.13c-.33-.16-.59-.43-.72-.78-.1-.35 0-.65.4-1.29.5-.68.74-1.52.69-2.36.07-.85-.16-1.69-.65-2.39A6.11 6.11 0 013 8.82c-.11-.63.31-1.23 1-1.35.54-.1.92.13 1.42.89a6.619 6.619 0 010 7.27c-.51.77-1.09 1-1.69.8h-.01z"/></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M16.79 23c-.42-.17-.72-.55-.79-1-.05-.26 0-.44.4-1.16 1.5-2.7 2.27-5.75 2.23-8.84.04-3-.69-5.93-2.13-8.56-.21-.44-.4-.86-.56-1.31.06-.38.25-.73.56-.94.45-.24 1-.19 1.41.09.28.36.52.72.72 1.14A21.4 21.4 0 0 1 20.8 9c.23 1.81.26 3.65.09 5.47-.31 2.34-1 4.6-2.06 6.71-.64 1.28-1 1.82-1.38 1.82H16.79m-4.36-2.21c-.57-.16-.93-.74-.81-1.32 0-.12.31-.67.59-1.23 1.18-2.27 1.69-4.83 1.46-7.38-.14-1.83-.67-3.61-1.54-5.22-.63-1.26-.67-1.46-.3-2 .44-.49 1.17-.56 1.71-.14.72 1.06 1.29 2.22 1.71 3.44 1.28 3.79 1.08 7.92-.56 11.56-.84 1.89-1.43 2.5-2.26 2.24v.05m-4.5-2.23a1.31 1.31 0 0 1-.73-.86c0-.2 0-.46.45-1.26a8.986 8.986 0 0 0 0-8.68C7 6.5 7 6.24 7.53 5.76c.19-.22.47-.33.77-.29.64 0 1 .31 1.54 1.44A10.51 10.51 0 0 1 11.12 12c.04 1.81-.4 3.61-1.27 5.2-.54 1.05-.81 1.3-1.35 1.39-.19.02-.39 0-.57-.09v.06m-4.21-2.13c-.33-.16-.59-.43-.72-.78-.1-.35 0-.65.4-1.29.5-.68.74-1.52.69-2.36.07-.85-.16-1.69-.65-2.39A6.11 6.11 0 0 1 3 8.82c-.11-.63.31-1.23 1-1.35.54-.1.92.13 1.42.89a6.619 6.619 0 0 1 0 7.27c-.51.77-1.09 1-1.69.8h-.01z"/></svg>
|
||||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
@@ -1 +1 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 8.5c0 2.7 2.75 5.37 7 9.24V7.2C10.42 5.91 9 5 7.5 5 5.5 5 4 6.5 4 8.5m9-1.3v13.24l-1 .91-1.45-1.32C5.4 15.36 2 12.27 2 8.5 2 5.41 4.42 3 7.5 3 10 3 13 5 13 7.2z"/></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 8.5c0 2.7 2.75 5.37 7 9.24V7.2C10.42 5.91 9 5 7.5 5 5.5 5 4 6.5 4 8.5m9-1.3V20.44l-1 .91-1.45-1.32C5.4 15.36 2 12.27 2 8.5 2 5.41 4.42 3 7.5 3 10 3 13 5 13 7.2z"/></svg>
|
||||||
|
Before Width: | Height: | Size: 241 B After Width: | Height: | Size: 241 B |
@@ -1 +1 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 7.2v13.24l-1 .91-1.45-1.32C5.4 15.36 2 12.27 2 8.5 2 5.41 4.42 3 7.5 3 10 3 13 5 13 7.2z"/></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 7.2V20.44l-1 .91-1.45-1.32C5.4 15.36 2 12.27 2 8.5 2 5.41 4.42 3 7.5 3 10 3 13 5 13 7.2z"/></svg>
|
||||||
|
Before Width: | Height: | Size: 170 B After Width: | Height: | Size: 170 B |
@@ -1 +1 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15 12h1.5v4.25l2.86 1.69-.75 1.22L15 17v-5m1-3c.69 0 1.37.1 2 .29V4.7l-3 1.16v3.21c.33-.07.66-.07 1-.07m7 7a7 7 0 01-7 7c-3 0-5.6-1.92-6.58-4.6L8 17.9l-5.34 2.07-.16.03a.5.5 0 01-.5-.5V4.38c0-.23.15-.41.36-.48L8 2l6 2.1 5.34-2.07.16-.03a.5.5 0 01.5.5v7.75c1.81 1.25 3 3.37 3 5.75M9 16c0-2.79 1.63-5.2 4-6.33v-3.8l-4-1.4V16m7-5a5 5 0 00-5 5 5 5 0 005 5 5 5 0 005-5 5 5 0 00-5-5M4 5.46v11.85l3-1.16V4.45L4 5.46z"/></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15 12h1.5v4.25l2.86 1.69-.75 1.22L15 17v-5m1-3c.69 0 1.37.1 2 .29V4.7l-3 1.16v3.21c.33-.07.66-.07 1-.07m7 7a7 7 0 0 1-7 7c-3 0-5.6-1.92-6.58-4.6L8 17.9l-5.34 2.07-.16.03a.5.5 0 0 1-.5-.5V4.38c0-.23.15-.41.36-.48L8 2l6 2.1 5.34-2.07.16-.03a.5.5 0 0 1 .5.5v7.75c1.81 1.25 3 3.37 3 5.75M9 16c0-2.79 1.63-5.2 4-6.33v-3.8l-4-1.4v11.66V16m7-5a5 5 0 0 0-5 5 5 5 0 0 0 5 5 5 5 0 0 0 5-5 5 5 0 0 0-5-5M4 5.46v11.85l3-1.16V4.45L4 5.46z"/></svg>
|
||||||
|
Before Width: | Height: | Size: 488 B After Width: | Height: | Size: 504 B |
@@ -1 +1 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M2 12a10 10 0 0010 10 10 10 0 0010-10A10 10 0 0012 2 10 10 0 002 12m3.24 6.76A9.493 9.493 0 012.44 12c0-2.55.99-4.95 2.8-6.76A9.493 9.493 0 0112 2.44c2.55 0 4.95.99 6.76 2.8a9.493 9.493 0 012.8 6.76c0 2.55-.99 4.95-2.8 6.76a9.493 9.493 0 01-6.76 2.8c-2.55 0-4.95-.99-6.76-2.8M6.35 9.5c-2.01 2.29-1.62 4.18-1.62 4.18s.55-1.3 1.88-2.68c.64-.63 1.11-.85 1.43-.85.36 0 .53.26.53.5v4.64c0 .46-.3.56-.57.55a1.5 1.5 0 01-.45-.08C8.92 17.73 12.19 18 12.19 18l1.44-1.5h.04L15 17.63c2.39-1.42 3.55-4.05 3.55-4.05-1.05 1.12-1.76 1.39-2.16 1.38-.36 0-.51-.21-.51-.21-.01-.1-.06-5.85.01-5.85.42-.77 1.74-2.34 1.74-2.34-2.47.49-3.82 2.1-3.82 2.1-.4-.31-1.22-.26-1.22-.26.38.21.76.81.76 1.32v4.93s-.85.73-1.47.73c-.38 0-.61-.21-.74-.38-.09-.12-.14-.21-.14-.21v-6.1c-.07.06-.18.11-.29.11-.14-.01-.28-.07-.37-.27-.08-.15-.12-.38-.12-.7 0-1.13 1.28-1.87 1.28-1.87-1.63.43-3.14 1.26-5.15 3.54"/></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2 10 10 0 0 0 2 12m3.24 6.76A9.493 9.493 0 0 1 2.44 12c0-2.55.99-4.95 2.8-6.76A9.493 9.493 0 0 1 12 2.44c2.55 0 4.95.99 6.76 2.8a9.493 9.493 0 0 1 2.8 6.76c0 2.55-.99 4.95-2.8 6.76a9.493 9.493 0 0 1-6.76 2.8c-2.55 0-4.95-.99-6.76-2.8M6.35 9.5c-2.01 2.29-1.62 4.18-1.62 4.18s.55-1.3 1.88-2.68c.64-.63 1.11-.85 1.43-.85.36 0 .53.26.53.5v4.64c0 .46-.3.56-.57.55-.23 0-.45-.08-.45-.08C8.92 17.73 12.19 18 12.19 18l1.44-1.5h.04L15 17.63c2.39-1.42 3.55-4.05 3.55-4.05-1.05 1.12-1.76 1.39-2.16 1.38-.36 0-.51-.21-.51-.21-.01-.1-.06-5.85.01-5.85.42-.77 1.74-2.34 1.74-2.34-2.47.49-3.82 2.1-3.82 2.1-.4-.31-1.22-.26-1.22-.26.38.21.76.81.76 1.32v4.93s-.85.73-1.47.73c-.38 0-.61-.21-.74-.38-.09-.12-.14-.21-.14-.21v-6.1c-.07.06-.18.11-.29.11-.14-.01-.28-.07-.37-.27-.08-.15-.12-.38-.12-.7 0-1.13 1.28-1.87 1.28-1.87-1.63.43-3.14 1.26-5.15 3.54"/></svg>
|
||||||
|
Before Width: | Height: | Size: 951 B After Width: | Height: | Size: 967 B |
@@ -1 +1 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 3.77l-.75.84S9.97 6.06 8.68 7.94C7.39 9.82 6 12.07 6 14.23a6 6 0 006 6 6 6 0 006-6c0-2.16-1.39-4.41-2.68-6.29a38.7 38.7 0 00-2.57-3.33L12 3.77m0 3.13c.44.52.84.95 1.68 2.17 1.21 1.76 2.32 4 2.32 5.16 0 2.22-1.78 4-4 4-2.22 0-4-1.78-4-4 0-1.16 1.11-3.4 2.32-5.16.84-1.22 1.24-1.65 1.68-2.17z"/></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 3.77l-.75.84S9.97 6.06 8.68 7.94C7.39 9.82 6 12.07 6 14.23a6 6 0 0 0 6 6 6 6 0 0 0 6-6c0-2.16-1.39-4.41-2.68-6.29-1.29-1.88-2.57-3.33-2.57-3.33L12 3.77m0 3.13c.44.52.84.95 1.68 2.17 1.21 1.76 2.32 4 2.32 5.16 0 2.22-1.78 4-4 4-2.22 0-4-1.78-4-4 0-1.16 1.11-3.4 2.32-5.16.84-1.22 1.24-1.65 1.68-2.17z"/></svg>
|
||||||
|
Before Width: | Height: | Size: 372 B After Width: | Height: | Size: 381 B |
@@ -1 +1 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3.62 8H5v7h2V8h4v2h2V8h4v7h2V8h1.61c.55 0 1-.44 1-1a.86.86 0 00-.05-.32L19 2H5L2.72 6.55A.998.998 0 003.62 8m2.62-4h11.52l1 2H5.24l1-2M2 16v2h2v4h16v-4h2v-2H2m16 4H6v-2h12v2m-4.07-9c.28 0 .5.22.5.5v.06l-.38 3c-.05.25-.24.44-.49.44h-3.12c-.25 0-.44-.19-.49-.44l-.38-3A.51.51 0 0110 11h3.93z"/></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3.62 8H5v7h2V8h4v2h2V8h4v7h2V8h1.61c.55 0 1-.44 1-1a.86.86 0 0 0-.05-.32L19 2H5L2.72 6.55A.998.998 0 0 0 3.62 8m2.62-4h11.52l1 2H5.24l1-2M2 16v2h2v4h16v-4h2v-2H2m16 4H6v-2h12v2m-4.07-9c.28 0 .5.22.5.5v.06l-.38 3c-.05.25-.24.44-.49.44h-3.12c-.25 0-.44-.19-.49-.44l-.38-3A.51.51 0 0 1 10 11H13.93z"/></svg>
|
||||||
|
Before Width: | Height: | Size: 368 B After Width: | Height: | Size: 374 B |
@@ -1 +1 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14.97 18.95l-2.56-6.03c-1.02 1.99-2.14 4.08-3.1 6.03-.01.01-.47 0-.47 0C7.37 15.5 5.85 12.1 4.37 8.68 4.03 7.84 2.83 6.5 2 6.5v-.45h5.06v.45c-.6 0-1.62.4-1.36 1.05.72 1.54 3.24 7.51 3.93 9.03.47-.94 1.8-3.42 2.37-4.47-.45-.88-1.87-4.18-2.29-5-.32-.54-1.13-.61-1.75-.61 0-.15.01-.25 0-.44l4.46.01v.4c-.61.03-1.18.24-.92.82.6 1.24.95 2.13 1.5 3.28.17-.34 1.07-2.19 1.5-3.16.26-.65-.13-.91-1.21-.91.01-.12.01-.33.01-.43 1.39-.01 3.48-.01 3.85-.02v.42c-.71.03-1.44.41-1.82.99L13.5 11.3c.18.51 1.96 4.46 2.15 4.9l3.85-8.83c-.3-.72-1.16-.87-1.5-.87v-.45l4 .03v.42c-.88 0-1.43.5-1.75 1.25-.8 1.79-3.25 7.49-4.85 11.2h-.43z"/></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14.97 18.95l-2.56-6.03c-1.02 1.99-2.14 4.08-3.1 6.03-.01.01-.47 0-.47 0C7.37 15.5 5.85 12.1 4.37 8.68 4.03 7.84 2.83 6.5 2 6.5v-.45h5.06v.45c-.6 0-1.62.4-1.36 1.05.72 1.54 3.24 7.51 3.93 9.03.47-.94 1.8-3.42 2.37-4.47-.45-.88-1.87-4.18-2.29-5-.32-.54-1.13-.61-1.75-.61 0-.15.01-.25 0-.44l4.46.01v.4c-.61.03-1.18.24-.92.82.6 1.24.95 2.13 1.5 3.28.17-.34 1.07-2.19 1.5-3.16.26-.65-.13-.91-1.21-.91.01-.12.01-.33.01-.43 1.39-.01 3.48-.01 3.85-.02v.42c-.71.03-1.44.41-1.82.99L13.5 11.3c.18.51 1.96 4.46 2.15 4.9l3.85-8.83c-.3-.72-1.16-.87-1.5-.87v-.45l4 .03V6.5c-.88 0-1.43.5-1.75 1.25-.8 1.79-3.25 7.49-4.85 11.2h-.43z"/></svg>
|
||||||
|
Before Width: | Height: | Size: 694 B After Width: | Height: | Size: 694 B |
32
material/assets/javascripts/bundle.ee96dedf.min.js
vendored
Normal file
7
material/assets/javascripts/bundle.ee96dedf.min.js.map
Normal file
206
material/assets/javascripts/lunr/tinyseg.js
Normal file
@@ -0,0 +1,206 @@
|
|||||||
|
/**
|
||||||
|
* export the module via AMD, CommonJS or as a browser global
|
||||||
|
* Export code from https://github.com/umdjs/umd/blob/master/returnExports.js
|
||||||
|
*/
|
||||||
|
;(function (root, factory) {
|
||||||
|
if (typeof define === 'function' && define.amd) {
|
||||||
|
// AMD. Register as an anonymous module.
|
||||||
|
define(factory)
|
||||||
|
} else if (typeof exports === 'object') {
|
||||||
|
/**
|
||||||
|
* Node. Does not work with strict CommonJS, but
|
||||||
|
* only CommonJS-like environments that support module.exports,
|
||||||
|
* like Node.
|
||||||
|
*/
|
||||||
|
module.exports = factory()
|
||||||
|
} else {
|
||||||
|
// Browser globals (root is window)
|
||||||
|
factory()(root.lunr);
|
||||||
|
}
|
||||||
|
}(this, function () {
|
||||||
|
/**
|
||||||
|
* Just return a value to define the module export.
|
||||||
|
* This example returns an object, but the module
|
||||||
|
* can return a function as the exported value.
|
||||||
|
*/
|
||||||
|
|
||||||
|
return function(lunr) {
|
||||||
|
// TinySegmenter 0.1 -- Super compact Japanese tokenizer in Javascript
|
||||||
|
// (c) 2008 Taku Kudo <taku@chasen.org>
|
||||||
|
// TinySegmenter is freely distributable under the terms of a new BSD licence.
|
||||||
|
// For details, see http://chasen.org/~taku/software/TinySegmenter/LICENCE.txt
|
||||||
|
|
||||||
|
function TinySegmenter() {
|
||||||
|
var patterns = {
|
||||||
|
"[一二三四五六七八九十百千万億兆]":"M",
|
||||||
|
"[一-龠々〆ヵヶ]":"H",
|
||||||
|
"[ぁ-ん]":"I",
|
||||||
|
"[ァ-ヴーア-ン゙ー]":"K",
|
||||||
|
"[a-zA-Za-zA-Z]":"A",
|
||||||
|
"[0-90-9]":"N"
|
||||||
|
}
|
||||||
|
this.chartype_ = [];
|
||||||
|
for (var i in patterns) {
|
||||||
|
var regexp = new RegExp(i);
|
||||||
|
this.chartype_.push([regexp, patterns[i]]);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.BIAS__ = -332
|
||||||
|
this.BC1__ = {"HH":6,"II":2461,"KH":406,"OH":-1378};
|
||||||
|
this.BC2__ = {"AA":-3267,"AI":2744,"AN":-878,"HH":-4070,"HM":-1711,"HN":4012,"HO":3761,"IA":1327,"IH":-1184,"II":-1332,"IK":1721,"IO":5492,"KI":3831,"KK":-8741,"MH":-3132,"MK":3334,"OO":-2920};
|
||||||
|
this.BC3__ = {"HH":996,"HI":626,"HK":-721,"HN":-1307,"HO":-836,"IH":-301,"KK":2762,"MK":1079,"MM":4034,"OA":-1652,"OH":266};
|
||||||
|
this.BP1__ = {"BB":295,"OB":304,"OO":-125,"UB":352};
|
||||||
|
this.BP2__ = {"BO":60,"OO":-1762};
|
||||||
|
this.BQ1__ = {"BHH":1150,"BHM":1521,"BII":-1158,"BIM":886,"BMH":1208,"BNH":449,"BOH":-91,"BOO":-2597,"OHI":451,"OIH":-296,"OKA":1851,"OKH":-1020,"OKK":904,"OOO":2965};
|
||||||
|
this.BQ2__ = {"BHH":118,"BHI":-1159,"BHM":466,"BIH":-919,"BKK":-1720,"BKO":864,"OHH":-1139,"OHM":-181,"OIH":153,"UHI":-1146};
|
||||||
|
this.BQ3__ = {"BHH":-792,"BHI":2664,"BII":-299,"BKI":419,"BMH":937,"BMM":8335,"BNN":998,"BOH":775,"OHH":2174,"OHM":439,"OII":280,"OKH":1798,"OKI":-793,"OKO":-2242,"OMH":-2402,"OOO":11699};
|
||||||
|
this.BQ4__ = {"BHH":-3895,"BIH":3761,"BII":-4654,"BIK":1348,"BKK":-1806,"BMI":-3385,"BOO":-12396,"OAH":926,"OHH":266,"OHK":-2036,"ONN":-973};
|
||||||
|
this.BW1__ = {",と":660,",同":727,"B1あ":1404,"B1同":542,"、と":660,"、同":727,"」と":1682,"あっ":1505,"いう":1743,"いっ":-2055,"いる":672,"うし":-4817,"うん":665,"から":3472,"がら":600,"こう":-790,"こと":2083,"こん":-1262,"さら":-4143,"さん":4573,"した":2641,"して":1104,"すで":-3399,"そこ":1977,"それ":-871,"たち":1122,"ため":601,"った":3463,"つい":-802,"てい":805,"てき":1249,"でき":1127,"です":3445,"では":844,"とい":-4915,"とみ":1922,"どこ":3887,"ない":5713,"なっ":3015,"など":7379,"なん":-1113,"にし":2468,"には":1498,"にも":1671,"に対":-912,"の一":-501,"の中":741,"ませ":2448,"まで":1711,"まま":2600,"まる":-2155,"やむ":-1947,"よっ":-2565,"れた":2369,"れで":-913,"をし":1860,"を見":731,"亡く":-1886,"京都":2558,"取り":-2784,"大き":-2604,"大阪":1497,"平方":-2314,"引き":-1336,"日本":-195,"本当":-2423,"毎日":-2113,"目指":-724,"B1あ":1404,"B1同":542,"」と":1682};
|
||||||
|
this.BW2__ = {"..":-11822,"11":-669,"――":-5730,"−−":-13175,"いう":-1609,"うか":2490,"かし":-1350,"かも":-602,"から":-7194,"かれ":4612,"がい":853,"がら":-3198,"きた":1941,"くな":-1597,"こと":-8392,"この":-4193,"させ":4533,"され":13168,"さん":-3977,"しい":-1819,"しか":-545,"した":5078,"して":972,"しな":939,"その":-3744,"たい":-1253,"たた":-662,"ただ":-3857,"たち":-786,"たと":1224,"たは":-939,"った":4589,"って":1647,"っと":-2094,"てい":6144,"てき":3640,"てく":2551,"ては":-3110,"ても":-3065,"でい":2666,"でき":-1528,"でし":-3828,"です":-4761,"でも":-4203,"とい":1890,"とこ":-1746,"とと":-2279,"との":720,"とみ":5168,"とも":-3941,"ない":-2488,"なが":-1313,"など":-6509,"なの":2614,"なん":3099,"にお":-1615,"にし":2748,"にな":2454,"によ":-7236,"に対":-14943,"に従":-4688,"に関":-11388,"のか":2093,"ので":-7059,"のに":-6041,"のの":-6125,"はい":1073,"はが":-1033,"はず":-2532,"ばれ":1813,"まし":-1316,"まで":-6621,"まれ":5409,"めて":-3153,"もい":2230,"もの":-10713,"らか":-944,"らし":-1611,"らに":-1897,"りし":651,"りま":1620,"れた":4270,"れて":849,"れば":4114,"ろう":6067,"われ":7901,"を通":-11877,"んだ":728,"んな":-4115,"一人":602,"一方":-1375,"一日":970,"一部":-1051,"上が":-4479,"会社":-1116,"出て":2163,"分の":-7758,"同党":970,"同日":-913,"大阪":-2471,"委員":-1250,"少な":-1050,"年度":-8669,"年間":-1626,"府県":-2363,"手権":-1982,"新聞":-4066,"日新":-722,"日本":-7068,"日米":3372,"曜日":-601,"朝鮮":-2355,"本人":-2697,"東京":-1543,"然と":-1384,"社会":-1276,"立て":-990,"第に":-1612,"米国":-4268,"11":-669};
|
||||||
|
this.BW3__ = {"あた":-2194,"あり":719,"ある":3846,"い.":-1185,"い。":-1185,"いい":5308,"いえ":2079,"いく":3029,"いた":2056,"いっ":1883,"いる":5600,"いわ":1527,"うち":1117,"うと":4798,"えと":1454,"か.":2857,"か。":2857,"かけ":-743,"かっ":-4098,"かに":-669,"から":6520,"かり":-2670,"が,":1816,"が、":1816,"がき":-4855,"がけ":-1127,"がっ":-913,"がら":-4977,"がり":-2064,"きた":1645,"けど":1374,"こと":7397,"この":1542,"ころ":-2757,"さい":-714,"さを":976,"し,":1557,"し、":1557,"しい":-3714,"した":3562,"して":1449,"しな":2608,"しま":1200,"す.":-1310,"す。":-1310,"する":6521,"ず,":3426,"ず、":3426,"ずに":841,"そう":428,"た.":8875,"た。":8875,"たい":-594,"たの":812,"たり":-1183,"たる":-853,"だ.":4098,"だ。":4098,"だっ":1004,"った":-4748,"って":300,"てい":6240,"てお":855,"ても":302,"です":1437,"でに":-1482,"では":2295,"とう":-1387,"とし":2266,"との":541,"とも":-3543,"どう":4664,"ない":1796,"なく":-903,"など":2135,"に,":-1021,"に、":-1021,"にし":1771,"にな":1906,"には":2644,"の,":-724,"の、":-724,"の子":-1000,"は,":1337,"は、":1337,"べき":2181,"まし":1113,"ます":6943,"まっ":-1549,"まで":6154,"まれ":-793,"らし":1479,"られ":6820,"るる":3818,"れ,":854,"れ、":854,"れた":1850,"れて":1375,"れば":-3246,"れる":1091,"われ":-605,"んだ":606,"んで":798,"カ月":990,"会議":860,"入り":1232,"大会":2217,"始め":1681,"市":965,"新聞":-5055,"日,":974,"日、":974,"社会":2024,"カ月":990};
|
||||||
|
this.TC1__ = {"AAA":1093,"HHH":1029,"HHM":580,"HII":998,"HOH":-390,"HOM":-331,"IHI":1169,"IOH":-142,"IOI":-1015,"IOM":467,"MMH":187,"OOI":-1832};
|
||||||
|
this.TC2__ = {"HHO":2088,"HII":-1023,"HMM":-1154,"IHI":-1965,"KKH":703,"OII":-2649};
|
||||||
|
this.TC3__ = {"AAA":-294,"HHH":346,"HHI":-341,"HII":-1088,"HIK":731,"HOH":-1486,"IHH":128,"IHI":-3041,"IHO":-1935,"IIH":-825,"IIM":-1035,"IOI":-542,"KHH":-1216,"KKA":491,"KKH":-1217,"KOK":-1009,"MHH":-2694,"MHM":-457,"MHO":123,"MMH":-471,"NNH":-1689,"NNO":662,"OHO":-3393};
|
||||||
|
this.TC4__ = {"HHH":-203,"HHI":1344,"HHK":365,"HHM":-122,"HHN":182,"HHO":669,"HIH":804,"HII":679,"HOH":446,"IHH":695,"IHO":-2324,"IIH":321,"III":1497,"IIO":656,"IOO":54,"KAK":4845,"KKA":3386,"KKK":3065,"MHH":-405,"MHI":201,"MMH":-241,"MMM":661,"MOM":841};
|
||||||
|
this.TQ1__ = {"BHHH":-227,"BHHI":316,"BHIH":-132,"BIHH":60,"BIII":1595,"BNHH":-744,"BOHH":225,"BOOO":-908,"OAKK":482,"OHHH":281,"OHIH":249,"OIHI":200,"OIIH":-68};
|
||||||
|
this.TQ2__ = {"BIHH":-1401,"BIII":-1033,"BKAK":-543,"BOOO":-5591};
|
||||||
|
this.TQ3__ = {"BHHH":478,"BHHM":-1073,"BHIH":222,"BHII":-504,"BIIH":-116,"BIII":-105,"BMHI":-863,"BMHM":-464,"BOMH":620,"OHHH":346,"OHHI":1729,"OHII":997,"OHMH":481,"OIHH":623,"OIIH":1344,"OKAK":2792,"OKHH":587,"OKKA":679,"OOHH":110,"OOII":-685};
|
||||||
|
this.TQ4__ = {"BHHH":-721,"BHHM":-3604,"BHII":-966,"BIIH":-607,"BIII":-2181,"OAAA":-2763,"OAKK":180,"OHHH":-294,"OHHI":2446,"OHHO":480,"OHIH":-1573,"OIHH":1935,"OIHI":-493,"OIIH":626,"OIII":-4007,"OKAK":-8156};
|
||||||
|
this.TW1__ = {"につい":-4681,"東京都":2026};
|
||||||
|
this.TW2__ = {"ある程":-2049,"いった":-1256,"ころが":-2434,"しょう":3873,"その後":-4430,"だって":-1049,"ていた":1833,"として":-4657,"ともに":-4517,"もので":1882,"一気に":-792,"初めて":-1512,"同時に":-8097,"大きな":-1255,"対して":-2721,"社会党":-3216};
|
||||||
|
this.TW3__ = {"いただ":-1734,"してい":1314,"として":-4314,"につい":-5483,"にとっ":-5989,"に当た":-6247,"ので,":-727,"ので、":-727,"のもの":-600,"れから":-3752,"十二月":-2287};
|
||||||
|
this.TW4__ = {"いう.":8576,"いう。":8576,"からな":-2348,"してい":2958,"たが,":1516,"たが、":1516,"ている":1538,"という":1349,"ました":5543,"ません":1097,"ようと":-4258,"よると":5865};
|
||||||
|
this.UC1__ = {"A":484,"K":93,"M":645,"O":-505};
|
||||||
|
this.UC2__ = {"A":819,"H":1059,"I":409,"M":3987,"N":5775,"O":646};
|
||||||
|
this.UC3__ = {"A":-1370,"I":2311};
|
||||||
|
this.UC4__ = {"A":-2643,"H":1809,"I":-1032,"K":-3450,"M":3565,"N":3876,"O":6646};
|
||||||
|
this.UC5__ = {"H":313,"I":-1238,"K":-799,"M":539,"O":-831};
|
||||||
|
this.UC6__ = {"H":-506,"I":-253,"K":87,"M":247,"O":-387};
|
||||||
|
this.UP1__ = {"O":-214};
|
||||||
|
this.UP2__ = {"B":69,"O":935};
|
||||||
|
this.UP3__ = {"B":189};
|
||||||
|
this.UQ1__ = {"BH":21,"BI":-12,"BK":-99,"BN":142,"BO":-56,"OH":-95,"OI":477,"OK":410,"OO":-2422};
|
||||||
|
this.UQ2__ = {"BH":216,"BI":113,"OK":1759};
|
||||||
|
this.UQ3__ = {"BA":-479,"BH":42,"BI":1913,"BK":-7198,"BM":3160,"BN":6427,"BO":14761,"OI":-827,"ON":-3212};
|
||||||
|
this.UW1__ = {",":156,"、":156,"「":-463,"あ":-941,"う":-127,"が":-553,"き":121,"こ":505,"で":-201,"と":-547,"ど":-123,"に":-789,"の":-185,"は":-847,"も":-466,"や":-470,"よ":182,"ら":-292,"り":208,"れ":169,"を":-446,"ん":-137,"・":-135,"主":-402,"京":-268,"区":-912,"午":871,"国":-460,"大":561,"委":729,"市":-411,"日":-141,"理":361,"生":-408,"県":-386,"都":-718,"「":-463,"・":-135};
|
||||||
|
this.UW2__ = {",":-829,"、":-829,"〇":892,"「":-645,"」":3145,"あ":-538,"い":505,"う":134,"お":-502,"か":1454,"が":-856,"く":-412,"こ":1141,"さ":878,"ざ":540,"し":1529,"す":-675,"せ":300,"そ":-1011,"た":188,"だ":1837,"つ":-949,"て":-291,"で":-268,"と":-981,"ど":1273,"な":1063,"に":-1764,"の":130,"は":-409,"ひ":-1273,"べ":1261,"ま":600,"も":-1263,"や":-402,"よ":1639,"り":-579,"る":-694,"れ":571,"を":-2516,"ん":2095,"ア":-587,"カ":306,"キ":568,"ッ":831,"三":-758,"不":-2150,"世":-302,"中":-968,"主":-861,"事":492,"人":-123,"会":978,"保":362,"入":548,"初":-3025,"副":-1566,"北":-3414,"区":-422,"大":-1769,"天":-865,"太":-483,"子":-1519,"学":760,"実":1023,"小":-2009,"市":-813,"年":-1060,"強":1067,"手":-1519,"揺":-1033,"政":1522,"文":-1355,"新":-1682,"日":-1815,"明":-1462,"最":-630,"朝":-1843,"本":-1650,"東":-931,"果":-665,"次":-2378,"民":-180,"気":-1740,"理":752,"発":529,"目":-1584,"相":-242,"県":-1165,"立":-763,"第":810,"米":509,"自":-1353,"行":838,"西":-744,"見":-3874,"調":1010,"議":1198,"込":3041,"開":1758,"間":-1257,"「":-645,"」":3145,"ッ":831,"ア":-587,"カ":306,"キ":568};
|
||||||
|
this.UW3__ = {",":4889,"1":-800,"−":-1723,"、":4889,"々":-2311,"〇":5827,"」":2670,"〓":-3573,"あ":-2696,"い":1006,"う":2342,"え":1983,"お":-4864,"か":-1163,"が":3271,"く":1004,"け":388,"げ":401,"こ":-3552,"ご":-3116,"さ":-1058,"し":-395,"す":584,"せ":3685,"そ":-5228,"た":842,"ち":-521,"っ":-1444,"つ":-1081,"て":6167,"で":2318,"と":1691,"ど":-899,"な":-2788,"に":2745,"の":4056,"は":4555,"ひ":-2171,"ふ":-1798,"へ":1199,"ほ":-5516,"ま":-4384,"み":-120,"め":1205,"も":2323,"や":-788,"よ":-202,"ら":727,"り":649,"る":5905,"れ":2773,"わ":-1207,"を":6620,"ん":-518,"ア":551,"グ":1319,"ス":874,"ッ":-1350,"ト":521,"ム":1109,"ル":1591,"ロ":2201,"ン":278,"・":-3794,"一":-1619,"下":-1759,"世":-2087,"両":3815,"中":653,"主":-758,"予":-1193,"二":974,"人":2742,"今":792,"他":1889,"以":-1368,"低":811,"何":4265,"作":-361,"保":-2439,"元":4858,"党":3593,"全":1574,"公":-3030,"六":755,"共":-1880,"円":5807,"再":3095,"分":457,"初":2475,"別":1129,"前":2286,"副":4437,"力":365,"動":-949,"務":-1872,"化":1327,"北":-1038,"区":4646,"千":-2309,"午":-783,"協":-1006,"口":483,"右":1233,"各":3588,"合":-241,"同":3906,"和":-837,"員":4513,"国":642,"型":1389,"場":1219,"外":-241,"妻":2016,"学":-1356,"安":-423,"実":-1008,"家":1078,"小":-513,"少":-3102,"州":1155,"市":3197,"平":-1804,"年":2416,"広":-1030,"府":1605,"度":1452,"建":-2352,"当":-3885,"得":1905,"思":-1291,"性":1822,"戸":-488,"指":-3973,"政":-2013,"教":-1479,"数":3222,"文":-1489,"新":1764,"日":2099,"旧":5792,"昨":-661,"時":-1248,"曜":-951,"最":-937,"月":4125,"期":360,"李":3094,"村":364,"東":-805,"核":5156,"森":2438,"業":484,"氏":2613,"民":-1694,"決":-1073,"法":1868,"海":-495,"無":979,"物":461,"特":-3850,"生":-273,"用":914,"町":1215,"的":7313,"直":-1835,"省":792,"県":6293,"知":-1528,"私":4231,"税":401,"立":-960,"第":1201,"米":7767,"系":3066,"約":3663,"級":1384,"統":-4229,"総":1163,"線":1255,"者":6457,"能":725,"自":-2869,"英":785,"見":1044,"調":-562,"財":-733,"費":1777,"車":1835,"軍":1375,"込":-1504,"通":-1136,"選":-681,"郎":1026,"郡":4404,"部":1200,"金":2163,"長":421,"開":-1432,"間":1302,"関":-1282,"雨":2009,"電":-1045,"非":2066,"駅":1620,"1":-800,"」":2670,"・":-3794,"ッ":-1350,"ア":551,"グ":1319,"ス":874,"ト":521,"ム":1109,"ル":1591,"ロ":2201,"ン":278};
|
||||||
|
this.UW4__ = {",":3930,".":3508,"―":-4841,"、":3930,"。":3508,"〇":4999,"「":1895,"」":3798,"〓":-5156,"あ":4752,"い":-3435,"う":-640,"え":-2514,"お":2405,"か":530,"が":6006,"き":-4482,"ぎ":-3821,"く":-3788,"け":-4376,"げ":-4734,"こ":2255,"ご":1979,"さ":2864,"し":-843,"じ":-2506,"す":-731,"ず":1251,"せ":181,"そ":4091,"た":5034,"だ":5408,"ち":-3654,"っ":-5882,"つ":-1659,"て":3994,"で":7410,"と":4547,"な":5433,"に":6499,"ぬ":1853,"ね":1413,"の":7396,"は":8578,"ば":1940,"ひ":4249,"び":-4134,"ふ":1345,"へ":6665,"べ":-744,"ほ":1464,"ま":1051,"み":-2082,"む":-882,"め":-5046,"も":4169,"ゃ":-2666,"や":2795,"ょ":-1544,"よ":3351,"ら":-2922,"り":-9726,"る":-14896,"れ":-2613,"ろ":-4570,"わ":-1783,"を":13150,"ん":-2352,"カ":2145,"コ":1789,"セ":1287,"ッ":-724,"ト":-403,"メ":-1635,"ラ":-881,"リ":-541,"ル":-856,"ン":-3637,"・":-4371,"ー":-11870,"一":-2069,"中":2210,"予":782,"事":-190,"井":-1768,"人":1036,"以":544,"会":950,"体":-1286,"作":530,"側":4292,"先":601,"党":-2006,"共":-1212,"内":584,"円":788,"初":1347,"前":1623,"副":3879,"力":-302,"動":-740,"務":-2715,"化":776,"区":4517,"協":1013,"参":1555,"合":-1834,"和":-681,"員":-910,"器":-851,"回":1500,"国":-619,"園":-1200,"地":866,"場":-1410,"塁":-2094,"士":-1413,"多":1067,"大":571,"子":-4802,"学":-1397,"定":-1057,"寺":-809,"小":1910,"屋":-1328,"山":-1500,"島":-2056,"川":-2667,"市":2771,"年":374,"庁":-4556,"後":456,"性":553,"感":916,"所":-1566,"支":856,"改":787,"政":2182,"教":704,"文":522,"方":-856,"日":1798,"時":1829,"最":845,"月":-9066,"木":-485,"来":-442,"校":-360,"業":-1043,"氏":5388,"民":-2716,"気":-910,"沢":-939,"済":-543,"物":-735,"率":672,"球":-1267,"生":-1286,"産":-1101,"田":-2900,"町":1826,"的":2586,"目":922,"省":-3485,"県":2997,"空":-867,"立":-2112,"第":788,"米":2937,"系":786,"約":2171,"経":1146,"統":-1169,"総":940,"線":-994,"署":749,"者":2145,"能":-730,"般":-852,"行":-792,"規":792,"警":-1184,"議":-244,"谷":-1000,"賞":730,"車":-1481,"軍":1158,"輪":-1433,"込":-3370,"近":929,"道":-1291,"選":2596,"郎":-4866,"都":1192,"野":-1100,"銀":-2213,"長":357,"間":-2344,"院":-2297,"際":-2604,"電":-878,"領":-1659,"題":-792,"館":-1984,"首":1749,"高":2120,"「":1895,"」":3798,"・":-4371,"ッ":-724,"ー":-11870,"カ":2145,"コ":1789,"セ":1287,"ト":-403,"メ":-1635,"ラ":-881,"リ":-541,"ル":-856,"ン":-3637};
|
||||||
|
this.UW5__ = {",":465,".":-299,"1":-514,"E2":-32768,"]":-2762,"、":465,"。":-299,"「":363,"あ":1655,"い":331,"う":-503,"え":1199,"お":527,"か":647,"が":-421,"き":1624,"ぎ":1971,"く":312,"げ":-983,"さ":-1537,"し":-1371,"す":-852,"だ":-1186,"ち":1093,"っ":52,"つ":921,"て":-18,"で":-850,"と":-127,"ど":1682,"な":-787,"に":-1224,"の":-635,"は":-578,"べ":1001,"み":502,"め":865,"ゃ":3350,"ょ":854,"り":-208,"る":429,"れ":504,"わ":419,"を":-1264,"ん":327,"イ":241,"ル":451,"ン":-343,"中":-871,"京":722,"会":-1153,"党":-654,"務":3519,"区":-901,"告":848,"員":2104,"大":-1296,"学":-548,"定":1785,"嵐":-1304,"市":-2991,"席":921,"年":1763,"思":872,"所":-814,"挙":1618,"新":-1682,"日":218,"月":-4353,"査":932,"格":1356,"機":-1508,"氏":-1347,"田":240,"町":-3912,"的":-3149,"相":1319,"省":-1052,"県":-4003,"研":-997,"社":-278,"空":-813,"統":1955,"者":-2233,"表":663,"語":-1073,"議":1219,"選":-1018,"郎":-368,"長":786,"間":1191,"題":2368,"館":-689,"1":-514,"E2":-32768,"「":363,"イ":241,"ル":451,"ン":-343};
|
||||||
|
this.UW6__ = {",":227,".":808,"1":-270,"E1":306,"、":227,"。":808,"あ":-307,"う":189,"か":241,"が":-73,"く":-121,"こ":-200,"じ":1782,"す":383,"た":-428,"っ":573,"て":-1014,"で":101,"と":-105,"な":-253,"に":-149,"の":-417,"は":-236,"も":-206,"り":187,"る":-135,"を":195,"ル":-673,"ン":-496,"一":-277,"中":201,"件":-800,"会":624,"前":302,"区":1792,"員":-1212,"委":798,"学":-960,"市":887,"広":-695,"後":535,"業":-697,"相":753,"社":-507,"福":974,"空":-822,"者":1811,"連":463,"郎":1082,"1":-270,"E1":306,"ル":-673,"ン":-496};
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
TinySegmenter.prototype.ctype_ = function(str) {
|
||||||
|
for (var i in this.chartype_) {
|
||||||
|
if (str.match(this.chartype_[i][0])) {
|
||||||
|
return this.chartype_[i][1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return "O";
|
||||||
|
}
|
||||||
|
|
||||||
|
TinySegmenter.prototype.ts_ = function(v) {
|
||||||
|
if (v) { return v; }
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
TinySegmenter.prototype.segment = function(input) {
|
||||||
|
if (input == null || input == undefined || input == "") {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
var result = [];
|
||||||
|
var seg = ["B3","B2","B1"];
|
||||||
|
var ctype = ["O","O","O"];
|
||||||
|
var o = input.split("");
|
||||||
|
for (i = 0; i < o.length; ++i) {
|
||||||
|
seg.push(o[i]);
|
||||||
|
ctype.push(this.ctype_(o[i]))
|
||||||
|
}
|
||||||
|
seg.push("E1");
|
||||||
|
seg.push("E2");
|
||||||
|
seg.push("E3");
|
||||||
|
ctype.push("O");
|
||||||
|
ctype.push("O");
|
||||||
|
ctype.push("O");
|
||||||
|
var word = seg[3];
|
||||||
|
var p1 = "U";
|
||||||
|
var p2 = "U";
|
||||||
|
var p3 = "U";
|
||||||
|
for (var i = 4; i < seg.length - 3; ++i) {
|
||||||
|
var score = this.BIAS__;
|
||||||
|
var w1 = seg[i-3];
|
||||||
|
var w2 = seg[i-2];
|
||||||
|
var w3 = seg[i-1];
|
||||||
|
var w4 = seg[i];
|
||||||
|
var w5 = seg[i+1];
|
||||||
|
var w6 = seg[i+2];
|
||||||
|
var c1 = ctype[i-3];
|
||||||
|
var c2 = ctype[i-2];
|
||||||
|
var c3 = ctype[i-1];
|
||||||
|
var c4 = ctype[i];
|
||||||
|
var c5 = ctype[i+1];
|
||||||
|
var c6 = ctype[i+2];
|
||||||
|
score += this.ts_(this.UP1__[p1]);
|
||||||
|
score += this.ts_(this.UP2__[p2]);
|
||||||
|
score += this.ts_(this.UP3__[p3]);
|
||||||
|
score += this.ts_(this.BP1__[p1 + p2]);
|
||||||
|
score += this.ts_(this.BP2__[p2 + p3]);
|
||||||
|
score += this.ts_(this.UW1__[w1]);
|
||||||
|
score += this.ts_(this.UW2__[w2]);
|
||||||
|
score += this.ts_(this.UW3__[w3]);
|
||||||
|
score += this.ts_(this.UW4__[w4]);
|
||||||
|
score += this.ts_(this.UW5__[w5]);
|
||||||
|
score += this.ts_(this.UW6__[w6]);
|
||||||
|
score += this.ts_(this.BW1__[w2 + w3]);
|
||||||
|
score += this.ts_(this.BW2__[w3 + w4]);
|
||||||
|
score += this.ts_(this.BW3__[w4 + w5]);
|
||||||
|
score += this.ts_(this.TW1__[w1 + w2 + w3]);
|
||||||
|
score += this.ts_(this.TW2__[w2 + w3 + w4]);
|
||||||
|
score += this.ts_(this.TW3__[w3 + w4 + w5]);
|
||||||
|
score += this.ts_(this.TW4__[w4 + w5 + w6]);
|
||||||
|
score += this.ts_(this.UC1__[c1]);
|
||||||
|
score += this.ts_(this.UC2__[c2]);
|
||||||
|
score += this.ts_(this.UC3__[c3]);
|
||||||
|
score += this.ts_(this.UC4__[c4]);
|
||||||
|
score += this.ts_(this.UC5__[c5]);
|
||||||
|
score += this.ts_(this.UC6__[c6]);
|
||||||
|
score += this.ts_(this.BC1__[c2 + c3]);
|
||||||
|
score += this.ts_(this.BC2__[c3 + c4]);
|
||||||
|
score += this.ts_(this.BC3__[c4 + c5]);
|
||||||
|
score += this.ts_(this.TC1__[c1 + c2 + c3]);
|
||||||
|
score += this.ts_(this.TC2__[c2 + c3 + c4]);
|
||||||
|
score += this.ts_(this.TC3__[c3 + c4 + c5]);
|
||||||
|
score += this.ts_(this.TC4__[c4 + c5 + c6]);
|
||||||
|
// score += this.ts_(this.TC5__[c4 + c5 + c6]);
|
||||||
|
score += this.ts_(this.UQ1__[p1 + c1]);
|
||||||
|
score += this.ts_(this.UQ2__[p2 + c2]);
|
||||||
|
score += this.ts_(this.UQ3__[p3 + c3]);
|
||||||
|
score += this.ts_(this.BQ1__[p2 + c2 + c3]);
|
||||||
|
score += this.ts_(this.BQ2__[p2 + c3 + c4]);
|
||||||
|
score += this.ts_(this.BQ3__[p3 + c2 + c3]);
|
||||||
|
score += this.ts_(this.BQ4__[p3 + c3 + c4]);
|
||||||
|
score += this.ts_(this.TQ1__[p2 + c1 + c2 + c3]);
|
||||||
|
score += this.ts_(this.TQ2__[p2 + c2 + c3 + c4]);
|
||||||
|
score += this.ts_(this.TQ3__[p3 + c1 + c2 + c3]);
|
||||||
|
score += this.ts_(this.TQ4__[p3 + c2 + c3 + c4]);
|
||||||
|
var p = "O";
|
||||||
|
if (score > 0) {
|
||||||
|
result.push(word);
|
||||||
|
word = "";
|
||||||
|
p = "B";
|
||||||
|
}
|
||||||
|
p1 = p2;
|
||||||
|
p2 = p3;
|
||||||
|
p3 = p;
|
||||||
|
word += seg[i];
|
||||||
|
}
|
||||||
|
result.push(word);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
lunr.TinySegmenter = TinySegmenter;
|
||||||
|
};
|
||||||
|
|
||||||
|
}));
|
||||||
61
material/assets/javascripts/workers/search.217ffd95.min.js
vendored
Normal file
@@ -1,16 +0,0 @@
|
|||||||
{
|
|
||||||
"assets/javascripts/bundle.js": "assets/javascripts/bundle.e8ecd72e.min.js",
|
|
||||||
"assets/javascripts/bundle.js.map": "assets/javascripts/bundle.e8ecd72e.min.js.map",
|
|
||||||
"assets/javascripts/vendor.js": "assets/javascripts/vendor.00ecb175.min.js",
|
|
||||||
"assets/javascripts/vendor.js.map": "assets/javascripts/vendor.00ecb175.min.js.map",
|
|
||||||
"assets/javascripts/worker/search.js": "assets/javascripts/worker/search.3f4c5856.min.js",
|
|
||||||
"assets/javascripts/worker/search.js.map": "assets/javascripts/worker/search.3f4c5856.min.js.map",
|
|
||||||
"assets/stylesheets/main.css": "assets/stylesheets/main.fa8597d9.min.css",
|
|
||||||
"assets/stylesheets/main.css.map": "assets/stylesheets/main.fa8597d9.min.css.map",
|
|
||||||
"assets/stylesheets/palette.css": "assets/stylesheets/palette.e03a20ad.min.css",
|
|
||||||
"assets/stylesheets/palette.css.map": "assets/stylesheets/palette.e03a20ad.min.css.map",
|
|
||||||
"overrides/assets/javascripts/bundle.js": "overrides/assets/javascripts/bundle.e5217812.min.js",
|
|
||||||
"overrides/assets/javascripts/bundle.js.map": "overrides/assets/javascripts/bundle.e5217812.min.js.map",
|
|
||||||
"overrides/assets/stylesheets/main.css": "overrides/assets/stylesheets/main.01a7853e.min.css",
|
|
||||||
"overrides/assets/stylesheets/main.css.map": "overrides/assets/stylesheets/main.01a7853e.min.css.map"
|
|
||||||
}
|
|
||||||
2
material/assets/stylesheets/main.a361390f.min.css
vendored
Normal file
1
material/assets/stylesheets/main.a361390f.min.css.map
Normal file
2
material/assets/stylesheets/palette.7fa14f5b.min.css
vendored
Normal file
1
material/assets/stylesheets/palette.7fa14f5b.min.css.map
Normal file
@@ -39,10 +39,10 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block styles %}
|
{% block styles %}
|
||||||
<link rel="stylesheet" href="{{ 'assets/stylesheets/main.fa8597d9.min.css' | url }}">
|
<link rel="stylesheet" href="{{ 'assets/stylesheets/main.a361390f.min.css' | url }}">
|
||||||
{% if config.theme.palette %}
|
{% if config.theme.palette %}
|
||||||
{% set palette = config.theme.palette %}
|
{% set palette = config.theme.palette %}
|
||||||
<link rel="stylesheet" href="{{ 'assets/stylesheets/palette.e03a20ad.min.css' | url }}">
|
<link rel="stylesheet" href="{{ 'assets/stylesheets/palette.7fa14f5b.min.css' | url }}">
|
||||||
{% if palette.primary %}
|
{% if palette.primary %}
|
||||||
{% import "partials/palette.html" as map %}
|
{% import "partials/palette.html" as map %}
|
||||||
{% set primary = map.primary(
|
{% set primary = map.primary(
|
||||||
@@ -61,7 +61,7 @@
|
|||||||
font.text | replace(' ', '+') + ':300,400,400i,700%7C' +
|
font.text | replace(' ', '+') + ':300,400,400i,700%7C' +
|
||||||
font.code | replace(' ', '+')
|
font.code | replace(' ', '+')
|
||||||
}}&display=fallback">
|
}}&display=fallback">
|
||||||
<style>:root{--md-text-font-family:"{{ font.text }}",;--md-code-font-family:"{{ font.code }}",}</style>
|
<style>:root{--md-text-font-family:"{{ font.text }}";--md-code-font-family:"{{ font.code }}"}</style>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% if config.extra.manifest %}
|
{% if config.extra.manifest %}
|
||||||
@@ -191,7 +191,7 @@
|
|||||||
"base": base_url,
|
"base": base_url,
|
||||||
"features": features,
|
"features": features,
|
||||||
"translations": {},
|
"translations": {},
|
||||||
"search": "assets/javascripts/worker/search.3f4c5856.min.js" | url,
|
"search": "assets/javascripts/workers/search.217ffd95.min.js" | url,
|
||||||
} -%}
|
} -%}
|
||||||
{%- set translations = app.translations -%}
|
{%- set translations = app.translations -%}
|
||||||
{%- for key in [
|
{%- for key in [
|
||||||
@@ -216,8 +216,7 @@
|
|||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block scripts %}
|
{% block scripts %}
|
||||||
<script src="{{ 'assets/javascripts/vendor.00ecb175.min.js' | url }}"></script>
|
<script src="{{ 'assets/javascripts/bundle.ee96dedf.min.js' | url }}"></script>
|
||||||
<script src="{{ 'assets/javascripts/bundle.e8ecd72e.min.js' | url }}"></script>
|
|
||||||
{% for path in config["extra_javascript"] %}
|
{% for path in config["extra_javascript"] %}
|
||||||
<script src="{{ path | url }}"></script>
|
<script src="{{ path | url }}"></script>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
19
material/overrides/assets/javascripts/bundle.0a1bb8db.min.js
vendored
Normal file
2
material/overrides/assets/stylesheets/main.8036384c.min.css
vendored
Normal file
@@ -22,7 +22,7 @@
|
|||||||
<meta name="twitter:title" content="{{ title }}">
|
<meta name="twitter:title" content="{{ title }}">
|
||||||
<meta name="twitter:description" content="{{ config.site_description }}">
|
<meta name="twitter:description" content="{{ config.site_description }}">
|
||||||
<meta name="twitter:image" content="{{ image }}">
|
<meta name="twitter:image" content="{{ image }}">
|
||||||
<link rel="stylesheet" href="{{ 'overrides/assets/stylesheets/main.01a7853e.min.css' | url }}">
|
<link rel="stylesheet" href="{{ 'overrides/assets/stylesheets/main.8036384c.min.css' | url }}">
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block announce %}
|
{% block announce %}
|
||||||
<a href="https://twitter.com/squidfunk">
|
<a href="https://twitter.com/squidfunk">
|
||||||
@@ -53,5 +53,5 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block scripts %}
|
{% block scripts %}
|
||||||
{{ super() }}
|
{{ super() }}
|
||||||
<script src="{{ 'overrides/assets/javascripts/bundle.e5217812.min.js' | url }}"></script>
|
<script src="{{ 'overrides/assets/javascripts/bundle.0a1bb8db.min.js' | url }}"></script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
8568
package-lock.json
generated
43
package.json
@@ -24,12 +24,14 @@
|
|||||||
"url": "https://github.com/squidfunk/mkdocs-material.git"
|
"url": "https://github.com/squidfunk/mkdocs-material.git"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "npm run clean && webpack --mode production",
|
"build": "run-s build:*",
|
||||||
|
"build:clean": "rimraf material",
|
||||||
|
"build:tools": "ts-node -T tools/build --optimize",
|
||||||
"clean": "rimraf material",
|
"clean": "rimraf material",
|
||||||
"lint": "npm run lint:scss && npm run lint:ts",
|
"lint": "run-p lint:*",
|
||||||
"lint:scss": "stylelint \"src/assets/**/*.scss\"",
|
"lint:scss": "stylelint \"src/assets/**/*.scss\"",
|
||||||
"lint:ts": "eslint --cache \"src/**/*.ts\"",
|
"lint:ts": "eslint --cache \"src/**/*.ts\"",
|
||||||
"start": "webpack --mode development --watch"
|
"start": "ts-node -T tools/build --watch"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"clipboard": "^2.0.6",
|
"clipboard": "^2.0.6",
|
||||||
@@ -45,63 +47,46 @@
|
|||||||
"@mdi/svg": "^5.9.55",
|
"@mdi/svg": "^5.9.55",
|
||||||
"@primer/octicons": "^12.0.0",
|
"@primer/octicons": "^12.0.0",
|
||||||
"@types/clipboard": "^2.0.1",
|
"@types/clipboard": "^2.0.1",
|
||||||
"@types/copy-webpack-plugin": "^6.4.0",
|
|
||||||
"@types/escape-html": "1.0.0",
|
"@types/escape-html": "1.0.0",
|
||||||
"@types/event-hooks-webpack-plugin": "^2.2.0",
|
|
||||||
"@types/fuzzaldrin-plus": "^0.6.1",
|
"@types/fuzzaldrin-plus": "^0.6.1",
|
||||||
"@types/html-minifier": "^4.0.0",
|
"@types/html-minifier": "^4.0.0",
|
||||||
"@types/lunr": "^2.3.3",
|
"@types/lunr": "^2.3.3",
|
||||||
"@types/mini-css-extract-plugin": "^1.2.2",
|
|
||||||
"@types/node": "^14.14.31",
|
"@types/node": "^14.14.31",
|
||||||
"@types/ramda": "^0.27.37",
|
|
||||||
"@types/resize-observer-browser": "^0.1.5",
|
"@types/resize-observer-browser": "^0.1.5",
|
||||||
"@types/webpack": "^4.41.26",
|
"@types/sass": "^1.16.0",
|
||||||
"@types/webpack-assets-manifest": "^3.0.1",
|
|
||||||
"@typescript-eslint/eslint-plugin": "^4.15.1",
|
"@typescript-eslint/eslint-plugin": "^4.15.1",
|
||||||
"@typescript-eslint/parser": "^4.15.1",
|
"@typescript-eslint/parser": "^4.15.1",
|
||||||
"autoprefixer": "10.2.4",
|
"autoprefixer": "^10.2.4",
|
||||||
"copy-webpack-plugin": "^6.4.1",
|
"chokidar": "^3.5.1",
|
||||||
"css-loader": "^5.0.2",
|
"cssnano": "^4.1.10",
|
||||||
|
"esbuild": "^0.8.50",
|
||||||
"eslint": "^7.20.0",
|
"eslint": "^7.20.0",
|
||||||
"eslint-plugin-eslint-comments": "^3.2.0",
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
||||||
"eslint-plugin-import": "^2.22.1",
|
"eslint-plugin-import": "^2.22.1",
|
||||||
"eslint-plugin-jsdoc": "^32.1.0",
|
"eslint-plugin-jsdoc": "^32.1.0",
|
||||||
"eslint-plugin-no-null": "^1.0.2",
|
"eslint-plugin-no-null": "^1.0.2",
|
||||||
"event-hooks-webpack-plugin": "^2.2.0",
|
|
||||||
"expose-loader": "^1.0.3",
|
|
||||||
"github-types": "^1.0.0",
|
"github-types": "^1.0.0",
|
||||||
"gitlab": "^14.2.2",
|
"gitlab": "^14.2.2",
|
||||||
"html-minifier": "^4.0.0",
|
"html-minifier": "^4.0.0",
|
||||||
"ignore-emit-webpack-plugin": "2.0.3",
|
|
||||||
"imagemin-webpack-plugin": "^2.4.2",
|
|
||||||
"material-design-color": "^2.3.2",
|
"material-design-color": "^2.3.2",
|
||||||
"material-shadows": "^3.0.1",
|
"material-shadows": "^3.0.1",
|
||||||
"mini-css-extract-plugin": "^1.3.8",
|
"npm-run-all": "^4.1.5",
|
||||||
"postcss": "^8.2.5",
|
"postcss": "^8.2.5",
|
||||||
"postcss-inline-svg": "^5.0.0",
|
"postcss-inline-svg": "^5.0.0",
|
||||||
"postcss-loader": "^4.2.0",
|
|
||||||
"postcss-svgo": "^4.0.2",
|
|
||||||
"preact": "^10.5.12",
|
"preact": "^10.5.12",
|
||||||
"ramda": "^0.27.1",
|
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"sass": "^1.32.8",
|
"sass": "^1.32.8",
|
||||||
"sass-loader": "^10.1.1",
|
|
||||||
"stylelint": "^13.11.0",
|
"stylelint": "^13.11.0",
|
||||||
"stylelint-config-rational-order": "^0.1.2",
|
"stylelint-config-rational-order": "^0.1.2",
|
||||||
"stylelint-config-recommended": "^3.0.0",
|
"stylelint-config-recommended": "^3.0.0",
|
||||||
"stylelint-config-standard": "^20.0.0",
|
"stylelint-config-standard": "^20.0.0",
|
||||||
"stylelint-scss": "^3.19.0",
|
"stylelint-scss": "^3.19.0",
|
||||||
|
"svgo": "^2.0.3",
|
||||||
"tiny-glob": "^0.2.8",
|
"tiny-glob": "^0.2.8",
|
||||||
"ts-loader": "^8.0.15",
|
|
||||||
"ts-node": "^9.1.1",
|
"ts-node": "^9.1.1",
|
||||||
"tsconfig-paths-webpack-plugin": "^3.3.0",
|
"typescript": "^4.1.5"
|
||||||
"tslib": "^2.1.0",
|
|
||||||
"typescript": "^4.1.5",
|
|
||||||
"webpack": "^4.46.0",
|
|
||||||
"webpack-assets-manifest": "3.1.1",
|
|
||||||
"webpack-cli": "^4.5.0"
|
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 12"
|
"node": ">= 14"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ export function watchMedia(query: string): Observable<boolean> {
|
|||||||
/**
|
/**
|
||||||
* Watch print mode, cross-browser
|
* Watch print mode, cross-browser
|
||||||
*
|
*
|
||||||
* @returns Print observable
|
* @returns Print mode observable
|
||||||
*/
|
*/
|
||||||
export function watchPrint(): Observable<void> {
|
export function watchPrint(): Observable<void> {
|
||||||
return merge(
|
return merge(
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ import {
|
|||||||
* Fetch the given URL
|
* Fetch the given URL
|
||||||
*
|
*
|
||||||
* @param url - Request URL
|
* @param url - Request URL
|
||||||
* @param options - Request options
|
* @param options - Options
|
||||||
*
|
*
|
||||||
* @returns Response observable
|
* @returns Response observable
|
||||||
*/
|
*/
|
||||||
@@ -55,7 +55,7 @@ export function request(
|
|||||||
* @template T - Data type
|
* @template T - Data type
|
||||||
*
|
*
|
||||||
* @param url - Request URL
|
* @param url - Request URL
|
||||||
* @param options - Request options
|
* @param options - Options
|
||||||
*
|
*
|
||||||
* @returns Data observable
|
* @returns Data observable
|
||||||
*/
|
*/
|
||||||
@@ -73,7 +73,7 @@ export function requestJSON<T>(
|
|||||||
* Fetch XML from the given URL
|
* Fetch XML from the given URL
|
||||||
*
|
*
|
||||||
* @param url - Request URL
|
* @param url - Request URL
|
||||||
* @param options - Request options
|
* @param options - Options
|
||||||
*
|
*
|
||||||
* @returns Data observable
|
* @returns Data observable
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ import {
|
|||||||
document.documentElement.classList.remove("no-js")
|
document.documentElement.classList.remove("no-js")
|
||||||
document.documentElement.classList.add("js")
|
document.documentElement.classList.add("js")
|
||||||
|
|
||||||
/* Set up navigation observables */
|
/* Set up navigation observables and subjects */
|
||||||
const document$ = watchDocument()
|
const document$ = watchDocument()
|
||||||
const location$ = watchLocation()
|
const location$ = watchLocation()
|
||||||
const target$ = watchLocationTarget()
|
const target$ = watchLocationTarget()
|
||||||
@@ -196,15 +196,16 @@ const component$ = document$
|
|||||||
/* Subscribe to all components */
|
/* Subscribe to all components */
|
||||||
component$.subscribe()
|
component$.subscribe()
|
||||||
|
|
||||||
/* Export to window */
|
/* ----------------------------------------------------------------------------
|
||||||
export {
|
* Exports
|
||||||
document$,
|
* ------------------------------------------------------------------------- */
|
||||||
location$,
|
|
||||||
target$,
|
window.document$ = document$ /* Document observable */
|
||||||
keyboard$,
|
window.location$ = location$ /* Location subject */
|
||||||
viewport$,
|
window.target$ = target$ /* Location target observable */
|
||||||
tablet$,
|
window.keyboard$ = keyboard$ /* Keyboard observable */
|
||||||
screen$,
|
window.viewport$ = viewport$ /* Viewport observable */
|
||||||
print$,
|
window.tablet$ = tablet$ /* Tablet observable */
|
||||||
component$
|
window.screen$ = screen$ /* Screen observable */
|
||||||
}
|
window.print$ = print$ /* Print mode observable */
|
||||||
|
window.component$ = component$ /* Component observable */
|
||||||
@@ -51,7 +51,7 @@ export type Content =
|
|||||||
interface MountOptions {
|
interface MountOptions {
|
||||||
target$: Observable<HTMLElement> /* Location target observable */
|
target$: Observable<HTMLElement> /* Location target observable */
|
||||||
viewport$: Observable<Viewport> /* Viewport observable */
|
viewport$: Observable<Viewport> /* Viewport observable */
|
||||||
print$: Observable<void> /* Print observable */
|
print$: Observable<void> /* Print mode observable */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------------
|
/* ----------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ export interface Details {}
|
|||||||
*/
|
*/
|
||||||
interface WatchOptions {
|
interface WatchOptions {
|
||||||
target$: Observable<HTMLElement> /* Location target observable */
|
target$: Observable<HTMLElement> /* Location target observable */
|
||||||
print$: Observable<void> /* Print observable */
|
print$: Observable<void> /* Print mode observable */
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -58,7 +58,7 @@ interface WatchOptions {
|
|||||||
*/
|
*/
|
||||||
interface MountOptions {
|
interface MountOptions {
|
||||||
target$: Observable<HTMLElement> /* Location target observable */
|
target$: Observable<HTMLElement> /* Location target observable */
|
||||||
print$: Observable<void> /* Print observable */
|
print$: Observable<void> /* Print mode observable */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------------
|
/* ----------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -128,9 +128,6 @@ function difference(a: string[], b: string[]): string[] {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Search index
|
* Search index
|
||||||
*
|
|
||||||
* Note that `lunr` is injected via Webpack, as it will otherwise also be
|
|
||||||
* bundled in the application bundle.
|
|
||||||
*/
|
*/
|
||||||
export class Search {
|
export class Search {
|
||||||
|
|
||||||
@@ -139,8 +136,8 @@ export class Search {
|
|||||||
*
|
*
|
||||||
* A mapping of URLs (including hash fragments) to the actual articles and
|
* A mapping of URLs (including hash fragments) to the actual articles and
|
||||||
* sections of the documentation. The search document mapping must be created
|
* sections of the documentation. The search document mapping must be created
|
||||||
* regardless of whether the index was prebuilt or not, as `lunr` itself will
|
* regardless of whether the index was prebuilt or not, as Lunr.js itself
|
||||||
* only store the actual index.
|
* only stores the actual index.
|
||||||
*/
|
*/
|
||||||
protected documents: SearchDocumentMap
|
protected documents: SearchDocumentMap
|
||||||
|
|
||||||
@@ -150,7 +147,7 @@ export class Search {
|
|||||||
protected highlight: SearchHighlightFactoryFn
|
protected highlight: SearchHighlightFactoryFn
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The underlying `lunr` search index
|
* The underlying Lunr.js search index
|
||||||
*/
|
*/
|
||||||
protected index: lunr.Index
|
protected index: lunr.Index
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ export type SearchTransformFn = (value: string) => string
|
|||||||
* that the resulting document must contain all terms, converting the query
|
* that the resulting document must contain all terms, converting the query
|
||||||
* to an `AND` query (as opposed to the default `OR` behavior). While users
|
* to an `AND` query (as opposed to the default `OR` behavior). While users
|
||||||
* may expect terms enclosed in quotation marks to map to span queries, i.e.
|
* may expect terms enclosed in quotation marks to map to span queries, i.e.
|
||||||
* for which order is important, `lunr` doesn't support them, so the best
|
* for which order is important, Lunr.js doesn't support them, so the best
|
||||||
* we can do is to convert the terms to an `AND` query.
|
* we can do is to convert the terms to an `AND` query.
|
||||||
*
|
*
|
||||||
* 2. Replace control characters which are not located at the beginning of the
|
* 2. Replace control characters which are not located at the beginning of the
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ function setupSearchIndex(
|
|||||||
* Set up search worker
|
* Set up search worker
|
||||||
*
|
*
|
||||||
* This function will create a web worker to set up and query the search index
|
* This function will create a web worker to set up and query the search index
|
||||||
* which is done using `lunr`. The index must be passed as an observable to
|
* which is done using Lunr.js. The index must be passed as an observable to
|
||||||
* enable hacks like _localsearch_ via search index embedding as JSON.
|
* enable hacks like _localsearch_ via search index embedding as JSON.
|
||||||
*
|
*
|
||||||
* @param url - Worker URL
|
* @param url - Worker URL
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
* IN THE SOFTWARE.
|
* IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import "lunr"
|
import lunr from "lunr"
|
||||||
|
|
||||||
import { Search, SearchIndexConfig } from "../../_"
|
import { Search, SearchIndexConfig } from "../../_"
|
||||||
import {
|
import {
|
||||||
@@ -91,7 +91,7 @@ async function setupSearchLanguages(
|
|||||||
/* Add scripts for languages */
|
/* Add scripts for languages */
|
||||||
const scripts = []
|
const scripts = []
|
||||||
for (const lang of config.lang) {
|
for (const lang of config.lang) {
|
||||||
if (lang === "ja") scripts.push(`${base}/tinyseg.min.js`)
|
if (lang === "ja") scripts.push(`${base}/tinyseg.js`)
|
||||||
if (lang !== "en") scripts.push(`${base}/min/lunr.${lang}.min.js`)
|
if (lang !== "en") scripts.push(`${base}/min/lunr.${lang}.min.js`)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -148,6 +148,10 @@ export async function handler(
|
|||||||
* Worker
|
* Worker
|
||||||
* ------------------------------------------------------------------------- */
|
* ------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
/* @ts-ignore - expose Lunr.js in global scope, or stemmers will not work */
|
||||||
|
self.lunr = lunr
|
||||||
|
|
||||||
|
/* Handle messages */
|
||||||
addEventListener("message", async ev => {
|
addEventListener("message", async ev => {
|
||||||
postMessage(await handler(ev.data))
|
postMessage(await handler(ev.data))
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
* IN THE SOFTWARE.
|
* IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { h } from "utilities"
|
import { h } from "~/utilities"
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------------
|
/* ----------------------------------------------------------------------------
|
||||||
* Functions
|
* Functions
|
||||||
|
|||||||
23
src/assets/javascripts/workers/search.ts
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2016-2021 Martin Donath <martin.donath@squidfunk.com>
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to
|
||||||
|
* deal in the Software without restriction, including without limitation the
|
||||||
|
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||||
|
* sell copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A RTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||||
|
* IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import "~/integrations/search/worker/main"
|
||||||
@@ -36,7 +36,7 @@ input {
|
|||||||
color: var(--md-typeset-color);
|
color: var(--md-typeset-color);
|
||||||
font-feature-settings: "kern", "liga";
|
font-feature-settings: "kern", "liga";
|
||||||
font-family:
|
font-family:
|
||||||
var(--md-text-font-family,)
|
var(--md-text-font-family, _),
|
||||||
-apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif;
|
-apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,7 +47,7 @@ kbd {
|
|||||||
color: var(--md-typeset-color);
|
color: var(--md-typeset-color);
|
||||||
font-feature-settings: "kern";
|
font-feature-settings: "kern";
|
||||||
font-family:
|
font-family:
|
||||||
var(--md-code-font-family,)
|
var(--md-code-font-family, _),
|
||||||
SFMono-Regular, Consolas, Menlo, monospace;
|
SFMono-Regular, Consolas, Menlo, monospace;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,8 +57,8 @@ kbd {
|
|||||||
|
|
||||||
// Icon definitions
|
// Icon definitions
|
||||||
:root {
|
:root {
|
||||||
--md-typeset-table--ascending: svg-load("@mdi/svg/svg/arrow-down.svg");
|
--md-typeset-table--ascending: svg-load("material/arrow-down.svg");
|
||||||
--md-typeset-table--descending: svg-load("@mdi/svg/svg/arrow-up.svg");
|
--md-typeset-table--descending: svg-load("material/arrow-up.svg");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ $admonitions: (
|
|||||||
:root {
|
:root {
|
||||||
@each $names, $props in $admonitions {
|
@each $names, $props in $admonitions {
|
||||||
--md-admonition-icon--#{nth($names, 1)}:
|
--md-admonition-icon--#{nth($names, 1)}:
|
||||||
svg-load("@mdi/svg/svg/#{nth($props, 1)}.svg");
|
svg-load("material/#{nth($props, 1)}.svg");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
// Icon definitions
|
// Icon definitions
|
||||||
:root {
|
:root {
|
||||||
--md-footnotes-icon: svg-load("@mdi/svg/svg/keyboard-return.svg");
|
--md-footnotes-icon: svg-load("material/keyboard-return.svg");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
// Icon definitions
|
// Icon definitions
|
||||||
:root {
|
:root {
|
||||||
--md-details-icon: svg-load("@mdi/svg/svg/chevron-right.svg");
|
--md-details-icon: svg-load("material/chevron-right.svg");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -27,9 +27,9 @@
|
|||||||
// Icon definitions
|
// Icon definitions
|
||||||
:root {
|
:root {
|
||||||
--md-tasklist-icon:
|
--md-tasklist-icon:
|
||||||
svg-load("@primer/octicons/build/svg/check-circle-fill-24.svg");
|
svg-load("octicons/check-circle-fill-24.svg");
|
||||||
--md-tasklist-icon--checked:
|
--md-tasklist-icon--checked:
|
||||||
svg-load("@primer/octicons/build/svg/check-circle-fill-24.svg");
|
svg-load("octicons/check-circle-fill-24.svg");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
// Icon definitions
|
// Icon definitions
|
||||||
:root {
|
:root {
|
||||||
--md-clipboard-icon: svg-load("@mdi/svg/svg/content-copy.svg");
|
--md-clipboard-icon: svg-load("material/content-copy.svg");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -26,9 +26,9 @@
|
|||||||
|
|
||||||
// Icon definitions
|
// Icon definitions
|
||||||
:root {
|
:root {
|
||||||
--md-nav-icon--prev: svg-load("@mdi/svg/svg/arrow-left.svg");
|
--md-nav-icon--prev: svg-load("material/arrow-left.svg");
|
||||||
--md-nav-icon--next: svg-load("@mdi/svg/svg/chevron-right.svg");
|
--md-nav-icon--next: svg-load("material/chevron-right.svg");
|
||||||
--md-toc-icon: svg-load("@mdi/svg/svg/table-of-contents.svg");
|
--md-toc-icon: svg-load("material/table-of-contents.svg");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
// Icon definitions
|
// Icon definitions
|
||||||
:root {
|
:root {
|
||||||
--md-search-result-icon: svg-load("@mdi/svg/svg/file-search-outline.svg");
|
--md-search-result-icon: svg-load("material/file-search-outline.svg");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -120,8 +120,8 @@
|
|||||||
/>
|
/>
|
||||||
<style>
|
<style>
|
||||||
:root {
|
:root {
|
||||||
--md-text-font-family: "{{ font.text }}",;
|
--md-text-font-family: "{{ font.text }}";
|
||||||
--md-code-font-family: "{{ font.code }}",;
|
--md-code-font-family: "{{ font.code }}";
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -355,7 +355,7 @@
|
|||||||
"base": base_url,
|
"base": base_url,
|
||||||
"features": features,
|
"features": features,
|
||||||
"translations": {},
|
"translations": {},
|
||||||
"search": "assets/javascripts/worker/search.js" | url,
|
"search": "assets/javascripts/workers/search.js" | url,
|
||||||
} -%}
|
} -%}
|
||||||
|
|
||||||
<!-- Translations -->
|
<!-- Translations -->
|
||||||
@@ -386,7 +386,6 @@
|
|||||||
|
|
||||||
<!-- Theme-related JavaScript -->
|
<!-- Theme-related JavaScript -->
|
||||||
{% block scripts %}
|
{% block scripts %}
|
||||||
<script src="{{ 'assets/javascripts/vendor.js' | url }}"></script>
|
|
||||||
<script src="{{ 'assets/javascripts/bundle.js' | url }}"></script>
|
<script src="{{ 'assets/javascripts/bundle.js' | url }}"></script>
|
||||||
|
|
||||||
<!-- Custom JavaScript -->
|
<!-- Custom JavaScript -->
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
* IN THE SOFTWARE.
|
* IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Observable, merge } from "rxjs"
|
import { merge } from "rxjs"
|
||||||
import { switchMap } from "rxjs/operators"
|
import { switchMap } from "rxjs/operators"
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -37,8 +37,7 @@ import { setupAnalytics } from "./integrations"
|
|||||||
setupAnalytics()
|
setupAnalytics()
|
||||||
|
|
||||||
/* Set up extra component observables */
|
/* Set up extra component observables */
|
||||||
declare const document$: Observable<Document>
|
window.document$
|
||||||
document$
|
|
||||||
.pipe(
|
.pipe(
|
||||||
switchMap(() => merge(
|
switchMap(() => merge(
|
||||||
|
|
||||||
@@ -53,7 +53,8 @@ import {
|
|||||||
watchElementThreshold
|
watchElementThreshold
|
||||||
} from "~/browser"
|
} from "~/browser"
|
||||||
|
|
||||||
import { Icon, renderIconSearchResult } from "../../../templates"
|
import { Icon, renderIconSearchResult } from "_/templates"
|
||||||
|
|
||||||
import { Component } from "../../_"
|
import { Component } from "../../_"
|
||||||
import { IconSearchIndex } from "../_"
|
import { IconSearchIndex } from "../_"
|
||||||
import { IconSearchQuery } from "../query"
|
import { IconSearchQuery } from "../query"
|
||||||
|
|||||||
@@ -97,7 +97,6 @@
|
|||||||
{{ super() }}
|
{{ super() }}
|
||||||
|
|
||||||
<!-- Extra JavaScript -->
|
<!-- Extra JavaScript -->
|
||||||
<!-- <script src="{{ 'overrides/assets/javascripts/vendor.js' | url }}"></script> -->
|
|
||||||
<script src="{{ 'overrides/assets/javascripts/bundle.js' | url }}"></script>
|
<script src="{{ 'overrides/assets/javascripts/bundle.js' | url }}"></script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|||||||
121
tools/build/_/index.ts
Normal file
@@ -0,0 +1,121 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2016-2021 Martin Donath <martin.donath@squidfunk.com>
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to
|
||||||
|
* deal in the Software without restriction, including without limitation the
|
||||||
|
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||||
|
* sell copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||||
|
* IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import * as chokidar from "chokidar"
|
||||||
|
import * as fs from "fs/promises"
|
||||||
|
import {
|
||||||
|
Observable,
|
||||||
|
from,
|
||||||
|
fromEvent,
|
||||||
|
identity,
|
||||||
|
EMPTY
|
||||||
|
} from "rxjs"
|
||||||
|
import {
|
||||||
|
catchError,
|
||||||
|
mapTo,
|
||||||
|
mergeWith,
|
||||||
|
switchMap
|
||||||
|
} from "rxjs/operators"
|
||||||
|
import glob from "tiny-glob"
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------------------
|
||||||
|
* Helper types
|
||||||
|
* ------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Resolve options
|
||||||
|
*/
|
||||||
|
interface ResolveOptions {
|
||||||
|
cwd: string /* Working directory */
|
||||||
|
watch?: boolean /* Watch mode */
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Watch options
|
||||||
|
*/
|
||||||
|
interface WatchOptions {
|
||||||
|
cwd: string /* Working directory */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------------------
|
||||||
|
* Data
|
||||||
|
* ------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Base directory for compiled files
|
||||||
|
*/
|
||||||
|
export const base = "material"
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------------------
|
||||||
|
* Functions
|
||||||
|
* ------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Recursively create the given directory
|
||||||
|
*
|
||||||
|
* @param directory - Directory
|
||||||
|
*
|
||||||
|
* @returns Directory observable
|
||||||
|
*/
|
||||||
|
export function mkdir(
|
||||||
|
directory: string
|
||||||
|
): Observable<string> {
|
||||||
|
return from(fs.mkdir(directory, { recursive: true }))
|
||||||
|
.pipe(
|
||||||
|
mapTo(directory)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Resolve a pattern
|
||||||
|
*
|
||||||
|
* @param pattern - Pattern
|
||||||
|
* @param options - Options
|
||||||
|
*
|
||||||
|
* @returns File observable
|
||||||
|
*/
|
||||||
|
export function resolve(
|
||||||
|
pattern: string, options?: ResolveOptions
|
||||||
|
): Observable<string> {
|
||||||
|
return from(glob(pattern, options))
|
||||||
|
.pipe(
|
||||||
|
catchError(() => EMPTY),
|
||||||
|
switchMap(files => from(files)),
|
||||||
|
options?.watch
|
||||||
|
? mergeWith(watch(pattern, options))
|
||||||
|
: identity
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Watch all files matching the given pattern
|
||||||
|
*
|
||||||
|
* @param pattern - Pattern
|
||||||
|
* @param options - Options
|
||||||
|
*
|
||||||
|
* @returns File observable
|
||||||
|
*/
|
||||||
|
export function watch(
|
||||||
|
pattern: string, options: WatchOptions
|
||||||
|
): Observable<string> {
|
||||||
|
return fromEvent(chokidar.watch(pattern, options), "change")
|
||||||
|
}
|
||||||
106
tools/build/copy/index.ts
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2016-2021 Martin Donath <martin.donath@squidfunk.com>
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to
|
||||||
|
* deal in the Software without restriction, including without limitation the
|
||||||
|
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||||
|
* sell copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||||
|
* IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import * as fs from "fs/promises"
|
||||||
|
import * as path from "path"
|
||||||
|
import { Observable, from } from "rxjs"
|
||||||
|
import { mapTo, mergeMap, switchMap } from "rxjs/operators"
|
||||||
|
|
||||||
|
import { mkdir, resolve } from "../_"
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------------------
|
||||||
|
* Helper types
|
||||||
|
* ------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Copy transform function
|
||||||
|
*
|
||||||
|
* @param data - File data
|
||||||
|
* @param name - File name
|
||||||
|
*
|
||||||
|
* @returns Transformed file data
|
||||||
|
*/
|
||||||
|
type CopyTransformFn = (data: string, name: string) => Promise<string>
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Copy options
|
||||||
|
*/
|
||||||
|
interface CopyOptions {
|
||||||
|
from: string /* Source destination */
|
||||||
|
to: string /* Target destination */
|
||||||
|
transform?: CopyTransformFn /* Transform function */
|
||||||
|
watch?: boolean /* Watch mode */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------------------
|
||||||
|
* Functions
|
||||||
|
* ------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Copy a file
|
||||||
|
*
|
||||||
|
* @param options - Options
|
||||||
|
*
|
||||||
|
* @returns File observable
|
||||||
|
*/
|
||||||
|
export function copy(
|
||||||
|
{ transform, ...options }: CopyOptions
|
||||||
|
): Observable<string> {
|
||||||
|
return mkdir(path.dirname(options.to))
|
||||||
|
.pipe(
|
||||||
|
switchMap(() => typeof transform === "undefined"
|
||||||
|
? from(fs.copyFile(options.from, options.to))
|
||||||
|
: from(fs.readFile(options.from, "utf8"))
|
||||||
|
.pipe(
|
||||||
|
switchMap(data => transform(data, options.from)),
|
||||||
|
switchMap(data => fs.writeFile(options.to, data))
|
||||||
|
)
|
||||||
|
),
|
||||||
|
mapTo(options.to)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Copy all files matching the given pattern
|
||||||
|
*
|
||||||
|
* Note that this function will rebase all files that match the pattern to the
|
||||||
|
* target folder, even if the pattern resolves to a parent folder.
|
||||||
|
*
|
||||||
|
* @param pattern - Pattern
|
||||||
|
* @param options - Options
|
||||||
|
*
|
||||||
|
* @returns File observable
|
||||||
|
*/
|
||||||
|
export function copyAll(
|
||||||
|
pattern: string, options: CopyOptions
|
||||||
|
): Observable<string> {
|
||||||
|
return resolve(pattern, { ...options, cwd: options.from })
|
||||||
|
.pipe(
|
||||||
|
mergeMap(file => copy({
|
||||||
|
...options,
|
||||||
|
from: `${options.from}/${file}`,
|
||||||
|
to: `${options.to}/${file.replace(/(\.{2}\/)+/, "")}`
|
||||||
|
}), 16)
|
||||||
|
)
|
||||||
|
}
|
||||||
286
tools/build/index.ts
Normal file
@@ -0,0 +1,286 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2016-2021 Martin Donath <martin.donath@squidfunk.com>
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to
|
||||||
|
* deal in the Software without restriction, including without limitation the
|
||||||
|
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||||
|
* sell copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||||
|
* IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import * as fs from "fs/promises"
|
||||||
|
import { minify as minhtml } from "html-minifier"
|
||||||
|
import * as path from "path"
|
||||||
|
import { concat, defer, merge, of, zip } from "rxjs"
|
||||||
|
import {
|
||||||
|
concatMap,
|
||||||
|
map,
|
||||||
|
reduce,
|
||||||
|
switchMap
|
||||||
|
} from "rxjs/operators"
|
||||||
|
import {
|
||||||
|
extendDefaultPlugins,
|
||||||
|
optimize
|
||||||
|
} from "svgo"
|
||||||
|
|
||||||
|
import { IconSearchIndex } from "_/components"
|
||||||
|
|
||||||
|
import { base, resolve } from "./_"
|
||||||
|
import { copyAll } from "./copy"
|
||||||
|
import {
|
||||||
|
transformScript,
|
||||||
|
transformStyle
|
||||||
|
} from "./transform"
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------------------
|
||||||
|
* Helper types
|
||||||
|
* ------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Twemoji icon
|
||||||
|
*/
|
||||||
|
interface TwemojiIcon {
|
||||||
|
unicode: string /* Unicode code point */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------------------
|
||||||
|
* Helper functions
|
||||||
|
* ------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Replace file extension
|
||||||
|
*
|
||||||
|
* @param file - File
|
||||||
|
* @param extension - New extension
|
||||||
|
*
|
||||||
|
* @returns File with new extension
|
||||||
|
*/
|
||||||
|
function ext(file: string, extension: string): string {
|
||||||
|
return file.replace(path.extname(file), extension)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Optimize SVG data
|
||||||
|
*
|
||||||
|
* This function will just pass-through non-SVG data, which makes the pipeline
|
||||||
|
* much simpler, as we can reuse it for the license texts.
|
||||||
|
*
|
||||||
|
* @param data - SVG data
|
||||||
|
*
|
||||||
|
* @returns Minified SVG data
|
||||||
|
*/
|
||||||
|
function minsvg(data: string): string {
|
||||||
|
const result = optimize(data, {
|
||||||
|
plugins: extendDefaultPlugins([
|
||||||
|
{ name: "removeDimensions", active: true },
|
||||||
|
{ name: "removeViewBox", active: false }
|
||||||
|
])
|
||||||
|
})
|
||||||
|
return result.data || data
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------------------
|
||||||
|
* Program
|
||||||
|
* ------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
/* Copy all assets */
|
||||||
|
const assets$ = concat(
|
||||||
|
|
||||||
|
/* Copy Material Design icons */
|
||||||
|
...["*.svg", "../LICENSE"]
|
||||||
|
.map(pattern => copyAll(pattern, {
|
||||||
|
from: "node_modules/@mdi/svg/svg",
|
||||||
|
to: `${base}/.icons/material`,
|
||||||
|
...process.argv.includes("--optimize") && {
|
||||||
|
transform: async data => minsvg(data)
|
||||||
|
}
|
||||||
|
})),
|
||||||
|
|
||||||
|
/* Copy GitHub octicons */
|
||||||
|
...["*.svg", "../../LICENSE"]
|
||||||
|
.map(pattern => copyAll(pattern, {
|
||||||
|
from: "node_modules/@primer/octicons/build/svg",
|
||||||
|
to: `${base}/.icons/octicons`,
|
||||||
|
...process.argv.includes("--optimize") && {
|
||||||
|
transform: async data => minsvg(data)
|
||||||
|
}
|
||||||
|
})),
|
||||||
|
|
||||||
|
/* Copy FontAwesome icons */
|
||||||
|
...["**/*.svg", "../LICENSE.txt"]
|
||||||
|
.map(pattern => copyAll(pattern, {
|
||||||
|
from: "node_modules/@fortawesome/fontawesome-free/svgs",
|
||||||
|
to: `${base}/.icons/fontawesome`,
|
||||||
|
...process.argv.includes("--optimize") && {
|
||||||
|
transform: async data => minsvg(data)
|
||||||
|
}
|
||||||
|
})),
|
||||||
|
|
||||||
|
/* Copy Lunr.js search stemmers and segmenter */
|
||||||
|
...["min/*.js", "tinyseg.js"]
|
||||||
|
.map(pattern => copyAll(pattern, {
|
||||||
|
from: "node_modules/lunr-languages",
|
||||||
|
to: `${base}/assets/javascripts/lunr`
|
||||||
|
})),
|
||||||
|
|
||||||
|
/* Copy images and configurations */
|
||||||
|
...[".icons/*.svg", "assets/images/*", "**/*.{py,yml}"]
|
||||||
|
.map(pattern => copyAll(pattern, {
|
||||||
|
from: "src",
|
||||||
|
to: base
|
||||||
|
}))
|
||||||
|
)
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
/* Transform styles */
|
||||||
|
const stylesheets$ = resolve("**/[!_]*.scss", { cwd: "src" })
|
||||||
|
.pipe(
|
||||||
|
concatMap(file => zip(
|
||||||
|
of(ext(file, ".css")),
|
||||||
|
transformStyle({
|
||||||
|
from: `src/${file}`,
|
||||||
|
to: ext(`${base}/${file}`, ".css")
|
||||||
|
}))
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
/* Transform scripts */
|
||||||
|
const javascripts$ = resolve("**/{bundle,search}.ts", { cwd: "src" })
|
||||||
|
.pipe(
|
||||||
|
concatMap(file => zip(
|
||||||
|
of(ext(file, ".js")),
|
||||||
|
transformScript({
|
||||||
|
from: `src/${file}`,
|
||||||
|
to: ext(`${base}/${file}`, ".js")
|
||||||
|
}))
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
/* Compute manifest */
|
||||||
|
const manifest$ = merge(
|
||||||
|
stylesheets$,
|
||||||
|
javascripts$
|
||||||
|
)
|
||||||
|
.pipe(
|
||||||
|
reduce((manifest, [key, value]) => manifest.set(
|
||||||
|
key,
|
||||||
|
value.replace(`${base}/`, "")
|
||||||
|
), new Map<string, string>())
|
||||||
|
)
|
||||||
|
|
||||||
|
/* Transform templates */
|
||||||
|
const templates$ = manifest$
|
||||||
|
.pipe(
|
||||||
|
switchMap(manifest => copyAll("**/*.html", {
|
||||||
|
from: "src",
|
||||||
|
to: base,
|
||||||
|
watch: process.argv.includes("--watch"),
|
||||||
|
transform: async data => {
|
||||||
|
const metadata = require("../../package.json")
|
||||||
|
const banner =
|
||||||
|
"{#-\n" +
|
||||||
|
" This file was automatically generated - do not edit\n" +
|
||||||
|
"-#}\n"
|
||||||
|
|
||||||
|
/* If necessary, apply manifest */
|
||||||
|
if (process.argv.includes("--optimize"))
|
||||||
|
for (const [key, value] of manifest)
|
||||||
|
data = data.replace(
|
||||||
|
new RegExp(`('|")${key}\\1`, "g"),
|
||||||
|
`$1${value}$1`
|
||||||
|
)
|
||||||
|
|
||||||
|
/* Normalize line feeds and minify HTML */
|
||||||
|
const html = data.replace(/\r\n/gm, "\n")
|
||||||
|
return banner + minhtml(html, {
|
||||||
|
collapseBooleanAttributes: true,
|
||||||
|
includeAutoGeneratedTags: false,
|
||||||
|
minifyCSS: true,
|
||||||
|
minifyJS: true,
|
||||||
|
removeComments: true,
|
||||||
|
removeScriptTypeAttributes: true,
|
||||||
|
removeStyleLinkTypeAttributes: true
|
||||||
|
})
|
||||||
|
|
||||||
|
/* Remove empty lines without collapsing everything */
|
||||||
|
.replace(/^\s*[\r\n]/gm, "")
|
||||||
|
|
||||||
|
/* Write theme version into template */
|
||||||
|
.replace("$md-name$", metadata.name)
|
||||||
|
.replace("$md-version$", metadata.version)
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
)
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
/* Compute icon mappings */
|
||||||
|
const icons$ = defer(() => resolve("**/*.svg", { cwd: "material/.icons" }))
|
||||||
|
.pipe(
|
||||||
|
reduce((index, file) => index.set(
|
||||||
|
file,
|
||||||
|
file.replace(/\.svg$/, "").replace(/\//g, "-")
|
||||||
|
), new Map<string, string>())
|
||||||
|
)
|
||||||
|
|
||||||
|
/* Compute emoji mappings (based on Twemoji) */
|
||||||
|
const emojis$ = defer(() => resolve("venv/**/twemoji_db.py"))
|
||||||
|
.pipe(
|
||||||
|
switchMap(file => fs.readFile(file, "utf8")),
|
||||||
|
map(data => {
|
||||||
|
const [, payload] = data.match(/^emoji = ({.*})$.alias/ms)!
|
||||||
|
return Object.entries<TwemojiIcon>(JSON.parse(payload))
|
||||||
|
.reduce((index, [name, { unicode }]) => index.set(
|
||||||
|
name.replace(/(^:|:$)/g, ""),
|
||||||
|
`${unicode}.svg`
|
||||||
|
), new Map<string, string>())
|
||||||
|
})
|
||||||
|
)
|
||||||
|
|
||||||
|
/* Build search index for icons and emojis */
|
||||||
|
const index$ = zip(icons$, emojis$)
|
||||||
|
.pipe(
|
||||||
|
map(([icons, emojis]) => {
|
||||||
|
const cdn = "https://raw.githubusercontent.com"
|
||||||
|
return {
|
||||||
|
icons: {
|
||||||
|
base: `${cdn}/squidfunk/mkdocs-material/master/material/.icons/`,
|
||||||
|
data: Object.fromEntries(icons)
|
||||||
|
},
|
||||||
|
emojis: {
|
||||||
|
base: `${cdn}/twitter/twemoji/master/assets/svg/`,
|
||||||
|
data: Object.fromEntries(emojis)
|
||||||
|
}
|
||||||
|
} as IconSearchIndex
|
||||||
|
}),
|
||||||
|
switchMap(data => fs.writeFile(
|
||||||
|
`${base}/overrides/assets/javascripts/icon_search_index.json`,
|
||||||
|
JSON.stringify(data)
|
||||||
|
))
|
||||||
|
)
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
/* Put everything together */
|
||||||
|
concat(
|
||||||
|
assets$,
|
||||||
|
merge(
|
||||||
|
templates$,
|
||||||
|
index$
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.subscribe()
|
||||||
|
// .subscribe(console.log)
|
||||||
196
tools/build/transform/index.ts
Normal file
@@ -0,0 +1,196 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2016-2021 Martin Donath <martin.donath@squidfunk.com>
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to
|
||||||
|
* deal in the Software without restriction, including without limitation the
|
||||||
|
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||||
|
* sell copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||||
|
* IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { createHash } from "crypto"
|
||||||
|
import { build as esbuild } from "esbuild"
|
||||||
|
import * as fs from "fs/promises"
|
||||||
|
import * as path from "path"
|
||||||
|
import postcss from "postcss"
|
||||||
|
import {
|
||||||
|
Observable,
|
||||||
|
concat,
|
||||||
|
defer,
|
||||||
|
merge,
|
||||||
|
of
|
||||||
|
} from "rxjs"
|
||||||
|
import {
|
||||||
|
endWith,
|
||||||
|
ignoreElements,
|
||||||
|
switchMap
|
||||||
|
} from "rxjs/operators"
|
||||||
|
import { render as sass } from "sass"
|
||||||
|
import { promisify } from "util"
|
||||||
|
|
||||||
|
import { base, mkdir } from "../_"
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------------------
|
||||||
|
* Helper types
|
||||||
|
* ------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Transform options
|
||||||
|
*/
|
||||||
|
interface TransformOptions {
|
||||||
|
from: string /* Source destination */
|
||||||
|
to: string /* Target destination */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------------------
|
||||||
|
* Data
|
||||||
|
* ------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Base directory for source map resolution
|
||||||
|
*/
|
||||||
|
const root = new RegExp(`file://${path.resolve(".")}/`, "g")
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------------------
|
||||||
|
* Helper functions
|
||||||
|
* ------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Compute a digest for cachebusting a file
|
||||||
|
*
|
||||||
|
* @param file - File
|
||||||
|
* @param data - File data
|
||||||
|
*
|
||||||
|
* @returns File with digest
|
||||||
|
*/
|
||||||
|
function digest(file: string, data: string): string {
|
||||||
|
const hash = createHash("sha256").update(data).digest("hex")
|
||||||
|
return process.argv.includes("--optimize")
|
||||||
|
? file.replace(/\b(?=\.)/, `.${hash.slice(0, 8)}.min`)
|
||||||
|
: file
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------------------
|
||||||
|
* Functions
|
||||||
|
* ------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Transform a stylesheet
|
||||||
|
*
|
||||||
|
* @param options - Options
|
||||||
|
*
|
||||||
|
* @returns File observable
|
||||||
|
*/
|
||||||
|
export function transformStyle(
|
||||||
|
options: TransformOptions
|
||||||
|
): Observable<string> {
|
||||||
|
return defer(() => promisify(sass)({
|
||||||
|
file: options.from,
|
||||||
|
outFile: options.to,
|
||||||
|
includePaths: [
|
||||||
|
"src/assets/stylesheets",
|
||||||
|
"node_modules/modularscale-sass/stylesheets",
|
||||||
|
"node_modules/material-design-color",
|
||||||
|
"node_modules/material-shadows"
|
||||||
|
],
|
||||||
|
sourceMap: true,
|
||||||
|
sourceMapContents: true
|
||||||
|
}))
|
||||||
|
.pipe(
|
||||||
|
switchMap(({ css, map }) => postcss([
|
||||||
|
require("autoprefixer"),
|
||||||
|
require("postcss-inline-svg")({
|
||||||
|
paths: [
|
||||||
|
`${base}/.icons`
|
||||||
|
],
|
||||||
|
encode: false
|
||||||
|
}),
|
||||||
|
...process.argv.includes("--optimize")
|
||||||
|
? [require("cssnano")]
|
||||||
|
: []
|
||||||
|
])
|
||||||
|
.process(css, {
|
||||||
|
from: options.from,
|
||||||
|
map: {
|
||||||
|
prev: `${map}`,
|
||||||
|
inline: false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
),
|
||||||
|
switchMap(({ css, map }) => {
|
||||||
|
const file = digest(options.to, css)
|
||||||
|
return concat(
|
||||||
|
mkdir(path.dirname(file)),
|
||||||
|
defer(() => merge(
|
||||||
|
fs.writeFile(`${file}.map`, `${map}`.replace(root, "")),
|
||||||
|
fs.writeFile(`${file}`, css.replace(
|
||||||
|
options.from,
|
||||||
|
path.basename(file)
|
||||||
|
)),
|
||||||
|
))
|
||||||
|
)
|
||||||
|
.pipe(
|
||||||
|
ignoreElements(),
|
||||||
|
endWith(file)
|
||||||
|
)
|
||||||
|
})
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Transform a script
|
||||||
|
*
|
||||||
|
* @param options - Options
|
||||||
|
*
|
||||||
|
* @returns File observable
|
||||||
|
*/
|
||||||
|
export function transformScript(
|
||||||
|
options: TransformOptions
|
||||||
|
): Observable<string> {
|
||||||
|
return defer(() => esbuild({
|
||||||
|
entryPoints: [options.from],
|
||||||
|
write: false,
|
||||||
|
bundle: true,
|
||||||
|
sourcemap: true,
|
||||||
|
minify: process.argv.includes("--optimize")
|
||||||
|
}))
|
||||||
|
.pipe(
|
||||||
|
switchMap(({ outputFiles: [file] }) => {
|
||||||
|
const contents = file.text.split("\n")
|
||||||
|
const [, data] = contents[contents.length - 2].split(",")
|
||||||
|
return of({
|
||||||
|
js: file.text,
|
||||||
|
map: Buffer.from(data, "base64")
|
||||||
|
})
|
||||||
|
}),
|
||||||
|
switchMap(({ js, map }) => {
|
||||||
|
const file = digest(options.to, js)
|
||||||
|
return concat(
|
||||||
|
mkdir(path.dirname(file)),
|
||||||
|
defer(() => merge(
|
||||||
|
fs.writeFile(`${file}.map`, map),
|
||||||
|
fs.writeFile(`${file}`, js.replace(
|
||||||
|
/(sourceMappingURL=)(.*)/,
|
||||||
|
`$1${path.basename(file)}\n`
|
||||||
|
)),
|
||||||
|
))
|
||||||
|
)
|
||||||
|
.pipe(
|
||||||
|
ignoreElements(),
|
||||||
|
endWith(file)
|
||||||
|
)
|
||||||
|
})
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"alwaysStrict": true,
|
"alwaysStrict": true,
|
||||||
"baseUrl": "src/assets/javascripts",
|
"baseUrl": "src",
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"jsx": "react",
|
"jsx": "react",
|
||||||
"jsxFactory": "h",
|
"jsxFactory": "h",
|
||||||
@@ -20,7 +20,8 @@
|
|||||||
"noUnusedLocals": true,
|
"noUnusedLocals": true,
|
||||||
"noUnusedParameters": true,
|
"noUnusedParameters": true,
|
||||||
"paths": {
|
"paths": {
|
||||||
"~/*": ["./*"]
|
"~/*": ["./assets/javascripts/*"],
|
||||||
|
"_/*": ["./overrides/assets/javascripts/*"]
|
||||||
},
|
},
|
||||||
"removeComments": false,
|
"removeComments": false,
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
@@ -32,6 +33,7 @@
|
|||||||
"target": "es2015"
|
"target": "es2015"
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
|
"tools",
|
||||||
"src/assets/javascripts",
|
"src/assets/javascripts",
|
||||||
"src/overrides/assets/javascripts",
|
"src/overrides/assets/javascripts",
|
||||||
"typings",
|
"typings",
|
||||||
|
|||||||
33
typings/_/index.d.ts
vendored
@@ -20,10 +20,17 @@
|
|||||||
* IN THE SOFTWARE.
|
* IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { SearchIndex, SearchTransformFn } from "~/integrations";
|
import { Observable, Subject } from "rxjs"
|
||||||
|
|
||||||
|
import { Keyboard, Viewport } from "~/browser"
|
||||||
|
import { Component } from "~/components"
|
||||||
|
import {
|
||||||
|
SearchIndex,
|
||||||
|
SearchTransformFn
|
||||||
|
} from "~/integrations"
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------------
|
/* ----------------------------------------------------------------------------
|
||||||
* Types
|
* Global types
|
||||||
* ------------------------------------------------------------------------- */
|
* ------------------------------------------------------------------------- */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -39,12 +46,30 @@ export interface GlobalSearchConfig {
|
|||||||
declare global {
|
declare global {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GLobal search configuration
|
* Global search configuration
|
||||||
*/
|
*/
|
||||||
var __search: GlobalSearchConfig | undefined
|
const __search: GlobalSearchConfig | undefined
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Google Analytics
|
* Google Analytics
|
||||||
*/
|
*/
|
||||||
function ga(...args: string[]): void
|
function ga(...args: string[]): void
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------------------
|
||||||
|
* Types
|
||||||
|
* ------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface Window {
|
||||||
|
document$: Observable<Document> /* Document observable */
|
||||||
|
location$: Subject<URL> /* Location subject */
|
||||||
|
target$: Observable<HTMLElement> /* Location target observable */
|
||||||
|
keyboard$: Observable<Keyboard> /* Keyboard observable */
|
||||||
|
viewport$: Observable<Viewport> /* Viewport obsevable */
|
||||||
|
tablet$: Observable<boolean> /* Tablet breakpoint observable */
|
||||||
|
screen$: Observable<boolean> /* Screen breakpoint observable */
|
||||||
|
print$: Observable<void> /* Print mode observable */
|
||||||
|
component$: Observable<Component> /* Component observable */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
6
typings/lunr/index.d.ts
vendored
@@ -22,6 +22,10 @@
|
|||||||
|
|
||||||
import lunr from "lunr"
|
import lunr from "lunr"
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------------------
|
||||||
|
* Global types
|
||||||
|
* ------------------------------------------------------------------------- */
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
const lunr: typeof lunr
|
const lunr: typeof lunr /* Global Lunr.js namespace */
|
||||||
}
|
}
|
||||||
|
|||||||
68
typings/svgo/index.d.ts
vendored
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2016-2021 Martin Donath <martin.donath@squidfunk.com>
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to
|
||||||
|
* deal in the Software without restriction, including without limitation the
|
||||||
|
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||||
|
* sell copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in
|
||||||
|
* all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||||
|
* IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------------------
|
||||||
|
* Types
|
||||||
|
* ------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
declare module "svgo" {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Plugin
|
||||||
|
*/
|
||||||
|
interface Plugin {
|
||||||
|
name: string
|
||||||
|
active: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Optimization configuration
|
||||||
|
*/
|
||||||
|
interface OptimizeConfig {
|
||||||
|
plugins: Plugin[]
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Optimization result
|
||||||
|
*/
|
||||||
|
interface OptimizeResult {
|
||||||
|
data: string
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Optimize SVG
|
||||||
|
*
|
||||||
|
* @param data - SVG data
|
||||||
|
*
|
||||||
|
* @returns Optimization result
|
||||||
|
*/
|
||||||
|
function optimize(data: string, config: OptimizeConfig): OptimizeResult
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extend the list of default plugins
|
||||||
|
*
|
||||||
|
* @param plugins - Plugins
|
||||||
|
*
|
||||||
|
* @returns Plugins
|
||||||
|
*/
|
||||||
|
function extendDefaultPlugins(plugins: Plugin[]): Plugin[]
|
||||||
|
}
|
||||||
@@ -1,466 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2016-2021 Martin Donath <martin.donath@squidfunk.com>
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to
|
|
||||||
* deal in the Software without restriction, including without limitation the
|
|
||||||
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
||||||
* sell copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in
|
|
||||||
* all copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
||||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
||||||
* IN THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import CopyPlugin from "copy-webpack-plugin"
|
|
||||||
import EventHooksPlugin from "event-hooks-webpack-plugin"
|
|
||||||
import * as fs from "fs"
|
|
||||||
import { minify as minhtml } from "html-minifier"
|
|
||||||
import IgnoreEmitPlugin from "ignore-emit-webpack-plugin"
|
|
||||||
import ImageminPlugin from "imagemin-webpack-plugin"
|
|
||||||
import MiniCssExtractPlugin = require("mini-css-extract-plugin")
|
|
||||||
import * as path from "path"
|
|
||||||
import { toPairs } from "ramda"
|
|
||||||
import glob from "tiny-glob"
|
|
||||||
import { minify as minjs } from "terser"
|
|
||||||
import { TsconfigPathsPlugin } from "tsconfig-paths-webpack-plugin"
|
|
||||||
import { Configuration } from "webpack"
|
|
||||||
import AssetsManifestPlugin from "webpack-assets-manifest"
|
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------------
|
|
||||||
* Helper functions
|
|
||||||
* ------------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Webpack base configuration
|
|
||||||
*
|
|
||||||
* @param args - Command-line arguments
|
|
||||||
*
|
|
||||||
* @returns Webpack configuration
|
|
||||||
*/
|
|
||||||
function config(args: Configuration): Configuration {
|
|
||||||
const assets = {}
|
|
||||||
return {
|
|
||||||
mode: args.mode,
|
|
||||||
|
|
||||||
/* Loaders */
|
|
||||||
module: {
|
|
||||||
rules: [
|
|
||||||
|
|
||||||
/* TypeScript */
|
|
||||||
{
|
|
||||||
test: /\.tsx?$/,
|
|
||||||
use: [
|
|
||||||
{
|
|
||||||
loader: "ts-loader",
|
|
||||||
options: {
|
|
||||||
experimentalWatchApi: true,
|
|
||||||
transpileOnly: true,
|
|
||||||
compilerOptions: {
|
|
||||||
importHelpers: true,
|
|
||||||
module: "esnext",
|
|
||||||
target: "es2015"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
exclude: /\/node_modules\//
|
|
||||||
},
|
|
||||||
|
|
||||||
/* SASS stylesheets */
|
|
||||||
{
|
|
||||||
test: /\.scss$/,
|
|
||||||
use: [
|
|
||||||
MiniCssExtractPlugin.loader,
|
|
||||||
{
|
|
||||||
loader: "css-loader",
|
|
||||||
options: {
|
|
||||||
url: false,
|
|
||||||
sourceMap: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
loader: "postcss-loader",
|
|
||||||
options: {
|
|
||||||
postcssOptions: {
|
|
||||||
plugins: [
|
|
||||||
["autoprefixer"],
|
|
||||||
["postcss-inline-svg", {
|
|
||||||
paths: [
|
|
||||||
path.resolve(__dirname, "node_modules")
|
|
||||||
],
|
|
||||||
encode: false
|
|
||||||
}],
|
|
||||||
["postcss-svgo", {
|
|
||||||
plugins: [
|
|
||||||
{ removeDimensions: true },
|
|
||||||
{ removeViewBox: false }
|
|
||||||
],
|
|
||||||
encode: false
|
|
||||||
}]
|
|
||||||
]
|
|
||||||
},
|
|
||||||
sourceMap: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
loader: "sass-loader",
|
|
||||||
options: {
|
|
||||||
implementation: require("sass"),
|
|
||||||
sassOptions: {
|
|
||||||
includePaths: [
|
|
||||||
"src/assets/stylesheets",
|
|
||||||
"node_modules/modularscale-sass/stylesheets",
|
|
||||||
"node_modules/material-design-color",
|
|
||||||
"node_modules/material-shadows"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
sourceMap: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
|
|
||||||
/* Search */
|
|
||||||
{
|
|
||||||
test: require.resolve("lunr"),
|
|
||||||
loader: "expose-loader",
|
|
||||||
options: {
|
|
||||||
exposes: ["lunr"]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
|
|
||||||
/* Module resolver */
|
|
||||||
resolve: {
|
|
||||||
mainFields: ["es2015", "module", "main"],
|
|
||||||
modules: [
|
|
||||||
__dirname,
|
|
||||||
path.resolve(__dirname, "node_modules")
|
|
||||||
],
|
|
||||||
extensions: [".scss", ".ts", ".tsx", ".js", ".json"],
|
|
||||||
plugins: [
|
|
||||||
new TsconfigPathsPlugin()
|
|
||||||
]
|
|
||||||
},
|
|
||||||
|
|
||||||
/* Plugins */
|
|
||||||
plugins: [
|
|
||||||
new IgnoreEmitPlugin(/\/stylesheets\/.*?\.js/),
|
|
||||||
new AssetsManifestPlugin({
|
|
||||||
output: "assets/manifest.json",
|
|
||||||
assets
|
|
||||||
})
|
|
||||||
],
|
|
||||||
|
|
||||||
/* Source maps */
|
|
||||||
devtool: args.mode === "production" ? "source-map" : "eval",
|
|
||||||
|
|
||||||
/* Filter false positives and omit verbosity */
|
|
||||||
stats: {
|
|
||||||
entrypoints: false,
|
|
||||||
excludeAssets: [
|
|
||||||
/\.(icons)/,
|
|
||||||
/\/(images|lunr)\//,
|
|
||||||
/\.(html|py|yml)$/
|
|
||||||
],
|
|
||||||
warningsFilter: [
|
|
||||||
/export '.[^']+' was not found in/
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------------
|
|
||||||
* Configuration
|
|
||||||
* ------------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Webpack configuration
|
|
||||||
*
|
|
||||||
* @param env - Webpack environment arguments
|
|
||||||
* @param args - Command-line arguments
|
|
||||||
*
|
|
||||||
* @returns Webpack configurations
|
|
||||||
*/
|
|
||||||
export default (_env: never, args: Configuration): Configuration[] => {
|
|
||||||
const hash = args.mode === "production" ? ".[chunkhash].min" : ""
|
|
||||||
const base = config(args)
|
|
||||||
return [
|
|
||||||
|
|
||||||
/* Application */
|
|
||||||
{
|
|
||||||
...base,
|
|
||||||
entry: {
|
|
||||||
"assets/javascripts/bundle": "src/assets/javascripts",
|
|
||||||
"assets/stylesheets/main": "src/assets/stylesheets/main.scss",
|
|
||||||
"assets/stylesheets/palette": "src/assets/stylesheets/palette.scss"
|
|
||||||
},
|
|
||||||
output: {
|
|
||||||
path: path.resolve(__dirname, "material"),
|
|
||||||
filename: `[name]${hash}.js`,
|
|
||||||
hashDigestLength: 8,
|
|
||||||
libraryTarget: "window"
|
|
||||||
},
|
|
||||||
|
|
||||||
/* Plugins */
|
|
||||||
plugins: [
|
|
||||||
...base.plugins || [],
|
|
||||||
|
|
||||||
/* Stylesheets */
|
|
||||||
new MiniCssExtractPlugin({
|
|
||||||
filename: `[name]${hash}.css`
|
|
||||||
}),
|
|
||||||
|
|
||||||
/* Improve performance by skipping dependencies in watch mode */
|
|
||||||
...args.watch ? [] : [
|
|
||||||
|
|
||||||
/* FontAwesome icons */
|
|
||||||
new CopyPlugin({
|
|
||||||
patterns: [
|
|
||||||
{ to: ".icons/fontawesome", from: "**/*.svg" },
|
|
||||||
{ to: ".icons/fontawesome", from: "../LICENSE.txt" }
|
|
||||||
].map(pattern => ({
|
|
||||||
context: "node_modules/@fortawesome/fontawesome-free/svgs",
|
|
||||||
...pattern
|
|
||||||
}))
|
|
||||||
}),
|
|
||||||
|
|
||||||
/* Material Design icons */
|
|
||||||
new CopyPlugin({
|
|
||||||
patterns: [
|
|
||||||
{ to: ".icons/material", from: "*.svg" },
|
|
||||||
{ to: ".icons/material", from: "../LICENSE" }
|
|
||||||
].map(pattern => ({
|
|
||||||
context: "node_modules/@mdi/svg/svg",
|
|
||||||
...pattern
|
|
||||||
}))
|
|
||||||
}),
|
|
||||||
|
|
||||||
/* GitHub octicons */
|
|
||||||
new CopyPlugin({
|
|
||||||
patterns: [
|
|
||||||
{ to: ".icons/octicons", from: "*.svg" },
|
|
||||||
{ to: ".icons/octicons", from: "../../LICENSE" }
|
|
||||||
].map(pattern => ({
|
|
||||||
context: "node_modules/@primer/octicons/build/svg",
|
|
||||||
...pattern
|
|
||||||
}))
|
|
||||||
}),
|
|
||||||
|
|
||||||
/* Search stemmers and segmenters */
|
|
||||||
new CopyPlugin({
|
|
||||||
patterns: [
|
|
||||||
{ to: "assets/javascripts/lunr", from: "min/*.js" },
|
|
||||||
{
|
|
||||||
to: "assets/javascripts/lunr/tinyseg.min.js",
|
|
||||||
from: "tinyseg.js",
|
|
||||||
transform: (content: Buffer) => minjs(`${content}`).code!
|
|
||||||
}
|
|
||||||
].map(pattern => ({
|
|
||||||
context: "node_modules/lunr-languages",
|
|
||||||
...pattern
|
|
||||||
}))
|
|
||||||
}),
|
|
||||||
|
|
||||||
/* Assets and configuration */
|
|
||||||
new CopyPlugin({
|
|
||||||
patterns: [
|
|
||||||
{ from: ".icons/*.svg" },
|
|
||||||
{ from: "assets/images/*" },
|
|
||||||
{ from: "**/*.{py,yml}" }
|
|
||||||
].map(pattern => ({
|
|
||||||
context: "src",
|
|
||||||
...pattern
|
|
||||||
}))
|
|
||||||
})
|
|
||||||
],
|
|
||||||
|
|
||||||
/* Template files */
|
|
||||||
new CopyPlugin({
|
|
||||||
patterns: [
|
|
||||||
{
|
|
||||||
from: "**/*.html",
|
|
||||||
transform: (content: Buffer) => {
|
|
||||||
const metadata = require("./package.json")
|
|
||||||
const banner =
|
|
||||||
"{#-\n" +
|
|
||||||
" This file was automatically generated - do not edit\n" +
|
|
||||||
"-#}\n"
|
|
||||||
|
|
||||||
/* Normalize line feeds and minify HTML */
|
|
||||||
const html = content.toString().replace(/\r\n/gm, "\n")
|
|
||||||
return banner + minhtml(html, {
|
|
||||||
collapseBooleanAttributes: true,
|
|
||||||
includeAutoGeneratedTags: false,
|
|
||||||
minifyCSS: true,
|
|
||||||
minifyJS: true,
|
|
||||||
removeComments: true,
|
|
||||||
removeScriptTypeAttributes: true,
|
|
||||||
removeStyleLinkTypeAttributes: true
|
|
||||||
})
|
|
||||||
|
|
||||||
/* Remove empty lines without collapsing everything */
|
|
||||||
.replace(/^\s*[\r\n]/gm, "")
|
|
||||||
|
|
||||||
/* Write theme version into template */
|
|
||||||
.replace("$md-name$", metadata.name)
|
|
||||||
.replace("$md-version$", metadata.version)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
].map(pattern => ({
|
|
||||||
context: "src",
|
|
||||||
...pattern
|
|
||||||
}))
|
|
||||||
}),
|
|
||||||
|
|
||||||
/* Hooks */
|
|
||||||
new EventHooksPlugin({
|
|
||||||
afterEmit: async () => {
|
|
||||||
|
|
||||||
/* Replace asset URLs in templates */
|
|
||||||
if (args.mode === "production") {
|
|
||||||
const manifest = require("./material/assets/manifest.json")
|
|
||||||
for (const file of [
|
|
||||||
"material/base.html",
|
|
||||||
"material/overrides/main.html"
|
|
||||||
]) {
|
|
||||||
const template = toPairs<string>(manifest)
|
|
||||||
.reduce((content, [from, to]) => (
|
|
||||||
content.replace(new RegExp(
|
|
||||||
`('|")${from}\\1`, "g"),
|
|
||||||
`$1${to}$1`
|
|
||||||
)
|
|
||||||
), fs.readFileSync(file, "utf8"))
|
|
||||||
|
|
||||||
/* Save template with replaced assets */
|
|
||||||
fs.writeFileSync(file, template, "utf8")
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Icon indexes */
|
|
||||||
const icons: Record<string, string> = {}
|
|
||||||
const emojis: Record<string, string> = {}
|
|
||||||
|
|
||||||
/* Build search index for bundled icons */
|
|
||||||
for (const file of await glob("**/*.svg", {
|
|
||||||
cwd: "material/.icons"
|
|
||||||
})) {
|
|
||||||
const name = file.replace(/\.svg$/, "").replace(/\//g, "-")
|
|
||||||
icons[name] = file
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Build search index for emojis (based on Twemoji) */
|
|
||||||
const [database] = await glob("venv/**/twemoji_db.py")
|
|
||||||
if (typeof database !== "undefined") {
|
|
||||||
const contents = fs.readFileSync(database, "utf8")
|
|
||||||
const [, content] = contents.match(/^emoji = ({.*})$.alias/ms)!
|
|
||||||
for (const [name, data] of toPairs(JSON.parse(content))) {
|
|
||||||
emojis[name.replace(/(^:|:$)/g, "")] = `${data.unicode}.svg`
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fs.writeFileSync(
|
|
||||||
"material/overrides/assets/javascripts/icon_search_index.json",
|
|
||||||
JSON.stringify({
|
|
||||||
icons: {
|
|
||||||
base: "https://raw.githubusercontent.com/squidfunk/mkdocs-material/master/material/.icons/",
|
|
||||||
data: icons
|
|
||||||
},
|
|
||||||
emojis: {
|
|
||||||
base: "https://raw.githubusercontent.com/twitter/twemoji/master/assets/svg/",
|
|
||||||
data: emojis
|
|
||||||
}
|
|
||||||
})
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
|
|
||||||
/* Minify SVGs */
|
|
||||||
new ImageminPlugin({
|
|
||||||
svgo: {
|
|
||||||
plugins: [
|
|
||||||
{ removeDimensions: true },
|
|
||||||
{ removeViewBox: false }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
})
|
|
||||||
],
|
|
||||||
|
|
||||||
/* Optimizations */
|
|
||||||
optimization: {
|
|
||||||
splitChunks: {
|
|
||||||
cacheGroups: {
|
|
||||||
vendor: {
|
|
||||||
test: /\/node_modules\//,
|
|
||||||
name: "assets/javascripts/vendor",
|
|
||||||
chunks: "all"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/* Search worker */
|
|
||||||
{
|
|
||||||
...base,
|
|
||||||
entry: {
|
|
||||||
"assets/javascripts/worker/search":
|
|
||||||
"src/assets/javascripts/integrations/search/worker/main"
|
|
||||||
},
|
|
||||||
output: {
|
|
||||||
path: path.resolve(__dirname, "material"),
|
|
||||||
filename: `[name]${hash}.js`,
|
|
||||||
hashDigestLength: 8,
|
|
||||||
libraryTarget: "var"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/* Overrides */
|
|
||||||
{
|
|
||||||
...base,
|
|
||||||
entry: {
|
|
||||||
"overrides/assets/javascripts/bundle": "src/overrides/assets/javascripts",
|
|
||||||
"overrides/assets/stylesheets/main": "src/overrides/assets/stylesheets/main.scss"
|
|
||||||
},
|
|
||||||
output: {
|
|
||||||
path: path.resolve(__dirname, "material"),
|
|
||||||
filename: `[name]${hash}.js`,
|
|
||||||
hashDigestLength: 8,
|
|
||||||
libraryTarget: "window"
|
|
||||||
},
|
|
||||||
|
|
||||||
/* Plugins */
|
|
||||||
plugins: [
|
|
||||||
...base.plugins || [],
|
|
||||||
|
|
||||||
/* Stylesheets */
|
|
||||||
new MiniCssExtractPlugin({
|
|
||||||
filename: `[name]${hash}.css`
|
|
||||||
})
|
|
||||||
],
|
|
||||||
|
|
||||||
/* Optimizations */
|
|
||||||
optimization: {
|
|
||||||
// minimize: false,
|
|
||||||
// splitChunks: {
|
|
||||||
// cacheGroups: {
|
|
||||||
// vendor: {
|
|
||||||
// test: /\/node_modules\//,
|
|
||||||
// name: "overrides/assets/javascripts/vendor",
|
|
||||||
// chunks: "all"
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||