├── .gitignore ├── app ├── css │ ├── variables.styl │ ├── 404.styl │ ├── deprecation.styl │ ├── style.styl │ ├── tutorial.styl │ ├── anchor.styl │ ├── doc.styl │ ├── code.styl │ ├── contents.styl │ ├── logo.styl │ ├── landing.styl │ ├── sidebar.styl │ ├── reset.styl │ ├── mixins.styl │ └── general.styl ├── tutorial.js ├── landing.js ├── doc.js ├── docsearch.js ├── downloadWiki.js ├── disqus.js ├── googleAnalytics.js ├── FullTextSearcher.js ├── onContentLoaded.js ├── 404.js └── bindToIntraLinks.js ├── tutorials ├── getting-started │ ├── 1.3 second-file │ │ ├── .tutorialignore │ │ ├── entry.js │ │ ├── content.js │ │ ├── webpack.config.js │ │ └── README.md │ ├── 1.4 first-loader │ │ ├── .tutorialignore │ │ ├── style.css │ │ ├── entry.js │ │ ├── webpack.config.js │ │ └── README.md │ ├── 1.5 binding-loaders │ │ ├── .tutorialignore │ │ ├── entry.js │ │ ├── webpack.config.js │ │ └── README.md │ ├── 1.2 setup-compilation │ │ ├── .tutorialignore │ │ ├── entry.js │ │ ├── webpack.config.js │ │ ├── index.html │ │ └── README.md │ ├── 1.1 installing-webpack │ │ └── README.md │ ├── 1.0 welcome │ │ └── README.md │ ├── 1.6 config-file │ │ ├── webpack.config.js │ │ └── README.md │ ├── 1.8 watch-mode │ │ ├── webpack.config.js │ │ └── README.md │ ├── 1.7 pretty-output │ │ └── README.md │ └── 1.9 development-server │ │ └── README.md └── migrate-to-webpack │ ├── 1.5 modules │ ├── .tutorialignore │ ├── userAgentModel.coffee │ ├── userAgentView.coffee │ ├── styles.less.css │ ├── app.coffee │ ├── webpack.config.js │ └── README.md │ ├── 1.8 templates │ ├── .tutorialignore │ ├── userAgentView.jade │ ├── index.html │ ├── userAgentView.coffee │ ├── README.md │ └── webpack.config.js │ ├── 1.7 other-resources │ ├── .tutorialignore │ ├── userAgentView.coffee │ ├── index.html │ ├── webpack.config.js │ └── README.md │ ├── 1.1 normal-app │ ├── .tutorialignore │ ├── styles.less │ ├── styles.less.css │ ├── app.coffee │ ├── app.coffee.js │ ├── README.md │ └── index.html │ ├── 1.6 external-depencencies │ ├── .tutorialignore │ ├── userAgentView.coffee │ ├── styles.less.css │ ├── app.coffee │ ├── index.html │ ├── webpack.config.js │ └── README.md │ ├── 1.4 webpack-config │ ├── .tutorialignore │ ├── styles.less.css │ ├── webpack.config.js │ └── README.md │ ├── 1.2 lets-webpack │ ├── .tutorialignore │ ├── styles.less.css │ ├── webpack.config.js │ ├── app.coffee.js │ ├── index.html │ └── README.md │ ├── 1.3 coffee-script │ ├── .tutorialignore │ ├── styles.less.css │ ├── webpack.config.js │ └── README.md │ └── 1.0 welcome │ └── README.md ├── lib ├── linkToTitle.js ├── titleToLink.js ├── extractRegExpFromText.js ├── highlight.js │ ├── json.js │ ├── javascript.js │ ├── xml.js │ ├── css.js │ ├── coffeescript.js │ ├── package.json │ └── highlight.js ├── diff.js │ ├── diff.js │ └── lcs.js ├── renderMarkdown.js └── fuse.js │ └── Searcher.js ├── layouts ├── logo.html ├── header.html ├── deprecation.html ├── tutorial.html ├── 404.html ├── doc.html └── landing.html ├── README.md ├── webpack.config.js ├── package.json ├── Gruntfile.js └── tasks ├── staticwiki.js └── statictutorial.js /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /.grunt 3 | /dist -------------------------------------------------------------------------------- /app/css/variables.styl: -------------------------------------------------------------------------------- 1 | $font-highlight = 'Coda', sans-serif; -------------------------------------------------------------------------------- /tutorials/getting-started/1.3 second-file/.tutorialignore: -------------------------------------------------------------------------------- 1 | webpack.config.js -------------------------------------------------------------------------------- /tutorials/getting-started/1.4 first-loader/.tutorialignore: -------------------------------------------------------------------------------- 1 | webpack.config.js -------------------------------------------------------------------------------- /tutorials/getting-started/1.5 binding-loaders/.tutorialignore: -------------------------------------------------------------------------------- 1 | webpack.config.js -------------------------------------------------------------------------------- /tutorials/getting-started/1.2 setup-compilation/.tutorialignore: -------------------------------------------------------------------------------- 1 | webpack.config.js -------------------------------------------------------------------------------- /app/tutorial.js: -------------------------------------------------------------------------------- 1 | require("./css/tutorial.styl"); 2 | require("./googleAnalytics"); 3 | -------------------------------------------------------------------------------- /tutorials/getting-started/1.2 setup-compilation/entry.js: -------------------------------------------------------------------------------- 1 | document.write("It works."); -------------------------------------------------------------------------------- /tutorials/getting-started/1.3 second-file/entry.js: -------------------------------------------------------------------------------- 1 | document.write(require("./content.js")); -------------------------------------------------------------------------------- /tutorials/getting-started/1.4 first-loader/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: yellow; 3 | } -------------------------------------------------------------------------------- /tutorials/migrate-to-webpack/1.5 modules/.tutorialignore: -------------------------------------------------------------------------------- 1 | jquery.min.js 2 | styles.less.css -------------------------------------------------------------------------------- /tutorials/getting-started/1.3 second-file/content.js: -------------------------------------------------------------------------------- 1 | module.exports = "It works from content.js."; -------------------------------------------------------------------------------- /tutorials/migrate-to-webpack/1.8 templates/.tutorialignore: -------------------------------------------------------------------------------- 1 | web_modules/jquery.js 2 | styles.less.css -------------------------------------------------------------------------------- /tutorials/migrate-to-webpack/1.7 other-resources/.tutorialignore: -------------------------------------------------------------------------------- 1 | web_modules/jquery.js 2 | styles.less.css -------------------------------------------------------------------------------- /app/landing.js: -------------------------------------------------------------------------------- 1 | require("./css/landing.styl"); 2 | require("./googleAnalytics"); 3 | require("./docsearch"); 4 | -------------------------------------------------------------------------------- /tutorials/migrate-to-webpack/1.1 normal-app/.tutorialignore: -------------------------------------------------------------------------------- 1 | jquery.min.js 2 | styles.less.css 3 | app.coffee.js -------------------------------------------------------------------------------- /tutorials/migrate-to-webpack/1.5 modules/userAgentModel.coffee: -------------------------------------------------------------------------------- 1 | module.exports = window.navigator.userAgent 2 | -------------------------------------------------------------------------------- /tutorials/migrate-to-webpack/1.6 external-depencencies/.tutorialignore: -------------------------------------------------------------------------------- 1 | web_modules/jquery.js 2 | styles.less.css -------------------------------------------------------------------------------- /tutorials/migrate-to-webpack/1.4 webpack-config/.tutorialignore: -------------------------------------------------------------------------------- 1 | jquery.min.js 2 | styles.less.css 3 | app.coffee.js -------------------------------------------------------------------------------- /tutorials/migrate-to-webpack/1.8 templates/userAgentView.jade: -------------------------------------------------------------------------------- 1 | h1 Hello World. 2 | p Your User-Agent is: #{model} 3 | -------------------------------------------------------------------------------- /tutorials/getting-started/1.5 binding-loaders/entry.js: -------------------------------------------------------------------------------- 1 | require("./style.css"); 2 | document.write(require("./content.js")); -------------------------------------------------------------------------------- /tutorials/migrate-to-webpack/1.5 modules/userAgentView.coffee: -------------------------------------------------------------------------------- 1 | exports.render = (model) -> 2 | $("#user-agent").text model 3 | -------------------------------------------------------------------------------- /tutorials/getting-started/1.4 first-loader/entry.js: -------------------------------------------------------------------------------- 1 | require("!style!css!./style.css"); 2 | document.write(require("./content.js")); -------------------------------------------------------------------------------- /tutorials/migrate-to-webpack/1.2 lets-webpack/.tutorialignore: -------------------------------------------------------------------------------- 1 | webpack.config.js 2 | jquery.min.js 3 | styles.less.css 4 | app.coffee.js -------------------------------------------------------------------------------- /tutorials/migrate-to-webpack/1.3 coffee-script/.tutorialignore: -------------------------------------------------------------------------------- 1 | webpack.config.js 2 | jquery.min.js 3 | styles.less.css 4 | app.coffee.js -------------------------------------------------------------------------------- /app/css/404.styl: -------------------------------------------------------------------------------- 1 | @import 'variables.styl' 2 | @import 'mixins.styl'; 3 | @import 'general.styl' 4 | @import 'sidebar.styl'; 5 | @import 'logo.styl'; 6 | -------------------------------------------------------------------------------- /app/css/deprecation.styl: -------------------------------------------------------------------------------- 1 | .deprecation 2 | border 1px solid red 3 | padding 2em 4 | font-size 1.2em 5 | font-weight 400 6 | margin-bottom 1em 7 | -------------------------------------------------------------------------------- /lib/linkToTitle.js: -------------------------------------------------------------------------------- 1 | module.exports = function linkToTitle(link) { 2 | if(!link) return link; 3 | return link.toLowerCase().replace(/[^a-z0-9\.]/g, " "); 4 | } 5 | -------------------------------------------------------------------------------- /lib/titleToLink.js: -------------------------------------------------------------------------------- 1 | module.exports = function titleToLink(title) { 2 | if(!title) return title; 3 | return title.replace(/[ _]/g, "-").toLowerCase(); 4 | } 5 | -------------------------------------------------------------------------------- /tutorials/migrate-to-webpack/1.1 normal-app/styles.less: -------------------------------------------------------------------------------- 1 | body { 2 | background: #eee; 3 | p { 4 | border: 1px solid #333; 5 | border-radius: 3px; 6 | } 7 | } -------------------------------------------------------------------------------- /tutorials/migrate-to-webpack/1.6 external-depencencies/userAgentView.coffee: -------------------------------------------------------------------------------- 1 | $ = require("jquery") 2 | exports.render = (model) -> 3 | $("#user-agent").text model 4 | -------------------------------------------------------------------------------- /tutorials/migrate-to-webpack/1.5 modules/styles.less.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: #eee; 3 | } 4 | body p { 5 | border: 1px solid #333; 6 | border-radius: 3px; 7 | } 8 | -------------------------------------------------------------------------------- /tutorials/migrate-to-webpack/1.1 normal-app/styles.less.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: #eee; 3 | } 4 | body p { 5 | border: 1px solid #333; 6 | border-radius: 3px; 7 | } 8 | -------------------------------------------------------------------------------- /tutorials/migrate-to-webpack/1.2 lets-webpack/styles.less.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: #eee; 3 | } 4 | body p { 5 | border: 1px solid #333; 6 | border-radius: 3px; 7 | } 8 | -------------------------------------------------------------------------------- /tutorials/migrate-to-webpack/1.3 coffee-script/styles.less.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: #eee; 3 | } 4 | body p { 5 | border: 1px solid #333; 6 | border-radius: 3px; 7 | } 8 | -------------------------------------------------------------------------------- /tutorials/migrate-to-webpack/1.5 modules/app.coffee: -------------------------------------------------------------------------------- 1 | $ -> 2 | model = require "./userAgentModel.coffee" 3 | view = require "./userAgentView.coffee" 4 | view.render model 5 | -------------------------------------------------------------------------------- /tutorials/getting-started/1.3 second-file/webpack.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | entry: "./entry.js", 3 | output: { 4 | path: __dirname, 5 | filename: "bundle.js" 6 | } 7 | }; -------------------------------------------------------------------------------- /tutorials/migrate-to-webpack/1.4 webpack-config/styles.less.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: #eee; 3 | } 4 | body p { 5 | border: 1px solid #333; 6 | border-radius: 3px; 7 | } 8 | -------------------------------------------------------------------------------- /tutorials/getting-started/1.4 first-loader/webpack.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | entry: "./entry.js", 3 | output: { 4 | path: __dirname, 5 | filename: "bundle.js" 6 | } 7 | }; -------------------------------------------------------------------------------- /tutorials/migrate-to-webpack/1.6 external-depencencies/styles.less.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: #eee; 3 | } 4 | body p { 5 | border: 1px solid #333; 6 | border-radius: 3px; 7 | } 8 | -------------------------------------------------------------------------------- /tutorials/getting-started/1.2 setup-compilation/webpack.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | entry: "./entry.js", 3 | output: { 4 | path: __dirname, 5 | filename: "bundle.js" 6 | } 7 | }; -------------------------------------------------------------------------------- /tutorials/migrate-to-webpack/1.2 lets-webpack/webpack.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | entry: "./app.coffee.js", 3 | output: { 4 | path: __dirname, 5 | filename: "bundle.js" 6 | } 7 | }; -------------------------------------------------------------------------------- /tutorials/migrate-to-webpack/1.7 other-resources/userAgentView.coffee: -------------------------------------------------------------------------------- 1 | require "./styles.less" 2 | $ = require("jquery") 3 | exports.render = (model) -> 4 | $("#user-agent").text model 5 | -------------------------------------------------------------------------------- /tutorials/migrate-to-webpack/1.6 external-depencencies/app.coffee: -------------------------------------------------------------------------------- 1 | $ = require("jquery") 2 | $ -> 3 | model = require "./userAgentModel.coffee" 4 | view = require "./userAgentView.coffee" 5 | view.render model 6 | -------------------------------------------------------------------------------- /app/doc.js: -------------------------------------------------------------------------------- 1 | require("./css/doc.styl"); 2 | require("./googleAnalytics"); 3 | require("./disqus"); 4 | require("./docsearch"); 5 | 6 | require("./onContentLoaded")(function(event) { 7 | require("./bindToIntraLinks"); 8 | }); 9 | -------------------------------------------------------------------------------- /tutorials/migrate-to-webpack/1.8 templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/css/style.styl: -------------------------------------------------------------------------------- 1 | @import 'variables.styl' 2 | @import 'mixins.styl'; 3 | @import 'general.styl' 4 | @import 'sidebar.styl'; 5 | @import 'logo.styl'; 6 | @import 'contents.styl'; 7 | @import 'code.styl'; 8 | @import 'anchor.styl'; 9 | -------------------------------------------------------------------------------- /tutorials/getting-started/1.2 setup-compilation/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /tutorials/migrate-to-webpack/1.8 templates/userAgentView.coffee: -------------------------------------------------------------------------------- 1 | require "./styles.less" 2 | $ = require("jquery") 3 | template = require "./userAgentView.jade" 4 | exports.render = (model) -> 5 | $("body").html template 6 | model: model 7 | -------------------------------------------------------------------------------- /tutorials/migrate-to-webpack/1.0 welcome/README.md: -------------------------------------------------------------------------------- 1 | # Welcome 2 | 3 | In this small tutorial we will migrate a very simple web app to a webpack-built app. 4 | 5 | You'll learn: 6 | 7 | * How to 8 | 9 | Click on the next button to continue with the next step. -------------------------------------------------------------------------------- /tutorials/getting-started/1.1 installing-webpack/README.md: -------------------------------------------------------------------------------- 1 | # Installing webpack 2 | 3 | You need to have [node.js](https://nodejs.org) installed. 4 | 5 | ``` sh 6 | $ npm install webpack -g 7 | ``` 8 | 9 | > This makes the webpack command available. 10 | -------------------------------------------------------------------------------- /tutorials/migrate-to-webpack/1.1 normal-app/app.coffee: -------------------------------------------------------------------------------- 1 | $ -> 2 | # Model: 3 | userAgent = window.navigator.userAgent 4 | 5 | # View: 6 | view = 7 | render: (ua) -> 8 | $("#user-agent").text ua 9 | 10 | # Controller (render the model): 11 | view.render userAgent 12 | -------------------------------------------------------------------------------- /tutorials/getting-started/1.0 welcome/README.md: -------------------------------------------------------------------------------- 1 | # Welcome 2 | 3 | This small tutorial will guide you through a simple example. 4 | 5 | You'll learn: 6 | 7 | * How to install webpack 8 | * How to use webpack 9 | * How to use loaders 10 | * How to use the development server 11 | -------------------------------------------------------------------------------- /tutorials/getting-started/1.6 config-file/webpack.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | entry: "./entry.js", 3 | output: { 4 | path: __dirname, 5 | filename: "bundle.js" 6 | }, 7 | module: { 8 | loaders: [ 9 | { test: /\.css$/, loader: "style!css" } 10 | ] 11 | } 12 | }; -------------------------------------------------------------------------------- /tutorials/getting-started/1.8 watch-mode/webpack.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | entry: "./entry.js", 3 | output: { 4 | path: __dirname, 5 | filename: "bundle.js" 6 | }, 7 | module: { 8 | loaders: [ 9 | { test: /\.css$/, loader: "style!css" } 10 | ] 11 | } 12 | }; -------------------------------------------------------------------------------- /tutorials/getting-started/1.5 binding-loaders/webpack.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | entry: "./entry.js", 3 | module: { 4 | loaders: [ 5 | { test: /\.css$/, loader: "style!css" } 6 | ] 7 | }, 8 | output: { 9 | path: __dirname, 10 | filename: "bundle.js" 11 | } 12 | }; -------------------------------------------------------------------------------- /app/docsearch.js: -------------------------------------------------------------------------------- 1 | require("./onContentLoaded")(function(event) { 2 | var search = docsearch({ 3 | inputSelector: '#docsearch', 4 | apiKey: '93950c6eda05068a6f0649e4a7f7546e', 5 | indexName: 'webpack', 6 | debug: false, 7 | enhancedSearchInput: true 8 | }); 9 | }) 10 | -------------------------------------------------------------------------------- /tutorials/migrate-to-webpack/1.3 coffee-script/webpack.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | entry: "./app.coffee", 3 | output: { 4 | path: __dirname, 5 | filename: "bundle.js" 6 | }, 7 | module: { 8 | loaders: [ 9 | { test: /\.coffee$/, loader: "coffee-loader" } 10 | ] 11 | } 12 | }; -------------------------------------------------------------------------------- /tutorials/getting-started/1.7 pretty-output/README.md: -------------------------------------------------------------------------------- 1 | # A prettier output 2 | 3 | If the project grows the compilation may take a bit longer. So we want to display some kind of progress bar. And we want colors... 4 | 5 | We can achieve this with 6 | 7 | ``` text 8 | webpack --progress --colors 9 | ``` 10 | -------------------------------------------------------------------------------- /tutorials/migrate-to-webpack/1.7 other-resources/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |Your User-Agent is:
9 | 10 | 11 | -------------------------------------------------------------------------------- /app/css/tutorial.styl: -------------------------------------------------------------------------------- 1 | @import 'variables.styl' 2 | @import 'mixins.styl'; 3 | @import 'general.styl' 4 | @import 'sidebar.styl'; 5 | @import 'logo.styl'; 6 | @import 'code.styl'; 7 | @import 'deprecation.styl'; 8 | 9 | 10 | iframe.tutorial-iframe 11 | width: 100% 12 | height: 200px 13 | border: 3px dashed #333 14 | 15 | -------------------------------------------------------------------------------- /lib/extractRegExpFromText.js: -------------------------------------------------------------------------------- 1 | module.exports = function extractRegExpFromText(text, regExp, postprocessFn) { 2 | var array = []; 3 | 4 | var match; 5 | while(match = regExp.exec(text)) { 6 | var link = postprocessFn(match[1]); 7 | if(array.indexOf(link) < 0) 8 | array.push(link); 9 | } 10 | 11 | return array; 12 | } 13 | -------------------------------------------------------------------------------- /tutorials/migrate-to-webpack/1.1 normal-app/app.coffee.js: -------------------------------------------------------------------------------- 1 | // Generated by CoffeeScript 1.6.3 2 | $(function() { 3 | var userAgent, view; 4 | userAgent = window.navigator.userAgent; 5 | view = { 6 | render: function(ua) { 7 | return $("#user-agent").text(ua); 8 | } 9 | }; 10 | return view.render(userAgent); 11 | }); 12 | -------------------------------------------------------------------------------- /tutorials/migrate-to-webpack/1.2 lets-webpack/app.coffee.js: -------------------------------------------------------------------------------- 1 | // Generated by CoffeeScript 1.6.3 2 | $(function() { 3 | var userAgent, view; 4 | userAgent = window.navigator.userAgent; 5 | view = { 6 | render: function(ua) { 7 | return $("#user-agent").text(ua); 8 | } 9 | }; 10 | return view.render(userAgent); 11 | }); 12 | -------------------------------------------------------------------------------- /app/css/anchor.styl: -------------------------------------------------------------------------------- 1 | .anchor 2 | display: none 3 | 4 | h1:hover, h2:hover, h3:hover, h4:hover, h5:hover, h6:hover 5 | .anchor 6 | display: inline-block 7 | font-size: 70% 8 | text-align: right 9 | margin-left: -40px 10 | width: 40px 11 | vertical-align: top 12 | &:hover, &:focus 13 | text-decoration: none 14 | font-weight: 700 15 | -------------------------------------------------------------------------------- /tutorials/getting-started/1.6 config-file/README.md: -------------------------------------------------------------------------------- 1 | # A config file 2 | 3 | We want to move the config options into a config file: 4 | 5 | $$$ files 6 | 7 | Now we can just run: 8 | 9 | ``` text 10 | webpack 11 | ``` 12 | 13 | to compile: 14 | 15 | $$$ output 16 | 17 | > The webpack command-line will try to load the file `webpack.config.js` in the current directory. 18 | -------------------------------------------------------------------------------- /tutorials/migrate-to-webpack/1.6 external-depencencies/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |Your User-Agent is:
10 | 11 | 12 | -------------------------------------------------------------------------------- /app/css/doc.styl: -------------------------------------------------------------------------------- 1 | @import 'variables.styl' 2 | @import 'mixins.styl'; 3 | @import 'general.styl' 4 | @import 'sidebar.styl'; 5 | @import 'logo.styl'; 6 | @import 'contents.styl'; 7 | @import 'code.styl'; 8 | @import 'anchor.styl'; 9 | @import 'deprecation.styl'; 10 | 11 | .loading 12 | transition: opacity 1s linear, background 1s linear 13 | background: white 14 | opacity: 0 15 | 16 | .wikieditlink 17 | font-weight: bold 18 | -------------------------------------------------------------------------------- /tutorials/migrate-to-webpack/1.5 modules/webpack.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | // the entry point 3 | entry: "./app.coffee", 4 | 5 | output: { 6 | // the output path 7 | path: __dirname, 8 | 9 | // the output filename 10 | filename: "bundle.js" 11 | }, 12 | 13 | module: { 14 | loaders: [ 15 | // support for coffeescript files 16 | { test: /\.coffee$/, loader: "coffee-loader" } 17 | ] 18 | } 19 | }; -------------------------------------------------------------------------------- /tutorials/migrate-to-webpack/1.4 webpack-config/webpack.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | // the entry point 3 | entry: "./app.coffee", 4 | 5 | output: { 6 | // the output path 7 | path: __dirname, 8 | 9 | // the output filename 10 | filename: "bundle.js" 11 | }, 12 | 13 | module: { 14 | loaders: [ 15 | // support for coffeescript files 16 | { test: /\.coffee$/, loader: "coffee-loader" } 17 | ] 18 | } 19 | }; -------------------------------------------------------------------------------- /tutorials/migrate-to-webpack/1.6 external-depencencies/webpack.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | // the entry point 3 | entry: "./app.coffee", 4 | 5 | output: { 6 | // the output path 7 | path: __dirname, 8 | 9 | // the output filename 10 | filename: "bundle.js" 11 | }, 12 | 13 | module: { 14 | loaders: [ 15 | // support for coffeescript files 16 | { test: /\.coffee$/, loader: "coffee-loader" } 17 | ] 18 | } 19 | }; -------------------------------------------------------------------------------- /layouts/logo.html: -------------------------------------------------------------------------------- 1 |Your User-Agent is:
11 | 12 | 13 | -------------------------------------------------------------------------------- /tutorials/migrate-to-webpack/1.2 lets-webpack/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |Your User-Agent is:
11 | 12 | 13 | -------------------------------------------------------------------------------- /tutorials/migrate-to-webpack/1.5 modules/README.md: -------------------------------------------------------------------------------- 1 | ## Let's make modules 2 | 3 | Because we use webpack now, we can use `require` to load other modules. 4 | 5 | We first want to split our code into model, view and controller. 6 | 7 | We use CommonJS style modules in this example, but AMD style modules are also possible (or mix both styles). 8 | 9 | $$$ files 10 | 11 | ### Summary 12 | 13 | Webpack now takes care of our coffeescript files and bundle them together. 14 | 15 | $$$ index.html -------------------------------------------------------------------------------- /tutorials/getting-started/1.2 setup-compilation/README.md: -------------------------------------------------------------------------------- 1 | # Setup the compilation 2 | 3 | Start with a empty directory. 4 | 5 | Create these files: 6 | 7 | $$$ files 8 | 9 | Then run the following: 10 | 11 | ``` sh 12 | $ webpack ./entry.js bundle.js 13 | ``` 14 | 15 | It will compile your file and create a bundle file. 16 | 17 | If successful it displays something like this: 18 | 19 | $$$ output 20 | 21 | Open `index.html` in your browser. It should display `It works.` 22 | 23 | $$$ index.html 24 | -------------------------------------------------------------------------------- /layouts/header.html: -------------------------------------------------------------------------------- 1 |12 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/layouts/404.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
45 |
46 |
--------------------------------------------------------------------------------
/app/FullTextSearcher.js:
--------------------------------------------------------------------------------
1 | var extractRegExpFromText = require("../lib/extractRegExpFromText");
2 | var Searcher = require("../lib/fuse.js/Searcher");
3 |
4 | function FullTextSearcher(searchString) {
5 | this.fuseSearchers = this.tokenize(searchString).map(function(item) {
6 | return new Searcher(item, {
7 | distance: item.length * 10,
8 | threshold: 0.8
9 | });
10 | });
11 | }
12 |
13 | module.exports = FullTextSearcher;
14 |
15 | FullTextSearcher.prototype.scanDocument = function(title, md) {
16 | title = this.tokenize(title);
17 | md = this.tokenize(md);
18 | var scores = this.fuseSearchers.map(function() { return 0 });
19 | scoreItems(title, this.fuseSearchers);
20 | scores = scores.map(function(s) { return s*10; });
21 | scoreItems(md, this.fuseSearchers);
22 | return {
23 | score: scores.length > 0 ? scores.reduce(function(a, b) { return a + b; }, 0) *
24 | scores.map(function(s) { return s; }, this).reduce(function(a, b) { return Math.min(a, b); }) : 0,
25 | scores: scores
26 | };
27 |
28 | function scoreItems(items, fuseSearchers) {
29 | items.forEach(function(item) {
30 | fuseSearchers.forEach(function(searcher, idx) {
31 | var result = searcher.search(item);
32 | if(result.isMatch) {
33 | scores[idx] += (1 - result.score) / items.length;
34 | }
35 | });
36 | });
37 | }
38 | }
39 |
40 | FullTextSearcher.prototype.tokenize = function(str) {
41 | return extractRegExpFromText(str, /([\w\d\-\_\.]+)/gi, function(s) { return s; });
42 | };
--------------------------------------------------------------------------------
/app/css/reset.styl:
--------------------------------------------------------------------------------
1 | // Based on [Eric Meyer's reset](http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/)
2 |
3 | reset-box-model()
4 | margin: 0
5 | padding: 0
6 | border: 0
7 | outline: 0
8 |
9 | reset-font()
10 | font-weight: inherit
11 | font-style: inherit
12 | font-family: inherit
13 | font-size: 100%
14 | vertical-align: baseline
15 |
16 | reset-body()
17 | line-height: 1
18 | color: black
19 | background: white
20 |
21 | reset-table()
22 | border-collapse: separate
23 | border-spacing: 0
24 | vertical-align: middle
25 |
26 | reset-table-cell()
27 | text-align: left
28 | font-weight: normal
29 | vertical-align: middle
30 |
31 | reset-html5()
32 | article, aside, canvas, details, figcaption,
33 | figure, footer, header, hgroup, menu, nav,
34 | section, summary, main
35 | reset-box-model()
36 | display: block
37 | audio, canvas, video
38 | display inline-block
39 | *display inline
40 | *zoom 1
41 | audio:not([controls]),[hidden]
42 | display none
43 |
44 | html, body, div, span, applet, object, iframe,
45 | h1, h2, h3, h4, h5, h6, p, blockquote, pre,
46 | a, abbr, acronym, address, big, cite, code,
47 | del, dfn, em, img, ins, kbd, q, s, samp,
48 | small, strike, strong, sub, sup, tt, var,
49 | dl, dt, dd, ol, ul, li,
50 | fieldset, form, label, legend,
51 | table, caption, tbody, tfoot, thead, tr, th, td
52 | reset-box-model()
53 | reset-font()
54 | body
55 | reset-body()
56 | ol, ul
57 | list-style: none
58 | table
59 | reset-table()
60 | caption, th, td
61 | reset-table-cell()
62 | a img
63 | border: none
64 |
--------------------------------------------------------------------------------
/app/onContentLoaded.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * contentloaded.js
3 | *
4 | * Author: Diego Perini (diego.perini at gmail.com)
5 | * Summary: cross-browser wrapper for DOMContentLoaded
6 | * Updated: 20101020
7 | * License: MIT
8 | * Version: 1.2
9 | *
10 | * URL:
11 | * http://javascript.nwbox.com/ContentLoaded/
12 | * http://javascript.nwbox.com/ContentLoaded/MIT-LICENSE
13 | *
14 | */
15 |
16 | // @win window reference
17 | // @fn function reference
18 | function contentLoaded(win, fn) {
19 |
20 | var done = false, top = true,
21 |
22 | doc = win.document, root = doc.documentElement,
23 |
24 | add = doc.addEventListener ? 'addEventListener' : 'attachEvent',
25 | rem = doc.addEventListener ? 'removeEventListener' : 'detachEvent',
26 | pre = doc.addEventListener ? '' : 'on',
27 |
28 | init = function(e) {
29 | if (e.type == 'readystatechange' && doc.readyState != 'complete') return;
30 | (e.type == 'load' ? win : doc)[rem](pre + e.type, init, false);
31 | if (!done && (done = true)) fn.call(win, e.type || e);
32 | },
33 |
34 | poll = function() {
35 | try { root.doScroll('left'); } catch(e) { setTimeout(poll, 50); return; }
36 | init('poll');
37 | };
38 |
39 | if (doc.readyState == 'complete') fn.call(win, 'lazy');
40 | else {
41 | if (doc.createEventObject && root.doScroll) {
42 | try { top = !win.frameElement; } catch(e) { }
43 | if (top) poll();
44 | }
45 | doc[add](pre + 'DOMContentLoaded', init, false);
46 | doc[add](pre + 'readystatechange', init, false);
47 | win[add](pre + 'load', init, false);
48 | }
49 |
50 | }
51 |
52 | module.exports = function(fn) {
53 | contentLoaded(window, fn);
54 | };
--------------------------------------------------------------------------------
/lib/highlight.js/javascript.js:
--------------------------------------------------------------------------------
1 | module.exports = function(hljs) {
2 | return {
3 | keywords: {
4 | keyword:
5 | 'in if for while finally var new function do return void else break catch ' +
6 | 'instanceof with throw case default try this switch continue typeof delete ' +
7 | 'let yield const',
8 | literal:
9 | 'true false null undefined NaN Infinity'
10 | },
11 | contains: [
12 | hljs.APOS_STRING_MODE,
13 | hljs.QUOTE_STRING_MODE,
14 | hljs.C_LINE_COMMENT_MODE,
15 | hljs.C_BLOCK_COMMENT_MODE,
16 | hljs.C_NUMBER_MODE,
17 | { // "value" container
18 | begin: '(' + hljs.RE_STARTERS_RE + '|\\b(case|return|throw)\\b)\\s*',
19 | keywords: 'return throw case',
20 | contains: [
21 | hljs.C_LINE_COMMENT_MODE,
22 | hljs.C_BLOCK_COMMENT_MODE,
23 | hljs.REGEXP_MODE,
24 | { // E4X
25 | begin: /, end: />;/,
26 | subLanguage: 'xml'
27 | }
28 | ],
29 | relevance: 0
30 | },
31 | {
32 | className: 'function',
33 | beginWithKeyword: true, end: /{/,
34 | keywords: 'function',
35 | contains: [
36 | {
37 | className: 'title', begin: /[A-Za-z$_][0-9A-Za-z$_]*/
38 | },
39 | {
40 | className: 'params',
41 | begin: /\(/, end: /\)/,
42 | contains: [
43 | hljs.C_LINE_COMMENT_MODE,
44 | hljs.C_BLOCK_COMMENT_MODE
45 | ],
46 | illegal: /["'\(]/
47 | }
48 | ],
49 | illegal: /\[|%/
50 | }
51 | ]
52 | };
53 | };
--------------------------------------------------------------------------------
/app/404.js:
--------------------------------------------------------------------------------
1 | require("./css/404.styl");
2 | require("./googleAnalytics");
3 |
4 | require("./onContentLoaded")(function(event) {
5 | var titleToLink = require("../lib/titleToLink");
6 | var linkToTitle = require("../lib/linkToTitle");
7 |
8 | var titleElement = document.getElementById("title");
9 | var resultsElement = document.getElementById("results");
10 |
11 | var pathname = location.pathname.substr(1);
12 | if(/404(\.html)?$/.test(pathname))
13 | pathname = location.search.substr(2);
14 | var searchString = linkToTitle(pathname.replace(/\.html$/i, "")).trim();
15 | document.title = titleElement.textContent = "Search '" + searchString + "'";
16 |
17 | require(["../lib/extractRegExpFromText", "./downloadWiki", "./FullTextSearcher"], function(extractRegExpFromText, downloadWiki, FullTextSearcher) {
18 | var searcher = new FullTextSearcher(searchString);
19 |
20 | var processedWikis = {};
21 | var matches = [];
22 | processWiki("contents");
23 |
24 | function processWiki(name) {
25 | if(processedWikis["$"+name]) return;
26 | processedWikis["$"+name] = true;
27 | downloadWiki(name, function(err, md) {
28 | if(err) return;
29 | console.log("Searching in " + name);
30 | var links = extractRegExpFromText(md, /\[\[(?:[^\]\|]+\|\s*)?([a-z0-9 \-_\.]+)\]\]/gi, titleToLink);
31 | links.forEach(processWiki);
32 | if(name === "contents") return;
33 | var result = searcher.scanDocument(linkToTitle(name), md);
34 | var score = result.score;
35 | if(score > 0) {
36 | var element = document.createElement("li");
37 | var linkElement = document.createElement("a");
38 | linkElement.setAttribute("href", name + ".html");
39 | linkElement.textContent = linkToTitle(name);
40 | element.appendChild(linkElement);
41 | for(var i = 0; i < matches.length; i++) {
42 | if(matches[i].score < score) {
43 | resultsElement.insertBefore(element, matches[i].element);
44 | matches.splice(i, 0, { score: score, element: element });
45 | return;
46 | }
47 | }
48 | resultsElement.appendChild(element);
49 | matches.push({ score: score, element: element });
50 | }
51 | });
52 | }
53 | });
54 | });
55 |
--------------------------------------------------------------------------------
/lib/diff.js/diff.js:
--------------------------------------------------------------------------------
1 | // import LCS if in node
2 | if (typeof LCS === 'undefined')
3 | var LCS = require('./lcs.js');
4 |
5 | // Diff sequence
6 | // @param A - sequence of atoms - Array
7 | // @param B - sequence of atoms - Array
8 | // @param equals - optional comparator of atoms - returns true or false,
9 | // if not specified, triple equals operator is used
10 | // @returns Array - sequence of objects in a form of:
11 | // - operation: one of "none", "add", "delete"
12 | // - atom: the atom found in either A or B
13 | // Applying operations from diff sequence you should be able to transform A to B
14 | var diff = function (A, B, equals) {
15 | // We just compare atoms with default equals operator by default
16 | if (equals === undefined)
17 | equals = function (a, b) { return a === b; };
18 |
19 | var diff = [];
20 | var i = 0, j = 0;
21 | var N = A.length, M = B.length, K = 0;
22 |
23 | while (i < N && j < M && equals(A[i], B[j]))
24 | i++, j++;
25 |
26 | while (i < N && j < M && equals(A[N-1], B[M-1]))
27 | N--, M--, K++;
28 |
29 | [].push.apply(diff, A.slice(0, i).map(function (atom) {
30 | return { operation: "none", atom: atom }; }));
31 |
32 | var lcs = LCS(A.slice(i, N), B.slice(j, M), equals);
33 |
34 | for (var k = 0; k < lcs.length; k++) {
35 | var atom = lcs[k];
36 | var ni = customIndexOf.call(A, atom, i, equals);
37 | var nj = customIndexOf.call(B, atom, j, equals);
38 |
39 | // XXX ES5 map
40 | // Delete unmatched atoms from A
41 | [].push.apply(diff, A.slice(i, ni).map(function (atom) {
42 | return { operation: "delete", atom: atom };
43 | }));
44 |
45 | // Add unmatched atoms from B
46 | [].push.apply(diff, B.slice(j, nj).map(function (atom) {
47 | return { operation: "add", atom: atom };
48 | }));
49 |
50 | // Add the atom found in both sequences
51 | diff.push({ operation: "none", atom: atom });
52 |
53 | i = ni + 1;
54 | j = nj + 1;
55 | }
56 |
57 | // Don't forget about the rest
58 |
59 | [].push.apply(diff, A.slice(i, N).map(function (atom) {
60 | return { operation: "delete", atom: atom };
61 | }));
62 |
63 | [].push.apply(diff, B.slice(j, M).map(function (atom) {
64 | return { operation: "add", atom: atom };
65 | }));
66 |
67 | [].push.apply(diff, A.slice(N, N + K).map(function (atom) {
68 | return { operation: "none", atom: atom }; }));
69 |
70 | return diff;
71 | };
72 |
73 | // Accepts custom comparator
74 | var customIndexOf = function(item, start, equals){
75 | var arr = this;
76 | for (var i = start; i < arr.length; i++)
77 | if (equals(item, arr[i]))
78 | return i;
79 | return -1;
80 | };
81 |
82 | // Exports
83 | if (typeof module !== "undefined")
84 | module.exports = diff;
85 |
86 |
--------------------------------------------------------------------------------
/app/css/mixins.styl:
--------------------------------------------------------------------------------
1 | // FONT
2 | @import url("//fonts.googleapis.com/css?family=Averia+Sans+Libre:400,700,400italic,700italic|Ubuntu+Mono:400,700|Kreon:400,700");
3 |
4 | sansSerif()
5 | font-family: Helvetica, Arial, freesans, clean, sans-serif
6 |
7 | logoFont()
8 | font-family: 'Averia Sans Libre', Arial, freesans, clean, sans-serif
9 |
10 | serif()
11 | font-family: 'Kreon', 'Times New Roman', Times, serif
12 |
13 | monospace()
14 | font-family: 'Ubuntu Mono', 'Courier New', monospace
15 |
16 |
17 | // CUBE
18 | cube(size=100px, color=#c4dafb)
19 | width: 100%
20 | height: 100%
21 | position: absolute
22 | display: block
23 | padding: 0
24 | margin: -(size/2) 0 0 -(size/2)
25 | top: 50%
26 | left: 50%
27 | transform-origin: (size/2) (size/2)
28 | //transform-origin: 50% 50%
29 | li
30 | display: block
31 | position: absolute
32 | width: size
33 | height: size
34 | transition: transform 1s ease-in-out
35 | .front, .back, .right, .left, .top
36 | background: radial-gradient(transparent 30%, rgba(darken(color, 70%), 0.2) 100%)
37 | li:after
38 | content: ""
39 | display: block
40 | position: absolute
41 | width: size
42 | height: size
43 | backface-visibility:hidden
44 | background-color: color
45 | transition: transform 1s ease-in-out
46 | .front
47 | transform: translateZ(size/2)
48 | .back
49 | transform: rotateX(-180deg) translateZ(size/2)
50 | .right
51 | transform: rotateY(90deg) translateZ(size/2)
52 | .left
53 | transform: rotateY(-90deg) translateZ(size/2)
54 | .top
55 | transform: rotateX(90deg) translateZ(size/2)
56 | .top:after
57 | background-color: lighten(color, 20%)
58 | .bottom
59 | transform: rotateX(-90deg) translateZ(size/2)
60 | .floor:after
61 | display: none
62 | .floor
63 | box-shadow: -300px 0px 50px rgba(0, 0, 0, 0.3);
64 | backface-visibility:visible
65 | width: size + 10px
66 | height: size + 10px
67 | left: 295px
68 | background-color: rgba(0, 0, 0, 0)
69 | transform: rotateX(-90deg) translateZ(size / 2 + 10)
70 |
71 | cubeRotateX = -33.5deg
72 | cubeRotateY = 45deg
73 |
74 | // SPIN
75 | @keyframes slowspin
76 | 0%
77 | transform: rotateX(cubeRotateX) rotateY(cubeRotateY + 0deg)
78 | 10%
79 | transform: rotateX(cubeRotateX) rotateY(cubeRotateY + 180deg)
80 | 100%
81 | transform: rotateX(cubeRotateX) rotateY(cubeRotateY + 180deg)
82 |
83 | @keyframes fastspin
84 | 0%
85 | transform: rotateX(cubeRotateX) rotateY(cubeRotateY - 0deg)
86 | 10%
87 | transform: rotateX(cubeRotateX) rotateY(cubeRotateY - 360deg)
88 | 100%
89 | transform: rotateX(cubeRotateX) rotateY(cubeRotateY - 360deg)
90 |
91 | spin(name=slowspin, speed=10s)
92 | transform: rotateX(cubeRotateX) rotateY(cubeRotateY + 0deg)
93 | transform-style: preserve-3d
94 | animation: name speed ease-in-out infinite 2s
95 |
--------------------------------------------------------------------------------
/layouts/doc.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
73 |
74 |
75 |
--------------------------------------------------------------------------------
/lib/highlight.js/xml.js:
--------------------------------------------------------------------------------
1 | module.exports = function(hljs) {
2 | var XML_IDENT_RE = '[A-Za-z0-9\\._:-]+';
3 | var TAG_INTERNALS = {
4 | endsWithParent: true,
5 | relevance: 0,
6 | contains: [
7 | {
8 | className: 'attribute',
9 | begin: XML_IDENT_RE,
10 | relevance: 0
11 | },
12 | {
13 | begin: '="', returnBegin: true, end: '"',
14 | contains: [{
15 | className: 'value',
16 | begin: '"', endsWithParent: true
17 | }]
18 | },
19 | {
20 | begin: '=\'', returnBegin: true, end: '\'',
21 | contains: [{
22 | className: 'value',
23 | begin: '\'', endsWithParent: true
24 | }]
25 | },
26 | {
27 | begin: '=',
28 | contains: [{
29 | className: 'value',
30 | begin: '[^\\s/>]+'
31 | }]
32 | }
33 | ]
34 | };
35 | return {
36 | case_insensitive: true,
37 | contains: [
38 | {
39 | className: 'pi',
40 | begin: '<\\?', end: '\\?>',
41 | relevance: 10
42 | },
43 | {
44 | className: 'doctype',
45 | begin: '',
46 | relevance: 10,
47 | contains: [{begin: '\\[', end: '\\]'}]
48 | },
49 | {
50 | className: 'comment',
51 | begin: '',
52 | relevance: 10
53 | },
54 | {
55 | className: 'cdata',
56 | begin: '<\\!\\[CDATA\\[', end: '\\]\\]>',
57 | relevance: 10
58 | },
59 | {
60 | className: 'tag',
61 | /*
62 | The lookahead pattern (?=...) ensures that 'begin' only matches
63 | '', returnEnd: true,
72 | subLanguage: 'css'
73 | }
74 | },
75 | {
76 | className: 'tag',
77 | // See the comment in the