├── CNAME ├── favicon.ico ├── assets ├── img │ ├── favicon.ico │ ├── favicon.png │ ├── icon-128.png │ ├── icon-16.png │ ├── icon-256.png │ ├── icon-32.png │ ├── icon-48.png │ ├── icon-512.png │ ├── icon-64.png │ ├── icon.fw.png │ ├── dark │ │ ├── favicon.ico │ │ ├── apple-touch-icon.png │ │ ├── apple-touch-icon-114x114.png │ │ ├── apple-touch-icon-120x120.png │ │ ├── apple-touch-icon-144x144.png │ │ ├── apple-touch-icon-152x152.png │ │ ├── apple-touch-icon-57x57.png │ │ ├── apple-touch-icon-72x72.png │ │ ├── apple-touch-icon-76x76.png │ │ └── README.md │ ├── icon-dark-512.png │ ├── icon-dark.fw.png │ └── light │ │ ├── favicon.ico │ │ ├── apple-touch-icon.png │ │ ├── apple-touch-icon-57x57.png │ │ ├── apple-touch-icon-72x72.png │ │ ├── apple-touch-icon-76x76.png │ │ ├── apple-touch-icon-114x114.png │ │ ├── apple-touch-icon-120x120.png │ │ ├── apple-touch-icon-144x144.png │ │ ├── apple-touch-icon-152x152.png │ │ └── README.md ├── fonts │ ├── glyphiconshalflings-regular.eot │ ├── glyphiconshalflings-regular.otf │ ├── glyphiconshalflings-regular.ttf │ └── glyphiconshalflings-regular.woff ├── js │ ├── showup.js │ ├── html5shiv.js │ ├── respond.min.js │ ├── application.js │ └── holder.js └── css │ ├── markdown.css │ ├── github.css │ └── gist.css ├── README.md ├── LICENSE-MIT ├── license.html ├── blog └── index.html ├── plugins └── index.html └── helpers ├── helpers-misc.html ├── helpers-markdown.html ├── helpers-data.html ├── helpers-inflections.html ├── helpers-path.html ├── helpers-content.html ├── helpers-url.html ├── helpers-math.html └── helpers-numbers.html /CNAME: -------------------------------------------------------------------------------- 1 | assemble.io -------------------------------------------------------------------------------- /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemble/assemble.io/gh-pages/favicon.ico -------------------------------------------------------------------------------- /assets/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemble/assemble.io/gh-pages/assets/img/favicon.ico -------------------------------------------------------------------------------- /assets/img/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemble/assemble.io/gh-pages/assets/img/favicon.png -------------------------------------------------------------------------------- /assets/img/icon-128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemble/assemble.io/gh-pages/assets/img/icon-128.png -------------------------------------------------------------------------------- /assets/img/icon-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemble/assemble.io/gh-pages/assets/img/icon-16.png -------------------------------------------------------------------------------- /assets/img/icon-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemble/assemble.io/gh-pages/assets/img/icon-256.png -------------------------------------------------------------------------------- /assets/img/icon-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemble/assemble.io/gh-pages/assets/img/icon-32.png -------------------------------------------------------------------------------- /assets/img/icon-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemble/assemble.io/gh-pages/assets/img/icon-48.png -------------------------------------------------------------------------------- /assets/img/icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemble/assemble.io/gh-pages/assets/img/icon-512.png -------------------------------------------------------------------------------- /assets/img/icon-64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemble/assemble.io/gh-pages/assets/img/icon-64.png -------------------------------------------------------------------------------- /assets/img/icon.fw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemble/assemble.io/gh-pages/assets/img/icon.fw.png -------------------------------------------------------------------------------- /assets/img/dark/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemble/assemble.io/gh-pages/assets/img/dark/favicon.ico -------------------------------------------------------------------------------- /assets/img/icon-dark-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemble/assemble.io/gh-pages/assets/img/icon-dark-512.png -------------------------------------------------------------------------------- /assets/img/icon-dark.fw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemble/assemble.io/gh-pages/assets/img/icon-dark.fw.png -------------------------------------------------------------------------------- /assets/img/light/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemble/assemble.io/gh-pages/assets/img/light/favicon.ico -------------------------------------------------------------------------------- /assets/img/dark/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemble/assemble.io/gh-pages/assets/img/dark/apple-touch-icon.png -------------------------------------------------------------------------------- /assets/img/light/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemble/assemble.io/gh-pages/assets/img/light/apple-touch-icon.png -------------------------------------------------------------------------------- /assets/fonts/glyphiconshalflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemble/assemble.io/gh-pages/assets/fonts/glyphiconshalflings-regular.eot -------------------------------------------------------------------------------- /assets/fonts/glyphiconshalflings-regular.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemble/assemble.io/gh-pages/assets/fonts/glyphiconshalflings-regular.otf -------------------------------------------------------------------------------- /assets/fonts/glyphiconshalflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemble/assemble.io/gh-pages/assets/fonts/glyphiconshalflings-regular.ttf -------------------------------------------------------------------------------- /assets/img/dark/apple-touch-icon-114x114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemble/assemble.io/gh-pages/assets/img/dark/apple-touch-icon-114x114.png -------------------------------------------------------------------------------- /assets/img/dark/apple-touch-icon-120x120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemble/assemble.io/gh-pages/assets/img/dark/apple-touch-icon-120x120.png -------------------------------------------------------------------------------- /assets/img/dark/apple-touch-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemble/assemble.io/gh-pages/assets/img/dark/apple-touch-icon-144x144.png -------------------------------------------------------------------------------- /assets/img/dark/apple-touch-icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemble/assemble.io/gh-pages/assets/img/dark/apple-touch-icon-152x152.png -------------------------------------------------------------------------------- /assets/img/dark/apple-touch-icon-57x57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemble/assemble.io/gh-pages/assets/img/dark/apple-touch-icon-57x57.png -------------------------------------------------------------------------------- /assets/img/dark/apple-touch-icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemble/assemble.io/gh-pages/assets/img/dark/apple-touch-icon-72x72.png -------------------------------------------------------------------------------- /assets/img/dark/apple-touch-icon-76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemble/assemble.io/gh-pages/assets/img/dark/apple-touch-icon-76x76.png -------------------------------------------------------------------------------- /assets/img/light/apple-touch-icon-57x57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemble/assemble.io/gh-pages/assets/img/light/apple-touch-icon-57x57.png -------------------------------------------------------------------------------- /assets/img/light/apple-touch-icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemble/assemble.io/gh-pages/assets/img/light/apple-touch-icon-72x72.png -------------------------------------------------------------------------------- /assets/img/light/apple-touch-icon-76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemble/assemble.io/gh-pages/assets/img/light/apple-touch-icon-76x76.png -------------------------------------------------------------------------------- /assets/fonts/glyphiconshalflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemble/assemble.io/gh-pages/assets/fonts/glyphiconshalflings-regular.woff -------------------------------------------------------------------------------- /assets/img/light/apple-touch-icon-114x114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemble/assemble.io/gh-pages/assets/img/light/apple-touch-icon-114x114.png -------------------------------------------------------------------------------- /assets/img/light/apple-touch-icon-120x120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemble/assemble.io/gh-pages/assets/img/light/apple-touch-icon-120x120.png -------------------------------------------------------------------------------- /assets/img/light/apple-touch-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemble/assemble.io/gh-pages/assets/img/light/apple-touch-icon-144x144.png -------------------------------------------------------------------------------- /assets/img/light/apple-touch-icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemble/assemble.io/gh-pages/assets/img/light/apple-touch-icon-152x152.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # [Assemble Documentation](http://assemble.io/) 2 | 3 | > Assemble makes it dead simple to build modular sites, documentation and components from reusable templates and data. 4 | 5 | 6 | #### [See examples →](https://github.com/assemble/assemble-examples/) 7 | 8 | #### [Visit the docs →](http://assemble.io/) -------------------------------------------------------------------------------- /assets/js/showup.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Showup.js 3 | * http://github.com/jonschlinkert/showup 4 | * Jon Schlinkert 5 | * 6 | */ 7 | (function( $ ) { 8 | 9 | $.fn.showUp = function(ele) { 10 | var target = $(ele), 11 | downClass = 'hidden', 12 | upClass = 'visible', 13 | previousScroll = 0; 14 | 15 | $(window).scroll(function() { 16 | // var currentScroll = $(this).scrollTop(); 17 | if($(this).scrollTop() > 100){ 18 | if ($(this).scrollTop() > previousScroll) { 19 | // Action on scroll down 20 | $(target).addClass(downClass); 21 | } else { 22 | // Action on scroll up 23 | $(target).removeClass(downClass); 24 | $(target).addClass(upClass); 25 | } 26 | } 27 | previousScroll = $(this).scrollTop(); 28 | 29 | // TODO: if "back to top" btn clicked, show navbar 30 | 31 | }); 32 | }; 33 | 34 | })( jQuery ); 35 | 36 | -------------------------------------------------------------------------------- /LICENSE-MIT: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Assemble 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /assets/img/dark/README.md: -------------------------------------------------------------------------------- 1 | # Icons 2 | 3 | > These icons were generated by [iconifier](http://iconifier.net/), a tool for creating "bundles" of Apple icon and favicon files for your website. 4 | 5 | Most browsers will find the Apple icons in the root folder of your website. Add the following HTML to your page if necessary to specify other locations, remembering to include the correct path: 6 | 7 | ```html 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | ``` 18 | 19 | ## Tips 20 | 21 | If your favicon.ico file isn't in the root folder, it's probably a good idea to place a copy in the root folder anyway as some web servers expect to see a favicon.ico file in this location and will add errors to the error log if the file is not found. 22 | 23 | Please visit [iconifier](http://iconifier.net/) to learn more. -------------------------------------------------------------------------------- /assets/img/light/README.md: -------------------------------------------------------------------------------- 1 | # Icons 2 | 3 | > These icons were generated by [iconifier](http://iconifier.net/), a tool for creating "bundles" of Apple icon and favicon files for your website. 4 | 5 | Most browsers will find the Apple icons in the root folder of your website. Add the following HTML to your page if necessary to specify other locations, remembering to include the correct path: 6 | 7 | ```html 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | ``` 18 | 19 | ## Tips 20 | 21 | If your favicon.ico file isn't in the root folder, it's probably a good idea to place a copy in the root folder anyway as some web servers expect to see a favicon.ico file in this location and will add errors to the error log if the file is not found. 22 | 23 | Please visit [iconifier](http://iconifier.net/) to learn more. -------------------------------------------------------------------------------- /assets/css/markdown.css: -------------------------------------------------------------------------------- 1 | .panel-docs ul + blockquote, 2 | .panel-docs br + blockquote, 3 | .panel-docs hr + blockquote, 4 | .panel-docs pre + p + blockquote, 5 | .panel-docs pre + blockquote { 6 | margin: 0; 7 | padding: 10px 25px; 8 | } 9 | .panel-docs ul + blockquote > p, 10 | .panel-docs br + blockquote > p, 11 | .panel-docs hr + blockquote > p, 12 | .panel-docs pre + p + blockquote > p, 13 | .panel-docs pre + blockquote > p, 14 | .panel-docs ul + blockquote > p > a, 15 | .panel-docs br + blockquote > p > a, 16 | .panel-docs hr + blockquote > p > a, 17 | .panel-docs pre + p + blockquote > p > a, 18 | .panel-docs pre + blockquote > p > a { 19 | font: bold normal 14px/2em 'Assemble SSm A', 'Assemble SSm B', 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; 20 | color: #000; 21 | } 22 | .panel-docs ul + blockquote > p > a, 23 | .panel-docs br + blockquote > p > a, 24 | .panel-docs hr + blockquote > p > a, 25 | .panel-docs pre + p + blockquote > p > a, 26 | .panel-docs pre + blockquote > p > a { 27 | color: #178ab4; 28 | } 29 | h1 > em, 30 | h2 > em, 31 | h3 > em, 32 | h4 > em { 33 | display: block; 34 | color: #000; 35 | font: bold normal 14px/2em 'Assemble SSm A', 'Assemble SSm B', 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; 36 | margin: 0; 37 | padding: 10px 25px; 38 | } 39 | h1 > em > p > a, 40 | h2 > em > p > a, 41 | h3 > em > p > a, 42 | h4 > em > p > a { 43 | color: #178ab4; 44 | } 45 | h2 > em { 46 | margin-top: -65px; 47 | } 48 | h3 > em { 49 | margin-top: -35px; 50 | } 51 | -------------------------------------------------------------------------------- /assets/css/github.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | github.com style (c) Vasily Polovnyov 4 | 5 | */ 6 | 7 | pre code { 8 | display: block; padding: 0.5em; 9 | color: #333; 10 | background: #f8f8ff 11 | } 12 | 13 | pre .comment, 14 | pre .template_comment, 15 | pre .diff .header, 16 | pre .javadoc { 17 | color: #998; 18 | font-style: italic 19 | } 20 | 21 | pre .keyword, 22 | pre .css .rule .keyword, 23 | pre .winutils, 24 | pre .javascript .title, 25 | pre .nginx .title, 26 | pre .subst, 27 | pre .request, 28 | pre .status { 29 | color: #333; 30 | font-weight: bold 31 | } 32 | 33 | pre .number, 34 | pre .hexcolor, 35 | pre .ruby .constant { 36 | color: #099; 37 | } 38 | 39 | pre .string, 40 | pre .tag .value, 41 | pre .phpdoc, 42 | pre .tex .formula { 43 | color: #d14 44 | } 45 | 46 | pre .title, 47 | pre .id, 48 | pre .coffeescript .params, 49 | pre .scss .preprocessor { 50 | color: #900; 51 | font-weight: bold 52 | } 53 | 54 | pre .javascript .title, 55 | pre .lisp .title, 56 | pre .clojure .title, 57 | pre .subst { 58 | font-weight: normal 59 | } 60 | 61 | pre .class .title, 62 | pre .haskell .type, 63 | pre .vhdl .literal, 64 | pre .tex .command { 65 | color: #458; 66 | font-weight: bold 67 | } 68 | 69 | pre .tag, 70 | pre .tag .title, 71 | pre .rules .property, 72 | pre .django .tag .keyword { 73 | color: #000080; 74 | font-weight: normal 75 | } 76 | 77 | pre .attribute, 78 | pre .variable, 79 | pre .lisp .body { 80 | color: #008080 81 | } 82 | 83 | pre .regexp { 84 | color: #009926 85 | } 86 | 87 | pre .class { 88 | color: #458; 89 | font-weight: bold 90 | } 91 | 92 | pre .symbol, 93 | pre .ruby .symbol .string, 94 | pre .lisp .keyword, 95 | pre .tex .special, 96 | pre .prompt { 97 | color: #990073 98 | } 99 | 100 | pre .built_in, 101 | pre .lisp .title, 102 | pre .clojure .built_in { 103 | color: #0086b3 104 | } 105 | 106 | pre .preprocessor, 107 | pre .pi, 108 | pre .doctype, 109 | pre .shebang, 110 | pre .cdata { 111 | color: #999; 112 | font-weight: bold 113 | } 114 | 115 | pre .deletion { 116 | background: #fdd 117 | } 118 | 119 | pre .addition { 120 | background: #dfd 121 | } 122 | 123 | pre .diff .change { 124 | background: #0086b3 125 | } 126 | 127 | pre .chunk { 128 | color: #aaa 129 | } -------------------------------------------------------------------------------- /assets/js/html5shiv.js: -------------------------------------------------------------------------------- 1 | /* 2 | HTML5 Shiv v3.6.2pre | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed 3 | */ 4 | (function(l,f){function m(){var a=e.elements;return"string"==typeof a?a.split(" "):a}function i(a){var b=n[a[o]];b||(b={},h++,a[o]=h,n[h]=b);return b}function p(a,b,c){b||(b=f);if(g)return b.createElement(a);c||(c=i(b));b=c.cache[a]?c.cache[a].cloneNode():r.test(a)?(c.cache[a]=c.createElem(a)).cloneNode():c.createElem(a);return b.canHaveChildren&&!s.test(a)?c.frag.appendChild(b):b}function t(a,b){if(!b.cache)b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag(); 5 | a.createElement=function(c){return!e.shivMethods?b.createElem(c):p(c,a,b)};a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/\w+/g,function(a){b.createElem(a);b.frag.createElement(a);return'c("'+a+'")'})+");return n}")(e,b.frag)}function q(a){a||(a=f);var b=i(a);if(e.shivCSS&&!j&&!b.hasCSS){var c,d=a;c=d.createElement("p");d=d.getElementsByTagName("head")[0]||d.documentElement;c.innerHTML="x"; 6 | c=d.insertBefore(c.lastChild,d.firstChild);b.hasCSS=!!c}g||t(a,b);return a}var k=l.html5||{},s=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,r=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,j,o="_html5shiv",h=0,n={},g;(function(){try{var a=f.createElement("a");a.innerHTML="";j="hidden"in a;var b;if(!(b=1==a.childNodes.length)){f.createElement("a");var c=f.createDocumentFragment();b="undefined"==typeof c.cloneNode|| 7 | "undefined"==typeof c.createDocumentFragment||"undefined"==typeof c.createElement}g=b}catch(d){g=j=!0}})();var e={elements:k.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",version:"3.6.2pre",shivCSS:!1!==k.shivCSS,supportsUnknownElements:g,shivMethods:!1!==k.shivMethods,type:"default",shivDocument:q,createElement:p,createDocumentFragment:function(a,b){a||(a=f);if(g)return a.createDocumentFragment(); 8 | for(var b=b||i(a),c=b.frag.cloneNode(),d=0,e=m(),h=e.length;d #mq-test-1 { width: 42px; }',d.insertBefore(f,e),c=42===g.offsetWidth,d.removeChild(f),{matches:c,media:a}}}(document); 4 | 5 | /*! Respond.js v1.1.0: min/max-width media query polyfill. (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs */ 6 | (function(a){"use strict";function x(){u(!0)}var b={};a.respond=b,b.update=function(){},b.mediaQueriesSupported=a.matchMedia&&a.matchMedia("only all").matches,b.mediaQueriesSupported;var q,r,t,c=a.document,d=c.documentElement,e=[],f=[],g=[],h={},i=30,j=c.getElementsByTagName("head")[0]||d,k=c.getElementsByTagName("base")[0],l=j.getElementsByTagName("link"),m=[],n=function(){for(var b=0;l.length>b;b++){var c=l[b],d=c.href,e=c.media,f=c.rel&&"stylesheet"===c.rel.toLowerCase();d&&f&&!h[d]&&(c.styleSheet&&c.styleSheet.rawCssText?(p(c.styleSheet.rawCssText,d,e),h[d]=!0):(!/^([a-zA-Z:]*\/\/)/.test(d)&&!k||d.replace(RegExp.$1,"").split("/")[0]===a.location.host)&&m.push({href:d,media:e}))}o()},o=function(){if(m.length){var a=m.shift();v(a.href,function(b){p(b,a.href,a.media),h[a.href]=!0,setTimeout(function(){o()},0)})}},p=function(a,b,c){var d=a.match(/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi),g=d&&d.length||0;b=b.substring(0,b.lastIndexOf("/"));var h=function(a){return a.replace(/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,"$1"+b+"$2$3")},i=!g&&c;b.length&&(b+="/"),i&&(g=1);for(var j=0;g>j;j++){var k,l,m,n;i?(k=c,f.push(h(a))):(k=d[j].match(/@media *([^\{]+)\{([\S\s]+?)$/)&&RegExp.$1,f.push(RegExp.$2&&h(RegExp.$2))),m=k.split(","),n=m.length;for(var o=0;n>o;o++)l=m[o],e.push({media:l.split("(")[0].match(/(only\s+)?([a-zA-Z]+)\s?/)&&RegExp.$2||"all",rules:f.length-1,hasquery:l.indexOf("(")>-1,minw:l.match(/\(min\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:l.match(/\(max\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}u()},s=function(){var a,b=c.createElement("div"),e=c.body,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",e||(e=f=c.createElement("body"),e.style.background="none"),e.appendChild(b),d.insertBefore(e,d.firstChild),a=b.offsetWidth,f?d.removeChild(e):e.removeChild(b),a=t=parseFloat(a)},u=function(a){var b="clientWidth",h=d[b],k="CSS1Compat"===c.compatMode&&h||c.body[b]||h,m={},n=l[l.length-1],o=(new Date).getTime();if(a&&q&&i>o-q)return clearTimeout(r),r=setTimeout(u,i),void 0;q=o;for(var p in e)if(e.hasOwnProperty(p)){var v=e[p],w=v.minw,x=v.maxw,y=null===w,z=null===x,A="em";w&&(w=parseFloat(w)*(w.indexOf(A)>-1?t||s():1)),x&&(x=parseFloat(x)*(x.indexOf(A)>-1?t||s():1)),v.hasquery&&(y&&z||!(y||k>=w)||!(z||x>=k))||(m[v.media]||(m[v.media]=[]),m[v.media].push(f[v.rules]))}for(var B in g)g.hasOwnProperty(B)&&g[B]&&g[B].parentNode===j&&j.removeChild(g[B]);for(var C in m)if(m.hasOwnProperty(C)){var D=c.createElement("style"),E=m[C].join("\n");D.type="text/css",D.media=C,j.insertBefore(D,n.nextSibling),D.styleSheet?D.styleSheet.cssText=E:D.appendChild(c.createTextNode(E)),g.push(D)}},v=function(a,b){var c=w();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))},w=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}();n(),b.update=n,a.addEventListener?a.addEventListener("resize",x,!1):a.attachEvent&&a.attachEvent("onresize",x)})(this); 7 | -------------------------------------------------------------------------------- /assets/js/application.js: -------------------------------------------------------------------------------- 1 | // NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT 2 | // IT'S ALL JUST JUNK FOR OUR DOCS! 3 | // ++++++++++++++++++++++++++++++++++++++++++ 4 | 5 | !function ($) { 6 | 7 | $(function(){ 8 | 9 | var $window = $(window) 10 | 11 | // Disable certain links in docs 12 | $('section [href^=#]').click(function (e) { 13 | e.preventDefault() 14 | }) 15 | 16 | // back to top 17 | setTimeout(function () { 18 | $('.sidebar').affix({ 19 | offset: { 20 | top: function () { return $window.width() <= 980 ? 290 : 210 } 21 | , bottom: 270 22 | } 23 | }) 24 | }, 100) 25 | 26 | setTimeout(function () { 27 | $('.bs-top').affix() 28 | }, 100) 29 | 30 | // add tipsies to grid for scaffolding 31 | if ($('#grid-system').length) { 32 | $('#grid-system').tooltip({ 33 | selector: '.show-grid > [class*="span"]' 34 | , title: function () { return $(this).width() + 'px' } 35 | }) 36 | } 37 | 38 | // tooltip demo 39 | $('.tooltip-demo').tooltip({ 40 | selector: "a[data-toggle=tooltip]" 41 | }) 42 | 43 | $('.tooltip-test').tooltip() 44 | $('.popover-test').popover() 45 | 46 | $('.bs-docs-navbar').tooltip({ 47 | selector: "a[data-toggle=tooltip]", 48 | container: ".bs-docs-navbar .nav" 49 | }) 50 | 51 | // popover demo 52 | $("a[data-toggle=popover]") 53 | .popover() 54 | .click(function(e) { 55 | e.preventDefault() 56 | }) 57 | 58 | // button state demo 59 | $('#fat-btn') 60 | .click(function () { 61 | var btn = $(this) 62 | btn.button('loading') 63 | setTimeout(function () { 64 | btn.button('reset') 65 | }, 3000) 66 | }) 67 | 68 | // carousel demo 69 | $('.bs-docs-carousel-example').carousel() 70 | 71 | // javascript build logic 72 | var inputsComponent = $("#less input") 73 | , inputsPlugin = $("#plugins input") 74 | , inputsVariables = $("#variables input") 75 | 76 | // toggle all plugin checkboxes 77 | $('#components .toggle').on('click', function (e) { 78 | e.preventDefault() 79 | inputsComponent.prop('checked', !inputsComponent.is(':checked')) 80 | }) 81 | 82 | $('#plugins .toggle').on('click', function (e) { 83 | e.preventDefault() 84 | inputsPlugin.prop('checked', !inputsPlugin.is(':checked')) 85 | }) 86 | 87 | $('#variables .toggle').on('click', function (e) { 88 | e.preventDefault() 89 | inputsVariables.val('') 90 | }) 91 | 92 | // request built javascript 93 | $('.download-btn .btn').on('click', function () { 94 | 95 | var css = $("#components input:checked") 96 | .map(function () { return this.value }) 97 | .toArray() 98 | , js = $("#plugins input:checked") 99 | .map(function () { return this.value }) 100 | .toArray() 101 | , vars = {} 102 | , img = ['glyphicons-halflings.png', 'glyphicons-halflings-white.png'] 103 | 104 | $("#variables input") 105 | .each(function () { 106 | $(this).val() && (vars[ $(this).prev().text() ] = $(this).val()) 107 | }) 108 | 109 | $.ajax({ 110 | type: 'POST' 111 | , url: /\?dev/.test(window.location) ? 'http://localhost:3000' : 'http://bootstrap.herokuapp.com' 112 | , dataType: 'jsonpi' 113 | , params: { 114 | js: js 115 | , css: css 116 | , vars: vars 117 | , img: img 118 | } 119 | }) 120 | }) 121 | }) 122 | 123 | // Modified from the original jsonpi https://github.com/benvinegar/jquery-jsonpi 124 | $.ajaxTransport('jsonpi', function(opts, originalOptions, jqXHR) { 125 | var url = opts.url; 126 | 127 | return { 128 | send: function(_, completeCallback) { 129 | var name = 'jQuery_iframe_' + jQuery.now() 130 | , iframe, form 131 | 132 | iframe = $(' 143 | 144 |

