summaryrefslogtreecommitdiffstats
path: root/docs/assets/flatdoc
diff options
context:
space:
mode:
Diffstat (limited to 'docs/assets/flatdoc')
-rw-r--r--docs/assets/flatdoc/flatdoc.js1734
-rw-r--r--docs/assets/flatdoc/legacy.js23
-rw-r--r--docs/assets/flatdoc/theme-white/script.js318
-rw-r--r--docs/assets/flatdoc/theme-white/style.css831
4 files changed, 2906 insertions, 0 deletions
diff --git a/docs/assets/flatdoc/flatdoc.js b/docs/assets/flatdoc/flatdoc.js
new file mode 100644
index 0000000..734accd
--- /dev/null
+++ b/docs/assets/flatdoc/flatdoc.js
@@ -0,0 +1,1734 @@
+/*!
+Flatdoc (http://ricostacruz.com/flatdoc)
+(c) 2013 Rico Sta. Cruz. MIT licensed.
+
+Also includes:
+
+ marked
+ a markdown parser
+ (c) 2011-2013, Christopher Jeffrey. (MIT Licensed)
+ https://github.com/chjj/marked
+
+ base64.js
+ http://github.com/dankogai/js-base64
+
+*/
+
+(function($) {
+ var exports = this;
+
+ var marked;
+
+ /**
+ * Basic Flatdoc module.
+ *
+ * The main entry point is `Flatdoc.run()`, which invokes the [Runner].
+ *
+ * Flatdoc.run({
+ * fetcher: Flatdoc.github('rstacruz/backbone-patterns');
+ * });
+ */
+
+ var Flatdoc = exports.Flatdoc = {};
+
+ /**
+ * Creates a runner.
+ * See [Flatdoc].
+ */
+
+ Flatdoc.run = function(options) {
+ $(function() { (new Flatdoc.runner(options)).run(); });
+ };
+
+ /**
+ * File fetcher function.
+ *
+ * Fetches a given `url` via AJAX.
+ * See [Runner#run()] for a description of fetcher functions.
+ */
+
+ Flatdoc.file = function(url) {
+ return function(callback) {
+ $.get(url)
+ .fail(function(e) { callback(e, null); })
+ .done(function(data) { callback(null, data); });
+ };
+ };
+
+ /**
+ * Github fetcher.
+ * Fetches from repo `repo` (in format 'user/repo').
+ *
+ * If the parameter `filepath` is supplied, it fetches the contents of that
+ * given file in the repo.
+ *
+ * See [Runner#run()] for a description of fetcher functions.
+ *
+ * See: http://developer.github.com/v3/repos/contents/
+ */
+ Flatdoc.github = function(repo, filepath) {
+ var url;
+ if (filepath) {
+ url = 'https://api.github.com/repos/'+repo+'/contents/'+filepath;
+ } else {
+ url = 'https://api.github.com/repos/'+repo+'/readme';
+ }
+ return function(callback) {
+ $.get(url)
+ .fail(function(e) { callback(e, null); })
+ .done(function(data) {
+ var markdown = exports.Base64.decode(data.content);
+ callback(null, markdown);
+ });
+ };
+ };
+
+ /**
+ * Parser module.
+ * Parses a given Markdown document and returns a JSON object with data
+ * on the Markdown document.
+ *
+ * var data = Flatdoc.parser.parse('markdown source here');
+ * console.log(data);
+ *
+ * data == {
+ * title: 'My Project',
+ * content: '<p>This project is a...',
+ * menu: {...}
+ * }
+ */
+
+ var Parser = Flatdoc.parser = {};
+
+ /**
+ * Parses a given Markdown document.
+ * See `Parser` for more info.
+ */
+ Parser.parse = function(source) {
+ marked = exports.marked;
+
+ Parser.setMarkedOptions();
+
+ var html = $("<div>" + marked(source));
+ var h1 = html.find('h1').eq(0);
+ var title = h1.text();
+
+ // Mangle content
+ Transformer.mangle(html);
+ var menu = Transformer.getMenu(html);
+
+ return { title: title, content: html, menu: menu };
+ };
+
+ Parser.setMarkedOptions = function() {
+ marked.setOptions({
+ highlight: function(code, lang) {
+ if (lang) {
+ var fn = Flatdoc.highlighters[lang] || Flatdoc.highlighters.generic;
+ return fn(code);
+ }
+ return code;
+ }
+ });
+ };
+
+ /**
+ * Transformer module.
+ * This takes care of any HTML mangling needed. The main entry point is
+ * `.mangle()` which applies all transformations needed.
+ *
+ * var $content = $("<p>Hello there, this is a docu...");
+ * Flatdoc.transformer.mangle($content);
+ *
+ * If you would like to change any of the transformations, decorate any of
+ * the functions in `Flatdoc.transformer`.
+ */
+
+ var Transformer = Flatdoc.transformer = {};
+
+ /**
+ * Takes a given HTML `$content` and improves the markup of it by executing
+ * the transformations.
+ *
+ * > See: [Transformer](#transformer)
+ */
+ Transformer.mangle = function($content) {
+ this.addIDs($content);
+ this.buttonize($content);
+ this.smartquotes($content);
+ };
+
+ /**
+ * Adds IDs to headings.
+ */
+
+ Transformer.addIDs = function($content) {
+ $content.find('h1, h2, h3').each(function() {
+ var $el = $(this);
+ var text = $el.text();
+ var id = slugify(text);
+ $el.attr('id', id);
+ });
+ };
+
+ /**
+ * Returns menu data for a given HTML.
+ *
+ * menu = Flatdoc.transformer.getMenu($content);
+ * menu == {
+ * level: 0,
+ * items: [{
+ * section: "Getting started",
+ * level: 1,
+ * items: [...]}, ...]}
+ */
+
+ Transformer.getMenu = function($content) {
+ var root = {items: [], id: '', level: 0};
+ var cache = [root];
+
+ function mkdir_p(level) {
+ var parent = (level > 1) ? mkdir_p(level-1) : root;
+ if (!cache[level]) {
+ var obj = { items: [], level: level };
+ cache[level] = obj;
+ parent.items.push(obj);
+ return obj;
+ }
+ return cache[level];
+ }
+
+ $content.find('h1, h2, h3').each(function() {
+ var $el = $(this);
+ var level = +(this.nodeName.substr(1));
+
+ var parent = mkdir_p(level-1);
+
+ var obj = { section: $el.text(), items: [], level: level, id: $el.attr('id') };
+ parent.items.push(obj);
+ cache[level] = obj;
+ });
+
+ return root;
+ };
+
+ /**
+ * Changes "button >" text to buttons.
+ */
+
+ Transformer.buttonize = function($content) {
+ $content.find('a').each(function() {
+ var $a = $(this);
+
+ var m = $a.text().match(/^(.*) >$/);
+ if (m) $a.text(m[1]).addClass('button');
+ });
+ };
+
+ /**
+ * Applies smart quotes to a given element.
+ * It leaves `code` and `pre` blocks alone.
+ */
+
+ Transformer.smartquotes = function ($content) {
+ var nodes = getTextNodesIn($content), len = nodes.length;
+ for (var i=0; i<len; i++) {
+ var node = nodes[i];
+ node.nodeValue = quotify(node.nodeValue);
+ }
+ };
+
+ /**
+ * Syntax highlighters.
+ *
+ * You may add or change more highlighters via the `Flatdoc.highlighters`
+ * object.
+ *
+ * Flatdoc.highlighters.js = function(code) {
+ * };
+ *
+ * Each of these functions
+ */
+
+ var Highlighters = Flatdoc.highlighters = {};
+
+ /**
+ * JavaScript syntax highlighter.
+ *
+ * Thanks @visionmedia!
+ */
+
+ Highlighters.js = Highlighters.javascript = function(code) {
+ return code
+ .replace(/</g, '&lt;')
+ .replace(/>/g, '&gt;')
+ .replace(/("[^\"]*?")/g, '<span class="string">$1</span>')
+ .replace(/('[^\']*?')/g, '<span class="string">$1</span>')
+ .replace(/\/\/(.*)/gm, '<span class="comment">//$1</span>')
+ .replace(/\/\*(.*)\*\//gm, '<span class="comment">/*$1*/</span>')
+ .replace(/(\d+\.\d+)/gm, '<span class="number">$1</span>')
+ .replace(/(\d+)/gm, '<span class="number">$1</span>')
+ .replace(/\bnew *(\w+)/gm, '<span class="keyword">new</span> <span class="init">$1</span>')
+ .replace(/\b(function|new|throw|return|var|if|else)\b/gm, '<span class="keyword">$1</span>');
+ };
+
+ Highlighters.html = function(code) {
+ return code
+ .replace(/</g, '&lt;')
+ .replace(/>/g, '&gt;')
+ .replace(/("[^\"]*?")/g, '<span class="string">$1</span>')
+ .replace(/('[^\']*?')/g, '<span class="string">$1</span>')
+ .replace(/&lt;!--(.*)--&gt;/g, '<span class="comment">&lt;!--$1--&gt;</span>')
+ .replace(/&lt;([^!][^ ]*)/g, '&lt;<span class="keyword">$1</span>');
+ };
+
+ Highlighters.generic = function(code) {
+ return code
+ .replace(/</g, '&lt;')
+ .replace(/>/g, '&gt;')
+ .replace(/("[^\"]*?")/g, '<span class="string">$1</span>')
+ .replace(/('[^\']*?')/g, '<span class="string">$1</span>')
+ .replace(/(\/\/|#)(.*)/gm, '<span class="comment">$1$2</span>')
+ .replace(/(\d+\.\d+)/gm, '<span class="number">$1</span>')
+ .replace(/(\d+)/gm, '<span class="number">$1</span>');
+ };
+
+ /**
+ * Menu view. Renders menus
+ */
+
+ var MenuView = Flatdoc.menuView = function(menu) {
+ var $el = $("<ul>");
+
+ function process(node, $parent) {
+ var id = node.id || 'root';
+
+ var $li = $('<li>')
+ .attr('id', id + '-item')
+ .addClass('level-' + node.level)
+ .appendTo($parent);
+
+ if (node.section) {
+ var $a = $('<a>')
+ .html(node.section)
+ .attr('id', id + '-link')
+ .attr('href', '#' + node.id)
+ .addClass('level-' + node.level)
+ .appendTo($li);
+ }
+
+ if (node.items.length > 0) {
+ var $ul = $('<ul>')
+ .addClass('level-' + (node.level+1))
+ .attr('id', id + '-list')
+ .appendTo($li);
+
+ node.items.forEach(function(item) {
+ process(item, $ul);
+ });
+ }
+ }
+
+ process(menu, $el);
+ return $el;
+ };
+
+ /**
+ * A runner module that fetches via a `fetcher` function.
+ *
+ * var runner = new Flatdoc.runner({
+ * fetcher: Flatdoc.url('readme.txt')
+ * });
+ * runner.run();
+ *
+ * The following options are available:
+ *
+ * - `fetcher` - a function that takes a callback as an argument and
+ * executes that callback when data is returned.
+ *
+ * See: [Flatdoc.run()]
+ */
+
+ var Runner = Flatdoc.runner = function(options) {
+ this.initialize(options);
+ };
+
+ Runner.prototype.root = '[role~="flatdoc"]';
+ Runner.prototype.menu = '[role~="flatdoc-menu"]';
+ Runner.prototype.title = '[role~="flatdoc-title"]';
+ Runner.prototype.content = '[role~="flatdoc-content"]';
+
+ Runner.prototype.initialize = function(options) {
+ $.extend(this, options);
+ };
+
+ /**
+ * Loads the Markdown document (via the fetcher), parses it, and applies it
+ * to the elements.
+ */
+
+ Runner.prototype.run = function() {
+ var doc = this;
+ $(doc.root).trigger('flatdoc:loading');
+ doc.fetcher(function(err, markdown) {
+ if (err) {
+ console.error('[Flatdoc] fetching Markdown data failed.', err);
+ return;
+ }
+ var data = Flatdoc.parser.parse(markdown);
+ doc.applyData(data, doc);
+ $(doc.root).trigger('flatdoc:ready');
+ });
+ };
+
+ /**
+ * Applies given doc data `data` to elements in object `elements`.
+ */
+
+ Runner.prototype.applyData = function(data) {
+ var elements = this;
+
+ elements.el('title').html(data.title);
+ elements.el('content').html(data.content.find('>*'));
+ elements.el('menu').html(MenuView(data.menu));
+ };
+
+ /**
+ * Fetches a given element from the DOM.
+ *
+ * Returns a jQuery object.
+ * @api private
+ */
+
+ Runner.prototype.el = function(aspect) {
+ return $(this[aspect], this.root);
+ };
+
+ /*
+ * Helpers
+ */
+
+ // http://stackoverflow.com/questions/298750/how-do-i-select-text-nodes-with-jquery
+ function getTextNodesIn(el) {
+ var exclude = 'iframe,pre,code';
+ return $(el).find(':not('+exclude+')').andSelf().contents().filter(function() {
+ return this.nodeType == 3 && $(this).closest(exclude).length === 0;
+ });
+ }
+
+ // http://www.leancrew.com/all-this/2010/11/smart-quotes-in-javascript/
+ function quotify(a) {
+ a = a.replace(/(^|[\-\u2014\s(\["])'/g, "$1\u2018"); // opening singles
+ a = a.replace(/'/g, "\u2019"); // closing singles & apostrophes
+ a = a.replace(/(^|[\-\u2014\/\[(\u2018\s])"/g, "$1\u201c"); // opening doubles
+ a = a.replace(/"/g, "\u201d"); // closing doubles
+ a = a.replace(/\.\.\./g, "\u2026"); // ellipses
+ a = a.replace(/--/g, "\u2014"); // em-dashes
+ return a;
+ }
+
+ function slugify(text) {
+ return text.toLowerCase().match(/[a-z0-9]+/g).join('-');
+ }
+})(jQuery);
+/*!
+ * marked - a markdown parser
+ * Copyright (c) 2011-2013, Christopher Jeffrey. (MIT Licensed)
+ * https://github.com/chjj/marked
+ */
+
+;(function() {
+
+/**
+ * Block-Level Grammar
+ */
+
+var block = {
+ newline: /^\n+/,
+ code: /^( {4}[^\n]+\n*)+/,
+ fences: noop,
+ hr: /^( *[-*_]){3,} *(?:\n+|$)/,
+ heading: /^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,
+ nptable: noop,
+ lheading: /^([^\n]+)\n *(=|-){3,} *\n*/,
+ blockquote: /^( *>[^\n]+(\n[^\n]+)*\n*)+/,
+ list: /^( *)(bull) [\s\S]+?(?:hr|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,
+ html: /^ *(?:comment|closed|closing) *(?:\n{2,}|\s*$)/,
+ def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,
+ table: noop,
+ paragraph: /^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,
+ text: /^[^\n]+/
+};
+
+block.bullet = /(?:[*+-]|\d+\.)/;
+block.item = /^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;
+block.item = replace(block.item, 'gm')
+ (/bull/g, block.bullet)
+ ();
+
+block.list = replace(block.list)
+ (/bull/g, block.bullet)
+ ('hr', /\n+(?=(?: *[-*_]){3,} *(?:\n+|$))/)
+ ();
+
+block._tag = '(?!(?:'
+ + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code'
+ + '|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo'
+ + '|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|@)\\b';
+
+block.html = replace(block.html)
+ ('comment', /<!--[\s\S]*?-->/)
+ ('closed', /<(tag)[\s\S]+?<\/\1>/)
+ ('closing', /<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/)
+ (/tag/g, block._tag)
+ ();
+
+block.paragraph = replace(block.paragraph)
+ ('hr', block.hr)
+ ('heading', block.heading)
+ ('lheading', block.lheading)
+ ('blockquote', block.blockquote)
+ ('tag', '<' + block._tag)
+ ('def', block.def)
+ ();
+
+/**
+ * Normal Block Grammar
+ */
+
+block.normal = merge({}, block);
+
+/**
+ * GFM Block Grammar
+ */
+
+block.gfm = merge({}, block.normal, {
+ fences: /^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/,
+ paragraph: /^/
+});
+
+block.gfm.paragraph = replace(block.paragraph)
+ ('(?!', '(?!' + block.gfm.fences.source.replace('\\1', '\\2') + '|')
+ ();
+
+/**
+ * GFM + Tables Block Grammar
+ */
+
+block.tables = merge({}, block.gfm, {
+ nptable: /^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,
+ table: /^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/
+});
+
+/**
+ * Block Lexer
+ */
+
+function Lexer(options) {
+ this.tokens = [];
+ this.tokens.links = {};
+ this.options = options || marked.defaults;
+ this.rules = block.normal;
+
+ if (this.options.gfm) {
+ if (this.options.tables) {
+ this.rules = block.tables;
+ } else {
+ this.rules = block.gfm;
+ }
+ }
+}
+
+/**
+ * Expose Block Rules
+ */
+
+Lexer.rules = block;
+
+/**
+ * Static Lex Method
+ */
+
+Lexer.lex = function(src, options) {
+ var lexer = new Lexer(options);
+ return lexer.lex(src);
+};
+
+/**
+ * Preprocessing
+ */
+
+Lexer.prototype.lex = function(src) {
+ src = src
+ .replace(/\r\n|\r/g, '\n')
+ .replace(/\t/g, ' ')
+ .replace(/\u00a0/g, ' ')
+ .replace(/\u2424/g, '\n');
+
+ return this.token(src, true);
+};
+
+/**
+ * Lexing
+ */
+
+Lexer.prototype.token = function(src, top) {
+ var src = src.replace(/^ +$/gm, '')
+ , next
+ , loose
+ , cap
+ , bull
+ , b
+ , item
+ , space
+ , i
+ , l;
+
+ while (src) {
+ // newline
+ if (cap = this.rules.newline.exec(src)) {
+ src = src.substring(cap[0].length);
+ if (cap[0].length > 1) {
+ this.tokens.push({
+ type: 'space'
+ });
+ }
+ }
+
+ // code
+ if (cap = this.rules.code.exec(src)) {
+ src = src.substring(cap[0].length);
+ cap = cap[0].replace(/^ {4}/gm, '');
+ this.tokens.push({
+ type: 'code',
+ text: !this.options.pedantic
+ ? cap.replace(/\n+$/, '')
+ : cap
+ });
+ continue;
+ }
+
+ // fences (gfm)
+ if (cap = this.rules.fences.exec(src)) {
+ src = src.substring(cap[0].length);
+ this.tokens.push({
+ type: 'code',
+ lang: cap[2],
+ text: cap[3]
+ });
+ continue;
+ }
+
+ // heading
+ if (cap = this.rules.heading.exec(src)) {
+ src = src.substring(cap[0].length);
+ this.tokens.push({
+ type: 'heading',
+ depth: cap[1].length,
+ text: cap[2]
+ });
+ continue;
+ }
+
+ // table no leading pipe (gfm)
+ if (top && (cap = this.rules.nptable.exec(src))) {
+ src = src.substring(cap[0].length);
+
+ item = {
+ type: 'table',
+ header: cap[1].replace(/^ *| *\| *$/g, '').split(/ *\| */),
+ align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */),
+ cells: cap[3].replace(/\n$/, '').split('\n')
+ };
+
+ for (i = 0; i < item.align.length; i++) {
+ if (/^ *-+: *$/.test(item.align[i])) {
+ item.align[i] = 'right';
+ } else if (/^ *:-+: *$/.test(item.align[i])) {
+ item.align[i] = 'center';
+ } else if (/^ *:-+ *$/.test(item.align[i])) {
+ item.align[i] = 'left';
+ } else {
+ item.align[i] = null;
+ }
+ }
+
+ for (i = 0; i < item.cells.length; i++) {
+ item.cells[i] = item.cells[i].split(/ *\| */);
+ }
+
+ this.tokens.push(item);
+
+ continue;
+ }
+
+ // lheading
+ if (cap = this.rules.lheading.exec(src)) {
+ src = src.substring(cap[0].length);
+ this.tokens.push({
+ type: 'heading',
+ depth: cap[2] === '=' ? 1 : 2,
+ text: cap[1]
+ });
+ continue;
+ }
+
+ // hr
+ if (cap = this.rules.hr.exec(src)) {
+ src = src.substring(cap[0].length);
+ this.tokens.push({
+ type: 'hr'
+ });
+ continue;
+ }
+
+ // blockquote
+ if (cap = this.rules.blockquote.exec(src)) {
+ src = src.substring(cap[0].length);
+
+ this.tokens.push({
+ type: 'blockquote_start'
+ });
+
+ cap = cap[0].replace(/^ *> ?/gm, '');
+
+ // Pass `top` to keep the current
+ // "toplevel" state. This is exactly
+ // how markdown.pl works.
+ this.token(cap, top);
+
+ this.tokens.push({
+ type: 'blockquote_end'
+ });
+
+ continue;
+ }
+
+ // list
+ if (cap = this.rules.list.exec(src)) {
+ src = src.substring(cap[0].length);
+ bull = cap[2];
+
+ this.tokens.push({
+ type: 'list_start',
+ ordered: bull.length > 1
+ });
+
+ // Get each top-level item.
+ cap = cap[0].match(this.rules.item);
+
+ next = false;
+ l = cap.length;
+ i = 0;
+
+ for (; i < l; i++) {
+ item = cap[i];
+
+ // Remove the list item's bullet
+ // so it is seen as the next token.
+ space = item.length;
+ item = item.replace(/^ *([*+-]|\d+\.) +/, '');
+
+ // Outdent whatever the
+ // list item contains. Hacky.
+ if (~item.indexOf('\n ')) {
+ space -= item.length;
+ item = !this.options.pedantic
+ ? item.replace(new RegExp('^ {1,' + space + '}', 'gm'), '')
+ : item.replace(/^ {1,4}/gm, '');
+ }
+
+ // Determine whether the next list item belongs here.
+ // Backpedal if it does not belong in this list.
+ if (this.options.smartLists && i !== l - 1) {
+ b = block.bullet.exec(cap[i+1])[0];
+ if (bull !== b && !(bull.length > 1 && b.length > 1)) {
+ src = cap.slice(i + 1).join('\n') + src;
+ i = l - 1;
+ }
+ }
+
+ // Determine whether item is loose or not.
+ // Use: /(^|\n)(?! )[^\n]+\n\n(?!\s*$)/
+ // for discount behavior.
+ loose = next || /\n\n(?!\s*$)/.test(item);
+ if (i !== l - 1) {
+ next = item[item.length-1] === '\n';
+ if (!loose) loose = next;
+ }
+
+ this.tokens.push({
+ type: loose
+ ? 'loose_item_start'
+ : 'list_item_start'
+ });
+
+ // Recurse.
+ this.token(item, false);
+
+ this.tokens.push({
+ type: 'list_item_end'
+ });
+ }
+
+ this.tokens.push({
+ type: 'list_end'
+ });
+
+ continue;
+ }
+
+ // html
+ if (cap = this.rules.html.exec(src)) {
+ src = src.substring(cap[0].length);
+ this.tokens.push({
+ type: this.options.sanitize
+ ? 'paragraph'
+ : 'html',
+ pre: cap[1] === 'pre' || cap[1] === 'script',
+ text: cap[0]
+ });
+ continue;
+ }
+
+ // def
+ if (top && (cap = this.rules.def.exec(src))) {
+ src = src.substring(cap[0].length);
+ this.tokens.links[cap[1].toLowerCase()] = {
+ href: cap[2],
+ title: cap[3]
+ };
+ continue;
+ }
+
+ // table (gfm)
+ if (top && (cap = this.rules.table.exec(src))) {
+ src = src.substring(cap[0].length);
+
+ item = {
+ type: 'table',
+ header: cap[1].replace(/^ *| *\| *$/g, '').split(/ *\| */),
+ align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */),
+ cells: cap[3].replace(/(?: *\| *)?\n$/, '').split('\n')
+ };
+
+ for (i = 0; i < item.align.length; i++) {
+ if (/^ *-+: *$/.test(item.align[i])) {
+ item.align[i] = 'right';
+ } else if (/^ *:-+: *$/.test(item.align[i])) {
+ item.align[i] = 'center';
+ } else if (/^ *:-+ *$/.test(item.align[i])) {
+ item.align[i] = 'left';
+ } else {
+ item.align[i] = null;
+ }
+ }
+
+ for (i = 0; i < item.cells.length; i++) {
+ item.cells[i] = item.cells[i]
+ .replace(/^ *\| *| *\| *$/g, '')
+ .split(/ *\| */);
+ }
+
+ this.tokens.push(item);
+
+ continue;
+ }
+
+ // top-level paragraph
+ if (top && (cap = this.rules.paragraph.exec(src))) {
+ src = src.substring(cap[0].length);
+ this.tokens.push({
+ type: 'paragraph',
+ text: cap[1][cap[1].length-1] === '\n'
+ ? cap[1].slice(0, -1)
+ : cap[1]
+ });
+ continue;
+ }
+
+ // text
+ if (cap = this.rules.text.exec(src)) {
+ // Top-level should never reach here.
+ src = src.substring(cap[0].length);
+ this.tokens.push({
+ type: 'text',
+ text: cap[0]
+ });
+ continue;
+ }
+
+ if (src) {
+ throw new
+ Error('Infinite loop on byte: ' + src.charCodeAt(0));
+ }
+ }
+
+ return this.tokens;
+};
+
+/**
+ * Inline-Level Grammar
+ */
+
+var inline = {
+ escape: /^\\([\\`*{}\[\]()#+\-.!_>])/,
+ autolink: /^<([^ >]+(@|:\/)[^ >]+)>/,
+ url: noop,
+ tag: /^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,
+ link: /^!?\[(inside)\]\(href\)/,
+ reflink: /^!?\[(inside)\]\s*\[([^\]]*)\]/,
+ nolink: /^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,
+ strong: /^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,
+ em: /^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,
+ code: /^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,
+ br: /^ {2,}\n(?!\s*$)/,
+ del: noop,
+ text: /^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/
+};
+
+inline._inside = /(?:\[[^\]]*\]|[^\]]|\](?=[^\[]*\]))*/;
+inline._href = /\s*<?([^\s]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/;
+
+inline.link = replace(inline.link)
+ ('inside', inline._inside)
+ ('href', inline._href)
+ ();
+
+inline.reflink = replace(inline.reflink)
+ ('inside', inline._inside)
+ ();
+
+/**
+ * Normal Inline Grammar
+ */
+
+inline.normal = merge({}, inline);
+
+/**
+ * Pedantic Inline Grammar
+ */
+
+inline.pedantic = merge({}, inline.normal, {
+ strong: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,
+ em: /^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/
+});
+
+/**
+ * GFM Inline Grammar
+ */
+
+inline.gfm = merge({}, inline.normal, {
+ escape: replace(inline.escape)('])', '~|])')(),
+ url: /^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,
+ del: /^~~(?=\S)([\s\S]*?\S)~~/,
+ text: replace(inline.text)
+ (']|', '~]|')
+ ('|', '|https?://|')
+ ()
+});
+
+/**
+ * GFM + Line Breaks Inline Grammar
+ */
+
+inline.breaks = merge({}, inline.gfm, {
+ br: replace(inline.br)('{2,}', '*')(),
+ text: replace(inline.gfm.text)('{2,}', '*')()
+});
+
+/**
+ * Inline Lexer & Compiler
+ */
+
+function InlineLexer(links, options) {
+ this.options = options || marked.defaults;
+ this.links = links;
+ this.rules = inline.normal;
+
+ if (!this.links) {
+ throw new
+ Error('Tokens array requires a `links` property.');
+ }
+
+ if (this.options.gfm) {
+ if (this.options.breaks) {
+ this.rules = inline.breaks;
+ } else {
+ this.rules = inline.gfm;
+ }
+ } else if (this.options.pedantic) {
+ this.rules = inline.pedantic;
+ }
+}
+
+/**
+ * Expose Inline Rules
+ */
+
+InlineLexer.rules = inline;
+
+/**
+ * Static Lexing/Compiling Method
+ */
+
+InlineLexer.output = function(src, links, options) {
+ var inline = new InlineLexer(links, options);
+ return inline.output(src);
+};
+
+/**
+ * Lexing/Compiling
+ */
+
+InlineLexer.prototype.output = function(src) {
+ var out = ''
+ , link
+ , text
+ , href
+ , cap;
+
+ while (src) {
+ // escape
+ if (cap = this.rules.escape.exec(src)) {
+ src = src.substring(cap[0].length);
+ out += cap[1];
+ continue;
+ }
+
+ // autolink
+ if (cap = this.rules.autolink.exec(src)) {
+ src = src.substring(cap[0].length);
+ if (cap[2] === '@') {
+ text = cap[1][6] === ':'
+ ? this.mangle(cap[1].substring(7))
+ : this.mangle(cap[1]);
+ href = this.mangle('mailto:') + text;
+ } else {
+ text = escape(cap[1]);
+ href = text;
+ }
+ out += '<a href="'
+ + href
+ + '">'
+ + text
+ + '</a>';
+ continue;
+ }
+
+ // url (gfm)
+ if (cap = this.rules.url.exec(src)) {
+ src = src.substring(cap[0].length);
+ text = escape(cap[1]);
+ href = text;
+ out += '<a href="'
+ + href
+ + '">'
+ + text
+ + '</a>';
+ continue;
+ }
+
+ // tag
+ if (cap = this.rules.tag.exec(src)) {
+ src = src.substring(cap[0].length);
+ out += this.options.sanitize
+ ? escape(cap[0])
+ : cap[0];
+ continue;
+ }
+
+ // link
+ if (cap = this.rules.link.exec(src)) {
+ src = src.substring(cap[0].length);
+ out += this.outputLink(cap, {
+ href: cap[2],
+ title: cap[3]
+ });
+ continue;
+ }
+
+ // reflink, nolink
+ if ((cap = this.rules.reflink.exec(src))
+ || (cap = this.rules.nolink.exec(src))) {
+ src = src.substring(cap[0].length);
+ link = (cap[2] || cap[1]).replace(/\s+/g, ' ');
+ link = this.links[link.toLowerCase()];
+ if (!link || !link.href) {
+ out += cap[0][0];
+ src = cap[0].substring(1) + src;
+ continue;
+ }
+ out += this.outputLink(cap, link);
+ continue;
+ }
+
+ // strong
+ if (cap = this.rules.strong.exec(src)) {
+ src = src.substring(cap[0].length);
+ out += '<strong>'
+ + this.output(cap[2] || cap[1])
+ + '</strong>';
+ continue;
+ }
+
+ // em
+ if (cap = this.rules.em.exec(src)) {
+ src = src.substring(cap[0].length);
+ out += '<em>'
+ + this.output(cap[2] || cap[1])
+ + '</em>';
+ continue;
+ }
+
+ // code
+ if (cap = this.rules.code.exec(src)) {
+ src = src.substring(cap[0].length);
+ out += '<code>'
+ + escape(cap[2], true)
+ + '</code>';
+ continue;
+ }
+
+ // br
+ if (cap = this.rules.br.exec(src)) {
+ src = src.substring(cap[0].length);
+ out += '<br>';
+ continue;
+ }
+
+ // del (gfm)
+ if (cap = this.rules.del.exec(src)) {
+ src = src.substring(cap[0].length);
+ out += '<del>'
+ + this.output(cap[1])
+ + '</del>';
+ continue;
+ }
+
+ // text
+ if (cap = this.rules.text.exec(src)) {
+ src = src.substring(cap[0].length);
+ out += escape(cap[0]);
+ continue;
+ }
+
+ if (src) {
+ throw new
+ Error('Infinite loop on byte: ' + src.charCodeAt(0));
+ }
+ }
+
+ return out;
+};
+
+/**
+ * Compile Link
+ */
+
+InlineLexer.prototype.outputLink = function(cap, link) {
+ if (cap[0][0] !== '!') {
+ return '<a href="'
+ + escape(link.href)
+ + '"'
+ + (link.title
+ ? ' title="'
+ + escape(link.title)
+ + '"'
+ : '')
+ + '>'
+ + this.output(cap[1])
+ + '</a>';
+ } else {
+ return '<img src="'
+ + escape(link.href)
+ + '" alt="'
+ + escape(cap[1])
+ + '"'
+ + (link.title
+ ? ' title="'
+ + escape(link.title)
+ + '"'
+ : '')
+ + '>';
+ }
+};
+
+/**
+ * Smartypants Transformations
+ */
+
+InlineLexer.prototype.smartypants = function(text) {
+ if (!this.options.smartypants) return text;
+ return text
+ .replace(/--/g, '—')
+ .replace(/'([^']*)'/g, '‘$1’')
+ .replace(/"([^"]*)"/g, '“$1”')
+ .replace(/\.{3}/g, '…');
+};
+
+/**
+ * Mangle Links
+ */
+
+InlineLexer.prototype.mangle = function(text) {
+ var out = ''
+ , l = text.length
+ , i = 0
+ , ch;
+
+ for (; i < l; i++) {
+ ch = text.charCodeAt(i);
+ if (Math.random() > 0.5) {
+ ch = 'x' + ch.toString(16);
+ }
+ out += '&#' + ch + ';';
+ }
+
+ return out;
+};
+
+/**
+ * Parsing & Compiling
+ */
+
+function Parser(options) {
+ this.tokens = [];
+ this.token = null;
+ this.options = options || marked.defaults;
+}
+
+/**
+ * Static Parse Method
+ */
+
+Parser.parse = function(src, options) {
+ var parser = new Parser(options);
+ return parser.parse(src);
+};
+
+/**
+ * Parse Loop
+ */
+
+Parser.prototype.parse = function(src) {
+ this.inline = new InlineLexer(src.links, this.options);
+ this.tokens = src.reverse();
+
+ var out = '';
+ while (this.next()) {
+ out += this.tok();
+ }
+
+ return out;
+};
+
+/**
+ * Next Token
+ */
+
+Parser.prototype.next = function() {
+ return this.token = this.tokens.pop();
+};
+
+/**
+ * Preview Next Token
+ */
+
+Parser.prototype.peek = function() {
+ return this.tokens[this.tokens.length-1] || 0;
+};
+
+/**
+ * Parse Text Tokens
+ */
+
+Parser.prototype.parseText = function() {
+ var body = this.token.text;
+
+ while (this.peek().type === 'text') {
+ body += '\n' + this.next().text;
+ }
+
+ return this.inline.output(body);
+};
+
+/**
+ * Parse Current Token
+ */
+
+Parser.prototype.tok = function() {
+ switch (this.token.type) {
+ case 'space': {
+ return '';
+ }
+ case 'hr': {
+ return '<hr>\n';
+ }
+ case 'heading': {
+ return '<h'
+ + this.token.depth
+ + '>'
+ + this.inline.output(this.token.text)
+ + '</h'
+ + this.token.depth
+ + '>\n';
+ }
+ case 'code': {
+ if (this.options.highlight) {
+ var code = this.options.highlight(this.token.text, this.token.lang);
+ if (code != null && code !== this.token.text) {
+ this.token.escaped = true;
+ this.token.text = code;
+ }
+ }
+
+ if (!this.token.escaped) {
+ this.token.text = escape(this.token.text, true);
+ }
+
+ return '<pre><code'
+ + (this.token.lang
+ ? ' class="'
+ + this.options.langPrefix
+ + this.token.lang
+ + '"'
+ : '')
+ + '>'
+ + this.token.text
+ + '</code></pre>\n';
+ }
+ case 'table': {
+ var body = ''
+ , heading
+ , i
+ , row
+ , cell
+ , j;
+
+ // header
+ body += '<thead>\n<tr>\n';
+ for (i = 0; i < this.token.header.length; i++) {
+ heading = this.inline.output(this.token.header[i]);
+ body += this.token.align[i]
+ ? '<th align="' + this.token.align[i] + '">' + heading + '</th>\n'
+ : '<th>' + heading + '</th>\n';
+ }
+ body += '</tr>\n</thead>\n';
+
+ // body
+ body += '<tbody>\n'
+ for (i = 0; i < this.token.cells.length; i++) {
+ row = this.token.cells[i];
+ body += '<tr>\n';
+ for (j = 0; j < row.length; j++) {
+ cell = this.inline.output(row[j]);
+ body += this.token.align[j]
+ ? '<td align="' + this.token.align[j] + '">' + cell + '</td>\n'
+ : '<td>' + cell + '</td>\n';
+ }
+ body += '</tr>\n';
+ }
+ body += '</tbody>\n';
+
+ return '<table>\n'
+ + body
+ + '</table>\n';
+ }
+ case 'blockquote_start': {
+ var body = '';
+
+ while (this.next().type !== 'blockquote_end') {
+ body += this.tok();
+ }
+
+ return '<blockquote>\n'
+ + body
+ + '</blockquote>\n';
+ }
+ case 'list_start': {
+ var type = this.token.ordered ? 'ol' : 'ul'
+ , body = '';
+
+ while (this.next().type !== 'list_end') {
+ body += this.tok();
+ }
+
+ return '<'
+ + type
+ + '>\n'
+ + body
+ + '</'
+ + type
+ + '>\n';
+ }
+ case 'list_item_start': {
+ var body = '';
+
+ while (this.next().type !== 'list_item_end') {
+ body += this.token.type === 'text'
+ ? this.parseText()
+ : this.tok();
+ }
+
+ return '<li>'
+ + body
+ + '</li>\n';
+ }
+ case 'loose_item_start': {
+ var body = '';
+
+ while (this.next().type !== 'list_item_end') {
+ body += this.tok();
+ }
+
+ return '<li>'
+ + body
+ + '</li>\n';
+ }
+ case 'html': {
+ return !this.token.pre && !this.options.pedantic
+ ? this.inline.output(this.token.text)
+ : this.token.text;
+ }
+ case 'paragraph': {
+ return '<p>'
+ + this.inline.output(this.token.text)
+ + '</p>\n';
+ }
+ case 'text': {
+ return '<p>'
+ + this.parseText()
+ + '</p>\n';
+ }
+ }
+};
+
+/**
+ * Helpers
+ */
+
+function escape(html, encode) {
+ return html
+ .replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&amp;')
+ .replace(/</g, '&lt;')
+ .replace(/>/g, '&gt;')
+ .replace(/"/g, '&quot;')
+ .replace(/'/g, '&#39;');
+}
+
+function replace(regex, opt) {
+ regex = regex.source;
+ opt = opt || '';
+ return function self(name, val) {
+ if (!name) return new RegExp(regex, opt);
+ val = val.source || val;
+ val = val.replace(/(^|[^\[])\^/g, '$1');
+ regex = regex.replace(name, val);
+ return self;
+ };
+}
+
+function noop() {}
+noop.exec = noop;
+
+function merge(obj) {
+ var i = 1
+ , target
+ , key;
+
+ for (; i < arguments.length; i++) {
+ target = arguments[i];
+ for (key in target) {
+ if (Object.prototype.hasOwnProperty.call(target, key)) {
+ obj[key] = target[key];
+ }
+ }
+ }
+
+ return obj;
+}
+
+/**
+ * Marked
+ */
+
+function marked(src, opt, callback) {
+ if (callback || typeof opt === 'function') {
+ if (!callback) {
+ callback = opt;
+ opt = null;
+ }
+
+ if (opt) opt = merge({}, marked.defaults, opt);
+
+ var tokens = Lexer.lex(tokens, opt)
+ , highlight = opt.highlight
+ , pending = 0
+ , l = tokens.length
+ , i = 0;
+
+ if (!highlight || highlight.length < 3) {
+ return callback(null, Parser.parse(tokens, opt));
+ }
+
+ var done = function() {
+ delete opt.highlight;
+ var out = Parser.parse(tokens, opt);
+ opt.highlight = highlight;
+ return callback(null, out);
+ };
+
+ for (; i < l; i++) {
+ (function(token) {
+ if (token.type !== 'code') return;
+ pending++;
+ return highlight(token.text, token.lang, function(err, code) {
+ if (code == null || code === token.text) {
+ return --pending || done();
+ }
+ token.text = code;
+ token.escaped = true;
+ --pending || done();
+ });
+ })(tokens[i]);
+ }
+
+ return;
+ }
+ try {
+ if (opt) opt = merge({}, marked.defaults, opt);
+ return Parser.parse(Lexer.lex(src, opt), opt);
+ } catch (e) {
+ e.message += '\nPlease report this to https://github.com/chjj/marked.';
+ if ((opt || marked.defaults).silent) {
+ return '<p>An error occured:</p><pre>'
+ + escape(e.message + '', true)
+ + '</pre>';
+ }
+ throw e;
+ }
+}
+
+/**
+ * Options
+ */
+
+marked.options =
+marked.setOptions = function(opt) {
+ merge(marked.defaults, opt);
+ return marked;
+};
+
+marked.defaults = {
+ gfm: true,
+ tables: true,
+ breaks: false,
+ pedantic: false,
+ sanitize: false,
+ smartLists: false,
+ silent: false,
+ highlight: null,
+ langPrefix: 'lang-'
+};
+
+/**
+ * Expose
+ */
+
+marked.Parser = Parser;
+marked.parser = Parser.parse;
+
+marked.Lexer = Lexer;
+marked.lexer = Lexer.lex;
+
+marked.InlineLexer = InlineLexer;
+marked.inlineLexer = InlineLexer.output;
+
+marked.parse = marked;
+
+if (typeof exports === 'object') {
+ module.exports = marked;
+} else if (typeof define === 'function' && define.amd) {
+ define(function() { return marked; });
+} else {
+ this.marked = marked;
+}
+
+}).call(function() {
+ return this || (typeof window !== 'undefined' ? window : global);
+}());
+/*!
+ * $Id: base64.js,v 2.12 2013/05/06 07:54:20 dankogai Exp dankogai $
+ *
+ * Licensed under the MIT license.
+ * http://opensource.org/licenses/mit-license
+ *
+ * References:
+ * http://en.wikipedia.org/wiki/Base64
+ */
+
+(function(global) {
+ 'use strict';
+ if (global.Base64) return;
+ var version = "2.1.2";
+ // if node.js, we use Buffer
+ var buffer;
+ if (typeof module !== 'undefined' && module.exports) {
+ buffer = require('buffer').Buffer;
+ }
+ // constants
+ var b64chars
+ = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
+ var b64tab = function(bin) {
+ var t = {};
+ for (var i = 0, l = bin.length; i < l; i++) t[bin.charAt(i)] = i;
+ return t;
+ }(b64chars);
+ var fromCharCode = String.fromCharCode;
+ // encoder stuff
+ var cb_utob = function(c) {
+ if (c.length < 2) {
+ var cc = c.charCodeAt(0);
+ return cc < 0x80 ? c
+ : cc < 0x800 ? (fromCharCode(0xc0 | (cc >>> 6))
+ + fromCharCode(0x80 | (cc & 0x3f)))
+ : (fromCharCode(0xe0 | ((cc >>> 12) & 0x0f))
+ + fromCharCode(0x80 | ((cc >>> 6) & 0x3f))
+ + fromCharCode(0x80 | ( cc & 0x3f)));
+ } else {
+ var cc = 0x10000
+ + (c.charCodeAt(0) - 0xD800) * 0x400
+ + (c.charCodeAt(1) - 0xDC00);
+ return (fromCharCode(0xf0 | ((cc >>> 18) & 0x07))
+ + fromCharCode(0x80 | ((cc >>> 12) & 0x3f))
+ + fromCharCode(0x80 | ((cc >>> 6) & 0x3f))
+ + fromCharCode(0x80 | ( cc & 0x3f)));
+ }
+ };
+ var re_utob = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g;
+ var utob = function(u) {
+ return u.replace(re_utob, cb_utob);
+ };
+ var cb_encode = function(ccc) {
+ var padlen = [0, 2, 1][ccc.length % 3],
+ ord = ccc.charCodeAt(0) << 16
+ | ((ccc.length > 1 ? ccc.charCodeAt(1) : 0) << 8)
+ | ((ccc.length > 2 ? ccc.charCodeAt(2) : 0)),
+ chars = [
+ b64chars.charAt( ord >>> 18),
+ b64chars.charAt((ord >>> 12) & 63),
+ padlen >= 2 ? '=' : b64chars.charAt((ord >>> 6) & 63),
+ padlen >= 1 ? '=' : b64chars.charAt(ord & 63)
+ ];
+ return chars.join('');
+ };
+ var btoa = global.btoa || function(b) {
+ return b.replace(/[\s\S]{1,3}/g, cb_encode);
+ };
+ var _encode = buffer
+ ? function (u) { return (new buffer(u)).toString('base64') }
+ : function (u) { return btoa(utob(u)) }
+ ;
+ var encode = function(u, urisafe) {
+ return !urisafe
+ ? _encode(u)
+ : _encode(u).replace(/[+\/]/g, function(m0) {
+ return m0 == '+' ? '-' : '_';
+ }).replace(/=/g, '');
+ };
+ var encodeURI = function(u) { return encode(u, true) };
+ // decoder stuff
+ var re_btou = new RegExp([
+ '[\xC0-\xDF][\x80-\xBF]',
+ '[\xE0-\xEF][\x80-\xBF]{2}',
+ '[\xF0-\xF7][\x80-\xBF]{3}'
+ ].join('|'), 'g');
+ var cb_btou = function(cccc) {
+ switch(cccc.length) {
+ case 4:
+ var cp = ((0x07 & cccc.charCodeAt(0)) << 18)
+ | ((0x3f & cccc.charCodeAt(1)) << 12)
+ | ((0x3f & cccc.charCodeAt(2)) << 6)
+ | (0x3f & cccc.charCodeAt(3)),
+ offset = cp - 0x10000;
+ return (fromCharCode((offset >>> 10) + 0xD800)
+ + fromCharCode((offset & 0x3FF) + 0xDC00));
+ case 3:
+ return fromCharCode(
+ ((0x0f & cccc.charCodeAt(0)) << 12)
+ | ((0x3f & cccc.charCodeAt(1)) << 6)
+ | (0x3f & cccc.charCodeAt(2))
+ );
+ default:
+ return fromCharCode(
+ ((0x1f & cccc.charCodeAt(0)) << 6)
+ | (0x3f & cccc.charCodeAt(1))
+ );
+ }
+ };
+ var btou = function(b) {
+ return b.replace(re_btou, cb_btou);
+ };
+ var cb_decode = function(cccc) {
+ var len = cccc.length,
+ padlen = len % 4,
+ n = (len > 0 ? b64tab[cccc.charAt(0)] << 18 : 0)
+ | (len > 1 ? b64tab[cccc.charAt(1)] << 12 : 0)
+ | (len > 2 ? b64tab[cccc.charAt(2)] << 6 : 0)
+ | (len > 3 ? b64tab[cccc.charAt(3)] : 0),
+ chars = [
+ fromCharCode( n >>> 16),
+ fromCharCode((n >>> 8) & 0xff),
+ fromCharCode( n & 0xff)
+ ];
+ chars.length -= [0, 0, 2, 1][padlen];
+ return chars.join('');
+ };
+ var atob = global.atob || function(a){
+ return a.replace(/[\s\S]{1,4}/g, cb_decode);
+ };
+ var _decode = buffer
+ ? function(a) { return (new buffer(a, 'base64')).toString() }
+ : function(a) { return btou(atob(a)) };
+ var decode = function(a){
+ return _decode(
+ a.replace(/[-_]/g, function(m0) { return m0 == '-' ? '+' : '/' })
+ .replace(/[^A-Za-z0-9\+\/]/g, '')
+ );
+ };
+ // export Base64
+ global.Base64 = {
+ VERSION: version,
+ atob: atob,
+ btoa: btoa,
+ fromBase64: decode,
+ toBase64: encode,
+ utob: utob,
+ encode: encode,
+ encodeURI: encodeURI,
+ btou: btou,
+ decode: decode
+ };
+ // if ES5 is available, make Base64.extendString() available
+ if (typeof Object.defineProperty === 'function') {
+ var noEnum = function(v){
+ return {value:v,enumerable:false,writable:true,configurable:true};
+ };
+ global.Base64.extendString = function () {
+ Object.defineProperty(
+ String.prototype, 'fromBase64', noEnum(function () {
+ return decode(this)
+ }));
+ Object.defineProperty(
+ String.prototype, 'toBase64', noEnum(function (urisafe) {
+ return encode(this, urisafe)
+ }));
+ Object.defineProperty(
+ String.prototype, 'toBase64URI', noEnum(function () {
+ return encode(this, true)
+ }));
+ };
+ }
+ // that's it!
+})(this); \ No newline at end of file
diff --git a/docs/assets/flatdoc/legacy.js b/docs/assets/flatdoc/legacy.js
new file mode 100644
index 0000000..998b0ad
--- /dev/null
+++ b/docs/assets/flatdoc/legacy.js
@@ -0,0 +1,23 @@
+/*!
+
+Support JS for legacy browsers.
+Includes:
+
+ HTML5 Shiv
+ @afarkas @jdalton @jon_neal @rem
+ MIT/GPL2 Licensed
+ https://github.com/aFarkas/html5shiv
+
+ matchMedia() polyfill
+ (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license
+
+ Respond.js
+ min/max-width media query polyfill
+ (c) Scott Jehl. MIT/GPLv2 Lic.
+ http://j.mp/respondjs
+
+*/
+!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();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<style>article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}</style>";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="<xyz></xyz>";j="hidden"in a;var b;if(!(b=1==a.childNodes.length)){f.createElement("a");var c=f.createDocumentFragment();b="undefined"==typeof c.cloneNode||"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 main mark meter nav output progress section summary time video",version:"3.6.2",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();for(var b=b||i(a),c=b.frag.cloneNode(),d=0,e=m(),h=e.length;d<h;d++)c.createElement(e[d]);return c}};l.html5=e;q(f)}(this,document);/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */
+/*! NOTE: If you're already including a window.matchMedia polyfill via Modernizr or otherwise, you don't need this part */
+window.matchMedia=window.matchMedia||function(doc,undefined){"use strict";var bool,docElem=doc.documentElement,refNode=docElem.firstElementChild||docElem.firstChild,fakeBody=doc.createElement("body"),div=doc.createElement("div");div.id="mq-test-1";div.style.cssText="position:absolute;top:-100em";fakeBody.style.background="none";fakeBody.appendChild(div);return function(q){div.innerHTML='&shy;<style media="'+q+'"> #mq-test-1 { width: 42px; }</style>';docElem.insertBefore(fakeBody,refNode);bool=div.offsetWidth===42;docElem.removeChild(fakeBody);return{matches:bool,media:q}}}(document);/*! Respond.js v1.1.0: min/max-width media query polyfill. (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs */
+!function(win){"use strict";var respond={};win.respond=respond;respond.update=function(){};respond.mediaQueriesSupported=win.matchMedia&&win.matchMedia("only all").matches;if(respond.mediaQueriesSupported){return}var doc=win.document,docElem=doc.documentElement,mediastyles=[],rules=[],appendedEls=[],parsedSheets={},resizeThrottle=30,head=doc.getElementsByTagName("head")[0]||docElem,base=doc.getElementsByTagName("base")[0],links=head.getElementsByTagName("link"),requestQueue=[],ripCSS=function(){for(var i=0;i<links.length;i++){var sheet=links[i],href=sheet.href,media=sheet.media,isCSS=sheet.rel&&sheet.rel.toLowerCase()==="stylesheet";if(!!href&&isCSS&&!parsedSheets[href]){if(sheet.styleSheet&&sheet.styleSheet.rawCssText){translate(sheet.styleSheet.rawCssText,href,media);parsedSheets[href]=true}else{if(!/^([a-zA-Z:]*\/\/)/.test(href)&&!base||href.replace(RegExp.$1,"").split("/")[0]===win.location.host){requestQueue.push({href:href,media:media})}}}}makeRequests()},makeRequests=function(){if(requestQueue.length){var thisRequest=requestQueue.shift();ajax(thisRequest.href,function(styles){translate(styles,thisRequest.href,thisRequest.media);parsedSheets[thisRequest.href]=true;win.setTimeout(function(){makeRequests()},0)})}},translate=function(styles,href,media){var qs=styles.match(/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi),ql=qs&&qs.length||0;href=href.substring(0,href.lastIndexOf("/"));var repUrls=function(css){return css.replace(/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,"$1"+href+"$2$3")},useMedia=!ql&&media;if(href.length){href+="/"}if(useMedia){ql=1}for(var i=0;i<ql;i++){var fullq,thisq,eachq,eql;if(useMedia){fullq=media;rules.push(repUrls(styles))}else{fullq=qs[i].match(/@media *([^\{]+)\{([\S\s]+?)$/)&&RegExp.$1;rules.push(RegExp.$2&&repUrls(RegExp.$2))}eachq=fullq.split(",");eql=eachq.length;for(var j=0;j<eql;j++){thisq=eachq[j];mediastyles.push({media:thisq.split("(")[0].match(/(only\s+)?([a-zA-Z]+)\s?/)&&RegExp.$2||"all",rules:rules.length-1,hasquery:thisq.indexOf("(")>-1,minw:thisq.match(/\(\s*min\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:thisq.match(/\(\s*max\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}}applyMedia()},lastCall,resizeDefer,getEmValue=function(){var ret,div=doc.createElement("div"),body=doc.body,fakeUsed=false;div.style.cssText="position:absolute;font-size:1em;width:1em";if(!body){body=fakeUsed=doc.createElement("body");body.style.background="none"}body.appendChild(div);docElem.insertBefore(body,docElem.firstChild);ret=div.offsetWidth;if(fakeUsed){docElem.removeChild(body)}else{body.removeChild(div)}ret=eminpx=parseFloat(ret);return ret},eminpx,applyMedia=function(fromResize){var name="clientWidth",docElemProp=docElem[name],currWidth=doc.compatMode==="CSS1Compat"&&docElemProp||doc.body[name]||docElemProp,styleBlocks={},lastLink=links[links.length-1],now=(new Date).getTime();if(fromResize&&lastCall&&now-lastCall<resizeThrottle){win.clearTimeout(resizeDefer);resizeDefer=win.setTimeout(applyMedia,resizeThrottle);return}else{lastCall=now}for(var i in mediastyles){if(mediastyles.hasOwnProperty(i)){var thisstyle=mediastyles[i],min=thisstyle.minw,max=thisstyle.maxw,minnull=min===null,maxnull=max===null,em="em";if(!!min){min=parseFloat(min)*(min.indexOf(em)>-1?eminpx||getEmValue():1)}if(!!max){max=parseFloat(max)*(max.indexOf(em)>-1?eminpx||getEmValue():1)}if(!thisstyle.hasquery||(!minnull||!maxnull)&&(minnull||currWidth>=min)&&(maxnull||currWidth<=max)){if(!styleBlocks[thisstyle.media]){styleBlocks[thisstyle.media]=[]}styleBlocks[thisstyle.media].push(rules[thisstyle.rules])}}}for(var j in appendedEls){if(appendedEls.hasOwnProperty(j)){if(appendedEls[j]&&appendedEls[j].parentNode===head){head.removeChild(appendedEls[j])}}}for(var k in styleBlocks){if(styleBlocks.hasOwnProperty(k)){var ss=doc.createElement("style"),css=styleBlocks[k].join("\n");ss.type="text/css";ss.media=k;head.insertBefore(ss,lastLink.nextSibling);if(ss.styleSheet){ss.styleSheet.cssText=css}else{ss.appendChild(doc.createTextNode(css))}appendedEls.push(ss)}}},ajax=function(url,callback){var req=xmlHttp();if(!req){return}req.open("GET",url,true);req.onreadystatechange=function(){if(req.readyState!==4||req.status!==200&&req.status!==304){return}callback(req.responseText)};if(req.readyState===4){return}req.send(null)},xmlHttp=function(){var xmlhttpmethod=false;try{xmlhttpmethod=new win.XMLHttpRequest}catch(e){xmlhttpmethod=new win.ActiveXObject("Microsoft.XMLHTTP")}return function(){return xmlhttpmethod}}();ripCSS();respond.update=ripCSS;function callMedia(){applyMedia(true)}if(win.addEventListener){win.addEventListener("resize",callMedia,false)}else if(win.attachEvent){win.attachEvent("onresize",callMedia)}}(this); \ No newline at end of file
diff --git a/docs/assets/flatdoc/theme-white/script.js b/docs/assets/flatdoc/theme-white/script.js
new file mode 100644
index 0000000..5d0c1be
--- /dev/null
+++ b/docs/assets/flatdoc/theme-white/script.js
@@ -0,0 +1,318 @@
+(function($) {
+ var $window = $(window);
+ var $document = $(document);
+
+ /*
+ * Scrollspy.
+ */
+
+ $document.on('flatdoc:ready', function() {
+ $("h2, h3").scrollagent(function(cid, pid, currentElement, previousElement) {
+ if (pid) {
+ $("[href='#"+pid+"']").removeClass('active');
+ }
+ if (cid) {
+ $("[href='#"+cid+"']").addClass('active');
+ }
+ });
+ });
+
+ /*
+ * Anchor jump links.
+ */
+
+ $document.on('flatdoc:ready', function() {
+ $('.menu a').anchorjump();
+ });
+
+ /*
+ * Title card.
+ */
+
+ $(function() {
+ var $card = $('.title-card');
+ if (!$card.length) return;
+
+ var $header = $('.header');
+ var headerHeight = $header.length ? $header.outerHeight() : 0;
+
+ $window
+ .on('resize.title-card', function() {
+ var windowWidth = $window.width();
+
+ if (windowWidth < 480) {
+ $card.css('height', '');
+ } else {
+ var height = $window.height();
+ $card.css('height', height - headerHeight);
+ }
+ })
+ .trigger('resize.title-card');
+
+ $card.fillsize('> img.bg');
+ });
+
+ /*
+ * Sidebar stick.
+ */
+
+ $(function() {
+ var $sidebar = $('.menubar');
+ var elTop;
+
+ $window
+ .on('resize.sidestick', function() {
+ elTop = $sidebar.offset().top;
+ $window.trigger('scroll.sidestick');
+ })
+ .on('scroll.sidestick', function() {
+ var scrollY = $window.scrollTop();
+ $sidebar.toggleClass('fixed', (scrollY >= elTop));
+ })
+ .trigger('resize.sidestick');
+ });
+
+})(jQuery);
+/*! jQuery.scrollagent (c) 2012, Rico Sta. Cruz. MIT License.
+ * https://github.com/rstacruz/jquery-stuff/tree/master/scrollagent */
+
+// Call $(...).scrollagent() with a callback function.
+//
+// The callback will be called everytime the focus changes.
+//
+// Example:
+//
+// $("h2").scrollagent(function(cid, pid, currentElement, previousElement) {
+// if (pid) {
+// $("[href='#"+pid+"']").removeClass('active');
+// }
+// if (cid) {
+// $("[href='#"+cid+"']").addClass('active');
+// }
+// });
+
+(function($) {
+
+ $.fn.scrollagent = function(options, callback) {
+ // Account for $.scrollspy(function)
+ if (typeof callback === 'undefined') {
+ callback = options;
+ options = {};
+ }
+
+ var $sections = $(this);
+ var $parent = options.parent || $(window);
+
+ // Find the top offsets of each section
+ var offsets = [];
+ $sections.each(function(i) {
+ var offset = $(this).attr('data-anchor-offset') ?
+ parseInt($(this).attr('data-anchor-offset'), 10) :
+ (options.offset || 0);
+
+ offsets.push({
+ top: $(this).offset().top + offset,
+ id: $(this).attr('id'),
+ index: i,
+ el: this
+ });
+ });
+
+ // State
+ var current = null;
+ var height = null;
+ var range = null;
+
+ // Save the height. Do this only whenever the window is resized so we don't
+ // recalculate often.
+ $(window).on('resize', function() {
+ height = $parent.height();
+ range = $(document).height();
+ });
+
+ // Find the current active section every scroll tick.
+ $parent.on('scroll', function() {
+ var y = $parent.scrollTop();
+ y += height * (0.3 + 0.7 * Math.pow(y/range, 2));
+
+ var latest = null;
+
+ for (var i in offsets) {
+ if (offsets.hasOwnProperty(i)) {
+ var offset = offsets[i];
+ if (offset.top < y) latest = offset;
+ }
+ }
+
+ if (latest && (!current || (latest.index !== current.index))) {
+ callback.call($sections,
+ latest ? latest.id : null,
+ current ? current.id : null,
+ latest ? latest.el : null,
+ current ? current.el : null);
+ current = latest;
+ }
+ });
+
+ $(window).trigger('resize');
+ $parent.trigger('scroll');
+
+ return this;
+ };
+
+})(jQuery);
+/*! Anchorjump (c) 2012, Rico Sta. Cruz. MIT License.
+ * http://github.com/rstacruz/jquery-stuff/tree/master/anchorjump */
+
+// Makes anchor jumps happen with smooth scrolling.
+//
+// $("#menu a").anchorjump();
+// $("#menu a").anchorjump({ offset: -30 });
+//
+// // Via delegate:
+// $("#menu").anchorjump({ for: 'a', offset: -30 });
+//
+// You may specify a parent. This makes it scroll down to the parent.
+// Great for tabbed views.
+//
+// $('#menu a').anchorjump({ parent: '.anchor' });
+//
+// You can jump to a given area.
+//
+// $.anchorjump('#bank-deposit', options);
+
+(function($) {
+ var defaults = {
+ 'speed': 500,
+ 'offset': 0,
+ 'for': null,
+ 'parent': null
+ };
+
+ $.fn.anchorjump = function(options) {
+ options = $.extend({}, defaults, options);
+
+ if (options['for']) {
+ this.on('click', options['for'], onClick);
+ } else {
+ this.on('click', onClick);
+ }
+
+ function onClick(e) {
+ var $a = $(e.target).closest('a');
+ if (e.ctrlKey || e.metaKey || e.altKey || $a.attr('target')) return;
+
+ e.preventDefault();
+ var href = $a.attr('href');
+
+ $.anchorjump(href, options);
+ }
+ };
+
+ // Jump to a given area.
+ $.anchorjump = function(href, options) {
+ options = $.extend({}, defaults, options);
+
+ var top = 0;
+
+ if (href != '#') {
+ var $area = $(href);
+ // Find the parent
+ if (options.parent) {
+ var $parent = $area.closest(options.parent);
+ if ($parent.length) { $area = $parent; }
+ }
+ if (!$area.length) { return; }
+
+ // Determine the pixel offset; use the default if not available
+ var offset =
+ $area.attr('data-anchor-offset') ?
+ parseInt($area.attr('data-anchor-offset'), 10) :
+ options.offset;
+
+ top = Math.max(0, $area.offset().top + offset);
+ }
+
+ $('html, body').animate({ scrollTop: top }, options.speed);
+ $('body').trigger('anchor', href);
+
+ // Add the location hash via pushState.
+ if (window.history.pushState) {
+ window.history.pushState({ href: href }, "", href);
+ }
+ };
+})(jQuery);
+/*! fillsize (c) 2012, Rico Sta. Cruz. MIT License.
+ * http://github.com/rstacruz/jquery-stuff/tree/master/fillsize */
+
+// Makes an element fill up its container.
+//
+// $(".container").fillsize("> img");
+//
+// This binds a listener on window resizing to automatically scale down the
+// child (`> img` in this example) just so that enough of it will be visible in
+// the viewport of the container.
+//
+// This assumes that the container has `position: relative` (or any 'position',
+// really), and `overflow: hidden`.
+
+(function($) {
+ $.fn.fillsize = function(selector) {
+ var $parent = this;
+ var $img;
+
+ function resize() {
+ if (!$img) $img = $parent.find(selector);
+
+ $img.each(function() {
+ if (!this.complete) return;
+ var $img = $(this);
+
+ var parent = { height: $parent.innerHeight(), width: $parent.innerWidth() };
+ var imageRatio = $img.width() / $img.height();
+ var containerRatio = parent.width / parent.height;
+
+ var css = {
+ position: 'absolute',
+ left: 0, top: 0, right: 'auto', bottom: 'auto'
+ };
+
+ // If image is wider than the container
+ if (imageRatio > containerRatio) {
+ css.left = Math.round((parent.width - imageRatio * parent.height) / 2) + 'px';
+ css.width = 'auto';
+ css.height = '100%';
+ }
+
+ // If the container is wider than the image
+ else {
+ css.top = Math.round((parent.height - (parent.width / $img.width() * $img.height())) / 2) + 'px';
+ css.height = 'auto';
+ css.width = '100%';
+ }
+
+ $img.css(css);
+ });
+ }
+
+ // Make it happen on window resize.
+ $(window).resize(resize);
+
+ // Allow manual invocation by doing `.trigger('fillsize')` on the container.
+ $(document).on('fillsize', $parent.selector, resize);
+
+ // Resize on first load (or immediately if called after).
+ $(function() {
+ // If the child is an image, fill it up when image's real dimensions are
+ // first determined. Needs to be .bind() because the load event will
+ // bubble up.
+ $(selector, $parent).bind('load', function() {
+ setTimeout(resize, 25);
+ });
+
+ resize();
+ });
+
+ return this;
+ };
+})(jQuery);
diff --git a/docs/assets/flatdoc/theme-white/style.css b/docs/assets/flatdoc/theme-white/style.css
new file mode 100644
index 0000000..9bc329e
--- /dev/null
+++ b/docs/assets/flatdoc/theme-white/style.css
@@ -0,0 +1,831 @@
+/* ----------------------------------------------------------------------------
+ * Fonts
+ */
+@import url("http://fonts.googleapis.com/css?family=Montserrat:700|Open+Sans:300");
+/* ----------------------------------------------------------------------------
+ * Base
+ */
+html,
+body,
+div,
+span,
+applet,
+object,
+iframe,
+h1,
+h2,
+h3,
+h4,
+h5,
+h6,
+p,
+blockquote,
+pre,
+a,
+abbr,
+acronym,
+address,
+big,
+cite,
+code,
+del,
+dfn,
+em,
+img,
+ins,
+kbd,
+q,
+s,
+samp,
+small,
+strike,
+strong,
+sub,
+sup,
+tt,
+var,
+dl,
+dt,
+dd,
+ol,
+ul,
+li,
+fieldset,
+form,
+label,
+legend,
+table,
+caption,
+tbody,
+tfoot,
+thead,
+tr,
+th,
+td {
+ margin: 0;
+ padding: 0;
+ border: 0;
+ outline: 0;
+ font-weight: inherit;
+ font-style: inherit;
+ font-family: inherit;
+ font-size: 100%;
+ vertical-align: baseline;
+}
+body {
+ line-height: 1;
+ color: #000;
+ background: #fff;
+}
+ol,
+ul {
+ list-style: none;
+}
+table {
+ border-collapse: separate;
+ border-spacing: 0;
+ vertical-align: middle;
+}
+caption,
+th,
+td {
+ text-align: left;
+ font-weight: normal;
+ vertical-align: middle;
+}
+a img {
+ border: none;
+}
+html,
+body {
+ height: 100%;
+}
+html {
+ overflow-x: hidden;
+}
+body,
+td,
+textarea,
+input {
+ font-family: Helvetica Neue, Open Sans, sans-serif;
+ line-height: 1.6;
+ font-size: 13px;
+ color: #505050;
+}
+@media (max-width: 480px) /* Mobile */ {
+ body,
+ td,
+ textarea,
+ input {
+ font-size: 12px;
+ }
+}
+a {
+ color: #2badad;
+ text-decoration: none;
+}
+a:hover {
+ color: #228a8a;
+}
+/* ----------------------------------------------------------------------------
+ * Content styling
+ */
+.content p,
+.content ul,
+.content ol,
+.content h1,
+.content h2,
+.content h3,
+.content h4,
+.content h5,
+.content h6,
+.content pre,
+.content blockquote {
+ padding: 10px 0;
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+}
+.content h1,
+.content h2,
+.content h3,
+.content h4,
+.content h5,
+.content h6 {
+ font-weight: bold;
+ -webkit-font-smoothing: antialiased;
+ text-rendering: optimizeLegibility;
+}
+.content pre {
+ font-family: Menlo, monospace;
+}
+.content ul > li {
+ list-style-type: disc;
+}
+.content ol > li {
+ list-style-type: decimal;
+}
+.content ul,
+.content ol {
+ margin-left: 20px;
+}
+.content ul > li {
+ list-style-type: none;
+ position: relative;
+}
+.content ul > li:before {
+ content: '';
+ display: block;
+ position: absolute;
+ left: -17px;
+ top: 7px;
+ width: 5px;
+ height: 5px;
+ -webkit-border-radius: 4px;
+ border-radius: 4px;
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ background: #fff;
+ border: solid 1px #9090aa;
+}
+.content li > :first-child {
+ padding-top: 0;
+}
+.content strong,
+.content b {
+ font-weight: bold;
+}
+.content i,
+.content em {
+ font-style: italic;
+ color: #9090aa;
+}
+.content code {
+ font-family: Menlo, monospace;
+ background: #f3f6fb;
+ padding: 1px 3px;
+ font-size: 0.95em;
+}
+.content pre > code {
+ display: block;
+ background: transparent;
+ font-size: 0.85em;
+ letter-spacing: -1px;
+}
+.content blockquote :first-child {
+ padding-top: 0;
+}
+.content blockquote :last-child {
+ padding-bottom: 0;
+}
+/* ----------------------------------------------------------------------------
+ * Content
+ */
+.content-root {
+ min-height: 90%;
+ position: relative;
+}
+.content {
+ padding-top: 30px;
+ padding-bottom: 40px;
+ padding-left: 40px;
+ padding-right: 40px;
+ zoom: 1;
+ max-width: 700px;
+}
+.content:before,
+.content:after {
+ content: "";
+ display: table;
+}
+.content:after {
+ clear: both;
+}
+.content blockquote {
+ color: #9090aa;
+ text-shadow: 0 1px 0 rgba(255,255,255,0.5);
+}
+.content h1,
+.content h2,
+.content h3 {
+ -webkit-font-smoothing: antialiased;
+ text-rendering: optimizeLegibility;
+ font-family: montserrat;
+ padding-bottom: 0;
+}
+.content h1 + p,
+.content h2 + p,
+.content h3 + p,
+.content h1 ul,
+.content h2 ul,
+.content h3 ul,
+.content h1 ol,
+.content h2 ol,
+.content h3 ol {
+ padding-top: 10px;
+}
+.content h1,
+.content h2 {
+ text-transform: uppercase;
+ letter-spacing: 1px;
+ font-size: 1.5em;
+}
+.content h3 {
+ font-size: 1.2em;
+}
+.content h1,
+.content h2,
+.content .big-heading,
+body.big-h3 .content h3 {
+ padding-top: 80px;
+}
+.content h1:before,
+.content h2:before,
+.content .big-heading:before,
+body.big-h3 .content h3:before {
+ display: block;
+ content: '';
+ background: -webkit-gradient(linear, left top, right top, color-stop(0.8, #dfe2e7), color-stop(1, rgba(223,226,231,0)));
+ background: -webkit-linear-gradient(left, #dfe2e7 80%, rgba(223,226,231,0) 100%);
+ background: -moz-linear-gradient(left, #dfe2e7 80%, rgba(223,226,231,0) 100%);
+ background: -o-linear-gradient(left, #dfe2e7 80%, rgba(223,226,231,0) 100%);
+ background: -ms-linear-gradient(left, #dfe2e7 80%, rgba(223,226,231,0) 100%);
+ background: linear-gradient(left, #dfe2e7 80%, rgba(223,226,231,0) 100%);
+ -webkit-box-shadow: 0 1px 0 rgba(255,255,255,0.4);
+ box-shadow: 0 1px 0 rgba(255,255,255,0.4);
+ height: 1px;
+ position: relative;
+ top: -40px;
+ left: -40px;
+ width: 100%;
+}
+@media (max-width: 768px) /* Mobile and tablet */ {
+ .content h1,
+ .content h2,
+ .content .big-heading,
+body.big-h3 .content h3 {
+ padding-top: 40px;
+ }
+ .content h1:before,
+ .content h2:before,
+ .content .big-heading:before,
+body.big-h3 .content h3:before {
+ background: #dfe2e7;
+ left: -40px;
+ top: -20px;
+ width: 120%;
+ }
+}
+.content h4,
+.content h5,
+.content .small-heading,
+body:not(.big-h3) .content h3 {
+ border-bottom: solid 1px rgba(0,0,0,0.07);
+ color: #9090aa;
+ padding-top: 30px;
+ padding-bottom: 10px;
+}
+body:not(.big-h3) .content h3 {
+ font-size: 0.9em;
+}
+.content h1:first-child {
+ padding-top: 0;
+}
+.content h1:first-child,
+.content h1:first-child a,
+.content h1:first-child a:visited {
+ color: #505050;
+}
+.content h1:first-child:before {
+ display: none;
+}
+@media (max-width: 768px) /* Tablet */ {
+ .content h4,
+ .content h5,
+ .content .small-heading,
+ body:not(.big-h3) .content h3 {
+ padding-top: 20px;
+ }
+}
+@media (max-width: 480px) /* Mobile */ {
+ .content {
+ padding: 20px;
+ padding-top: 40px;
+ }
+ .content h4,
+ .content h5,
+ .content .small-heading,
+ body:not(.big-h3) .content h3 {
+ padding-top: 10px;
+ }
+}
+body.no-literate .content pre > code {
+ background: #f3f6fb;
+ border: solid 1px #e7eaee;
+ border-top: solid 1px #dbdde2;
+ border-left: solid 1px #e2e5e9;
+ display: block;
+ padding: 10px;
+ -webkit-border-radius: 2px;
+ border-radius: 2px;
+ overflow: auto;
+}
+body.no-literate .content pre > code {
+ -webkit-overflow-scrolling: touch;
+}
+body.no-literate .content pre > code::-webkit-scrollbar {
+ width: 15px;
+ height: 15px;
+}
+body.no-literate .content pre > code::-webkit-scrollbar-thumb {
+ background: #ddd;
+ -webkit-border-radius: 8px;
+ border-radius: 8px;
+ border: solid 4px #f3f6fb;
+}
+body.no-literate .content pre > code:hover::-webkit-scrollbar-thumb {
+ background: #999;
+ -webkit-box-shadow: inset 2px 2px 3px rgba(0,0,0,0.2);
+ box-shadow: inset 2px 2px 3px rgba(0,0,0,0.2);
+}
+@media (max-width: 1180px) /* Small desktop */ {
+ .content pre > code {
+ background: #f3f6fb;
+ border: solid 1px #e7eaee;
+ border-top: solid 1px #dbdde2;
+ border-left: solid 1px #e2e5e9;
+ display: block;
+ padding: 10px;
+ -webkit-border-radius: 2px;
+ border-radius: 2px;
+ overflow: auto;
+ }
+ .content pre > code {
+ -webkit-overflow-scrolling: touch;
+ }
+ .content pre > code::-webkit-scrollbar {
+ width: 15px;
+ height: 15px;
+ }
+ .content pre > code::-webkit-scrollbar-thumb {
+ background: #ddd;
+ -webkit-border-radius: 8px;
+ border-radius: 8px;
+ border: solid 4px #f3f6fb;
+ }
+ .content pre > code:hover::-webkit-scrollbar-thumb {
+ background: #999;
+ -webkit-box-shadow: inset 2px 2px 3px rgba(0,0,0,0.2);
+ box-shadow: inset 2px 2px 3px rgba(0,0,0,0.2);
+ }
+}
+.button {
+ -webkit-font-smoothing: antialiased;
+ text-rendering: optimizeLegibility;
+ font-family: montserrat, sans-serif;
+ letter-spacing: -1px;
+ font-weight: bold;
+ display: inline-block;
+ padding: 3px 25px;
+ border: solid 2px #2badad;
+ -webkit-border-radius: 20px;
+ border-radius: 20px;
+ margin-right: 15px;
+}
+.button,
+.button:visited {
+ background: #2badad;
+ color: #fff;
+ text-shadow: none;
+}
+.button:hover {
+ border-color: #111;
+ background: #111;
+ color: #fff;
+}
+.button.light,
+.button.light:visited {
+ background: transparent;
+ color: #9090aa;
+ border-color: #9090aa;
+ text-shadow: none;
+}
+.button.light:hover {
+ border-color: #9090aa;
+ background: #9090aa;
+ color: #fff;
+}
+.content .button + em {
+ color: #9090aa;
+}
+@media (min-width: 1180px) /* Big desktop */ {
+ body:not(.no-literate) .content-root {
+ background-color: #f3f6fb;
+ -webkit-box-shadow: inset 780px 0 #fff, inset 781px 0 #dfe2e7, inset 790px 0 5px -10px rgba(0,0,0,0.1);
+ box-shadow: inset 780px 0 #fff, inset 781px 0 #dfe2e7, inset 790px 0 5px -10px rgba(0,0,0,0.1);
+ }
+}
+@media (min-width: 1180px) /* Big desktop */ {
+ body:not(.no-literate) .content {
+ padding-left: 0;
+ padding-right: 0;
+ width: 930px;
+ max-width: none;
+ }
+ body:not(.no-literate) .content > p,
+ body:not(.no-literate) .content > ul,
+ body:not(.no-literate) .content > ol,
+ body:not(.no-literate) .content > h1,
+ body:not(.no-literate) .content > h2,
+ body:not(.no-literate) .content > h3,
+ body:not(.no-literate) .content > h4,
+ body:not(.no-literate) .content > h5,
+ body:not(.no-literate) .content > h6,
+ body:not(.no-literate) .content > pre,
+ body:not(.no-literate) .content > blockquote {
+ width: 550px;
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ padding-right: 40px;
+ padding-left: 40px;
+ }
+ body:not(.no-literate) .content > h1,
+ body:not(.no-literate) .content > h2,
+ body:not(.no-literate) .content > h3 {
+ clear: both;
+ width: 100%;
+ }
+ body:not(.no-literate) .content > pre,
+ body:not(.no-literate) .content > blockquote {
+ width: 380px;
+ padding-left: 20px;
+ padding-right: 20px;
+ float: right;
+ clear: right;
+ }
+ body:not(.no-literate) .content > pre + p,
+ body:not(.no-literate) .content > blockquote + p,
+ body:not(.no-literate) .content > pre + ul,
+ body:not(.no-literate) .content > blockquote + ul,
+ body:not(.no-literate) .content > pre + ol,
+ body:not(.no-literate) .content > blockquote + ol,
+ body:not(.no-literate) .content > pre + h4,
+ body:not(.no-literate) .content > blockquote + h4,
+ body:not(.no-literate) .content > pre + h5,
+ body:not(.no-literate) .content > blockquote + h5,
+ body:not(.no-literate) .content > pre + h6,
+ body:not(.no-literate) .content > blockquote + h6 {
+ clear: both;
+ }
+ body:not(.no-literate) .content > p,
+ body:not(.no-literate) .content > ul,
+ body:not(.no-literate) .content > ol,
+ body:not(.no-literate) .content > h4,
+ body:not(.no-literate) .content > h5,
+ body:not(.no-literate) .content > h6 {
+ float: left;
+ clear: left;
+ }
+ body:not(.no-literate) .content > h4,
+ body:not(.no-literate) .content > h5,
+ body:not(.no-literate) .content > .small-heading,
+ body:not(.big-h3) body:not(.no-literate) .content > h3 {
+ margin-left: 40px;
+ width: 470px;
+ margin-bottom: 3px;
+ padding-left: 0;
+ padding-right: 0;
+ }
+ body:not(.no-literate):not(.big-h3) .content > h3 {
+ margin-left: 40px;
+ width: 470px;
+ margin-bottom: 3px;
+ padding-left: 0;
+ padding-right: 0;
+ }
+}
+.header {
+ background: #f3f6fb;
+ text-shadow: 0 1px 0 rgba(255,255,255,0.5);
+ border-bottom: solid 1px #dfe2e7;
+ padding: 15px 15px 15px 30px;
+ zoom: 1;
+ line-height: 20px;
+ position: relative;
+}
+.header:before,
+.header:after {
+ content: "";
+ display: table;
+}
+.header:after {
+ clear: both;
+}
+.header .left {
+ float: left;
+}
+.header .right {
+ text-align: right;
+ position: absolute;
+ right: 15px;
+ top: 15px;
+}
+.header .right iframe {
+ display: inline-block;
+ vertical-align: middle;
+}
+.header h1 {
+ -webkit-font-smoothing: antialiased;
+ text-rendering: optimizeLegibility;
+ font-weight: bold;
+ font-family: montserrat, sans-serif;
+ font-size: 13px;
+}
+.header h1,
+.header h1 a,
+.header h1 a:visited {
+ color: #9090aa;
+}
+.header h1 a:hover {
+ color: #505050;
+}
+.header li a {
+ font-size: 0.88em;
+ color: #9090aa;
+ display: block;
+}
+.header li a:hover {
+ color: #3a3a44;
+}
+@media (min-width: 480px) /* Tablet & Desktop */ {
+ .header h1 {
+ float: left;
+ }
+ .header ul,
+ .header li {
+ display: block;
+ float: left;
+ }
+ .header ul {
+ margin-left: -15px;
+ }
+ .header h1 + ul {
+ border-left: solid 1px #dfe2e7;
+ margin-left: 15px;
+ }
+ .header li {
+ border-left: solid 1px rgba(255,255,255,0.5);
+ border-right: solid 1px #dfe2e7;
+ }
+ .header li:last-child {
+ border-right: 0;
+ }
+ .header li a {
+ padding: 0 15px;
+ }
+}
+@media (max-width: 480px) /* Mobile */ {
+ .right {
+ display: none;
+ }
+}
+.menubar {
+ -webkit-font-smoothing: antialiased;
+ text-rendering: optimizeLegibility;
+}
+.menubar .section {
+ padding: 30px 30px;
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+}
+.menubar .section + .section {
+ border-top: solid 1px #dfe2e7;
+}
+.menubar .section.no-line {
+ border-top: 0;
+ padding-top: 0;
+}
+a.big.button {
+ display: block;
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ width: 100%;
+ padding: 10px 20px;
+ text-align: center;
+ font-weight: bold;
+ font-size: 1.1em;
+ background: transparent;
+ border: solid 3px #2badad;
+ -webkit-border-radius: 30px;
+ border-radius: 30px;
+ font-family: montserrat, sans-serif;
+}
+a.big.button,
+a.big.button:visited {
+ color: #2badad;
+ text-decoration: none;
+}
+a.big.button:hover {
+ background: #2badad;
+}
+a.big.button:hover,
+a.big.button:hover:visited {
+ color: #fff;
+}
+@media (max-width: 480px) /* Mobile */ {
+ .menubar {
+ padding: 20px;
+ border-bottom: solid 1px #dfe2e7;
+ }
+}
+@media (max-width: 768px) /* Mobile and tablet */ {
+ .menubar {
+ display: none;
+ }
+}
+@media (min-width: 768px) /* Desktop */ {
+ .content-root {
+ padding-left: 230px;
+ }
+ .menubar {
+ position: absolute;
+ left: 0;
+ top: 0;
+ bottom: 0;
+ width: 230px;
+ border-right: solid 1px #dfe2e7;
+ }
+ .menubar.fixed {
+ position: fixed;
+ overflow-y: auto;
+ }
+ .menubar.fixed {
+ -webkit-overflow-scrolling: touch;
+ }
+ .menubar.fixed::-webkit-scrollbar {
+ width: 15px;
+ height: 15px;
+ }
+ .menubar.fixed::-webkit-scrollbar-thumb {
+ background: #ddd;
+ -webkit-border-radius: 8px;
+ border-radius: 8px;
+ border: solid 4px #fff;
+ }
+ .menubar.fixed:hover::-webkit-scrollbar-thumb {
+ background: #999;
+ -webkit-box-shadow: inset 2px 2px 3px rgba(0,0,0,0.2);
+ box-shadow: inset 2px 2px 3px rgba(0,0,0,0.2);
+ }
+}
+.menubar {
+ font-size: 0.9em;
+}
+.menu ul.level-1 > li + li {
+ margin-top: 20px;
+}
+.menu a {
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ position: relative;
+ display: block;
+ padding-top: 1px;
+ padding-bottom: 1px;
+ margin-right: -30px;
+}
+.menu a,
+.menu a:visited {
+ color: #2badad;
+}
+.menu a:hover {
+ color: #228a8a;
+}
+.menu a.level-1 {
+ font-family: montserrat, sans-serif;
+ text-transform: uppercase;
+ font-size: 0.9em;
+ font-weight: bold;
+}
+.menu a.level-1,
+.menu a.level-1:visited {
+ color: #9090aa;
+}
+.menu a.level-1:hover {
+ color: #565666;
+}
+.menu a.level-2 {
+ font-weight: normal;
+}
+.menu a.level-3 {
+ font-weight: normal;
+ font-size: 0.9em;
+ padding-left: 10px;
+}
+.menu a.active {
+ font-weight: bold !important;
+}
+.menu a.active,
+.menu a.active:visited,
+.menu a.active:hover {
+ color: #505050 !important;
+}
+.menu a.active:after {
+ content: '';
+ display: block;
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ position: absolute;
+ top: 10px;
+ right: 30px;
+ width: 9px;
+ height: 3px;
+ -webkit-border-radius: 2px;
+ border-radius: 2px;
+ background: #2badad;
+}
+code .string,
+code .number {
+ color: #3ac;
+}
+code .init {
+ color: #383;
+}
+code .keyword {
+ font-weight: bold;
+}
+code .comment {
+ color: #adadcc;
+}
+.large-brief .content > h1:first-child + p,
+.content > p.brief {
+ font-size: 1.3em;
+ font-family: Open Sans, sans-serif;
+ font-weight: 300;
+}
+.title-area {
+ min-height: 100px;
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ -webkit-font-smoothing: antialiased;
+ text-rendering: optimizeLegibility;
+ text-align: center;
+ border-bottom: solid 1px #dfe2e7;
+ overflow: hidden;
+}
+.title-area > img.bg {
+ z-index: 0;
+ position: absolute;
+ left: -9999px;
+}
+.title-area > div {
+ position: relative;
+ z-index: 1;
+}
+