1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2024-11-24 07:30:12 +01:00

Refactored Gulp build pipeline with Webpack

This commit is contained in:
Martin Donath 2017-11-21 21:32:25 +01:00 committed by GitHub
parent 57142f144b
commit 81e433bf2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
94 changed files with 597 additions and 8071 deletions

View File

@ -1,7 +1,18 @@
{ {
"presets": ["es2015"], "presets": [
["env", {
"loose": true,
"target": {
"browsers": [
"> 1%",
"last 2 versions"
]
}
}]
],
"plugins": [ "plugins": [
"add-module-exports", ["transform-react-jsx", {
"root-import" "pragma": "JSX.createElement"
}]
] ]
} }

View File

@ -29,3 +29,8 @@ indent_size = 2
end_of_line = lf end_of_line = lf
insert_final_newline = true insert_final_newline = true
trim_trailing_whitespace = true trim_trailing_whitespace = true
# Makefiles
[Makefile]
indent_style = tab
indent_size = 8

View File

@ -22,7 +22,3 @@
/build /build
/material /material
/site /site
# Files used and generated by flow
/lib/declarations
/tmp

View File

@ -1,5 +0,0 @@
[ignore]
.*/node_modules/.*
[libs]
lib/declarations/

View File

@ -55,15 +55,6 @@ if [ "$FILES" ]; then
else else
echo -e "\x1B[32m✓\x1B[0m Linter" echo -e "\x1B[32m✓\x1B[0m Linter"
fi fi
# If flow terminated with errors, abort commit
yarn run flow --silent
if [ $? -gt 0 ]; then
echo -e "\x1B[31m✗\x1B[0m Flow - \x1B[31m$MESSAGE\x1B[0m"
exit 1
else
echo -e "\x1B[32m✓\x1B[0m Flow"
fi
fi fi
# We're good # We're good

5
.gitignore vendored
View File

@ -28,13 +28,10 @@
# Files generated by build # Files generated by build
/build /build
/manifest.json /material/manifest.json
/MANIFEST /MANIFEST
/site /site
# Files generated by flow typechecker
/tmp
# Distribution files # Distribution files
/dist /dist
/mkdocs_material.egg-info /mkdocs_material.egg-info

11
.modernizr-autorc Normal file
View File

@ -0,0 +1,11 @@
{
"options": [
"addTest",
"setClasses"
],
"files": {
"src": ["src/assets/**/*.{js,scss}"]
},
"feature-detects": [],
"runOnce": true
}

View File

@ -18,5 +18,5 @@
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE. # IN THE SOFTWARE.
# Don't line shame # Don't lint shame
src/assets/stylesheets/_shame.scss src/assets/stylesheets/_shame.scss

View File

@ -23,9 +23,6 @@
# Exit, if one command fails # Exit, if one command fails
set -e set -e
# Run build and terminate on error
"$(yarn bin)"/gulp build --clean --optimize --revision
# Deploy documentation to GitHub pages # Deploy documentation to GitHub pages
if [ "$TRAVIS_BRANCH" == "master" -a "$TRAVIS_PULL_REQUEST" == "false" ]; then if [ "$TRAVIS_BRANCH" == "master" -a "$TRAVIS_PULL_REQUEST" == "false" ]; then
REMOTE="https://${GH_TOKEN}@github.com/squidfunk/mkdocs-material" REMOTE="https://${GH_TOKEN}@github.com/squidfunk/mkdocs-material"

View File

@ -22,7 +22,7 @@ language: node_js
sudo: false sudo: false
# Node.js version and necessary services # Node.js version and necessary services
node_js: 5 node_js: 8
services: services:
- docker - docker
@ -43,9 +43,14 @@ before_install:
# Install dependencies # Install dependencies
install: install:
- yarn install --ignore-optional - yarn install
- pip install --user -r requirements.txt - pip install --user -r requirements.txt
# Perform build and release # Perform build and release
script: script:
- yarn run travis - yarn run lint
- yarn run build
# Deploy artifacts
after_success:
- ./travis.sh

View File

@ -1,427 +0,0 @@
/*
* Copyright (c) 2016-2017 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 chalk from "chalk"
import gulp from "gulp"
import notifier from "node-notifier"
import plumber from "gulp-plumber"
import util from "gulp-util"
import yargs from "yargs"
/* ----------------------------------------------------------------------------
* Configuration and arguments
* ------------------------------------------------------------------------- */
/* General configuration */
const config = {
assets: {
src: "src/assets", /* Source directory for assets */
build: "material/assets" /* Target directory for assets */
},
lib: "lib", /* Libraries and tasks */
views: {
src: "src", /* Source directory for views */
build: "material" /* Target directory for views */
}
}
/* Commandline arguments */
let args = yargs
.locale("en")
.usage(`\n${chalk.yellow("Usage:")} yarn run <command> -- [options]`)
.wrap(84)
.updateStrings({
"Commands:": chalk.yellow("Commands:"),
"Examples:": chalk.yellow("Examples:")
})
/* Commands */
.command("build", chalk.grey("build assets and views"))
.command("clean", chalk.grey("clean build artifacts"))
.command("flow", chalk.grey("type check with flow"))
.command("help", chalk.grey("display this message"))
.command("lint", chalk.grey("lint sources"))
.command("start", chalk.grey("start development server"))
/* Options */
.group([
"help", "clean"
], chalk.yellow("Options:"))
.help("help", chalk.grey("display this message"))
.option("clean", {
describe: chalk.grey("clean artifacts before command"),
default: false,
global: true
})
/* Build options */
.group([
"lint", "optimize", "revision", "sourcemaps", "mkdocs"
], chalk.yellow("Build Options:"))
.option("lint", {
describe: chalk.grey("lint sources before build"),
default: true,
global: true
})
.option("optimize", {
describe: chalk.grey("optimize and minify assets"),
default: false,
global: true
})
.option("revision", {
describe: chalk.grey("revision assets for cache busting"),
default: false,
global: true
})
.option("sourcemaps", {
describe: chalk.grey("generate sourcemaps for assets"),
default: false,
global: true
})
.option("mkdocs", {
describe: chalk.grey("build documentation or start watchdog"),
default: true,
global: true
})
/* Example commands */
.example("yarn run build")
.example("yarn run build -- --no-optimize")
.example("yarn run clean")
.example("yarn run flow")
.example("yarn run lint")
.example("yarn run start")
/* Apply to process.argv */
.argv
/* Only use the last seen value if boolean, so overrides are possible */
args = Object.keys(args).reduce((result, arg) => {
result[arg] = Array.isArray(args[arg]) && typeof args[arg][0] === "boolean"
? [].concat(args[arg]).pop()
: args[arg]
return result
}, {})
/* ----------------------------------------------------------------------------
* Overrides and helpers
* ------------------------------------------------------------------------- */
/*
* Override gulp.src() for nicer error handling.
*/
const src = gulp.src
gulp.src = (...glob) => {
return src.apply(gulp, glob)
.pipe(
plumber(function(error) {
util.log(util.colors.red(
`Error (${error.plugin}): ${error.message}`
))
/* Extract file where error happened, if existent */
const file = error.relativePath
? error.relativePath.split("/").pop()
: ""
/* Dispatch system-level notification */
notifier.notify({
title: `Error (${error.plugin}): ${file}`,
message: error.messageOriginal
})
// eslint-disable-next-line no-invalid-this
this.emit("end")
/* Throw error and abort, if not in watch mode */
if (args._[0] !== "watch")
throw error
}))
}
/*
* Helper function to load a task
*
* This function returns a callback that will require the task with the given
* name and execute the function that is returned by this task. It omits the
* need to load all tasks upfront, speeding up the build a gazillion times.
*/
const load = task => {
return done => {
return require(`./${config.lib}/tasks/${task}`)
.call(gulp, gulp, config, args)(done)
}
}
/* ----------------------------------------------------------------------------
* Images
* ------------------------------------------------------------------------- */
/*
* Copy favicon
*/
gulp.task("assets:images:build:ico", [
args.clean ? "assets:images:clean" : false
].filter(Boolean), load("assets/images/build/ico"))
/*
* Copy and minify vector graphics
*/
gulp.task("assets:images:build:svg", [
args.clean ? "assets:images:clean" : false
].filter(Boolean), load("assets/images/build/svg"))
/*
* Copy images
*/
gulp.task("assets:images:build", [
"assets:images:build:ico",
"assets:images:build:svg"
])
/*
* Clean images generated by build
*/
gulp.task("assets:images:clean",
load("assets/images/clean"))
/* ----------------------------------------------------------------------------
* JavaScript
* ------------------------------------------------------------------------- */
/*
* Build application logic
*
* When revisioning assets, the build must be serialized due to possible race
* conditions when two tasks try to write manifest.json simultaneously
*/
gulp.task("assets:javascripts:build:application", [
args.clean ? "assets:javascripts:clean" : false,
args.lint ? "assets:javascripts:lint" : false,
args.revision ? "assets:stylesheets:build" : false
].filter(Boolean), load("assets/javascripts/build/application"))
/*
* Build custom modernizr
*
* When revisioning assets, the build must be serialized due to possible race
* conditions when two tasks try to write manifest.json simultaneously
*/
gulp.task("assets:javascripts:build:modernizr", [
"assets:stylesheets:build",
args.clean ? "assets:javascripts:clean" : false,
args.lint ? "assets:javascripts:lint" : false,
args.revision ? "assets:javascripts:build:application" : false
].filter(Boolean), load("assets/javascripts/build/modernizr"))
/*
* Build search language support files
*/
gulp.task("assets:javascripts:build:languages", [
args.clean ? "assets:javascripts:clean" : false
].filter(Boolean), load("assets/javascripts/build/languages"))
/*
* Build JavaScript
*/
gulp.task("assets:javascripts:build", [
"assets:javascripts:build:application",
"assets:javascripts:build:modernizr",
"assets:javascripts:build:languages"
])
/*
* Clean JavaScript generated by build
*/
gulp.task("assets:javascripts:clean",
load("assets/javascripts/clean"))
/*
* Annotate JavaScript
*/
gulp.task("assets:javascripts:annotate",
load("assets/javascripts/annotate"))
/*
* Lint JavaScript
*/
gulp.task("assets:javascripts:lint",
load("assets/javascripts/lint"))
/* ----------------------------------------------------------------------------
* Stylesheets
* ------------------------------------------------------------------------- */
/*
* Build stylesheets from SASS source
*/
gulp.task("assets:stylesheets:build", [
args.clean ? "assets:stylesheets:clean" : false,
args.lint ? "assets:stylesheets:lint" : false
].filter(Boolean), load("assets/stylesheets/build"))
/*
* Clean stylesheets generated by build
*/
gulp.task("assets:stylesheets:clean",
load("assets/stylesheets/clean"))
/*
* Lint SASS sources
*/
gulp.task("assets:stylesheets:lint",
load("assets/stylesheets/lint"))
/* ----------------------------------------------------------------------------
* Assets
* ------------------------------------------------------------------------- */
/*
* Build assets
*/
gulp.task("assets:build", [
"assets:images:build",
"assets:javascripts:build",
"assets:stylesheets:build"
])
/*
* Clean files generated by build
*/
gulp.task("assets:clean", [
"assets:images:clean",
"assets:javascripts:clean",
"assets:stylesheets:clean"
])
/* ----------------------------------------------------------------------------
* Views
* ------------------------------------------------------------------------- */
/*
* Minify views
*/
gulp.task("views:build", [
args.clean ? "views:clean" : false,
args.revision ? "assets:images:build" : false,
args.revision ? "assets:stylesheets:build" : false,
args.revision ? "assets:javascripts:build" : false
].filter(Boolean), load("views/build"))
/*
* Clean views
*/
gulp.task("views:clean",
load("views/clean"))
/* ----------------------------------------------------------------------------
* MkDocs
* ------------------------------------------------------------------------- */
/*
* Build documentation
*/
gulp.task("mkdocs:build", [
"assets:build",
"views:build",
"mkdocs:clean"
], load("mkdocs/build"))
/*
* Clean documentation build
*/
gulp.task("mkdocs:clean",
load("mkdocs/clean"))
/*
* Restart MkDocs server
*/
gulp.task("mkdocs:serve",
load("mkdocs/serve"))
/* ----------------------------------------------------------------------------
* Interface
* ------------------------------------------------------------------------- */
/*
* Build assets and documentation
*/
gulp.task("build", [
"assets:build",
"views:build",
args.mkdocs ? "mkdocs:build" : false
].filter(f => f))
/*
* Clean assets and documentation
*/
gulp.task("clean", [
"assets:clean",
"views:clean",
"mkdocs:clean"
])
/*
* Watch for changes and rebuild assets on the fly
*/
gulp.task("watch", [
"assets:build",
"views:build"
], () => {
process.env.WATCH = true
/* Start MkDocs server */
if (args.mkdocs)
gulp.start("mkdocs:serve")
/* Rebuild stylesheets */
gulp.watch([
`${config.assets.src}/stylesheets/**/*.scss`
], ["assets:stylesheets:build"])
/* Rebuild JavaScript */
gulp.watch([
`${config.assets.src}/javascripts/**/*.{js,jsx}`
], ["assets:javascripts:build:application"])
/* Copy images */
gulp.watch([
`${config.assets.src}/images/**/*`
], ["assets:images:build"])
/* Minify views */
gulp.watch([
`${config.views.src}/**/*.html`
], ["views:build"])
})
/*
* Print help message
*/
gulp.task("help")
/*
* Build assets by default
*/
gulp.task("default", ["build"])