Find an error? 145 | Let us know → 146 |

147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 166 | 169 | 170 | 171 | -------------------------------------------------------------------------------- /blog/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Blog | Assemble 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 53 | 68 | 69 | 70 | 114 | 123 |
124 |
125 |
126 |
127 |

128 | blog /  Blog

129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 | 138 |
139 |
140 |
141 |

Blog

142 | 148 |
149 |
150 |
151 |

In progress...

152 |

We expect the blog to be up and running any day now. Please check back soon!

153 |
154 |
Comment block here
155 |
156 |

157 |

158 |

159 |
160 |

161 | See the template for this page → 162 |

163 |
164 | 171 | 172 | 173 |

Find an error? 174 | Let us know → 175 |

176 |
177 |
178 |
179 |
180 |
181 | 182 | 183 | 184 | 185 | 186 | 195 | 198 | 199 | 200 | -------------------------------------------------------------------------------- /plugins/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Overview | Assemble 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 53 | 68 | 69 | 70 | 114 | 126 |
127 |
128 |
129 |
130 |

131 | plugins /  Overview

132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 | 146 |
147 |
148 |
149 |

Overview

150 |
151 |

Plugins extend the core functionality of Assemble.

152 |
153 |

Plugins are a new feature, but we know they'll play a big part in Assemble's future. We're looking for great plugins to add to our documentation and "contrib" collection, so please 154 | let us know if you have something in mind!