71
Makefile Normal file
View File

@ -0,0 +1,71 @@
# Copyright (c) 2016-2017 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.
all: clean lint | build
# -----------------------------------------------------------------------------
# Prerequisites
# -----------------------------------------------------------------------------
# Install dependencies
node_modules:
yarn install
# -----------------------------------------------------------------------------
# Targets
# -----------------------------------------------------------------------------
# Build theme for distribution with Webpack
material: $(shell find src) webpack.config.js .babelrc
$(shell yarn bin)/webpack --env.prod
# -----------------------------------------------------------------------------
# Rules
# -----------------------------------------------------------------------------
# Build distribution files
build: node_modules material
# Clean distribution files
clean:
rm -rf material
# Lint source files
lint: node_modules
$(shell yarn bin)/eslint --max-warnings 0 .
$(shell yarn bin)/stylelint `find src/assets -name *.scss`
# Rebuild theme on changes with Webpack
watch-webpack: node_modules clean
$(shell yarn bin)/webpack --watch
# Serve documentation with MkDocs
watch-mkdocs: clean
while [ ! -d "./material" ]; do sleep 1; done
mkdocs serve
# Run Webpack and MkDocs in watch mode
watch: node_modules watch-webpack watch-mkdocs
# -----------------------------------------------------------------------------
# Special targets
.PHONY: .FORCE build clean lint watch watch-mkdocs watch-webpack
.FORCE:

View File

@ -169,19 +169,19 @@ For more on this topic refer to the [MkDocs documentation][4]
## Theme development ## Theme development
The Material theme is built on modern technologies like ES6, [Webpack][5], The Material theme uses [Webpack][5] as a build tool to leverage modern web
[Babel][6] and [SASS][7]. If you want to make more fundamental changes, it may technologies like [Babel][6] and [SASS][7]. If you want to make more fundamental
be necessary to make the adjustments directly in the source of the Material changes, it may be necessary to make the adjustments directly in the source of
theme and recompile it. This is fairly easy. the Material theme and recompile it. This is fairly easy.
[5]: https://webpack.github.io/ [5]: https://webpack.js.org/
[6]: https://babeljs.io [6]: https://babeljs.io
[7]: http://sass-lang.com [7]: http://sass-lang.com
### Environment setup ### Environment setup
In order to start development on the Material theme, a [Node.js][8] version of In order to start development on the Material theme, a [Node.js][8] version of
at least 5 is required, as well as the package manager [yarn][9] which is a at least 8 is required, as well as the package manager [yarn][9] which is a
better version of `npm`. First, clone the repository: better version of `npm`. First, clone the repository:
``` sh ``` sh
@ -201,11 +201,10 @@ yarn install
### Development mode ### Development mode
The Material theme uses a sophisticated asset pipeline using [Gulp][10] and The development server can be started with:
Webpack which can be started with the following command:
``` sh ``` sh
yarn start yarn run watch
``` ```
This will also start the MkDocs development server which will monitor changes This will also start the MkDocs development server which will monitor changes
@ -227,8 +226,7 @@ $md-color-accent: $clr-teal-a700;
directory are automatically generated from the `src` directory and will be directory are automatically generated from the `src` directory and will be
overriden when the theme is built. overriden when the theme is built.
[10]: http://gulpjs.com [10]: http://localhost:8000
[11]: http://localhost:8000
### Build process ### Build process

View File

@ -1,14 +0,0 @@
# Examples
To run the example configurations, ensure Python and MkDocs are up and running,
change to the respective directory and run `mkdocs serve`. This will print:
``` sh
INFO - Building documentation...
INFO - Cleaning site directory
[I 170620 18:54:55 server:283] Serving on http://127.0.0.1:8000
[I 170620 18:54:55 handlers:60] Start watching changes
[I 170620 18:54:55 handlers:62] Start detecting changes
```
Go to http://127.0.0.1:8000 to see the resulting documentation.

View File

@ -1,3 +0,0 @@
# Example
This is a minimal example configuration.

View File

@ -1,25 +0,0 @@
# Copyright (c) 2016-2017 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.
# Project information
site_name: Example
# Theme
theme: material

View File

@ -1,29 +0,0 @@
# Example
This example project contains a configuration for the German language. All
footer and search labels (or placeholders), as well as link titles have been
translated to German. Use this example as a starting point for a project with
another language than English.
The translations can be changed in `theme/partials/language.html`:
``` jinja
{% macro t(key) %}{{ {
"language": "de",
"clipboard.copy": "In Zwischenablage kopieren",
"clipboard.copied": "In Zwischenablage kopiert",
"edit.link.title": "Seite editieren",
"footer.previous": "Vorherige Seite",
"footer.next": "Nächste Seite",
"meta.comments": "Kommentare",
"meta.source": "Quellcode",
"search.language": "de",
"search.placeholder": "Suche",
"search.result.placeholder": "Suchbegriff eingeben",
"search.result.none": "Keine Suchergebnisse",
"search.result.one": "1 Suchergebnis",
"search.result.other": "# Suchergebnisse",
"source.link.title": "Quellcode",
"toc.title": "Inhaltsverzeichnis"
}[key] }}{% endmacro %}
```

View File

@ -1,30 +0,0 @@
# Copyright (c) 2016-2017 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.
# Project information
site_name: Example
# Repository
repo_name: squidfunk/mkdocs-material
repo_url: https://github.com/squidfunk/mkdocs-material
# Theme and overrides, i.e. language partial
theme: material
theme_dir: theme

View File

@ -1,41 +0,0 @@
<!--
Copyright (c) 2016-2017 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.
-->
<!-- Translations -->
{% macro t(key) %}{{ {
"language": "de",
"clipboard.copy": "In Zwischenablage kopieren",
"clipboard.copied": "In Zwischenablage kopiert",
"edit.link.title": "Seite editieren",
"footer.previous": "Vorherige Seite",
"footer.next": "Nächste Seite",
"meta.comments": "Kommentare",
"meta.source": "Quellcode",
"search.language": "de",
"search.placeholder": "Suche",
"search.result.placeholder": "Suchbegriff eingeben",
"search.result.none": "Keine Suchergebnisse",
"search.result.one": "1 Suchergebnis",
"search.result.other": "# Suchergebnisse",
"source.link.title": "Quellcode",
"toc.title": "Inhaltsverzeichnis"
}[key] }}{% endmacro %}

View File

@ -1,6 +0,0 @@
{
"rules": {
"no-invalid-this": 0,
"max-params": 0
}
}

View File

@ -1,44 +0,0 @@
/*
* Copyright (c) 2016-2017 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.
*/
/* ----------------------------------------------------------------------------
* Declarations
* ------------------------------------------------------------------------- */
declare module "clipboard" {
/* Class: Clipboard action */
declare class ClipboardAction {
trigger: HTMLElement,
clearSelection(): void
}
/* Class: Clipboard */
declare class Clipboard {
static isSupported(): boolean,
constructor(selector: string): void,
on(name: string, cb: (action: ClipboardAction) => void): void
}
/* Exports */
declare export default typeof Clipboard
}

View File

@ -1,36 +0,0 @@
/*
* Copyright (c) 2016-2017 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.
*/
/* ----------------------------------------------------------------------------
* Declarations
* ------------------------------------------------------------------------- */
declare module "fastclick" {
/* Type: FastClick */
declare type FastClick = {
attach(name: HTMLElement): void
}
/* Exports */
declare export default FastClick
}

View File

@ -1,43 +0,0 @@
/*
* Copyright (c) 2016-2017 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.
*/
/* ----------------------------------------------------------------------------
* Declarations
* ------------------------------------------------------------------------- */
declare module "js-cookie" {
/* Type: Options for setting cookie values */
declare type Options = {
path?: string,
expires?: number | string
}
/* Type: Cookie */
declare type Cookie = {
getJSON(json: string): Object,
set(key: string, value: Array<string>, options?: Options): string
}
/* Exports */
declare export default Cookie
}

View File

@ -1,36 +0,0 @@
/*
* Copyright (c) 2016-2017 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.
*/
/* ----------------------------------------------------------------------------
* Declarations
* ------------------------------------------------------------------------- */
declare class Jsx {
static createElement(tag: string, properties?: Object,
...children?: Array<
string | number | { __html?: string } | Array<HTMLElement>
>
): HTMLElement
}
/* Exports */
declare export default Jsx

View File

@ -1,34 +0,0 @@
/*
* Copyright (c) 2016-2017 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.
*/
/* ----------------------------------------------------------------------------
* Declarations
* ------------------------------------------------------------------------- */
/*
* Currently, it's not possible to export a function that returns a class type,
* as the imports just don't correctly work with flow. As a workaround we
* export an object until this error is fixed.
*/
declare module "expose-loader?lunr!lunr" {
declare function exports(name: () => void): Object
}

View File

@ -1,32 +0,0 @@
/*
* Copyright (c) 2016-2017 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.
*/
/* ----------------------------------------------------------------------------
* Declarations
* ------------------------------------------------------------------------- */
declare class Modernizr {
static addTest(name: string, test: () => boolean): void
}
/* Exports */
declare export default Modernizr

View File

@ -1,35 +0,0 @@
/*
* Copyright (c) 2016-2017 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 changed from "gulp-changed"
/* ----------------------------------------------------------------------------
* Task: clean images generated by build
* ------------------------------------------------------------------------- */
export default (gulp, config) => {
return () => {
return gulp.src(`${config.assets.src}/images/**/favicon.*`)
.pipe(changed(`${config.assets.build}/images`))
.pipe(gulp.dest(`${config.assets.build}/images`))
}
}

View File

@ -1,54 +0,0 @@
/*
* Copyright (c) 2016-2017 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 changed from "gulp-changed"
import gulpif from "gulp-if"
import minsvg from "gulp-svgmin"
import rev from "gulp-rev"
import version from "gulp-rev-replace"
/* ----------------------------------------------------------------------------
* Task: clean images generated by build
* ------------------------------------------------------------------------- */
export default (gulp, config, args) => {
return () => {
return gulp.src(`${config.assets.src}/images/**/*.svg`)
.pipe(changed(`${config.assets.build}/images`))
.pipe(gulpif(args.optimize,
minsvg({
plugins: [
{ cleanupIDs: false }
]
})))
.pipe(gulpif(args.revision, rev()))
.pipe(gulpif(args.revision,
version({ manifest: gulp.src("manifest.json") })))
.pipe(gulp.dest(`${config.assets.build}/images`))
.pipe(gulpif(args.revision,
rev.manifest("manifest.json", {
base: config.assets.build,
merge: true
})))
.pipe(gulpif(args.revision, gulp.dest(config.assets.build)))
}
}

View File

@ -1,35 +0,0 @@
/*
* Copyright (c) 2016-2017 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 clean from "del"
import vinyl from "vinyl-paths"
/* ----------------------------------------------------------------------------
* Task: clean images generated by build
* ------------------------------------------------------------------------- */
export default (gulp, config) => {
return () => {
return gulp.src(`${config.assets.build}/images/*`)
.pipe(vinyl(clean))
}
}

View File

@ -1,63 +0,0 @@
/*
* Copyright (c) 2016-2017 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 { transform } from "babel-core"
import jsdoc2flow from "flow-jsdoc"
import through from "through2"
/* ----------------------------------------------------------------------------
* Task: annotate JavaScript
* ------------------------------------------------------------------------- */
export default (gulp, config) => {
return () => {
return gulp.src(`${config.assets.src}/javascripts/**/*.{js,jsx}`)
/* Linting */
.pipe(
through.obj(function(file, enc, done) {
if (file.isNull() || file.isStream())
return done()
/* Perform Babel transformation to resolve JSX calls */
const transformed = transform(file.contents.toString(), {
plugins: [
["transform-react-jsx", {
"pragma": "Jsx.createElement"
}]
]
})
/* Annotate contents */
file.contents = new Buffer(jsdoc2flow(
`/* @flow */\n\n${transformed.code}`
).toString())
/* Push file to next stage */
this.push(file)
done()
}))
/* Print errors */
.pipe(gulp.dest("tmp/assets/javascripts"))
}
}

View File

@ -1,131 +0,0 @@
/*
* Copyright (c) 2016-2017 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 gulpif from "gulp-if"
import path from "path"
import rev from "gulp-rev"
import stream from "webpack-stream"
import version from "gulp-rev-replace"
import webpack from "webpack"
/* ----------------------------------------------------------------------------
* Task: build application logic
* ------------------------------------------------------------------------- */
export default (gulp, config, args) => {
return () => {
return gulp.src(`${config.assets.src}/javascripts/**/*.{js,jsx}`)
/* Build with webpack */
.pipe(
stream({
entry: [
/* Polyfills */
"core-js/fn/promise",
"custom-event-polyfill",
"whatwg-fetch",
/* Main entry point */
"application.js"
],
output: {
filename: "application.js",
library: "app",
libraryTarget: "window"
},
module: {
/* Transpile ES6 to ES5 with Babel */
rules: [
{
loader: "babel-loader",
test: /\.jsx?$/
}
]
},
plugins: [
/* Don't emit assets that include errors */
new webpack.NoEmitOnErrorsPlugin(),
/* Provide JSX helper */
new webpack.ProvidePlugin({
Jsx: path.join(process.cwd(), `${config.lib}/providers/jsx.js`)
})
].concat(
/* Minify sources */
args.optimize ? [
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false,
screw_ie8: true, // eslint-disable-line camelcase
conditionals: true,
unused: true,
comparisons: true,
sequences: true,
dead_code: true, // eslint-disable-line camelcase
evaluate: true,
if_return: true, // eslint-disable-line camelcase
join_vars: true // eslint-disable-line camelcase
},
output: {
comments: false
}
})
] : []),
/* Module resolver */
resolve: {
modules: [
"src/assets/javascripts",
"node_modules"
],
extensions: [
".js",
".jsx"
]
},
/* Webpack commandline output */
stats: {
colors: true
},
/* Sourcemap support */
devtool: args.sourcemaps ? "inline-source-map" : ""
}, webpack))
/* Revisioning */
.pipe(gulpif(args.revision, rev()))
.pipe(gulpif(args.revision,
version({ manifest: gulp.src("manifest.json") })))
.pipe(gulp.dest(`${config.assets.build}/javascripts`))
.pipe(gulpif(args.revision,
rev.manifest("manifest.json", {
base: config.assets.build,
merge: true
})))
.pipe(gulpif(args.revision, gulp.dest(config.assets.build)))
}
}

View File

@ -1,36 +0,0 @@
/*
* Copyright (c) 2016-2017 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 gulpif from "gulp-if"
import uglify from "gulp-uglify"
/* ----------------------------------------------------------------------------
* Task: build search language support files
* ------------------------------------------------------------------------- */
export default (gulp, config, args) => {
return () => {
return gulp.src("node_modules/lunr-languages/*.js")
.pipe(gulpif(args.optimize, uglify()))
.pipe(gulp.dest(`${config.assets.build}/javascripts/lunr`))
}
}

View File

@ -1,63 +0,0 @@
/*
* Copyright (c) 2016-2017 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 concat from "gulp-concat"
import gulpif from "gulp-if"
import modernizr from "gulp-modernizr"
import uglify from "gulp-uglify"
import rev from "gulp-rev"
import version from "gulp-rev-replace"
/* ----------------------------------------------------------------------------
* Task: build custom modernizr
* ------------------------------------------------------------------------- */
export default (gulp, config, args) => {
return () => {
return gulp.src(`${config.assets.build}/stylesheets/*.css`)
/* Build custom modernizr */
.pipe(
modernizr({
options: [
"addTest", /* Add custom tests */
"setClasses" /* Add CSS classes to root tag */
]
}))
.pipe(concat("modernizr.js"))
/* Minify sources */
.pipe(gulpif(args.optimize, uglify()))
/* Revisioning */
.pipe(gulpif(args.revision, rev()))
.pipe(gulpif(args.revision,
version({ manifest: gulp.src("manifest.json") })))
.pipe(gulp.dest(`${config.assets.build}/javascripts`))
.pipe(gulpif(args.revision,
rev.manifest("manifest.json", {
base: config.assets.build,
merge: true
})))
.pipe(gulpif(args.revision, gulp.dest(config.assets.build)))
}
}

View File

@ -1,35 +0,0 @@
/*
* Copyright (c) 2016-2017 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 clean from "del"
import vinyl from "vinyl-paths"
/* ----------------------------------------------------------------------------
* Task: clean JavaScript generated by build
* ------------------------------------------------------------------------- */
export default (gulp, config) => {
return () => {
return gulp.src(`${config.assets.build}/javascripts/*`)
.pipe(vinyl(clean))
}
}

View File

@ -1,108 +0,0 @@
/*
* Copyright (c) 2016-2017 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 path from "path"
import through from "through2"
import util from "gulp-util"
import { CLIEngine } from "eslint"
/* ----------------------------------------------------------------------------
* Locals
* ------------------------------------------------------------------------- */
const eslint = new CLIEngine
const format = eslint.getFormatter()
/* ----------------------------------------------------------------------------
* Task: lint JavaScript
* ------------------------------------------------------------------------- */
export default (gulp, config) => {
return () => {
return gulp.src(`${config.assets.src}/javascripts/**/*.{js,jsx}`)
/* Linting */
.pipe(
through.obj(function(file, enc, done) {
if (file.isNull() || file.isStream())
return done()
/* Lint file using .eslintrc */
file.eslint = eslint.executeOnText(
file.contents.toString())
/* Correct file path */
file.eslint.results[0].filePath =
path.relative(process.cwd(), file.path)
/* Push file to next stage */
this.push(file)
done()
}))
/* Print errors */
.pipe(
through.obj(function(file, enc, done) {
if (file.eslint.errorCount || file.eslint.warningCount) {
// eslint-disable-next-line no-console
console.log(format(file.eslint.results))
}
/* Push file to next stage */
this.push(file)
done()
}))
/* Terminate on error */
.pipe(
(() => {
const errors = []
/* Gather errors */
return through.obj(function(file, enc, done) {
const results = file.eslint
/* Consider warnings as errors */
if (results.errorCount || results.warningCount)
errors.push(file)
/* Push file to next stage */
this.push(file)
done()
/* Format errors and terminate */
}, function(done) {
if (errors.length > 0) {
const message = errors.map(file => {
return file.relative
}).join(", ")
/* Emit error */
this.emit("error", new util.PluginError("eslint",
`Terminated with errors in files: ${message}`))
}
done()
})
})())
}
}

View File

@ -1,80 +0,0 @@
/*
* Copyright (c) 2016-2017 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 autoprefixer from "autoprefixer"
import gulpif from "gulp-if"
import mincss from "gulp-cssnano"
import mqpacker from "css-mqpacker"
import postcss from "gulp-postcss"
import pseudoclasses from "postcss-pseudo-classes"
import rev from "gulp-rev"
import sass from "gulp-sass"
import sourcemaps from "gulp-sourcemaps"
import version from "gulp-rev-replace"
/* ----------------------------------------------------------------------------
* Task: build stylesheets from SASS source
* ------------------------------------------------------------------------- */
export default (gulp, config, args) => {
return () => {
return gulp.src(`${config.assets.src}/stylesheets/*.scss`)
.pipe(gulpif(args.sourcemaps, sourcemaps.init()))
/* Compile SASS sources */
.pipe(
sass({
includePaths: [
"node_modules/modularscale-sass/stylesheets",
"node_modules/material-design-color",
"node_modules/material-shadows"
]
}))
/* Apply PostCSS plugins */
.pipe(
postcss([
autoprefixer(),
mqpacker
].concat(!args.optimize ? [
// pseudoclasses({
// "restrictTo": ["hover", "focus"]
// })
] : [])))
/* Minify sources */
.pipe(gulpif(args.optimize, mincss()))
/* Revisioning */
.pipe(gulpif(args.revision, rev()))
.pipe(gulpif(args.revision,
version({ manifest: gulp.src("manifest.json") })))
.pipe(gulpif(args.sourcemaps, sourcemaps.write()))
.pipe(gulp.dest(`${config.assets.build}/stylesheets`))
.pipe(gulpif(args.revision,
rev.manifest("manifest.json", {
base: config.assets.build,
merge: true
})))
.pipe(gulpif(args.revision, gulp.dest(config.assets.build)))
}
}

View File

@ -1,35 +0,0 @@
/*
* Copyright (c) 2016-2017 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 clean from "del"
import vinyl from "vinyl-paths"
/* ----------------------------------------------------------------------------
* Task: clean stylesheets generated by build
* ------------------------------------------------------------------------- */
export default (gulp, config) => {
return () => {
return gulp.src(`${config.assets.build}/stylesheets/*`)
.pipe(vinyl(clean))
}
}

View File

@ -1,39 +0,0 @@
/*
* Copyright (c) 2016-2017 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 stylelint from "gulp-stylelint"
/* ----------------------------------------------------------------------------
* Task: lint SASS sources
* ------------------------------------------------------------------------- */
export default (gulp, config) => {
return () => {
return gulp.src(`${config.assets.src}/stylesheets/**/*.scss`)
.pipe(
stylelint({
reporters: [
{ formatter: "string", console: true }
]
}))
}
}

View File

@ -1,36 +0,0 @@
/*
* Copyright (c) 2016-2017 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 child from "child_process"
/* ----------------------------------------------------------------------------
* Task: build documentation
* ------------------------------------------------------------------------- */
export default () => {
return () => {
const proc = child.spawnSync("mkdocs", ["build"])
if (proc.status)
throw new Error(`MkDocs error:\n${proc.stderr.toString()}`)
return proc
}
}

View File

@ -1,35 +0,0 @@
/*
* Copyright (c) 2016-2017 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 clean from "del"
import vinyl from "vinyl-paths"
/* ----------------------------------------------------------------------------
* Task: clean documentation build
* ------------------------------------------------------------------------- */
export default gulp => {
return () => {
return gulp.src("site")
.pipe(vinyl(clean))
}
}

View File

@ -1,48 +0,0 @@
/*
* Copyright (c) 2016-2017 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 child from "child_process"
/* ----------------------------------------------------------------------------
* Locals
* ------------------------------------------------------------------------- */
/* MkDocs server */
let server = null
/* ----------------------------------------------------------------------------
* Task: serve documentation
* ------------------------------------------------------------------------- */
export default () => {
return () => {
if (server)
server.kill()
/* Spawn MkDocs server */
server = child.spawn("mkdocs", [
"serve", "--dev-addr", "0.0.0.0:8000", "--strict"
], {
stdio: "inherit"
})
}
}

View File

@ -1,58 +0,0 @@
/*
* Copyright (c) 2016-2017 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 changed from "gulp-changed"
import compact from "gulp-remove-empty-lines"
import gulpif from "gulp-if"
import minhtml from "gulp-htmlmin"
import path from "path"
import replace from "gulp-replace"
import version from "gulp-rev-replace"
/* ----------------------------------------------------------------------------
* Task: minify views
* ------------------------------------------------------------------------- */
export default (gulp, config, args) => {
return () => {
const metadata = require(path.join(process.cwd(), "./package.json"))
return gulp.src(`${config.views.src}/**/*.{html,py,yml}`)
.pipe(changed(config.views.build))
.pipe(
minhtml({
collapseBooleanAttributes: true,
customAttrCollapse: /(content)/,
includeAutoGeneratedTags: false,
minifyCSS: true,
minifyJS: true,
removeComments: true,
removeScriptTypeAttributes: true,
removeStyleLinkTypeAttributes: true
}))
.pipe(replace("$md-name$", metadata.name))
.pipe(replace("$md-version$", metadata.version))
.pipe(compact())
.pipe(gulpif(args.revision,
version({ manifest: gulp.src("manifest.json") })))
.pipe(gulp.dest(config.views.build))
}
}