155 |

If you authored an Assemble plugin, please submit a pull request to add it to this page!

156 |

Contrib Plugins

157 |
    158 |
  • 159 | assemble-contrib-contextual: Generates a JSON file containing the context of each page. Basic plugin to help see what's happening in the build.
  • 160 |
  • 161 | assemble-contrib-permalinks: This plugin enables powerful and configurable URI replacement patterns, presets, uses Moment.js for parsing dates, and much more.
  • 162 |
163 |

Community Plugins

164 | 172 |

Plugins we want

173 |

Here are some plugins we'd like to see. ( 174 | Let us know if you build one and want to make it a contrib plugin):

175 |
    176 |
  • pagination
  • 177 |
  • navigation
  • 178 |
  • indexing
  • 179 |
  • anchor generation for headings in HTML converted from markdown
  • 180 |
  • component-builders for YUI, OOCSS (make sure you talk to us about these if you're interested!)
  • 181 |
  • theme generators
  • 182 |
183 |

Things we're working on or need help with

184 |
    185 |
  • yeoman plugin generator
  • 186 |
  • grunt init template
  • 187 |
  • documentation
  • 188 |
  • best practices for creating plugins
  • 189 |
190 |
191 |

192 | See the template for this page → 193 |

194 |
195 | 202 | 203 | 204 |

Find an error? 205 | Let us know → 206 |

207 |
208 |
209 |
210 |
211 |
212 | 213 | 214 | 215 | 216 | 217 | 226 | 229 | 230 | 231 | -------------------------------------------------------------------------------- /helpers/helpers-misc.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Misc | Assemble 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 53 | 68 | 69 | 70 | 114 | 123 |
124 |
125 |
126 |
127 |

128 | helpers /  Misc

129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 | 244 |
245 |
246 |
247 |

Misc

248 |

249 |

{{default}}

250 |

251 |

Provides a default or fallback value if a value doesn't exist. 252 |
Parameters: defaultValue string|int - The default value to use. title = '' 253 |

254 |

Template:

255 |
{{default title "No title available."}}
256 |

Renders to:

257 |
No title available.
258 |

{{noop}}

259 |

TODO...

260 |
261 |

262 | See the template for this page → 263 |

264 |
265 | 272 | 273 | 274 |

Find an error? 275 | Let us know → 276 |

277 |
278 |
279 |
280 |
281 |
282 | 283 | 284 | 285 | 286 | 287 | 296 | 299 | 300 | 301 | -------------------------------------------------------------------------------- /helpers/helpers-markdown.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Markdown | Assemble 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 53 | 68 | 69 | 70 | 114 | 123 |
124 |
125 |
126 |
127 |

128 | helpers /  Markdown

129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 | 244 |
245 |
246 |
247 |

Markdown

248 |

249 |

{{markdown}}

250 |

251 |

Block helper for embedding markdown content inside HTML, and rendering it to HTML at build time. 252 |

253 |

Template:

254 |
<h1>My Blog</h1>
255 | {{#markdown}}
256 | ## Post of the day
257 | Vestibulum posuere, quam sed bibendum posuere
258 | Pellentesque habitant morbi tristique senectus
259 | Pellentesque nulla augue, volutpat vitae
260 | Read more... 
261 | In hac habitasse platea dictumst. Morbi non rutrum risus.
262 | {{/markdown}}
263 |

Renders to:

264 |
<h1>My Blog</h1>
265 | <h2>Post of the day</h2>
266 | <p>Vestibulum posuere, quam sed bibendum posuere
267 | Pellentesque habitant morbi tristique senectus
268 | Pellentesque nulla augue, volutpat vitae</p>
269 | <a href="https://github.com/assemble/jonschlinkert">Read  more...</a>
270 | <p>In hac habitasse platea dictumst. Morbi non rutrum risus.</p>
271 |

{{md}}

272 |

Include markdown from specified file(s), and render it to HTML 273 |

274 |

Template:

275 |
{{md "file/to/include/post.md"}}
276 |

Any content inside the "included" markdown file will be rendered as HTML.

277 |
278 |

279 | See the template for this page → 280 |

281 |
282 | 289 | 290 | 291 |

Find an error? 292 | Let us know → 293 |

294 |
295 |
296 |
297 |
298 |
299 | 300 | 301 | 302 | 303 | 304 | 313 | 316 | 317 | 318 | -------------------------------------------------------------------------------- /helpers/helpers-data.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Data | Assemble 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 53 | 68 | 69 | 70 | 114 | 123 |
124 |
125 |
126 |
127 |

128 | helpers /  Data

129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 | 244 |
245 |
246 |
247 |

Data

248 |

249 |

{{parseJSON}}

250 |

251 |
252 |

This block helper parses "inline" JSON and passes it into the templates or partial contained therein.

253 |
254 |

Credit: 255 | Keegan Street from 256 | this issue 257 |

258 |

The helper:

259 |
parseJSON = function (data, options)  { 
260 |   return  options.fn(JSON.parse(data));
261 | };
262 |

Templates (here we are using a partial, input.hbs):

263 |
<div>
264 |   <label for="{{id}}">{{label}}</label>
265 |   <input type="text" id="{{id}}">
266 | </div>
267 |

And we include our partial like this:

268 |
{{#parseJSON '{"id": "firstname", "label": "First name"}'}}
269 |   {{> input }}
270 | {{/parseJSON}}
271 |
272 |

Instead of having to write out the same HTML over and over again, we can define it once in a partial and then include that partial inline whenever we need it. Typically Handlebars requires data to be defined separately from templates. But 273 | in this use case it is easier to define the options for the partial where we include the partial. These options aren't "data" that should be separated from the template; they are really just options for the template. 274 |
-- Keegan Street (@keeganstreet)

275 |
276 |
277 |

278 | See the template for this page → 279 |

280 |
281 | 288 | 289 | 290 |

Find an error? 291 | Let us know → 292 |

293 |
294 |
295 |
296 |
297 |
298 | 299 | 300 | 301 | 302 | 303 | 312 | 315 | 316 | 317 | -------------------------------------------------------------------------------- /helpers/helpers-inflections.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Inflections | Assemble 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 53 | 68 | 69 | 70 | 114 | 123 |
124 |
125 |
126 |
127 |

128 | helpers /  Inflections

129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 | 244 |
245 |
246 |
247 |

Inflections

248 |

249 |

{{inflect}}

250 |

251 |

252 |

Returns the plural or singular form of a word based on a count. 253 |

254 |

255 |

256 |

Parameters:

257 |

258 |

259 |

    260 |

    261 |

    262 |

  • singular string - The singular form of the word. (Required)
  • 263 |

    264 |

    265 |

  • plural string - The plural form of the word. (Required)
  • 266 |

    267 |

    268 |

  • include boolean - whether or not to include the count before the word. (Optional)
  • 269 |
270 |

271 |

272 |

Data:

273 |

274 |
enemies = 0 
275 | friends = 1 
276 |

Template:

277 |
{{inflect enemies "enemy" "enemies"}}
278 | {{inflect friends "friend" "friends" true}}
279 |

Renders to:

280 |
enemies
281 | 1 friend
282 |

{{ordinalize}}

283 |

Turns a number into an ordinal string. Taken from the templating library Walrus by Jeremy Ruppel. 284 |

285 |

Parameters: none 286 |

287 |

Template:

288 |
{{ordinalize 3}}
289 | {{ordinalize 1}}
290 | {{ordinalize 22}}
291 |

Renders to:

292 |
3rd
293 | 1st
294 | 22nd
295 |
296 |

297 | See the template for this page → 298 |

299 |
300 | 307 | 308 | 309 |

Find an error? 310 | Let us know → 311 |

312 |
313 |
314 |
315 |
316 |
317 | 318 | 319 | 320 | 321 | 322 | 331 | 334 | 335 | 336 | -------------------------------------------------------------------------------- /assets/js/holder.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Holder - 1.9 - client side image placeholders 4 | (c) 2012-2013 Ivan Malopinsky / http://imsky.co 5 | 6 | Provided under the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 7 | Commercial use requires attribution. 8 | 9 | */ 10 | 11 | var Holder = Holder || {}; 12 | (function (app, win) { 13 | 14 | var preempted = false, 15 | fallback = false, 16 | canvas = document.createElement('canvas'); 17 | 18 | //getElementsByClassName polyfill 19 | document.getElementsByClassName||(document.getElementsByClassName=function(e){var t=document,n,r,i,s=[];if(t.querySelectorAll)return t.querySelectorAll("."+e);if(t.evaluate){r=".//*[contains(concat(' ', @class, ' '), ' "+e+" ')]",n=t.evaluate(r,t,null,0,null);while(i=n.iterateNext())s.push(i)}else{n=t.getElementsByTagName("*"),r=new RegExp("(^|\\s)"+e+"(\\s|$)");for(i=0;i 1) { 69 | text_height = template.size / (ctx.measureText(text).width / width); 70 | } 71 | //Resetting font size if necessary 72 | ctx.font = "bold " + (text_height * ratio) + "px " + font; 73 | ctx.fillText(text, (width / 2), (height / 2), width); 74 | return canvas.toDataURL("image/png"); 75 | } 76 | 77 | function render(mode, el, holder, src) { 78 | var dimensions = holder.dimensions, 79 | theme = holder.theme, 80 | text = holder.text ? decodeURIComponent(holder.text) : holder.text; 81 | var dimensions_caption = dimensions.width + "x" + dimensions.height; 82 | 83 | theme = (text ? extend(theme, { 84 | text: text 85 | }) : theme); 86 | theme = (holder.font ? extend(theme, { 87 | font: holder.font 88 | }) : theme); 89 | 90 | if (mode == "image") { 91 | el.setAttribute("data-src", src); 92 | el.setAttribute("alt", text ? text : theme.text ? theme.text + " [" + dimensions_caption + "]" : dimensions_caption); 93 | 94 | if (fallback || !holder.auto) { 95 | el.style.width = dimensions.width + "px"; 96 | el.style.height = dimensions.height + "px"; 97 | } 98 | 99 | if (fallback) { 100 | el.style.backgroundColor = theme.background; 101 | 102 | } else { 103 | el.setAttribute("src", draw(ctx, dimensions, theme, ratio)); 104 | } 105 | } else { 106 | if (!fallback) { 107 | el.style.backgroundImage = "url(" + draw(ctx, dimensions, theme, ratio) + ")"; 108 | el.style.backgroundSize = dimensions.width + "px " + dimensions.height + "px"; 109 | } 110 | } 111 | }; 112 | 113 | function fluid(el, holder, src) { 114 | var dimensions = holder.dimensions, 115 | theme = holder.theme, 116 | text = holder.text; 117 | var dimensions_caption = dimensions.width + "x" + dimensions.height; 118 | theme = (text ? extend(theme, { 119 | text: text 120 | }) : theme); 121 | 122 | var fluid = document.createElement("div"); 123 | 124 | if (el.fluidRef) { 125 | fluid = el.fluidRef; 126 | } 127 | 128 | fluid.style.backgroundColor = theme.background; 129 | fluid.style.color = theme.foreground; 130 | fluid.className = el.className + " holderjs-fluid"; 131 | fluid.style.width = holder.dimensions.width + (holder.dimensions.width.indexOf("%") > 0 ? "" : "px"); 132 | fluid.style.height = holder.dimensions.height + (holder.dimensions.height.indexOf("%") > 0 ? "" : "px"); 133 | fluid.id = el.id; 134 | 135 | el.style.width = 0; 136 | el.style.height = 0; 137 | 138 | if (!el.fluidRef) { 139 | 140 | if (theme.text) { 141 | fluid.appendChild(document.createTextNode(theme.text)) 142 | } else { 143 | fluid.appendChild(document.createTextNode(dimensions_caption)) 144 | fluid_images.push(fluid); 145 | setTimeout(fluid_update, 0); 146 | } 147 | 148 | } 149 | 150 | el.fluidRef = fluid; 151 | el.parentNode.insertBefore(fluid, el.nextSibling) 152 | 153 | if (window.jQuery) { 154 | jQuery(function ($) { 155 | $(el).on("load", function () { 156 | el.style.width = fluid.style.width; 157 | el.style.height = fluid.style.height; 158 | $(el).show(); 159 | $(fluid).remove(); 160 | }); 161 | }) 162 | } 163 | } 164 | 165 | function fluid_update() { 166 | for (i in fluid_images) { 167 | if (!fluid_images.hasOwnProperty(i)) continue; 168 | var el = fluid_images[i], 169 | label = el.firstChild; 170 | 171 | el.style.lineHeight = el.offsetHeight + "px"; 172 | label.data = el.offsetWidth + "x" + el.offsetHeight; 173 | } 174 | } 175 | 176 | function parse_flags(flags, options) { 177 | 178 | var ret = { 179 | theme: settings.themes.gray 180 | }, render = false; 181 | 182 | for (sl = flags.length, j = 0; j < sl; j++) { 183 | var flag = flags[j]; 184 | if (app.flags.dimensions.match(flag)) { 185 | render = true; 186 | ret.dimensions = app.flags.dimensions.output(flag); 187 | } else if (app.flags.fluid.match(flag)) { 188 | render = true; 189 | ret.dimensions = app.flags.fluid.output(flag); 190 | ret.fluid = true; 191 | } else if (app.flags.colors.match(flag)) { 192 | ret.theme = app.flags.colors.output(flag); 193 | } else if (options.themes[flag]) { 194 | //If a theme is specified, it will override custom colors 195 | ret.theme = options.themes[flag]; 196 | } else if (app.flags.text.match(flag)) { 197 | ret.text = app.flags.text.output(flag); 198 | } else if (app.flags.font.match(flag)) { 199 | ret.font = app.flags.font.output(flag); 200 | } else if (app.flags.auto.match(flag)) { 201 | ret.auto = true; 202 | } 203 | } 204 | 205 | return render ? ret : false; 206 | 207 | }; 208 | 209 | 210 | 211 | if (!canvas.getContext) { 212 | fallback = true; 213 | } else { 214 | if (canvas.toDataURL("image/png") 215 | .indexOf("data:image/png") < 0) { 216 | //Android doesn't support data URI 217 | fallback = true; 218 | } else { 219 | var ctx = canvas.getContext("2d"); 220 | } 221 | } 222 | 223 | var dpr = 1, bsr = 1; 224 | 225 | if(!fallback){ 226 | dpr = window.devicePixelRatio || 1, 227 | bsr = ctx.webkitBackingStorePixelRatio || ctx.mozBackingStorePixelRatio || ctx.msBackingStorePixelRatio || ctx.oBackingStorePixelRatio || ctx.backingStorePixelRatio || 1; 228 | } 229 | 230 | var ratio = dpr / bsr; 231 | 232 | var fluid_images = []; 233 | 234 | var settings = { 235 | domain: "holder.js", 236 | images: "img", 237 | bgnodes: ".holderjs", 238 | themes: { 239 | "gray": { 240 | background: "#eee", 241 | foreground: "#aaa", 242 | size: 12 243 | }, 244 | "social": { 245 | background: "#3a5a97", 246 | foreground: "#fff", 247 | size: 12 248 | }, 249 | "industrial": { 250 | background: "#434A52", 251 | foreground: "#C2F200", 252 | size: 12 253 | } 254 | }, 255 | stylesheet: ".holderjs-fluid {font-size:16px;font-weight:bold;text-align:center;font-family:sans-serif;margin:0}" 256 | }; 257 | 258 | 259 | app.flags = { 260 | dimensions: { 261 | regex: /^(\d+)x(\d+)$/, 262 | output: function (val) { 263 | var exec = this.regex.exec(val); 264 | return { 265 | width: +exec[1], 266 | height: +exec[2] 267 | } 268 | } 269 | }, 270 | fluid: { 271 | regex: /^([0-9%]+)x([0-9%]+)$/, 272 | output: function (val) { 273 | var exec = this.regex.exec(val); 274 | return { 275 | width: exec[1], 276 | height: exec[2] 277 | } 278 | } 279 | }, 280 | colors: { 281 | regex: /#([0-9a-f]{3,})\:#([0-9a-f]{3,})/i, 282 | output: function (val) { 283 | var exec = this.regex.exec(val); 284 | return { 285 | size: settings.themes.gray.size, 286 | foreground: "#" + exec[2], 287 | background: "#" + exec[1] 288 | } 289 | } 290 | }, 291 | text: { 292 | regex: /text\:(.*)/, 293 | output: function (val) { 294 | return this.regex.exec(val)[1]; 295 | } 296 | }, 297 | font: { 298 | regex: /font\:(.*)/, 299 | output: function (val) { 300 | return this.regex.exec(val)[1]; 301 | } 302 | }, 303 | auto: { 304 | regex: /^auto$/ 305 | } 306 | } 307 | 308 | for (var flag in app.flags) { 309 | if (!app.flags.hasOwnProperty(flag)) continue; 310 | app.flags[flag].match = function (val) { 311 | return val.match(this.regex) 312 | } 313 | } 314 | 315 | app.add_theme = function (name, theme) { 316 | name != null && theme != null && (settings.themes[name] = theme); 317 | return app; 318 | }; 319 | 320 | app.add_image = function (src, el) { 321 | var node = selector(el); 322 | if (node.length) { 323 | for (var i = 0, l = node.length; i < l; i++) { 324 | var img = document.createElement("img") 325 | img.setAttribute("data-src", src); 326 | node[i].appendChild(img); 327 | } 328 | } 329 | return app; 330 | }; 331 | 332 | app.run = function (o) { 333 | var options = extend(settings, o), 334 | images = [], imageNodes = [], bgnodes = []; 335 | 336 | if(typeof(options.images) == "string"){ 337 | imageNodes = selector(options.images); 338 | } 339 | else if (window.NodeList && options.images instanceof window.NodeList) { 340 | imageNodes = options.images; 341 | } else if (window.Node && options.images instanceof window.Node) { 342 | imageNodes = [options.images]; 343 | } 344 | 345 | if(typeof(options.bgnodes) == "string"){ 346 | bgnodes = selector(options.bgnodes); 347 | } else if (window.NodeList && options.elements instanceof window.NodeList) { 348 | bgnodes = options.bgnodes; 349 | } else if (window.Node && options.bgnodes instanceof window.Node) { 350 | bgnodes = [options.bgnodes]; 351 | } 352 | 353 | preempted = true; 354 | 355 | for (i = 0, l = imageNodes.length; i < l; i++) images.push(imageNodes[i]); 356 | 357 | var holdercss = document.getElementById("holderjs-style"); 358 | if (!holdercss) { 359 | holdercss = document.createElement("style"); 360 | holdercss.setAttribute("id", "holderjs-style"); 361 | holdercss.type = "text/css"; 362 | document.getElementsByTagName("head")[0].appendChild(holdercss); 363 | } 364 | 365 | if (!options.nocss) { 366 | if (holdercss.styleSheet) { 367 | holdercss.styleSheet.cssText += options.stylesheet; 368 | } else { 369 | holdercss.appendChild(document.createTextNode(options.stylesheet)); 370 | } 371 | } 372 | 373 | 374 | 375 | var cssregex = new RegExp(options.domain + "\/(.*?)\"?\\)"); 376 | 377 | for (var l = bgnodes.length, i = 0; i < l; i++) { 378 | var src = window.getComputedStyle(bgnodes[i], null) 379 | .getPropertyValue("background-image"); 380 | var flags = src.match(cssregex); 381 | var bgsrc = bgnodes[i].getAttribute("data-background-src"); 382 | 383 | if (flags) { 384 | var holder = parse_flags(flags[1].split("/"), options); 385 | if (holder) { 386 | render("background", bgnodes[i], holder, src); 387 | } 388 | } 389 | else if(bgsrc != null){ 390 | var holder = parse_flags(bgsrc.substr(bgsrc.lastIndexOf(options.domain) + options.domain.length + 1) 391 | .split("/"), options); 392 | if(holder){ 393 | render("background", bgnodes[i], holder, src); 394 | } 395 | } 396 | } 397 | 398 | for (l = images.length, i = 0; i < l; i++) { 399 | 400 | var attr_src = attr_data_src = src = null; 401 | 402 | try{ 403 | attr_src = images[i].getAttribute("src"); 404 | attr_datasrc = images[i].getAttribute("data-src"); 405 | }catch(e){} 406 | 407 | if (attr_datasrc == null && !! attr_src && attr_src.indexOf(options.domain) >= 0) { 408 | src = attr_src; 409 | } else if ( !! attr_datasrc && attr_datasrc.indexOf(options.domain) >= 0) { 410 | src = attr_datasrc; 411 | } 412 | 413 | if (src) { 414 | var holder = parse_flags(src.substr(src.lastIndexOf(options.domain) + options.domain.length + 1) 415 | .split("/"), options); 416 | if (holder) { 417 | if (holder.fluid) { 418 | fluid(images[i], holder, src); 419 | } else { 420 | render("image", images[i], holder, src); 421 | } 422 | } 423 | } 424 | } 425 | return app; 426 | }; 427 | 428 | contentLoaded(win, function () { 429 | if (window.addEventListener) { 430 | window.addEventListener("resize", fluid_update, false); 431 | window.addEventListener("orientationchange", fluid_update, false); 432 | } else { 433 | window.attachEvent("onresize", fluid_update) 434 | } 435 | preempted || app.run(); 436 | }); 437 | 438 | if (typeof define === "function" && define.amd) { 439 | define("Holder", [], function () { 440 | return app; 441 | }); 442 | } 443 | 444 | })(Holder, window); 445 | -------------------------------------------------------------------------------- /helpers/helpers-path.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Path | Assemble 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 53 | 68 | 69 | 70 | 114 | 123 |
124 |
125 |
126 |
127 |

128 | helpers /  Path

129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 | 244 |
245 |
246 |
247 |

Path

248 |

249 |

Path helpers are 250 | node.js utilities for handling and transforming file paths. As with node.js:

251 |

252 |

253 |

254 |

255 |

256 |

"these helpers perform only string transformations. The file system is not consulted to check whether paths are valid."

257 |
258 |

259 |

260 |

{{_dirname}}

261 |

262 |

263 |

Return the directory name of a path. Similar to the Unix dirname command. 264 |

265 |

266 |

267 |

Template:

268 |

269 |
{{_dirname '/foo/bar/baz/asdf/quux'}}
270 |

Renders to:

271 |
'/foo/bar/baz/asdf'
272 |

{{_extname}}

273 |

"Return the extension of the path, from the last '.' to end of string in the last portion of the path. If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string." 274 |

275 |

Parameters: string (the value to test against). Default: none 276 |

277 |

Template:

278 |
{{_extname 'index.html'}}
279 |

Renders to:

280 |
.html
281 |

Template:

282 |
{{_extname 'index.'}}
283 |

Renders to:

284 |
.
285 |

Template:

286 |
{{_extname 'index'}}
287 |

Returns nothing.

288 |

{{_relative}}

289 |

Derive the relative path from one absolute path to another (e.g from path A, to path B). 290 |
Parameters: string (the value to test against) 291 |
Default: none 292 |

293 |

Example:

294 |
{{_relative "from" "to"}}
295 |

Template:

296 |
<a href="{{_relative "src" "dist"}}/assets/css/styles.css"></a>
297 |

Renders to:

298 |
<a href="../../dist/assets/css/styles.css"></a>
299 |
300 |

301 | See the template for this page → 302 |

303 |
304 | 311 | 312 | 313 |

Find an error? 314 | Let us know → 315 |

316 |
317 |
318 |
319 |
320 |
321 | 322 | 323 | 324 | 325 | 326 | 335 | 338 | 339 | 340 | -------------------------------------------------------------------------------- /helpers/helpers-content.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Content | Assemble 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 53 | 68 | 69 | 70 | 114 | 123 |
124 |
125 |
126 |
127 |

128 | helpers /  Content

129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 | 244 |
245 |
246 |
247 |

Content

248 |

249 |

{{copy}}

250 |

251 |

252 |

example helpers, not for actual use! 253 | Why do this? The goal is to inspire other concepts that build from this one.

254 |

255 |

256 |

Example helper, copies file A to path B. 257 |
Parameters: String 258 |
Default: undefined 259 |

260 |

261 |

262 |

Example:

263 |

264 |
{{copy 'a.html' '../dir/b.txt'}}
265 |

{{glob}}

266 |

example helper: This helper is intended to be instructive, to help with creating new helpers that use these features.

267 |

Use minimatch patterns to include content from specified file or files. 268 |
Parameters: String 269 |
Default: undefined 270 |

271 |

Examples:

272 |
{{glob  'src /files /*.md '}} 
273 | {{glob  'src /files /*. {txt,md }'}} 
274 |

{{include}}

275 |

Include external files. 276 |

277 |

278 |
Pattern: {{include [name] [data]}} 279 |
Parameters:

280 |
    281 |
  • name (required): [string] - The name or path of the file in which your template is defined. (Required)
  • 282 |
  • data (optional): [int|string|collection] - Data you want to use inside the include.
  • 283 |
284 |

Data (collection): planet-express.json 285 |

286 |
[
287 |   "Professor Farnsworth",
288 |   "Fry",
289 |   "Bender" 
290 | ]
291 |

Include (partial to be "included"): planet-express.hbs 292 |

293 |
{{sort this}}
294 |

Template:

295 |
<p>{{include "planet-express.hbs" data}}</p>
296 |

Renders to:

297 |
<p>Bender, Fry, Professor Farnsworth</p>
298 |
299 |

300 | See the template for this page → 301 |

302 |
303 | 310 | 311 | 312 |

Find an error? 313 | Let us know → 314 |

315 |
316 |
317 |
318 |
319 |
320 | 321 | 322 | 323 | 324 | 325 | 334 | 337 | 338 | 339 | -------------------------------------------------------------------------------- /helpers/helpers-url.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | URL | Assemble 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 53 | 68 | 69 | 70 | 114 | 123 |
124 |
125 |
126 |
127 |

128 | helpers /  URL

129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 | 244 |
245 |
246 |
247 |

URL

248 |

249 |

250 |

251 |

252 |

URL helpers are 253 | node.js url utilities for URL resolution and parsing. As with node.js:

254 |
255 |

256 |

257 |

{{urlParse}}

258 |

259 |

260 |

Take a URL string, and return an object. 261 |

262 |

263 |

264 |

Params

265 |

266 |

267 |

url

268 |

269 |

270 |

Type: String 271 | Default: undefined 272 |

273 |

274 |

275 |

The URL to parse.

276 |

277 |

278 |

output format

279 |

280 |

281 |

Type: String 282 | Default: json (options: yaml or json)

283 |

284 |

285 |

Template:

286 |

287 |
{{urlParse "http://example.com/one"}}
288 |

Renders to:

289 |
{
290 |   "protocol ": "http:" ,
291 |   "slashes ": true ,
292 |   "auth ": null ,
293 |   "host ": "example.com" ,
294 |   "port ": null ,
295 |   "hostname ": "example.com" ,
296 |   "hash ": null ,
297 |   "search ": null ,
298 |   "query ": null ,
299 |   "pathname ": "/one" ,
300 |   "path ": "/one" ,
301 |   "href ": "http://example.com/one" 
302 |  }
303 |

Or with yaml as the second param:

304 |
{{urlParse "http://foo.com/bar/baz?key=value" "yaml"}}
305 |

Renders to:

306 |
protocol: "http:"
307 | slashes: true
308 | auth: null
309 | host: "foo.com"
310 | port: null
311 | hostname: "foo.com"
312 | hash: null
313 | search: "?key=value"
314 | query: "key=value"
315 | pathname: "/bar/baz"
316 | path: "/bar/baz?key=value"
317 | href: "http://foo.com/bar/baz?key=value"
318 | parse:
319 | format:
320 | resolve:
321 | resolveObject:
322 | parseHost:
323 |

{{urlResolve}}

324 |

Take a base URL, and a href URL, and resolve them as a browser would for an anchor tag. 325 |

326 |

327 |
Template:

328 |
{{urlResolve url href}}
329 |

Example:

330 |
<a href="{{urlResolve "http://example.com/one" "/two"}}"></a>
331 |

Renders to:

332 |
<a href="http://example.com/two"></a>
333 |
334 |

335 | See the template for this page → 336 |

337 |
338 | 345 | 346 | 347 |

Find an error? 348 | Let us know → 349 |

350 |
351 |
352 |
353 |
354 |
355 | 356 | 357 | 358 | 359 | 360 | 369 | 372 | 373 | 374 | -------------------------------------------------------------------------------- /helpers/helpers-math.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Math | Assemble 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 53 | 68 | 69 | 70 | 114 | 123 |
124 |
125 |
126 |
127 |

128 | helpers /  Math

129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 | 244 |
245 |
246 |
247 |

Math

248 |

249 |

{{add}}

250 |

251 |

252 |

Returns the sum of two numbers. 253 |
Parameters: value int - The number to add to the expression. (Required)

254 |

255 |

256 |

Data:

257 |

258 |
value = 5 
259 |

Template:

260 |
{{add value 5}}
261 |

Renders to:

262 |
10
263 |

{{ceil}}

264 |

Returns the value rounded up to the nearest integer. 265 |
Parameters: none 266 |

267 |

Data:

268 |
value = 5.6 
269 |

Template:

270 |
{{ceil value}}
271 |

Renders to:

272 |
6
273 |

{{divide}}

274 |

Returns the division of two numbers. 275 |
Parameters: value int - The number to divide the expression. (Required)

276 |

Data:

277 |
value = 5 
278 |

Template:

279 |
{{divide value 5}}
280 |

Renders to:

281 |
1
282 |

{{floor}}

283 |

Returns the value rounded down to the nearest integer. 284 |
Parameters: none 285 |

286 |

Data:

287 |
value = 5.6 
288 |

Template:

289 |
{{floor value}}
290 |

Renders to:

291 |
5
292 |

{{multiply}}

293 |

Returns the multiplication of two numbers. 294 |
Parameters: value int - The number to multiply the expression. (Required)

295 |

Data:

296 |
value = 5 
297 |

Template:

298 |
{{multiply value 5}}
299 |

Renders to:

300 |
25
301 |

{{round}}

302 |

Returns the value rounded to the nearest integer. 303 |
Parameters: none 304 |

305 |

Data:

306 |
value = 5.69 
307 |

Template:

308 |
{{round value}}
309 |

Renders to:

310 |
6
311 |

{{subtract}}

312 |

Returns the difference of two numbers. Opposite of add 313 |
Parameters: value int - The number to subtract from the expression. (Required)_

314 |

Data:

315 |
value = 5 
316 |

Template:

317 |
{{subtract value 5}}
318 |

Renders to:

319 |
0
320 |

{{sum}}

321 |

Returns the sum of multiple numbers. Similar to {{#add}} block helper but accepts multiple arguments. 322 |
Parameters: none 323 |

324 |

Data:

325 |
value = {
326 |   a: 1,
327 |   b: 2,
328 |   c: 3 
329 | }
330 |

Template:

331 |
{{sum value.a value.b value.c}}
332 |

Renders to:

333 |
6
334 |
335 |

336 | See the template for this page → 337 |

338 |
339 | 346 | 347 | 348 |

Find an error? 349 | Let us know → 350 |

351 |
352 |
353 |
354 |
355 |
356 | 357 | 358 | 359 | 360 | 361 | 370 | 373 | 374 | 375 | -------------------------------------------------------------------------------- /helpers/helpers-numbers.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Numbers | Assemble 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 53 | 68 | 69 | 70 | 114 | 123 |
124 |
125 |
126 |
127 |

128 | helpers /  Numbers

129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 | 244 |
245 |
246 |
247 |

Numbers

248 |

249 |

{{addCommas}}

250 |

251 |

252 |

Adds commas to a number. 253 |

254 |

255 |

256 |

Parameters: none 257 |

258 |

259 |

260 |

Data:

261 |

262 |
value = 2222222 
263 |

Template:

264 |
{{addCommas value}}
265 |

Renders to:

266 |
2,222,222
267 |

{{toAbbr}}

268 |

Returns the number in abbreviation formats based on a value. The number is rounded to a particular decimal place. 269 |

270 |

Parameters: digits int - The number of digits to appear after the decimal point. (Optional)

271 |

Default: 2 272 |

273 |

Data:

274 |
value = 123456789 
275 |

Template:

276 |
{{toAbbr value}}
277 |

Renders to:

278 |
123.457m
279 |

{{toExponential}}

280 |

Returns the number in exponential notation with one digit before the decimal point, rounded to fractions digits after the decimal point. 281 |

282 |

Parameters: fractions int - An integer specifying the number of digits after the decimal point. (Optional)

283 |

Data:

284 |
value = 5 
285 |

Template:

286 |
{{toExponential value 5}}
287 |

Renders to:

288 |
5.00000e+0
289 |

{{toFixed}}

290 |

Returns exactly digits after the decimal place. The number is rounded if necessary, and the fractional part is padded with zeros if necessary so that it has the specified length. 291 |

292 |

Parameters: digits int - The number of digits to appear after the decimal point. (Optional)

293 |

Data:

294 |
value = 5.53231 
295 |

Template:

296 |
{{toFixed value 3}}
297 |

Renders to:

298 |
5.532
299 |

{{toFloat}}

300 |

Returns a floating point number. 301 |

302 |

Parameters: none 303 |

304 |

Data:

305 |
value = '22.2abc' 
306 |

Template:

307 |
{{toFloat value}}
308 |

Renders to:

309 |
22.2
310 |

{{toInt}}

311 |

Returns an integer. 312 |

313 |

Parameters: none 314 |

315 |

Data:

316 |
value = '22.2abc' 
317 |

Template:

318 |
{{toInt value}}
319 |

Renders to:

320 |
22
321 |

{{toPrecision}}

322 |

Returns the number in fixed-point or exponential notation rounded to precision significant digits. 323 |

324 |

Parameters: precision int - The number of digits. If omitted, it returns the entire number (without any formatting). (Optional)

325 |

Data:

326 |
value = 555.322 
327 |

Template:

328 |
{{toPrecision value 4}}
329 |

Renders to:

330 |
555.3
331 |
332 |

333 | See the template for this page → 334 |

335 |
336 | 343 | 344 | 345 |

Find an error? 346 | Let us know → 347 |

348 |
349 |
350 |
351 |
352 |
353 | 354 | 355 | 356 | 357 | 358 | 367 | 370 | 371 | 372 | --------------------------------------------------------------------------------