View File

@ -1,35 +0,0 @@
/*
* Copyright (c) 2016-2017 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 clean from "del"
import vinyl from "vinyl-paths"
/* ----------------------------------------------------------------------------
* Task: clean views
* ------------------------------------------------------------------------- */
export default (gulp, config) => {
return () => {
return gulp.src(`${config.views.build}/**/*.{html,py}`)
.pipe(vinyl(clean))
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 521 B

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 991 B

After

Width:  |  Height:  |  Size: 991 B

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.da=function(){this.pipeline.reset(),this.pipeline.add(e.da.trimmer,e.da.stopWordFilter,e.da.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.da.stemmer))},e.da.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA--",e.da.trimmer=e.trimmerSupport.generateTrimmer(e.da.wordCharacters),e.Pipeline.registerFunction(e.da.trimmer,"trimmer-da"),e.da.stemmer=function(){var r=e.stemmerSupport.Among,i=e.stemmerSupport.SnowballProgram,n=new function(){function e(){var e,r=f.cursor+3;if(d=f.limit,0<=r&&r<=f.limit){for(a=r;;){if(e=f.cursor,f.in_grouping(w,97,248)){f.cursor=e;break}if(f.cursor=e,e>=f.limit)return;f.cursor++}for(;!f.out_grouping(w,97,248);){if(f.cursor>=f.limit)return;f.cursor++}(d=f.cursor)<a&&(d=a)}}function n(){var e,r;if(f.cursor>=d&&(r=f.limit_backward,f.limit_backward=d,f.ket=f.cursor,e=f.find_among_b(c,32),f.limit_backward=r,e))switch(f.bra=f.cursor,e){case 1:f.slice_del();break;case 2:f.in_grouping_b(p,97,229)&&f.slice_del()}}function t(){var e,r=f.limit-f.cursor;f.cursor>=d&&(e=f.limit_backward,f.limit_backward=d,f.ket=f.cursor,f.find_among_b(l,4)?(f.bra=f.cursor,f.limit_backward=e,f.cursor=f.limit-r,f.cursor>f.limit_backward&&(f.cursor--,f.bra=f.cursor,f.slice_del())):f.limit_backward=e)}function s(){var e,r,i,n=f.limit-f.cursor;if(f.ket=f.cursor,f.eq_s_b(2,"st")&&(f.bra=f.cursor,f.eq_s_b(2,"ig")&&f.slice_del()),f.cursor=f.limit-n,f.cursor>=d&&(r=f.limit_backward,f.limit_backward=d,f.ket=f.cursor,e=f.find_among_b(m,5),f.limit_backward=r,e))switch(f.bra=f.cursor,e){case 1:f.slice_del(),i=f.limit-f.cursor,t(),f.cursor=f.limit-i;break;case 2:f.slice_from("løs")}}function o(){var e;f.cursor>=d&&(e=f.limit_backward,f.limit_backward=d,f.ket=f.cursor,f.out_grouping_b(w,97,248)?(f.bra=f.cursor,u=f.slice_to(u),f.limit_backward=e,f.eq_v_b(u)&&f.slice_del()):f.limit_backward=e)}var a,d,u,c=[new r("hed",-1,1),new r("ethed",0,1),new r("ered",-1,1),new r("e",-1,1),new r("erede",3,1),new r("ende",3,1),new r("erende",5,1),new r("ene",3,1),new r("erne",3,1),new r("ere",3,1),new r("en",-1,1),new r("heden",10,1),new r("eren",10,1),new r("er",-1,1),new r("heder",13,1),new r("erer",13,1),new r("s",-1,2),new r("heds",16,1),new r("es",16,1),new r("endes",18,1),new r("erendes",19,1),new r("enes",18,1),new r("ernes",18,1),new r("eres",18,1),new r("ens",16,1),new r("hedens",24,1),new r("erens",24,1),new r("ers",16,1),new r("ets",16,1),new r("erets",28,1),new r("et",-1,1),new r("eret",30,1)],l=[new r("gd",-1,-1),new r("dt",-1,-1),new r("gt",-1,-1),new r("kt",-1,-1)],m=[new r("ig",-1,1),new r("lig",0,1),new r("elig",1,1),new r("els",-1,1),new r("løst",-1,2)],w=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,48,0,128],p=[239,254,42,3,0,0,0,0,0,0,0,0,0,0,0,0,16],f=new i;this.setCurrent=function(e){f.setCurrent(e)},this.getCurrent=function(){return f.getCurrent()},this.stem=function(){var r=f.cursor;return e(),f.limit_backward=r,f.cursor=f.limit,n(),f.cursor=f.limit,t(),f.cursor=f.limit,s(),f.cursor=f.limit,o(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return n.setCurrent(e),n.stem(),n.getCurrent()}):(n.setCurrent(e),n.stem(),n.getCurrent())}}(),e.Pipeline.registerFunction(e.da.stemmer,"stemmer-da"),e.da.stopWordFilter=e.generateStopWordFilter("ad af alle alt anden at blev blive bliver da de dem den denne der deres det dette dig din disse dog du efter eller en end er et for fra ham han hans har havde have hende hendes her hos hun hvad hvis hvor i ikke ind jeg jer jo kunne man mange med meget men mig min mine mit mod ned noget nogle nu når og også om op os over på selv sig sin sine sit skal skulle som sådan thi til ud under var vi vil ville vor være været".split(" ")),e.Pipeline.registerFunction(e.da.stopWordFilter,"stopWordFilter-da")}}); !function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.da=function(){this.pipeline.reset(),this.pipeline.add(e.da.trimmer,e.da.stopWordFilter,e.da.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.da.stemmer))},e.da.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA--",e.da.trimmer=e.trimmerSupport.generateTrimmer(e.da.wordCharacters),e.Pipeline.registerFunction(e.da.trimmer,"trimmer-da"),e.da.stemmer=function(){var r=e.stemmerSupport.Among,i=e.stemmerSupport.SnowballProgram,n=new function(){function e(){var e,r=l.limit-l.cursor;l.cursor>=t&&(e=l.limit_backward,l.limit_backward=t,l.ket=l.cursor,l.find_among_b(a,4)?(l.bra=l.cursor,l.limit_backward=e,l.cursor=l.limit-r,l.cursor>l.limit_backward&&(l.cursor--,l.bra=l.cursor,l.slice_del())):l.limit_backward=e)}var n,t,s,o=[new r("hed",-1,1),new r("ethed",0,1),new r("ered",-1,1),new r("e",-1,1),new r("erede",3,1),new r("ende",3,1),new r("erende",5,1),new r("ene",3,1),new r("erne",3,1),new r("ere",3,1),new r("en",-1,1),new r("heden",10,1),new r("eren",10,1),new r("er",-1,1),new r("heder",13,1),new r("erer",13,1),new r("s",-1,2),new r("heds",16,1),new r("es",16,1),new r("endes",18,1),new r("erendes",19,1),new r("enes",18,1),new r("ernes",18,1),new r("eres",18,1),new r("ens",16,1),new r("hedens",24,1),new r("erens",24,1),new r("ers",16,1),new r("ets",16,1),new r("erets",28,1),new r("et",-1,1),new r("eret",30,1)],a=[new r("gd",-1,-1),new r("dt",-1,-1),new r("gt",-1,-1),new r("kt",-1,-1)],d=[new r("ig",-1,1),new r("lig",0,1),new r("elig",1,1),new r("els",-1,1),new r("løst",-1,2)],u=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,48,0,128],c=[239,254,42,3,0,0,0,0,0,0,0,0,0,0,0,0,16],l=new i;this.setCurrent=function(e){l.setCurrent(e)},this.getCurrent=function(){return l.getCurrent()},this.stem=function(){var r=l.cursor;return function(){var e,r=l.cursor+3;if(t=l.limit,0<=r&&r<=l.limit){for(n=r;;){if(e=l.cursor,l.in_grouping(u,97,248)){l.cursor=e;break}if(l.cursor=e,e>=l.limit)return;l.cursor++}for(;!l.out_grouping(u,97,248);){if(l.cursor>=l.limit)return;l.cursor++}(t=l.cursor)<n&&(t=n)}}(),l.limit_backward=r,l.cursor=l.limit,function(){var e,r;if(l.cursor>=t&&(r=l.limit_backward,l.limit_backward=t,l.ket=l.cursor,e=l.find_among_b(o,32),l.limit_backward=r,e))switch(l.bra=l.cursor,e){case 1:l.slice_del();break;case 2:l.in_grouping_b(c,97,229)&&l.slice_del()}}(),l.cursor=l.limit,e(),l.cursor=l.limit,function(){var r,i,n,s=l.limit-l.cursor;if(l.ket=l.cursor,l.eq_s_b(2,"st")&&(l.bra=l.cursor,l.eq_s_b(2,"ig")&&l.slice_del()),l.cursor=l.limit-s,l.cursor>=t&&(i=l.limit_backward,l.limit_backward=t,l.ket=l.cursor,r=l.find_among_b(d,5),l.limit_backward=i,r))switch(l.bra=l.cursor,r){case 1:l.slice_del(),n=l.limit-l.cursor,e(),l.cursor=l.limit-n;break;case 2:l.slice_from("løs")}}(),l.cursor=l.limit,function(){var e;l.cursor>=t&&(e=l.limit_backward,l.limit_backward=t,l.ket=l.cursor,l.out_grouping_b(u,97,248)?(l.bra=l.cursor,s=l.slice_to(s),l.limit_backward=e,l.eq_v_b(s)&&l.slice_del()):l.limit_backward=e)}(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return n.setCurrent(e),n.stem(),n.getCurrent()}):(n.setCurrent(e),n.stem(),n.getCurrent())}}(),e.Pipeline.registerFunction(e.da.stemmer,"stemmer-da"),e.da.stopWordFilter=e.generateStopWordFilter("ad af alle alt anden at blev blive bliver da de dem den denne der deres det dette dig din disse dog du efter eller en end er et for fra ham han hans har havde have hende hendes her hos hun hvad hvis hvor i ikke ind jeg jer jo kunne man mange med meget men mig min mine mit mod ned noget nogle nu når og også om op os over på selv sig sin sine sit skal skulle som sådan thi til ud under var vi vil ville vor være været".split(" ")),e.Pipeline.registerFunction(e.da.stopWordFilter,"stopWordFilter-da")}});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var r="2"==e.version[0];e.jp=function(){this.pipeline.reset(),this.pipeline.add(e.jp.stopWordFilter,e.jp.stemmer),r?this.tokenizer=e.jp.tokenizer:(e.tokenizer&&(e.tokenizer=e.jp.tokenizer),this.tokenizerFn&&(this.tokenizerFn=e.jp.tokenizer))};var t=new e.TinySegmenter;e.jp.tokenizer=function(n){if(!arguments.length||null==n||void 0==n)return[];if(Array.isArray(n))return n.map(function(t){return r?new e.Token(t.toLowerCase()):t.toLowerCase()});for(var i=n.toString().toLowerCase().replace(/^\s+/,""),o=i.length-1;o>=0;o--)if(/\S/.test(i.charAt(o))){i=i.substring(0,o+1);break}return t.segment(i).filter(function(e){return!!e}).map(function(t){return r?new e.Token(t):t})},e.jp.stemmer=function(){return function(e){return e}}(),e.Pipeline.registerFunction(e.jp.stemmer,"stemmer-jp"),e.jp.wordCharacters="一二三四五六七八九十百千万億兆一-龠々〆ヵヶぁ-んァ-ヴーア-ン゙a-zA-Z--0-9-",e.jp.stopWordFilter=function(t){if(-1===e.jp.stopWordFilter.stopWords.indexOf(r?t.toString():t))return t},e.jp.stopWordFilter=e.generateStopWordFilter("これ それ あれ この その あの ここ そこ あそこ こちら どこ だれ なに なん 何 私 貴方 貴方方 我々 私達 あの人 あのかた 彼女 彼 です あります おります います は が の に を で え から まで より も どの と し それで しかし".split(" ")),e.Pipeline.registerFunction(e.jp.stopWordFilter,"stopWordFilter-jp")}}); !function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var r="2"==e.version[0];e.jp=function(){this.pipeline.reset(),this.pipeline.add(e.jp.stopWordFilter,e.jp.stemmer),r?this.tokenizer=e.jp.tokenizer:(e.tokenizer&&(e.tokenizer=e.jp.tokenizer),this.tokenizerFn&&(this.tokenizerFn=e.jp.tokenizer))};var t=new e.TinySegmenter;e.jp.tokenizer=function(n){if(!arguments.length||null==n||void 0==n)return[];if(Array.isArray(n))return n.map(function(t){return r?new e.Token(t.toLowerCase()):t.toLowerCase()});for(var i=n.toString().toLowerCase().replace(/^\s+/,""),o=i.length-1;o>=0;o--)if(/\S/.test(i.charAt(o))){i=i.substring(0,o+1);break}return t.segment(i).filter(function(e){return!!e}).map(function(t){return r?new e.Token(t):t})},e.jp.stemmer=function(e){return e},e.Pipeline.registerFunction(e.jp.stemmer,"stemmer-jp"),e.jp.wordCharacters="一二三四五六七八九十百千万億兆一-龠々〆ヵヶぁ-んァ-ヴーア-ン゙a-zA-Z--0-9-",e.jp.stopWordFilter=function(t){if(-1===e.jp.stopWordFilter.stopWords.indexOf(r?t.toString():t))return t},e.jp.stopWordFilter=e.generateStopWordFilter("これ それ あれ この その あの ここ そこ あそこ こちら どこ だれ なに なん 何 私 貴方 貴方方 我々 私達 あの人 あのかた 彼女 彼 です あります おります います は が の に を で え から まで より も どの と し それで しかし".split(" ")),e.Pipeline.registerFunction(e.jp.stopWordFilter,"stopWordFilter-jp")}});

View File

@ -1 +1 @@
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.no=function(){this.pipeline.reset(),this.pipeline.add(e.no.trimmer,e.no.stopWordFilter,e.no.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.no.stemmer))},e.no.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA--",e.no.trimmer=e.trimmerSupport.generateTrimmer(e.no.wordCharacters),e.Pipeline.registerFunction(e.no.trimmer,"trimmer-no"),e.no.stemmer=function(){var r=e.stemmerSupport.Among,n=e.stemmerSupport.SnowballProgram,i=new function(){function e(){var e,r=w.cursor+3;if(a=w.limit,0<=r||r<=w.limit){for(s=r;;){if(e=w.cursor,w.in_grouping(d,97,248)){w.cursor=e;break}if(e>=w.limit)return;w.cursor=e+1}for(;!w.out_grouping(d,97,248);){if(w.cursor>=w.limit)return;w.cursor++}(a=w.cursor)<s&&(a=s)}}function i(){var e,r,n;if(w.cursor>=a&&(r=w.limit_backward,w.limit_backward=a,w.ket=w.cursor,e=w.find_among_b(m,29),w.limit_backward=r,e))switch(w.bra=w.cursor,e){case 1:w.slice_del();break;case 2:n=w.limit-w.cursor,w.in_grouping_b(c,98,122)?w.slice_del():(w.cursor=w.limit-n,w.eq_s_b(1,"k")&&w.out_grouping_b(d,97,248)&&w.slice_del());break;case 3:w.slice_from("er")}}function t(){var e,r=w.limit-w.cursor;w.cursor>=a&&(e=w.limit_backward,w.limit_backward=a,w.ket=w.cursor,w.find_among_b(u,2)?(w.bra=w.cursor,w.limit_backward=e,w.cursor=w.limit-r,w.cursor>w.limit_backward&&(w.cursor--,w.bra=w.cursor,w.slice_del())):w.limit_backward=e)}function o(){var e,r;w.cursor>=a&&(r=w.limit_backward,w.limit_backward=a,w.ket=w.cursor,(e=w.find_among_b(l,11))?(w.bra=w.cursor,w.limit_backward=r,1==e&&w.slice_del()):w.limit_backward=r)}var s,a,m=[new r("a",-1,1),new r("e",-1,1),new r("ede",1,1),new r("ande",1,1),new r("ende",1,1),new r("ane",1,1),new r("ene",1,1),new r("hetene",6,1),new r("erte",1,3),new r("en",-1,1),new r("heten",9,1),new r("ar",-1,1),new r("er",-1,1),new r("heter",12,1),new r("s",-1,2),new r("as",14,1),new r("es",14,1),new r("edes",16,1),new r("endes",16,1),new r("enes",16,1),new r("hetenes",19,1),new r("ens",14,1),new r("hetens",21,1),new r("ers",14,1),new r("ets",14,1),new r("et",-1,1),new r("het",25,1),new r("ert",-1,3),new r("ast",-1,1)],u=[new r("dt",-1,-1),new r("vt",-1,-1)],l=[new r("leg",-1,1),new r("eleg",0,1),new r("ig",-1,1),new r("eig",2,1),new r("lig",2,1),new r("elig",4,1),new r("els",-1,1),new r("lov",-1,1),new r("elov",7,1),new r("slov",7,1),new r("hetslov",9,1)],d=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,48,0,128],c=[119,125,149,1],w=new n;this.setCurrent=function(e){w.setCurrent(e)},this.getCurrent=function(){return w.getCurrent()},this.stem=function(){var r=w.cursor;return e(),w.limit_backward=r,w.cursor=w.limit,i(),w.cursor=w.limit,t(),w.cursor=w.limit,o(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return i.setCurrent(e),i.stem(),i.getCurrent()}):(i.setCurrent(e),i.stem(),i.getCurrent())}}(),e.Pipeline.registerFunction(e.no.stemmer,"stemmer-no"),e.no.stopWordFilter=e.generateStopWordFilter("alle at av bare begge ble blei bli blir blitt både båe da de deg dei deim deira deires dem den denne der dere deres det dette di din disse ditt du dykk dykkar då eg ein eit eitt eller elles en enn er et ett etter for fordi fra før ha hadde han hans har hennar henne hennes her hjå ho hoe honom hoss hossen hun hva hvem hver hvilke hvilken hvis hvor hvordan hvorfor i ikke ikkje ikkje ingen ingi inkje inn inni ja jeg kan kom korleis korso kun kunne kva kvar kvarhelst kven kvi kvifor man mange me med medan meg meget mellom men mi min mine mitt mot mykje ned no noe noen noka noko nokon nokor nokre nå når og også om opp oss over på samme seg selv si si sia sidan siden sin sine sitt sjøl skal skulle slik so som som somme somt så sånn til um upp ut uten var vart varte ved vere verte vi vil ville vore vors vort vår være være vært å".split(" ")),e.Pipeline.registerFunction(e.no.stopWordFilter,"stopWordFilter-no")}}); !function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.no=function(){this.pipeline.reset(),this.pipeline.add(e.no.trimmer,e.no.stopWordFilter,e.no.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.no.stemmer))},e.no.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA--",e.no.trimmer=e.trimmerSupport.generateTrimmer(e.no.wordCharacters),e.Pipeline.registerFunction(e.no.trimmer,"trimmer-no"),e.no.stemmer=function(){var r=e.stemmerSupport.Among,n=e.stemmerSupport.SnowballProgram,i=new function(){var e,i,t=[new r("a",-1,1),new r("e",-1,1),new r("ede",1,1),new r("ande",1,1),new r("ende",1,1),new r("ane",1,1),new r("ene",1,1),new r("hetene",6,1),new r("erte",1,3),new r("en",-1,1),new r("heten",9,1),new r("ar",-1,1),new r("er",-1,1),new r("heter",12,1),new r("s",-1,2),new r("as",14,1),new r("es",14,1),new r("edes",16,1),new r("endes",16,1),new r("enes",16,1),new r("hetenes",19,1),new r("ens",14,1),new r("hetens",21,1),new r("ers",14,1),new r("ets",14,1),new r("et",-1,1),new r("het",25,1),new r("ert",-1,3),new r("ast",-1,1)],o=[new r("dt",-1,-1),new r("vt",-1,-1)],s=[new r("leg",-1,1),new r("eleg",0,1),new r("ig",-1,1),new r("eig",2,1),new r("lig",2,1),new r("elig",4,1),new r("els",-1,1),new r("lov",-1,1),new r("elov",7,1),new r("slov",7,1),new r("hetslov",9,1)],a=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,48,0,128],m=[119,125,149,1],u=new n;this.setCurrent=function(e){u.setCurrent(e)},this.getCurrent=function(){return u.getCurrent()},this.stem=function(){var r=u.cursor;return function(){var r,n=u.cursor+3;if(i=u.limit,0<=n||n<=u.limit){for(e=n;;){if(r=u.cursor,u.in_grouping(a,97,248)){u.cursor=r;break}if(r>=u.limit)return;u.cursor=r+1}for(;!u.out_grouping(a,97,248);){if(u.cursor>=u.limit)return;u.cursor++}(i=u.cursor)<e&&(i=e)}}(),u.limit_backward=r,u.cursor=u.limit,function(){var e,r,n;if(u.cursor>=i&&(r=u.limit_backward,u.limit_backward=i,u.ket=u.cursor,e=u.find_among_b(t,29),u.limit_backward=r,e))switch(u.bra=u.cursor,e){case 1:u.slice_del();break;case 2:n=u.limit-u.cursor,u.in_grouping_b(m,98,122)?u.slice_del():(u.cursor=u.limit-n,u.eq_s_b(1,"k")&&u.out_grouping_b(a,97,248)&&u.slice_del());break;case 3:u.slice_from("er")}}(),u.cursor=u.limit,function(){var e,r=u.limit-u.cursor;u.cursor>=i&&(e=u.limit_backward,u.limit_backward=i,u.ket=u.cursor,u.find_among_b(o,2)?(u.bra=u.cursor,u.limit_backward=e,u.cursor=u.limit-r,u.cursor>u.limit_backward&&(u.cursor--,u.bra=u.cursor,u.slice_del())):u.limit_backward=e)}(),u.cursor=u.limit,function(){var e,r;u.cursor>=i&&(r=u.limit_backward,u.limit_backward=i,u.ket=u.cursor,(e=u.find_among_b(s,11))?(u.bra=u.cursor,u.limit_backward=r,1==e&&u.slice_del()):u.limit_backward=r)}(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return i.setCurrent(e),i.stem(),i.getCurrent()}):(i.setCurrent(e),i.stem(),i.getCurrent())}}(),e.Pipeline.registerFunction(e.no.stemmer,"stemmer-no"),e.no.stopWordFilter=e.generateStopWordFilter("alle at av bare begge ble blei bli blir blitt både båe da de deg dei deim deira deires dem den denne der dere deres det dette di din disse ditt du dykk dykkar då eg ein eit eitt eller elles en enn er et ett etter for fordi fra før ha hadde han hans har hennar henne hennes her hjå ho hoe honom hoss hossen hun hva hvem hver hvilke hvilken hvis hvor hvordan hvorfor i ikke ikkje ikkje ingen ingi inkje inn inni ja jeg kan kom korleis korso kun kunne kva kvar kvarhelst kven kvi kvifor man mange me med medan meg meget mellom men mi min mine mitt mot mykje ned no noe noen noka noko nokon nokor nokre nå når og også om opp oss over på samme seg selv si si sia sidan siden sin sine sitt sjøl skal skulle slik so som som somme somt så sånn til um upp ut uten var vart varte ved vere verte vi vil ville vore vors vort vår være være vært å".split(" ")),e.Pipeline.registerFunction(e.no.stopWordFilter,"stopWordFilter-no")}});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.sv=function(){this.pipeline.reset(),this.pipeline.add(e.sv.trimmer,e.sv.stopWordFilter,e.sv.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.sv.stemmer))},e.sv.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA--",e.sv.trimmer=e.trimmerSupport.generateTrimmer(e.sv.wordCharacters),e.Pipeline.registerFunction(e.sv.trimmer,"trimmer-sv"),e.sv.stemmer=function(){var r=e.stemmerSupport.Among,n=e.stemmerSupport.SnowballProgram,t=new function(){function e(){var e,r=w.cursor+3;if(o=w.limit,0<=r||r<=w.limit){for(a=r;;){if(e=w.cursor,w.in_grouping(l,97,246)){w.cursor=e;break}if(w.cursor=e,w.cursor>=w.limit)return;w.cursor++}for(;!w.out_grouping(l,97,246);){if(w.cursor>=w.limit)return;w.cursor++}(o=w.cursor)<a&&(o=a)}}function t(){var e,r=w.limit_backward;if(w.cursor>=o&&(w.limit_backward=o,w.cursor=w.limit,w.ket=w.cursor,e=w.find_among_b(u,37),w.limit_backward=r,e))switch(w.bra=w.cursor,e){case 1:w.slice_del();break;case 2:w.in_grouping_b(d,98,121)&&w.slice_del()}}function i(){var e=w.limit_backward;w.cursor>=o&&(w.limit_backward=o,w.cursor=w.limit,w.find_among_b(c,7)&&(w.cursor=w.limit,w.ket=w.cursor,w.cursor>w.limit_backward&&(w.bra=--w.cursor,w.slice_del())),w.limit_backward=e)}function s(){var e,r;if(w.cursor>=o){if(r=w.limit_backward,w.limit_backward=o,w.cursor=w.limit,w.ket=w.cursor,e=w.find_among_b(m,5))switch(w.bra=w.cursor,e){case 1:w.slice_del();break;case 2:w.slice_from("lös");break;case 3:w.slice_from("full")}w.limit_backward=r}}var a,o,u=[new r("a",-1,1),new r("arna",0,1),new r("erna",0,1),new r("heterna",2,1),new r("orna",0,1),new r("ad",-1,1),new r("e",-1,1),new r("ade",6,1),new r("ande",6,1),new r("arne",6,1),new r("are",6,1),new r("aste",6,1),new r("en",-1,1),new r("anden",12,1),new r("aren",12,1),new r("heten",12,1),new r("ern",-1,1),new r("ar",-1,1),new r("er",-1,1),new r("heter",18,1),new r("or",-1,1),new r("s",-1,2),new r("as",21,1),new r("arnas",22,1),new r("ernas",22,1),new r("ornas",22,1),new r("es",21,1),new r("ades",26,1),new r("andes",26,1),new r("ens",21,1),new r("arens",29,1),new r("hetens",29,1),new r("erns",21,1),new r("at",-1,1),new r("andet",-1,1),new r("het",-1,1),new r("ast",-1,1)],c=[new r("dd",-1,-1),new r("gd",-1,-1),new r("nn",-1,-1),new r("dt",-1,-1),new r("gt",-1,-1),new r("kt",-1,-1),new r("tt",-1,-1)],m=[new r("ig",-1,1),new r("lig",0,1),new r("els",-1,1),new r("fullt",-1,3),new r("löst",-1,2)],l=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,24,0,32],d=[119,127,149],w=new n;this.setCurrent=function(e){w.setCurrent(e)},this.getCurrent=function(){return w.getCurrent()},this.stem=function(){var r=w.cursor;return e(),w.limit_backward=r,w.cursor=w.limit,t(),w.cursor=w.limit,i(),w.cursor=w.limit,s(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return t.setCurrent(e),t.stem(),t.getCurrent()}):(t.setCurrent(e),t.stem(),t.getCurrent())}}(),e.Pipeline.registerFunction(e.sv.stemmer,"stemmer-sv"),e.sv.stopWordFilter=e.generateStopWordFilter("alla allt att av blev bli blir blivit de dem den denna deras dess dessa det detta dig din dina ditt du där då efter ej eller en er era ert ett från för ha hade han hans har henne hennes hon honom hur här i icke ingen inom inte jag ju kan kunde man med mellan men mig min mina mitt mot mycket ni nu när någon något några och om oss på samma sedan sig sin sina sitta själv skulle som så sådan sådana sådant till under upp ut utan vad var vara varför varit varje vars vart vem vi vid vilka vilkas vilken vilket vår våra vårt än är åt över".split(" ")),e.Pipeline.registerFunction(e.sv.stopWordFilter,"stopWordFilter-sv")}}); !function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.sv=function(){this.pipeline.reset(),this.pipeline.add(e.sv.trimmer,e.sv.stopWordFilter,e.sv.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.sv.stemmer))},e.sv.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA--",e.sv.trimmer=e.trimmerSupport.generateTrimmer(e.sv.wordCharacters),e.Pipeline.registerFunction(e.sv.trimmer,"trimmer-sv"),e.sv.stemmer=function(){var r=e.stemmerSupport.Among,n=e.stemmerSupport.SnowballProgram,t=new function(){var e,t,i=[new r("a",-1,1),new r("arna",0,1),new r("erna",0,1),new r("heterna",2,1),new r("orna",0,1),new r("ad",-1,1),new r("e",-1,1),new r("ade",6,1),new r("ande",6,1),new r("arne",6,1),new r("are",6,1),new r("aste",6,1),new r("en",-1,1),new r("anden",12,1),new r("aren",12,1),new r("heten",12,1),new r("ern",-1,1),new r("ar",-1,1),new r("er",-1,1),new r("heter",18,1),new r("or",-1,1),new r("s",-1,2),new r("as",21,1),new r("arnas",22,1),new r("ernas",22,1),new r("ornas",22,1),new r("es",21,1),new r("ades",26,1),new r("andes",26,1),new r("ens",21,1),new r("arens",29,1),new r("hetens",29,1),new r("erns",21,1),new r("at",-1,1),new r("andet",-1,1),new r("het",-1,1),new r("ast",-1,1)],s=[new r("dd",-1,-1),new r("gd",-1,-1),new r("nn",-1,-1),new r("dt",-1,-1),new r("gt",-1,-1),new r("kt",-1,-1),new r("tt",-1,-1)],a=[new r("ig",-1,1),new r("lig",0,1),new r("els",-1,1),new r("fullt",-1,3),new r("löst",-1,2)],o=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,24,0,32],u=[119,127,149],c=new n;this.setCurrent=function(e){c.setCurrent(e)},this.getCurrent=function(){return c.getCurrent()},this.stem=function(){var r=c.cursor;return function(){var r,n=c.cursor+3;if(t=c.limit,0<=n||n<=c.limit){for(e=n;;){if(r=c.cursor,c.in_grouping(o,97,246)){c.cursor=r;break}if(c.cursor=r,c.cursor>=c.limit)return;c.cursor++}for(;!c.out_grouping(o,97,246);){if(c.cursor>=c.limit)return;c.cursor++}(t=c.cursor)<e&&(t=e)}}(),c.limit_backward=r,c.cursor=c.limit,function(){var e,r=c.limit_backward;if(c.cursor>=t&&(c.limit_backward=t,c.cursor=c.limit,c.ket=c.cursor,e=c.find_among_b(i,37),c.limit_backward=r,e))switch(c.bra=c.cursor,e){case 1:c.slice_del();break;case 2:c.in_grouping_b(u,98,121)&&c.slice_del()}}(),c.cursor=c.limit,function(){var e=c.limit_backward;c.cursor>=t&&(c.limit_backward=t,c.cursor=c.limit,c.find_among_b(s,7)&&(c.cursor=c.limit,c.ket=c.cursor,c.cursor>c.limit_backward&&(c.bra=--c.cursor,c.slice_del())),c.limit_backward=e)}(),c.cursor=c.limit,function(){var e,r;if(c.cursor>=t){if(r=c.limit_backward,c.limit_backward=t,c.cursor=c.limit,c.ket=c.cursor,e=c.find_among_b(a,5))switch(c.bra=c.cursor,e){case 1:c.slice_del();break;case 2:c.slice_from("lös");break;case 3:c.slice_from("full")}c.limit_backward=r}}(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return t.setCurrent(e),t.stem(),t.getCurrent()}):(t.setCurrent(e),t.stem(),t.getCurrent())}}(),e.Pipeline.registerFunction(e.sv.stemmer,"stemmer-sv"),e.sv.stopWordFilter=e.generateStopWordFilter("alla allt att av blev bli blir blivit de dem den denna deras dess dessa det detta dig din dina ditt du där då efter ej eller en er era ert ett från för ha hade han hans har henne hennes hon honom hur här i icke ingen inom inte jag ju kan kunde man med mellan men mig min mina mitt mot mycket ni nu när någon något några och om oss på samma sedan sig sin sina sitta själv skulle som så sådan sådana sådant till under upp ut utan vad var vara varför varit varje vars vart vem vi vid vilka vilkas vilken vilket vår våra vårt än är åt över".split(" ")),e.Pipeline.registerFunction(e.sv.stopWordFilter,"stopWordFilter-sv")}});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -46,13 +46,13 @@
{% endif %} {% endif %}
{% endblock %} {% endblock %}
{% block styles %} {% block styles %}
<link rel="stylesheet" href="{{ base_url }}/assets/stylesheets/application-3368aa6b74.css"> <link rel="stylesheet" href="{{ base_url }}/assets/stylesheets/application.1411ec6b.css">
{% if palette.primary or palette.accent %} {% if palette.primary or palette.accent %}
<link rel="stylesheet" href="{{ base_url }}/assets/stylesheets/application-95ad5566f9.palette.css"> <link rel="stylesheet" href="{{ base_url }}/assets/stylesheets/application-palette.d142ea54.css">
{% endif %} {% endif %}
{% endblock %} {% endblock %}
{% block libs %} {% block libs %}
<script src="{{ base_url }}/assets/javascripts/modernizr-e826f8942a.js"></script> <script src="{{ base_url }}/assets/javascripts/modernizr.f383bccf.js"></script>
{% endblock %} {% endblock %}
{% block fonts %} {% block fonts %}
{% if font != false %} {% if font != false %}
@ -86,11 +86,11 @@
<defs> <defs>
{% set platform = config.extra.repo_icon or config.repo_url %} {% set platform = config.extra.repo_icon or config.repo_url %}
{% if "github" in platform %} {% if "github" in platform %}
{% include "assets/images/icons/github-1da075986e.svg" %} {% include "assets/images/icons/github.a4034fb1.svg" %}
{% elif "gitlab" in platform %} {% elif "gitlab" in platform %}
{% include "assets/images/icons/gitlab-5ad3f9f9e5.svg" %} {% include "assets/images/icons/gitlab.d80e5efc.svg" %}
{% elif "bitbucket" in platform %} {% elif "bitbucket" in platform %}
{% include "assets/images/icons/bitbucket-670608a71a.svg" %} {% include "assets/images/icons/bitbucket.4ebea66e.svg" %}
{% endif %} {% endif %}
</defs> </defs>
</svg> </svg>
@ -162,7 +162,7 @@
{% endblock %} {% endblock %}
</div> </div>
{% block scripts %} {% block scripts %}
<script src="{{ base_url }}/assets/javascripts/application-a5397a53ce.js"></script> <script src="{{ base_url }}/assets/javascripts/application.f0a10a07.js"></script>
{% if lang.t("search.language") != "en" %} {% if lang.t("search.language") != "en" %}
{% set languages = lang.t("search.language").split(",") %} {% set languages = lang.t("search.language").split(",") %}
{% if languages | length and languages[0] != "" %} {% if languages | length and languages[0] != "" %}
@ -188,7 +188,7 @@
{% endblock %} {% endblock %}
{% block analytics %} {% block analytics %}
{% if config.google_analytics %} {% if config.google_analytics %}
<script>!function(e,t,a,n,o,c,i){e.GoogleAnalyticsObject=o,e[o]=e[o]||function(){(e[o].q=e[o].q||[]).push(arguments)},e[o].l=1*new Date,c=t.createElement(a),i=t.getElementsByTagName(a)[0],c.async=1,c.src=n,i.parentNode.insertBefore(c,i)}(window,document,"script","https://www.google-analytics.com/analytics.js","ga"),ga("create","{{ config.google_analytics[0] }}","{{ config.google_analytics[1] }}"),ga("set","anonymizeIp",!0),ga("send","pageview");var links=document.getElementsByTagName("a");Array.prototype.map.call(links,function(e){e.host!=document.location.host&&e.addEventListener("click",function(){var t=e.getAttribute("data-md-action")||"follow";ga("send","event","outbound",t,e.href)})});var query=document.forms.search.query;query.addEventListener("blur",function(){if(this.value){var e=document.location.pathname;ga("send","pageview",e+"?q="+this.value)}})</script> <script>!function(e,a,t,n,o,c,i){e.GoogleAnalyticsObject=o,e.ga=e.ga||function(){(e.ga.q=e.ga.q||[]).push(arguments)},e.ga.l=1*new Date,c=a.createElement(t),i=a.getElementsByTagName(t)[0],c.async=1,c.src="https://www.google-analytics.com/analytics.js",i.parentNode.insertBefore(c,i)}(window,document,"script",0,"ga"),ga("create","{{ config.google_analytics[0] }}","{{ config.google_analytics[1] }}"),ga("set","anonymizeIp",!0),ga("send","pageview");var links=document.getElementsByTagName("a");Array.prototype.map.call(links,function(e){e.host!=document.location.host&&e.addEventListener("click",function(){var a=e.getAttribute("data-md-action")||"follow";ga("send","event","outbound",a,e.href)})});var query=document.forms.search.query;query.addEventListener("blur",function(){if(this.value){var e=document.location.pathname;ga("send","pageview",e+"?q="+this.value)}})</script>
{% endif %} {% endif %}
{% endblock %} {% endblock %}
</body> </body>

View File

@ -1,12 +1,15 @@
# Copyright (c) 2016-2017 Martin Donath <martin.donath @squidfunk.com> # Copyright (c) 2016-2017 Martin Donath <martin.donath@squidfunk.com>
# Permission is hereby granted, free of charge, to any person obtaining a copy # Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to # of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the # deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # 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 # sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions: # furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in # The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software. # all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE # FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
@ -14,40 +17,54 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # 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 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE. # IN THE SOFTWARE.
# Language for theme localization # Language for theme localization
language: en language: en
# Feature flags for functionality that alters behavior significantly, and thus # Feature flags for functionality that alters behavior significantly, and thus
# may be a matter of taste # may be a matter of taste
feature: feature:
# Another layer on top of the main navigation for larger screens in the form # Another layer on top of the main navigation for larger screens in the form
# of tabs, especially useful for larger documentation projects # of tabs, especially useful for larger documentation projects
tabs: false tabs: false
# Sets the primary and accent color palettes as defined in the Material Design # Sets the primary and accent color palettes as defined in the Material Design
# documentation - possible values can be looked up in the getting started guide # documentation - possible values can be looked up in the getting started guide
palette: palette:
# Primary color used for header, sidebar and links, default: indigo # Primary color used for header, sidebar and links, default: indigo
primary: primary:
# Accent color for highlighting user interaction, default: indigo # Accent color for highlighting user interaction, default: indigo
accent: accent:
# Fonts used by Material, automatically loaded from Google Fonts - see the site # Fonts used by Material, automatically loaded from Google Fonts - see the site
# for a list of available fonts # for a list of available fonts
font: font:
# Default font for text # Default font for text
text: Roboto text: Roboto
# Fixed-width font for code listings # Fixed-width font for code listings
code: Roboto Mono code: Roboto Mono
# Favicon to be rendered # Favicon to be rendered
favicon: assets/images/favicon.png favicon: assets/images/favicon.png
# The logo of the documentation shown in the header and navigation can either # The logo of the documentation shown in the header and navigation can either
# be a Material Icon ligature or an image URL # be a Material Icon ligature or an image URL
logo: logo:
icon: "\uE80C" icon: "\uE80C"
# Material includes the search in the header as a partial, not as a separate # Material includes the search in the header as a partial, not as a separate
# template, so it's correct that search.html is missing # template, so it's correct that search.html is missing
include_search_page: false include_search_page: false
# Material doesn't use MkDocs search functionality but provides its own. For # Material doesn't use MkDocs search functionality but provides its own. For
# this reason, only the search index needs to be built # this reason, only the search index needs to be built
search_index_only: true search_index_only: true
# Static pages to build # Static pages to build
static_templates: static_templates:
- 404.html - 404.html

0
material/partials/language/pl.html Executable file → Normal file
View File

View File

@ -23,80 +23,62 @@
"url": "https://github.com/squidfunk/mkdocs-material.git" "url": "https://github.com/squidfunk/mkdocs-material.git"
}, },
"scripts": { "scripts": {
"build": "scripts/build", "build": "make clean build",
"clean": "scripts/clean", "clean": "make clean",
"flow": "scripts/flow", "lint": "make lint",
"help": "scripts/help", "start": "make -j watch",
"lint": "scripts/lint", "watch": "make -j watch"
"start": "scripts/start",
"travis": "scripts/travis"
}, },
"dependencies": {}, "dependencies": {},
"devDependencies": { "devDependencies": {
"autoprefixer": "^7.1.2", "autoprefixer": "^7.1.2",
"babel-cli": "^6.26.0",
"babel-core": "^6.25.0", "babel-core": "^6.25.0",
"babel-eslint": "^8.0.0", "babel-eslint": "^8.0.0",
"babel-loader": "^7.1.1", "babel-loader": "^7.1.1",
"babel-plugin-add-module-exports": "^0.2.1", "babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-root-import": "^5.1.0",
"babel-plugin-transform-react-jsx": "^6.24.1", "babel-plugin-transform-react-jsx": "^6.24.1",
"babel-polyfill": "^6.23.0", "babel-preset-env": "^1.6.1",
"babel-preset-es2015": "^6.24.1",
"babel-register": "^6.24.1",
"chalk": "^2.0.1", "chalk": "^2.0.1",
"clipboard": "^1.7.1", "clipboard": "^1.7.1",
"core-js": "^2.4.1", "copy-webpack-plugin": "^4.2.1",
"css-loader": "^0.28.7",
"css-mqpacker": "^6.0.1", "css-mqpacker": "^6.0.1",
"custom-event-polyfill": "^0.3.0", "custom-event-polyfill": "^0.3.0",
"del": "^3.0.0", "customizr": "^1.0.0-alpha",
"escape-string-regexp": "^1.0.5", "escape-string-regexp": "^1.0.5",
"eslint": "^4.3.0", "eslint": "^4.3.0",
"event-hooks-webpack-plugin": "^1.0.0",
"expose-loader": "^0.7.3", "expose-loader": "^0.7.3",
"extract-text-webpack-plugin": "^3.0.2",
"fastclick": "^1.0.6", "fastclick": "^1.0.6",
"flow-bin": "^0.59.0", "file-loader": "^1.1.5",
"flow-jsdoc": "^0.3.0",
"git-hooks": "^1.1.8", "git-hooks": "^1.1.8",
"gulp": "^3.9.1", "html-minifier": "^3.5.6",
"gulp-changed": "^3.1.0", "imagemin-webpack-plugin": "^1.5.2",
"gulp-concat": "^2.6.1",
"gulp-cssnano": "^2.1.2",
"gulp-htmlmin": "^3.0.0",
"gulp-if": "^2.0.2",
"gulp-ignore": "^2.0.2",
"gulp-modernizr": "1.0.0-alpha",
"gulp-plumber": "^1.1.0",
"gulp-postcss": "^7.0.0",
"gulp-remove-empty-lines": "0.1.0",
"gulp-replace": "^0.6.1",
"gulp-rev": "^8.0.0",
"gulp-rev-replace": "^0.4.3",
"gulp-sass": "^3.1.0",
"gulp-sourcemaps": "^2.6.0",
"gulp-stylelint": "^5.0.0",
"gulp-svgmin": "^1.2.4",
"gulp-uglify": "^3.0.0",
"gulp-util": "^3.0.8",
"js-cookie": "^2.1.4", "js-cookie": "^2.1.4",
"lunr": "^2.1.2", "lunr": "^2.1.2",
"lunr-languages": "^1.0.0", "lunr-languages": "^1.0.0",
"material-design-color": "2.3.2", "material-design-color": "^2.3.2",
"material-shadows": "3.0.1", "material-shadows": "^3.0.1",
"modularscale-sass": "3.0.3", "modernizr-auto-loader": "^0.1.0",
"node-notifier": "^5.1.2", "modularscale-sass": "^3.0.3",
"postcss-pseudo-classes": "^0.2.0", "node-sass": "^4.7.2",
"postcss-loader": "^2.0.8",
"promise-polyfill": "^6.0.2",
"sass-loader": "^6.0.6",
"style-loader": "^0.19.0",
"stylelint": "^8.0.0", "stylelint": "^8.0.0",
"stylelint-config-standard": "^17.0.0", "stylelint-config-standard": "^17.0.0",
"stylelint-order": "^0.7.0", "stylelint-order": "^0.7.0",
"stylelint-scss": "^2.0.0", "stylelint-scss": "^2.0.0",
"through2": "^2.0.3", "uglify-js": "^3.1.10",
"vinyl-paths": "^2.1.0", "unfetch": "^3.0.0",
"webpack": "^3.4.1", "webpack": "^3.4.1",
"webpack-stream": "^4.0.0", "webpack-manifest-plugin": "^1.3.2"
"whatwg-fetch": "^2.0.3",
"yargs": "^10.0.3"
}, },
"engines": { "engines": {
"node": ">= 5.0.0" "node": ">= 8"
}, },
"private": true "private": true
} }

View File

@ -1,31 +0,0 @@
#!/bin/bash
# Copyright (c) 2016-2017 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.
# Check if "yarn install" was executed
if [[ ! -d "$(yarn bin)" ]]; then
echo "\"node_modules\" not found:"
echo "yarn install"
exit 1
fi
# Run command
"$(yarn bin)"/gulp build --clean --optimize --revision "$@"

View File

@ -1,31 +0,0 @@
#!/bin/bash
# Copyright (c) 2016-2017 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.
# Check if "yarn install" was executed
if [[ ! -d "$(yarn bin)" ]]; then
echo "\"node_modules\" not found:"
echo "yarn install"
exit 1
fi
# Run command
"$(yarn bin)"/gulp clean "$@"

View File

@ -1,44 +0,0 @@
#!/bin/bash
# Copyright (c) 2016-2017 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.
# Check if "yarn install" was executed
if [[ ! -d "$(yarn bin)" ]]; then
echo "\"node_modules\" not found:"
echo "yarn install"
exit 1
fi
# Annotate source files
"$(yarn bin)"/gulp assets:javascripts:annotate "$@"
FLOW_JSDOC=$?
# Run flow typecheck
"$(yarn bin)"/flow check tmp --strip-root
FLOW=$?
# If one command failed, exit with error
if [ $FLOW_JSDOC -gt 0 ] || [ $FLOW -gt 0 ]; then
exit 1
fi;
# Otherwise return with success
exit 0

View File

@ -1,31 +0,0 @@
#!/bin/bash
# Copyright (c) 2016-2017 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.
# Check if "yarn install" was executed
if [[ ! -d "$(yarn bin)" ]]; then
echo "\"node_modules\" not found:"
echo "yarn install"
exit 1
fi
# Run command
"$(yarn bin)"/gulp help "@"

View File

@ -1,44 +0,0 @@
#!/bin/bash
# Copyright (c) 2016-2017 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.
# Check if "yarn install" was executed
if [[ ! -d "$(yarn bin)" ]]; then
echo "\"node_modules\" not found:"
echo "yarn install"
exit 1
fi
# Run ESLint
"$(yarn bin)"/eslint --max-warnings 0 .
ESLINT=$?
# Run Stylelint
"$(yarn bin)"/stylelint `find src/assets -name *.scss`
STYLELINT=$?
# If one command failed, exit with error
if [ $ESLINT -gt 0 ] || [ $STYLELINT -gt 0 ]; then
exit 1
fi;
# Otherwise return with success
exit 0

View File

@ -1,32 +0,0 @@
#!/bin/bash
# Copyright (c) 2016-2017 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.
# Check if "yarn install" was executed
if [[ ! -d "$(yarn bin)" ]]; then
echo "\"node_modules\" not found:"
echo "yarn install"
exit 1
fi
# Run command
"$(yarn bin)"/gulp clean && \
"$(yarn bin)"/gulp watch --no-lint "$@"

View File

@ -1,10 +0,0 @@
{
"presets": [
["es2015", { "modules": false }]
],
"plugins": [
["transform-react-jsx", {
"pragma": "Jsx.createElement"
}]
]
}

View File

@ -20,6 +20,27 @@
* IN THE SOFTWARE. * IN THE SOFTWARE.
*/ */
import "../images/icons/bitbucket.svg"
import "../images/icons/github.svg"
import "../images/icons/gitlab.svg"
import "../stylesheets/application.scss"
import "../stylesheets/application-palette.scss"
/* ----------------------------------------------------------------------------
* Polyfills
* ------------------------------------------------------------------------- */
import "custom-event-polyfill"
import "unfetch/polyfill"
import Promise from "promise-polyfill"
window.Promise = window.Promise || Promise
/* ----------------------------------------------------------------------------
* Dependencies
* ------------------------------------------------------------------------- */
import Clipboard from "clipboard" import Clipboard from "clipboard"
import FastClick from "fastclick" import FastClick from "fastclick"
@ -33,11 +54,10 @@ import Material from "./components/Material"
* Return the meta tag value for the given key * Return the meta tag value for the given key
* *
* @param {string} key - Meta name * @param {string} key - Meta name
* @param {string} [_] - Stop Flow complaining (TODO)
* *
* @return {string} Meta content value * @return {string} Meta content value
*/ */
const translate = (key, _) => { // eslint-disable-line no-unused-vars const translate = key => {
const meta = document.getElementsByName(`lang:${key}`)[0] const meta = document.getElementsByName(`lang:${key}`)[0]
if (!(meta instanceof HTMLMetaElement)) if (!(meta instanceof HTMLMetaElement))
throw new ReferenceError throw new ReferenceError
@ -455,6 +475,11 @@ function initialize(config) { // eslint-disable-line func-style
* Exports * Exports
* ------------------------------------------------------------------------- */ * ------------------------------------------------------------------------- */
export { /* Provide this for downward compatibility for now */
const app = {
initialize initialize
} }
export {
app
}

View File

@ -21,7 +21,7 @@
*/ */
import escape from "escape-string-regexp" import escape from "escape-string-regexp"
import lunr from "expose-loader?lunr!lunr" import lunr from "lunr" // expose-loader?lunr!lunr"
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
* Functions * Functions
@ -51,11 +51,10 @@ const truncate = (string, n) => {
* Return the meta tag value for the given key * Return the meta tag value for the given key
* *
* @param {string} key - Meta name * @param {string} key - Meta name
* @param {string} [_] - Stop Flow complaining (TODO)
* *
* @return {string} Meta content value * @return {string} Meta content value
*/ */
const translate = (key, _) => { // eslint-disable-line no-unused-vars const translate = key => {
const meta = document.getElementsByName(`lang:${key}`)[0] const meta = document.getElementsByName(`lang:${key}`)[0]
if (!(meta instanceof HTMLMetaElement)) if (!(meta instanceof HTMLMetaElement))
throw new ReferenceError throw new ReferenceError

View File

@ -20,10 +20,4 @@
* IN THE SOFTWARE. * IN THE SOFTWARE.
*/ */
/* ---------------------------------------------------------------------------- import "../../../.modernizr-autorc"
* Declarations
* ------------------------------------------------------------------------- */
declare module "escape-string-regexp" {
declare function exports(value: string): string
}

View File

@ -0,0 +1,16 @@
{
"presets": [
["env", {
"loose": true,
"target": {
"browsers": [
"> 1%",
"last 2 versions"
]
}
}]
],
"plugins": [
"add-module-exports"
]
}

View File

@ -56,7 +56,7 @@
&[data-md-state="shadow"] { &[data-md-state="shadow"] {
transition: transition:
background-color 0.25s, background-color 0.25s,
color 0.25, color 0.25s,
box-shadow 0.25s; box-shadow 0.25s;
box-shadow: box-shadow:
0 0 0.4rem rgba(0, 0, 0, 0.1), 0 0 0.4rem rgba(0, 0, 0, 0.1),
@ -139,7 +139,7 @@
// Page title // Page title
& + & { & + & {
transform: translateX(4rem); transform: translateX(2.5rem);
transition: transition:
transform 0.4s cubic-bezier(1, 0.7, 0.1, 0.1), transform 0.4s cubic-bezier(1, 0.7, 0.1, 0.1),
opacity 0.15s; opacity 0.15s;
@ -162,7 +162,7 @@
// Show page title // Show page title
&[data-md-state="active"] .md-header-nav__topic { &[data-md-state="active"] .md-header-nav__topic {
transform: translateX(-4rem); transform: translateX(-2.5rem);
transition: transition:
transform 0.4s cubic-bezier(1, 0.7, 0.1, 0.1), transform 0.4s cubic-bezier(1, 0.7, 0.1, 0.1),
opacity 0.15s; opacity 0.15s;

View File

@ -147,13 +147,4 @@ $md-toggle__drawer--checked:
} }
} }
} }
// Sidebar content
&__inner {
// [screen +]: Add line for reference
@include break-from-device(screen) {
border-right: 0.1rem solid $md-color-black--lightest;
}
}
} }

View File

@ -102,7 +102,7 @@
<!-- Extra color palette --> <!-- Extra color palette -->
{% if palette.primary or palette.accent %} {% if palette.primary or palette.accent %}
<link rel="stylesheet" type="text/css" <link rel="stylesheet" type="text/css"
href="{{ base_url }}/assets/stylesheets/application.palette.css" /> href="{{ base_url }}/assets/stylesheets/application-palette.css" />
{% endif %} {% endif %}
{% endblock %} {% endblock %}

View File

@ -1,3 +1,26 @@
<!--
Copyright (c) 2016-2017 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.
-->
<!-- Translations: Chinese (Traditional) -->
{% macro t(key) %}{{ { {% macro t(key) %}{{ {
"language": "zh-Hant", "language": "zh-Hant",
"clipboard.copy": "拷貝", "clipboard.copy": "拷貝",

View File

@ -1,3 +1,26 @@
<!--
Copyright (c) 2016-2017 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.
-->
<!-- Translations: Chinese (Simplified) -->
{% macro t(key) %}{{ { {% macro t(key) %}{{ {
"language": "zh", "language": "zh",
"clipboard.copy": "复制", "clipboard.copy": "复制",

305
webpack.config.js Normal file
View File

@ -0,0 +1,305 @@
/*
* Copyright (c) 2016-2017 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.
*/
const fs = require("fs")
const path = require("path")
const html = require("html-minifier")
const uglify = require("uglify-js")
const webpack = require("webpack")
/* ----------------------------------------------------------------------------
* Plugins
* ------------------------------------------------------------------------- */
const CopyPlugin = require("copy-webpack-plugin")
const EventHooksPlugin = require("event-hooks-webpack-plugin")
const ExtractTextPlugin = require("extract-text-webpack-plugin")
const ImageminPlugin = require("imagemin-webpack-plugin").default
const ManifestPlugin = require("webpack-manifest-plugin")
/* ----------------------------------------------------------------------------
* Configuration
* ------------------------------------------------------------------------- */
module.exports = env => {
const config = {
/* Entrypoints */
entry: {
/* Custom Modernizr build */
"assets/javascripts/modernizr": path.resolve(
__dirname, "src/assets/javascripts/modernizr.js"
),
/* Application */
"assets/javascripts/application": path.resolve(
__dirname, "src/assets/javascripts/application.js"
)
},
/* Loaders */
module: {
rules: [
/* Babel ES6 transformations */
{
test: /\.jsx?$/,
use: "babel-loader",
exclude: /\/node_modules\//
},
/* Custom Modernizr build */
{
test: /\.modernizr-autorc$/,
use: "modernizr-auto-loader"
},
/* Cache busting for SVGs */
{
test: /\.svg$/,
use: `file-loader?name=[path][name]${
env && env.prod ? ".[md5:hash:hex:8]" : ""
}.[ext]&context=./src`
}
]
},
/* Output */
output: {
path: path.resolve(__dirname, "material"),
filename: `[name]${env && env.prod ? ".[chunkhash]" : ""}.js`,
hashDigestLength: 8,
libraryTarget: "window"
},
/* Plugins */
plugins: [
/* Combine all dependencies into a single file */
new webpack.optimize.CommonsChunkPlugin({
name: "src/assets/javascripts/modernizr.js",
chunks: [".modernizr-autorc"]
}),
/* Provide JSX helper */
new webpack.ProvidePlugin({
JSX: path.resolve(__dirname, "src/assets/javascripts/providers/jsx.js")
}),
/* Copy and transform static assets */
new CopyPlugin([
/* Copy search language support files - we could define the languages
package as entrypoints, but this leads to a lot of problems because
the files have the structure lunr.[language].js, which some Webpack
plugins will complain about. For this reason we only minify */
{
context: path.resolve(__dirname, "node_modules/lunr-languages"),
to: "assets/javascripts/lunr",
from: "*.js",
transform: content => {
return uglify.minify(content.toString()).code
}
},
/* Copy images without cache busting */
{
context: "src",
from: "assets/images/*.{ico,png}"
},
/* Copy configuration */
{
context: "src",
from: "**/*.{py,yml}"
},
/* Copy and minify HTML */
{
context: "src",
from: "**/*.html",
transform: content => {
const metadata = require(path.resolve(__dirname, "package.json"))
return html.minify(content.toString(), {
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)
}
}
]),
/* Hack: The webpack development middleware sometimes goes into a loop on
macOS when starting for the first time. This is a quick fix until
this issue is resolved. See: http://bit.ly/2AsizEn */
new EventHooksPlugin({
"watch-run": (compiler, cb) => {
compiler.startTime += 10000
cb()
},
"done": stats => {
stats.startTime -= 10000
}
})
],
/* Module resolver */
resolve: {
modules: [
path.resolve(__dirname, "node_modules")
],
extensions: [".js", ".jsx", ".scss"],
alias: {
modernizr$: path.resolve(__dirname, ".modernizr-autorc")
}
},
/* Sourcemaps */
devtool: !env || env.prod ? "inline-source-map" : ""
}
/* Compile stylesheets */
for (const stylesheet of [
"application.scss",
"application-palette.scss"
]) {
const plugin = new ExtractTextPlugin(
`assets/stylesheets/${
stylesheet.replace(".scss",
env && env.prod ? ".[md5:contenthash:hex:8]" : ""
)}.css`)
/* Register plugin */
config.plugins.push(plugin)
config.module.rules.push({
test: new RegExp(`${stylesheet}$`),
use: plugin.extract({
use: [
{
loader: "css-loader",
options: {
minimize: env && env.prod
}
},
{
loader: "postcss-loader",
options: {
ident: "postcss",
plugins: () => [
require("autoprefixer")(),
require("css-mqpacker")
]
}
},
{
loader: "sass-loader",
options: {
includePaths: [
"node_modules/modularscale-sass/stylesheets",
"node_modules/material-design-color",
"node_modules/material-shadows"
]
}
}
]
})
})
}
/* Production compilation */
if (env && env.prod) {
config.plugins.push(
/* Uglify sources */
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false,
screw_ie8: true, // eslint-disable-line camelcase
conditionals: true,
unused: true,
comparisons: true,
sequences: true,
dead_code: true, // eslint-disable-line camelcase
evaluate: true,
if_return: true, // eslint-disable-line camelcase
join_vars: true // eslint-disable-line camelcase
},
output: {
comments: false
}
}),
/* Minify images */
new ImageminPlugin({
test: /\.(ico|png|svg)$/i,
svgo: {
plugins: [
{ cleanupIDs: false }
]
}
}),
/* Write manifest */
new ManifestPlugin({
/* This is an ugly workaround for the fact that the manifest plugin
doesn't handle multiple chunks. See http://bit.ly/2BbfER9 */
map(file) {
file.name = file.path.replace(/\.[a-z0-9].+\.(css|js|svg)/i, ".$1")
return file
}
}),
/* Apply manifest */
new EventHooksPlugin({
"after-emit": (compilation, cb) => {
const manifest = require(path.resolve("material/manifest.json"))
Object.keys(compilation.assets).forEach(name => {
if (name.match(/\.html/)) {
const asset = compilation.assets[name]
const replaced = Object.keys(manifest).reduce((source, key) => {
return source.replace(key, manifest[key])
}, asset.source())
fs.writeFileSync(asset.existsAt, replaced)
}
})
cb()
}
})
)
}
/* Oh my god, that was a hell of a setup */
return config
}

5979
yarn.lock

File diff suppressed because it is too large Load Diff