├── .gitignore
├── assets
├── stylesheets
│ ├── reset.css
│ ├── screen.css
│ ├── low_vision_screen.css
│ ├── low.css
│ ├── theme-default.css
│ ├── low_vision_shared.css
│ ├── print.css
│ ├── low_vision_high.css
│ ├── prettify.css
│ ├── highlight
│ │ └── default.min.css
│ ├── shared.css
│ └── high.css
├── favicon.ico
├── images
│ ├── bug.png
│ ├── rb.png
│ ├── check.png
│ ├── logo.gif
│ ├── columns.jpg
│ ├── download.gif
│ ├── shadow.jpg
│ ├── blue-columns.jpg
│ ├── logo-background.jpg
│ ├── code-box-top-left.gif
│ ├── dotted-underline.gif
│ ├── footer-background.jpg
│ ├── header-background.jpg
│ ├── blue-columns-home-page.jpg
│ ├── code-box-bottom-right.gif
│ ├── dark-dotted-underline.gif
│ ├── site-links-background.gif
│ ├── blue-columns-top-home-page.jpg
│ └── blue-columns-bottom-home-page.jpg
└── javascripts
│ ├── prototype_extensions.js
│ ├── firebug.js
│ ├── main.js
│ ├── jquery.mousewheel.min.js
│ ├── keymaster.js
│ ├── quicksearch.js
│ ├── handlebars.runtime.js
│ ├── jquery.history.js
│ ├── handlebars.helpers.js
│ ├── rubyfaux.js
│ ├── highlight.min.js
│ └── rundown.js
├── source
├── ecotemplates
│ ├── document_heading.eco
│ ├── title.eco
│ ├── navigation.eco
│ └── document_heading.js
├── handlebars
│ ├── script_sidebar.handlebars
│ ├── document_content.handlebars
│ ├── document_heading.handlebars
│ ├── script_heading.handlebars
│ ├── class_heading.handlebars
│ ├── title.handlebars
│ ├── navigation.handlebars
│ ├── script_content.handlebars
│ ├── copyright.handlebars
│ ├── searchbox.handlebars
│ ├── method.handlebars
│ ├── document_sidebar.handlebars
│ ├── class_content.handlebars
│ └── class_sidebar.handlebars
└── coffeescripts
│ ├── rubyfaux.coffee
│ └── rubyfaux.js
├── Rakefile
├── README.md
├── index.html
└── COPYING.md
/.gitignore:
--------------------------------------------------------------------------------
1 | .fire/digest
2 | heroku
3 | website
4 | work
5 |
--------------------------------------------------------------------------------
/assets/stylesheets/reset.css:
--------------------------------------------------------------------------------
1 | ul {
2 | margin: 0;
3 | padding: 0 2em;
4 | }
5 |
--------------------------------------------------------------------------------
/assets/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubyworks/rubyfaux/master/assets/favicon.ico
--------------------------------------------------------------------------------
/assets/images/bug.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubyworks/rubyfaux/master/assets/images/bug.png
--------------------------------------------------------------------------------
/assets/images/rb.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubyworks/rubyfaux/master/assets/images/rb.png
--------------------------------------------------------------------------------
/assets/images/check.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubyworks/rubyfaux/master/assets/images/check.png
--------------------------------------------------------------------------------
/assets/images/logo.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubyworks/rubyfaux/master/assets/images/logo.gif
--------------------------------------------------------------------------------
/source/ecotemplates/document_heading.eco:
--------------------------------------------------------------------------------
1 |
2 |
<%= name %>
3 |
--------------------------------------------------------------------------------
/source/handlebars/script_sidebar.handlebars:
--------------------------------------------------------------------------------
1 |
2 | {{> document_sidebar}}
3 |
4 |
--------------------------------------------------------------------------------
/assets/images/columns.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubyworks/rubyfaux/master/assets/images/columns.jpg
--------------------------------------------------------------------------------
/assets/images/download.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubyworks/rubyfaux/master/assets/images/download.gif
--------------------------------------------------------------------------------
/assets/images/shadow.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubyworks/rubyfaux/master/assets/images/shadow.jpg
--------------------------------------------------------------------------------
/source/handlebars/document_content.handlebars:
--------------------------------------------------------------------------------
1 |
2 | {{markup text format}}
3 |
4 |
--------------------------------------------------------------------------------
/source/handlebars/document_heading.handlebars:
--------------------------------------------------------------------------------
1 |
2 | {{name}}
3 |
--------------------------------------------------------------------------------
/source/handlebars/script_heading.handlebars:
--------------------------------------------------------------------------------
1 |
2 | {{name}}
3 |
4 |
--------------------------------------------------------------------------------
/source/handlebars/class_heading.handlebars:
--------------------------------------------------------------------------------
1 |
2 | {{name}}
3 |
4 |
--------------------------------------------------------------------------------
/assets/images/blue-columns.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubyworks/rubyfaux/master/assets/images/blue-columns.jpg
--------------------------------------------------------------------------------
/assets/images/logo-background.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubyworks/rubyfaux/master/assets/images/logo-background.jpg
--------------------------------------------------------------------------------
/assets/images/code-box-top-left.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubyworks/rubyfaux/master/assets/images/code-box-top-left.gif
--------------------------------------------------------------------------------
/assets/images/dotted-underline.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubyworks/rubyfaux/master/assets/images/dotted-underline.gif
--------------------------------------------------------------------------------
/assets/images/footer-background.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubyworks/rubyfaux/master/assets/images/footer-background.jpg
--------------------------------------------------------------------------------
/assets/images/header-background.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubyworks/rubyfaux/master/assets/images/header-background.jpg
--------------------------------------------------------------------------------
/assets/images/blue-columns-home-page.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubyworks/rubyfaux/master/assets/images/blue-columns-home-page.jpg
--------------------------------------------------------------------------------
/assets/images/code-box-bottom-right.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubyworks/rubyfaux/master/assets/images/code-box-bottom-right.gif
--------------------------------------------------------------------------------
/assets/images/dark-dotted-underline.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubyworks/rubyfaux/master/assets/images/dark-dotted-underline.gif
--------------------------------------------------------------------------------
/assets/images/site-links-background.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubyworks/rubyfaux/master/assets/images/site-links-background.gif
--------------------------------------------------------------------------------
/assets/images/blue-columns-top-home-page.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubyworks/rubyfaux/master/assets/images/blue-columns-top-home-page.jpg
--------------------------------------------------------------------------------
/assets/stylesheets/screen.css:
--------------------------------------------------------------------------------
1 | /*
2 | screen.css - styles for the screen
3 | */
4 |
5 | @import url(high.css);
6 | @import url(shared.css);
7 |
--------------------------------------------------------------------------------
/assets/images/blue-columns-bottom-home-page.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rubyworks/rubyfaux/master/assets/images/blue-columns-bottom-home-page.jpg
--------------------------------------------------------------------------------
/assets/stylesheets/low_vision_screen.css:
--------------------------------------------------------------------------------
1 | /*
2 | low_vision_screen.css - styles for the screen for visually impaired people
3 | */
4 |
5 | @import url(low_vision_shared.css);
6 | @import url(low_vision_high.css);
7 |
--------------------------------------------------------------------------------
/source/ecotemplates/title.eco:
--------------------------------------------------------------------------------
1 |
2 |
3 |
<%= title %>
4 |
5 |
6 |
--------------------------------------------------------------------------------
/source/handlebars/title.handlebars:
--------------------------------------------------------------------------------
1 |
2 |
3 |
{{title}}
4 |
5 |
6 |
--------------------------------------------------------------------------------
/assets/javascripts/prototype_extensions.js:
--------------------------------------------------------------------------------
1 |
2 | //
3 | Array.prototype.contains = function(obj) {
4 | var i = this.length;
5 | while (i--) {
6 | if (this[i] == obj) {
7 | return true;
8 | }
9 | }
10 | return false;
11 | }
12 |
13 | //
14 | String.prototype.capitalize = function() {
15 | return this.charAt(0).toUpperCase() + this.slice(1);
16 | }
17 |
18 |
--------------------------------------------------------------------------------
/source/handlebars/navigation.handlebars:
--------------------------------------------------------------------------------
1 |
2 |
3 |
10 |
11 |
--------------------------------------------------------------------------------
/source/ecotemplates/navigation.eco:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
--------------------------------------------------------------------------------
/assets/javascripts/firebug.js:
--------------------------------------------------------------------------------
1 | /* Provide console simulation for firebug-less environments */
2 |
3 | if (!("console" in window) || !("firebug" in console)) {
4 | var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml",
5 | "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
6 |
7 | window.console = {};
8 | for (var i = 0; i < names.length; ++i)
9 | window.console[names[i]] = function() {};
10 | };
11 |
12 |
--------------------------------------------------------------------------------
/assets/stylesheets/low.css:
--------------------------------------------------------------------------------
1 | /*
2 | low.css - styles for legacy browsers
3 | */
4 |
5 | a {
6 | color: #3256B6;
7 | }
8 | a:visited {
9 | color: #7130B8;
10 | }
11 | a:hover, a:visited:hover {
12 | color: #C61A1A;
13 | }
14 | a img { border: 0; }
15 | body {
16 | font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
17 | }
18 | h1, h2, h3, h4, h5, h6 {
19 | font-family: Georgia, Palatino, "Times New Roman", Times, serif;
20 | }
21 | h1 {
22 | font-size: 300%;
23 | font-weight: normal;
24 | }
25 | .hidden {
26 | display: none;
27 | }
28 |
29 |
--------------------------------------------------------------------------------
/assets/javascripts/main.js:
--------------------------------------------------------------------------------
1 | function openCode( url )
2 | {
3 | window.open( url, "SOURCE_CODE", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=480,width=750" ).focus();
4 | }
5 |
6 | function hookHighlightSyntax() {
7 | /* TODO: wrap code if not present? */
8 | $('pre:not(.code)').wrapInner('');
9 | // $('pre:not(.code)').addClass('code');
10 | // $('pre.code').wrapInner('');
11 | /* hljs.tabReplace = ' ';
12 | hljs.initHighlightingOnLoad('ruby', 'cpp'); */
13 | prettyPrint();
14 | };
15 |
16 |
--------------------------------------------------------------------------------
/source/handlebars/script_content.handlebars:
--------------------------------------------------------------------------------
1 |
2 |
3 | {{#if requires}}
4 | Required Files
5 |
6 | {{#doc requires}}
7 | {{#if id}}
8 | {{name}}
9 | {{else}}
10 | {{this}}
11 | {{/if}}
12 | {{/doc}}
13 |
14 | {{/if}}
15 |
16 | {{#if uri}}
17 |
20 | {{/if}}
21 |
22 | {{#if source}}
23 | {{source}}
24 | {{/if}}
25 |
26 |
--------------------------------------------------------------------------------
/assets/stylesheets/theme-default.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This file overrides the theme_default.css file in RDoc+.
3 | * It's a temporary solution to fix the styles issues caused
4 | * by the addition of themes to RDoc+.
5 | * Ultimately this file should be removed and other .css
6 | * files adjusted to accomodate.
7 | *
8 | * On the other hand maybe this format whould not be themable.
9 | */
10 |
11 |
12 | h1,h2,h3,h4,h5,h6,th,dt,.h {
13 | font-family: Palatino, Times, serif;
14 | font-weight: bold;
15 | }
16 |
17 | p,li,td,dd {
18 | font-family: "Helvetica Neue", Helvetica, Tahoma, sans-serif;
19 | }
20 |
21 |
--------------------------------------------------------------------------------
/assets/stylesheets/low_vision_shared.css:
--------------------------------------------------------------------------------
1 | /*
2 | low_vision_shared.css - styles shared between print and high for visually impaired people
3 | */
4 |
5 | @import url(shared.css);
6 |
7 | body {
8 | font-size: 90%;
9 | }
10 | #content h2 {
11 | font-size: 180%;
12 | }
13 | #content h3 {
14 | color: #b60a0a;
15 | font-size: 180%;
16 | line-height: 120%;
17 | }
18 | #content h4 {
19 | font-size: 170%;
20 | line-height: 120%;
21 | }
22 | #content h5 {
23 | font-size: 120%;
24 | line-height: 120%;
25 | }
26 | #content .post-info {
27 | color: #706f59;
28 | font-size: 100%;
29 | }
30 | #search-form .field {
31 | border: 4px solid #a3a39f;
32 | }
33 | #search-form .button {
34 | border: 4px solid #a3a39f;
35 | background-color: #f6f6e7;
36 | color: #9b9b95;
37 | font-size: 24px;
38 | }
39 |
--------------------------------------------------------------------------------
/source/handlebars/copyright.handlebars:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
7 |
8 |
9 |
10 | This website is made with
11 | Shomen and
12 | RubyFaux v{{rubyfaux_version}}.
13 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/assets/stylesheets/print.css:
--------------------------------------------------------------------------------
1 | /*
2 | print.css - styles for print
3 | */
4 |
5 | @import url(shared.css);
6 |
7 | .site-links, #sidebar-wrapper,
8 | #search-form {
9 | display: none;
10 | }
11 | #header {
12 | border: 0px solid black;
13 | border-bottom-width: 1pt;
14 | }
15 | #content-wrapper {
16 | float: left;
17 | padding-bottom: 2em;
18 | width: 100%;
19 | }
20 | #footer {
21 | border: 0px solid black;
22 | border-top-width: 1pt;
23 | }
24 | #footer p {
25 | margin-top: .5em;
26 | }
27 | #code {
28 | border: 1px solid gray;
29 | padding: 20px;
30 | }
31 | #code code {
32 | display: block;
33 | color: gray;
34 | font-family: "Lucida Console", Monaco, monospace;
35 | font-size: 90%;
36 | }
37 | #code .comment {
38 | color: green;
39 | }
40 | #code .keyword {
41 | color: blue;
42 | }
43 | #heading .multi-page {
44 | display: none;
45 | }
46 |
--------------------------------------------------------------------------------
/assets/stylesheets/low_vision_high.css:
--------------------------------------------------------------------------------
1 | /*
2 | low_vision_high.css - styles for modern browsers for visually impaired people
3 | */
4 |
5 | @import url(high.css);
6 |
7 | #content #news ul a {
8 | color: #1111ee;
9 | font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
10 | }
11 | #content dl dt {
12 | font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
13 | }
14 | #sidebar {
15 | font-size: 90%;
16 | }
17 | #sidebar .navigation .menu a,
18 | #sidebar .navigation .more a {
19 | color: #1111ee;
20 | }
21 | #sidebar .navigation a {
22 | color: #1111ee;
23 | }
24 | #search-box {
25 | width: 738px;
26 | }
27 | #search-form {
28 | position: absolute;
29 | top: 57px;
30 | width: 738px;
31 | height: 50px:
32 | }
33 | #search-form .field {
34 | width: 214px;
35 | height: 48px;
36 | }
37 | #search-form .button {
38 | width: 148px;
39 | height: 48px;
40 | }
41 |
--------------------------------------------------------------------------------
/source/handlebars/searchbox.handlebars:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
--------------------------------------------------------------------------------
/assets/javascripts/jquery.mousewheel.min.js:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2009 Brandon Aaron (http://brandonaaron.net)
2 | * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
3 | * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
4 | * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
5 | * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
6 | *
7 | * Version: 3.0.2
8 | *
9 | * Requires: 1.2.2+
10 | */
11 | (function(c){var a=["DOMMouseScroll","mousewheel"];c.event.special.mousewheel={setup:function(){if(this.addEventListener){for(var d=a.length;d;){this.addEventListener(a[--d],b,false)}}else{this.onmousewheel=b}},teardown:function(){if(this.removeEventListener){for(var d=a.length;d;){this.removeEventListener(a[--d],b,false)}}else{this.onmousewheel=null}}};c.fn.extend({mousewheel:function(d){return d?this.bind("mousewheel",d):this.trigger("mousewheel")},unmousewheel:function(d){return this.unbind("mousewheel",d)}});function b(f){var d=[].slice.call(arguments,1),g=0,e=true;f=c.event.fix(f||window.event);f.type="mousewheel";if(f.wheelDelta){g=f.wheelDelta/120}if(f.detail){g=-f.detail/3}d.unshift(f,g);return c.event.handle.apply(this,d)}})(jQuery);
--------------------------------------------------------------------------------
/assets/stylesheets/prettify.css:
--------------------------------------------------------------------------------
1 | /* FROM RUBYFAUX */
2 |
3 | .str{color:#00cc00;}
4 | .kwd{color:#f9bb00;}
5 | .com{color:#428bdd;}
6 | .typ{color:#b53b3c;}
7 | .lit{color:#eddd3d;}
8 | .pun{color:#8aa6c1;}
9 | .pln{color:#ffffff}
10 | .tag{color:#8aa6c1;}
11 | .atn{color:#8aa6c1;}
12 | .atv{color:#00cc00;}
13 | .dec{color:#b53b3c;}
14 |
15 | /* pre.prettyprint{padding:2px;border:1px solid #888} */
16 |
17 | @media print{
18 | .str{color:#060}
19 | .kwd{color:#006;font-weight:bold}
20 | .com{color:#600;font-style:italic}
21 | .typ{color:#404;font-weight:bold}
22 | .lit{color:#044}
23 | .pun{color:#440}
24 | .pln{color:#449}
25 | .tag{color:#006;font-weight:bold}
26 | .atn{color:#404}
27 | .atv{color:#060}
28 | }
29 |
30 | #content pre {
31 | background-color: #eeeeff;
32 | background-position: top left;
33 | background-repeat: no-repeat;
34 | color: white;
35 | display: block;
36 | width: 100%;
37 | }
38 |
39 | #content pre code.prettyprint {
40 | background-position: bottom right;
41 | background-repeat: no-repeat;
42 | display: block;
43 | overflow: auto;
44 | font-family: monospace; /*, "Lucida Console", Monaco, monospace; */
45 | font-size: 100%;
46 | line-height: 135%;
47 | padding: 10px 0px 10px 5px;
48 | margin-left: -5px;
49 | }
50 |
51 |
--------------------------------------------------------------------------------
/source/handlebars/method.handlebars:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
18 |
19 | {{#if interfaces.length}}
20 | {{#interfaces}}
21 | {{signature}}
22 | {{/interfaces}}
23 | {{else}}
24 | {{name}}
25 | {{/if}}
26 |
27 | {{#if source}}
28 |
31 | {{/if}}
32 |
33 | {{#if comment}}
34 | {{markup comment format}}
35 | {{/if}}
36 |
37 | {{#if aliases.length}}
38 |
39 | This method is also aliased as
40 | {{#doc aliases}}
41 | {{#if id}}
42 |
{{name}}
43 | {{else}}
44 | {{this}}
45 | {{/if}}
46 | {{/doc}}
47 |
48 | {{/if}}
49 |
50 |
51 |
--------------------------------------------------------------------------------
/assets/stylesheets/highlight/default.min.css:
--------------------------------------------------------------------------------
1 | pre code{display:block;padding:.5em;background:#f0f0f0}pre code,pre .ruby .subst,pre .tag .title,pre .lisp .title{color:black}pre .string,pre .title,pre .constant,pre .parent,pre .tag .value,pre .rules .value,pre .rules .value .number,pre .preprocessor,pre .ruby .symbol,pre .ruby .symbol .string,pre .ruby .symbol .keyword,pre .ruby .symbol .keymethods,pre .instancevar,pre .aggregate,pre .template_tag,pre .django .variable,pre .smalltalk .class,pre .addition,pre .flow,pre .stream,pre .bash .variable,pre .apache .tag,pre .apache .cbracket,pre .tex .command,pre .tex .special,pre .erlang_repl .function_or_atom{color:#800}pre .comment,pre .annotation,pre .template_comment,pre .diff .header,pre .chunk{color:#888}pre .number,pre .date,pre .regexp,pre .literal,pre .smalltalk .symbol,pre .smalltalk .char,pre .go .constant,pre .change{color:#080}pre .label,pre .javadoc,pre .ruby .string,pre .decorator,pre .filter .argument,pre .localvars,pre .array,pre .attr_selector,pre .important,pre .pseudo,pre .pi,pre .doctype,pre .deletion,pre .envvar,pre .shebang,pre .apache .sqbracket,pre .nginx .built_in,pre .tex .formula,pre .erlang_repl .reserved,pre .input_number{color:#88F}pre .css .tag,pre .javadoctag,pre .phpdoc,pre .yardoctag{font-weight:bold}pre .keyword,pre .id,pre .phpdoc,pre .title,pre .built_in,pre .aggregate,pre .smalltalk .class,pre .winutils,pre .bash .variable,pre .apache .tag,pre .go .typename,pre .tex .command{font-weight:bold}pre .nginx .built_in{font-weight:normal}pre .xml .css,pre .xml .javascript,pre .xml .vbscript,pre .tex .formula{opacity:.5}
--------------------------------------------------------------------------------
/source/ecotemplates/document_heading.js:
--------------------------------------------------------------------------------
1 | (function() {
2 | this.ecoTemplates || (this.ecoTemplates = {});
3 | this.ecoTemplates["document_heading"] = function(__obj) {
4 | if (!__obj) __obj = {};
5 | var __out = [], __capture = function(callback) {
6 | var out = __out, result;
7 | __out = [];
8 | callback.call(this);
9 | result = __out.join('');
10 | __out = out;
11 | return __safe(result);
12 | }, __sanitize = function(value) {
13 | if (value && value.ecoSafe) {
14 | return value;
15 | } else if (typeof value !== 'undefined' && value != null) {
16 | return __escape(value);
17 | } else {
18 | return '';
19 | }
20 | }, __safe, __objSafe = __obj.safe, __escape = __obj.escape;
21 | __safe = __obj.safe = function(value) {
22 | if (value && value.ecoSafe) {
23 | return value;
24 | } else {
25 | if (!(typeof value !== 'undefined' && value != null)) value = '';
26 | var result = new String(value);
27 | result.ecoSafe = true;
28 | return result;
29 | }
30 | };
31 | if (!__escape) {
32 | __escape = __obj.escape = function(value) {
33 | return ('' + value)
34 | .replace(/&/g, '&')
35 | .replace(//g, '>')
37 | .replace(/"/g, '"');
38 | };
39 | }
40 | (function() {
41 | (function() {
42 |
43 | __out.push('\n');
44 |
45 | __out.push(__sanitize(name));
46 |
47 | __out.push(' \n');
48 |
49 | }).call(this);
50 |
51 | }).call(__obj);
52 | __obj.safe = __objSafe, __obj.escape = __escape;
53 | return __out.join('');
54 | };
55 | }).call(this);
56 |
--------------------------------------------------------------------------------
/source/handlebars/document_sidebar.handlebars:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
12 |
13 |
14 |
15 |
16 |
17 | {{#if documents.length}}
18 |
19 |
20 |
21 | {{#documents}}
22 | {{name}}
23 | {{/documents}}
24 |
25 |
26 | {{/if}}
27 |
28 |
29 | {{#if classes.length}}
30 |
31 |
32 |
33 | {{#classes}}
34 | {{path}}
35 | {{/classes}}
36 |
37 |
No matching classes.
38 |
39 | {{/if}}
40 |
41 |
42 | {{#if methods.length}}
43 |
44 |
45 |
46 | {{#methods}}
47 |
48 |
49 | {{name}}
50 |
51 | {{namespace}}
52 |
53 | {{/methods}}
54 |
55 |
56 | {{/if}}
57 |
58 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/assets/javascripts/keymaster.js:
--------------------------------------------------------------------------------
1 | // keymaster.js
2 | // (c) 2011 Thomas Fuchs
3 | // keymaster.js may be freely distributed under the MIT license.
4 | (function(a){function m(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent&&a.attachEvent("on"+b,function(){c(window.event)})}function l(a){e=a||"all"}function k(a,b,d){var e,h,i,j;d===undefined&&(d=b,b="all"),a=a.replace(/\s/g,""),e=a.split(","),e[e.length-1]==""&&(e[e.length-2]+=",");for(i=0;i1){h=a.slice(0,a.length-1);for(j=0;j0;for(j in d)if(!d[j]&&h(i.mods,+j)>-1||d[j]&&h(i.mods,+j)==-1)m=!1;(i.mods.length==0&&!d[16]&&!d[18]&&!d[17]&&!d[91]||m)&&i.method(a,i)===!1&&(a.preventDefault?a.preventDefault():a.returnValue=!1,a.stopPropagation&&a.stopPropagation(),a.cancelBubble&&(a.cancelBubble=!0))}}}}function h(a,b){var c=a.length;while(c--)if(a[c]===b)return c;return-1}var b,c={},d={16:!1,18:!1,17:!1,91:!1},e="all",f={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,command:91},g={backspace:8,tab:9,clear:12,enter:13,"return":13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,"delete":46,home:36,end:35,pageup:33,pagedown:34,",":188,".":190,"/":191,"`":192,"-":189,"=":187,";":186,"'":222,"[":219,"]":221,"\\":220};for(b=1;b<20;b++)f["f"+b]=111+b;for(b in f)k[b]=!1;m(document,"keydown",i),m(document,"keyup",j),a.key=k,a.key.setScope=l,typeof module!="undefined"&&(module.exports=key)})(this)
--------------------------------------------------------------------------------
/assets/stylesheets/shared.css:
--------------------------------------------------------------------------------
1 | /*
2 | shared.css - styles shared between print and high
3 |
4 | TODO: The css for this seems way to complicated.
5 | We need to use sass.
6 | */
7 |
8 | /* reverse theme */
9 |
10 | body {
11 | font-size: 80%;
12 | }
13 |
14 | li p { margin: 5px; }
15 | pre { padding-left: 10px; }
16 |
17 | .hidden-modern {
18 | position: absolute;
19 | left: -20000px;
20 | top: -20000px;
21 | }
22 | .site-links .separator { display: none; }
23 | .site-links {
24 | background-color: #7d0000;
25 | }
26 | #content h2 {
27 | font-size: 170%;
28 | margin-top: 1.5em;
29 | }
30 | #content h3 {
31 | color: #c61a1a;
32 | font-weight: normal;
33 | font-size: 170%;
34 | line-height: 110%;
35 | /*margin-top: 1.5em;*/
36 | margin-bottom: 0.25em;
37 | padding-bottom: 0;
38 | }
39 | #content .post {
40 | margin-bottom: 2em;
41 | }
42 | #content h4 {
43 | font-weight: normal;
44 | font-size: 160%;
45 | line-height: 110%;
46 | margin-top: 2em;
47 | margin-bottom: 1em;
48 | }
49 | #content h5 {
50 | font-weight: bold;
51 | font-size: 110%;
52 | line-height: 110%;
53 | margin-top: 2em;
54 | margin-bottom: 1em;
55 | }
56 | #content p {
57 | margin-top: 0;
58 | }
59 | #content .post-info {
60 | color: #b0af99;
61 | font-size: 80%;
62 | }
63 | #search-form .field {
64 | border: 1px solid #d3d3cf;
65 | }
66 | #search-form .button {
67 | border: 1px solid #d3d3cf;
68 | background-color: #e6e6d7;
69 | color: #7b7b75;
70 | font-family: Georgia, Palatino, "Times New Roman", Times, serif;
71 | font-size: 14px;
72 | font-weight: bold;
73 | }
74 | #footer {
75 | clear: both;
76 | }
77 |
78 |
79 | /* layouts */
80 |
81 | #home-page-layout h3 {
82 | margin-top: 1.5em;
83 | margin-bottom: .5em;
84 | }
85 |
86 |
87 | #content pre {
88 | background-color: #eeeeff;
89 | background-position: left top;
90 | background-repeat: no-repeat;
91 | color: white;
92 | display: block;
93 | width: 100%;
94 | }
95 | #content pre code.prettyprint {
96 | background-position: right bottom;
97 | background-repeat: no-repeat;
98 | display: block;
99 | font-family: monospace;
100 | font-size: 100%;
101 | line-height: 135%;
102 | margin-left: -5px;
103 | overflow: auto;
104 | padding: 10px 0 10px 5px;
105 | color: white;
106 | }
107 |
108 |
--------------------------------------------------------------------------------
/Rakefile:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 |
3 | ignore 'website', 'heroku'
4 |
5 | #include ShellUtils #why does this not work ?
6 |
7 | #
8 | # Run thin server to give site a spin.
9 | #
10 | desc "start thin server"
11 | task "serve" do
12 | sh "thin start -A file"
13 | end
14 |
15 | #
16 | # Compile Handlebar.js templates.
17 | #
18 | desc "compile hnadle bar templates"
19 | task 'compile' do
20 | sh "handlebars source/handlebars/*.handlebars -f assets/javascripts/handlebars.templates.js"
21 | end
22 |
23 | #
24 | # The publish task uses the detroit-github plugin
25 | # from the Detroit project.
26 | #
27 | desc 'prepare'
28 | task 'prepare' do
29 | github.prepare
30 | end
31 |
32 | desc 'publish'
33 | task 'publish' do
34 | #mkdir_p 'website'
35 | #cp 'index.html', 'website/'
36 | #cp 'doc.json', 'website/'
37 | #cp_r 'assets', 'website/'
38 | github.publish
39 | end
40 |
41 | #
42 | # Helper method create Detroit::GitHub instace.
43 | #
44 | def github
45 | @github ||= (
46 | require 'detroit'
47 | require 'detroit-github'
48 | Detroit::GitHub.new(
49 | :folder => 'website'
50 | #:sitemap => {
51 | # 'index.html' => 'index.html',
52 | # 'doc.json' => 'doc.json',
53 | # 'assets' => 'assets'
54 | #}
55 | )
56 | )
57 | end
58 |
59 | # Copy project files in website directory.
60 | desc 'update website files'
61 | task 'web:update' do
62 | mkdir_p 'website'
63 | install 'index.html', 'website/index.html'
64 | install 'doc.json', 'website/doc.json'
65 | sync 'assets', 'website/assets'
66 | end
67 |
68 | desc 'publish website'
69 | task 'web:publish' => ['web:update'] do
70 | cd 'website' do
71 | sh 'git add index.html doc.json assets'
72 | sh 'git commit -a -m "Automatic update."'
73 | sh 'git push origin gh-pages'
74 | end
75 | end
76 |
77 | desc 'publish to heroku'
78 | task 'heroku' do
79 | mkdir_p 'heroku'
80 | install 'index.html', 'heroku/index.html'
81 | install 'doc.json', 'heroku/doc.json'
82 | sync 'assets', 'heroku/assets'
83 |
84 | cd 'heroku' do
85 | sh 'git add index.html doc.json assets'
86 | sh 'git commit -a -m "Automatic update."'
87 | sh 'git push orgin master'
88 | end
89 | end
90 |
91 | file 'source/handlebars/*.handlebars' do
92 | run :compile
93 | end
94 |
95 | #group :web do
96 | # file 'assets' do |paths|
97 | # sync 'assets', 'website/assets'
98 | # end
99 | #
100 | # file 'index.html' do
101 | # install 'index.html', 'website/index.html'
102 | # end
103 | #end
104 |
105 |
--------------------------------------------------------------------------------
/source/handlebars/class_content.handlebars:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | {{#unless_header}}
5 |
{{name}}
6 | {{/unless_header}}
7 | {{markup comment format}}
8 |
9 |
10 |
11 | {{#if includes.length}}
12 | Inclusions
13 |
14 | {{#doc includes}}
15 |
16 | {{#if id}}
17 | {{path}}
18 | {{else}}
19 | {{this}}
20 | {{/if}}
21 |
22 | {{/doc}}
23 |
24 | {{/if}}
25 |
26 |
27 | {{#if extensions.length}}
28 | Extensions
29 |
30 | {{#doc extensions}}
31 |
32 | {{#if id}}
33 | {{path}}
34 | {{else}}
35 | {{this}}
36 | {{/if}}
37 |
38 | {{/doc}}
39 |
40 | {{/if}}
41 |
42 |
43 | {{#if_namespace}}
44 | Classes and Modules
45 |
46 | {{#namespaces}}
47 |
48 | {{path}}
49 | {{#if_type "module"}}
50 | M
51 | {{/if_type}}
52 |
53 | {{/namespaces}}
54 |
55 | {{/if_namespace}}
56 |
57 |
58 | {{#if constants.length}}
59 | Constants
60 |
72 | {{/if}}
73 |
74 |
75 |
76 |
77 | {{#if accessors.length}}
78 | Attributes
79 |
96 | {{/if}}
97 |
98 |
99 | {{#methods_categorized}}
100 | {{> method}}
101 | {{/methods_categorized}}
102 |
103 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Rubyfaux
2 |
3 | [Website](http://rubyworks.github.com/rubyfaux) ·
4 | [Development](http://github.com/rubyworks/rubyfaux)
5 |
6 |
7 | ## Welcome
8 |
9 | Rubyfaux is a Shomen-based documentation browser with an old-school
10 | ruby-lang.org style.
11 |
12 |
13 | ## Features
14 |
15 | * Old-school ruby-lang.org style gives documentation an offical look-and-feel.
16 | * Quicksearch sidebar makes it easy to locate classes and methods.
17 | * Built on JQuery, JQuery Templates and other well supported Javascript tools.
18 |
19 |
20 | ## How To Use
21 |
22 | Generate a shomen `.json` file for you project.
23 |
24 | $ cd ..
25 | $ shomen rdoc > site/foo-1.0.0.json
26 |
27 | See Shomen project to learn more about this.
28 |
29 | To locally view your documentation, clone this repo to your project's
30 | webite directory (or `gh-pages` branch if you are crazy like that).
31 |
32 | $ cd myproject
33 | $ git clone http://rubyworks.github.com/rubyfaux.git site
34 | $ cd site
35 | $ rm -rf .git
36 |
37 | By default it will look for `doc.json` so you can link that to
38 | the latest documentation file.
39 |
40 | $ ln -s foo-1.0.0.json doc.json
41 |
42 | Now fire up local directory webserver. The `shomen` command provides
43 | one (must have `sinatra` installed):
44 |
45 | $ shomen server
46 |
47 | You can also view the files directly if your browser supports local
48 | ajax calls (Firefox works. Chrome? Not so much).
49 |
50 | $ firefox index.html
51 |
52 | Now then, customize that template to your little hearts desire!
53 |
54 | To view you documentation remotely, firs publish you Shomen .json
55 | file, presumably to your website, but it can be anywhere on the
56 | internet that will accept loading via ajax.
57 |
58 | Now navigate over to the Rubyfaux site setting the `doc` property
59 | in the URL to the location of the file, e.g.
60 |
61 | http://rubyworks.github.com/rubyfaux?doc=http://myorg.github.com/myapp/myapp-1.0.0.json
62 |
63 | And there you are.
64 |
65 | Note that if the documented project is large so too will be the Shomen `.json` file.
66 | In which case it take a moment for the browser to load the file. For large projects
67 | as such it is a good idea to divide documentation into a set of smaller files, rather
68 | than one big file.
69 |
70 |
71 | ## Legalease
72 |
73 | Copyright (c) 2011 Thomas Sawyer
74 |
75 | Available according to the terms of the *BSD-2-Clause* license.
76 |
77 | External libraries used:
78 |
79 | * [jQuery](http://jquery.org)
80 | * [jQuery-tmpl](http://github.com/jquery/jquery-tmpl)
81 | * [Quicksearch](http://github.com/riklomas/quicksearch)
82 | * [Highlight](http://github.com/isagalaev/highlight.js)
83 | * [Showdown](http://github.com/coreyti/showdown)
84 | * [Rundown](http://github.com/rubyworks/rundown)
85 | * [Keymaster](http://github.com/madrobby/keymaster)
86 | * [Mousewheel](http://plugins.jquery.com/project/mousewheel)
87 |
88 |
--------------------------------------------------------------------------------
/source/handlebars/class_sidebar.handlebars:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
13 |
14 | {{#if namespace}}
15 |
16 |
Parent
17 |
18 |
19 | {{#with_doc namespace}}
20 | {{#if id}}
21 | {{path}}
22 | {{else}}
23 | {{namespace}}
24 | {{/if}}
25 | {{/with_doc}}
26 |
27 |
28 |
29 | {{/if}}
30 |
31 |
32 | {{#if superclass}}
33 |
34 |
Superclass
35 |
36 |
37 | {{#with_doc superclass}}
38 | {{#if id}}
39 | {{path}}
40 | {{else}}
41 | {{superclass}}
42 | {{/if}}
43 | {{/with_doc}}
44 |
45 |
46 |
47 | {{/if}}
48 |
49 |
50 | {{#if includes.length}}
51 |
52 |
Includes
53 |
54 | {{#doc includes}}
55 |
56 | {{#if id}}
57 | {{path}}
58 | {{else}}
59 | {{this}}
60 | {{/if}}
61 |
62 | {{/doc}}
63 |
64 |
65 | {{/if}}
66 |
67 |
68 | {{#if modules.length}}
69 |
70 |
Modules
71 |
72 | {{#doc modules}}
73 | {{#if id}}
74 | {{path}}
75 | {{else}}
76 | {{this}}
77 | {{/if}}
78 | {{/doc}}
79 |
80 |
81 | {{/if}}
82 |
83 |
84 | {{#if classes.length}}
85 |
86 |
Classes
87 |
88 | {{#doc classes}}
89 | {{#if id}}
90 | {{path}}
91 | {{else}}
92 | {{this}}
93 | {{/if}}
94 | {{/doc}}
95 |
96 |
97 | {{/if}}
98 |
99 |
100 | {{#if methods.length}}
101 |
102 |
Methods
103 |
108 |
109 | {{/if}}
110 |
111 |
112 |
113 |
In Files
114 |
123 |
124 |
125 |
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | API
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
105 |
106 |
107 |
108 |
109 |
110 |
--------------------------------------------------------------------------------
/assets/javascripts/quicksearch.js:
--------------------------------------------------------------------------------
1 | function hookQuickSearch() {
2 | $('.quicksearch-field').each( function() {
3 | var searchElems = $('.quicksearch-target').find( 'li' );
4 | //var toggle = $(this).parents('.section').find('h3 .search-toggle');
5 | // console.debug( "Toggle is: %o", toggle );
6 | //var qsbox = $(this).parents('form').get( 0 );
7 |
8 | $(this).quicksearch( this, searchElems, {
9 | noSearchResultsIndicator: 'no-class-search-results',
10 | focusOnLoad: false
11 | });
12 |
13 | //$(toggle).click( function() {
14 | // // console.debug( "Toggling qsbox: %o", qsbox );
15 | // $(qsbox).toggle();
16 | //});
17 | });
18 | };
19 |
20 | /**
21 | *
22 | * JQuery QuickSearch - Hook up a form field to hide non-matching elements.
23 | * $Id: quicksearch.js 53 2009-01-07 02:52:03Z deveiant $
24 | *
25 | * Author: Michael Granger
26 | *
27 | */
28 | jQuery.fn.quicksearch = function( target, searchElems, options ) {
29 | // console.debug( "Quicksearch fn" );
30 |
31 | var settings = {
32 | delay: 250,
33 | clearButton: false,
34 | highlightMatches: false,
35 | focusOnLoad: false,
36 | noSearchResultsIndicator: null
37 | };
38 | if ( options ) $.extend( settings, options );
39 |
40 | return jQuery(this).each( function() {
41 | // console.debug( "Creating a new quicksearch on %o for %o", this, searchElems );
42 | new jQuery.quicksearch( this, searchElems, settings );
43 | });
44 | };
45 |
46 |
47 | jQuery.quicksearch = function( searchBox, searchElems, settings ) {
48 | var timeout;
49 | var boxdiv = $(searchBox).parents('div').eq(0);
50 |
51 | function init() {
52 | setupKeyEventHandlers();
53 | focusOnLoad();
54 | };
55 |
56 | function setupKeyEventHandlers() {
57 | // console.debug( "Hooking up the 'keypress' event to %o", searchBox );
58 | $(searchBox).
59 | unbind( 'keyup' ).
60 | keyup( function(e) { return onSearchKey( e.keyCode ); });
61 | $(searchBox).
62 | unbind( 'keypress' ).
63 | keypress( function(e) {
64 | switch( e.which ) {
65 | // Execute the search on Enter, Tab, or Newline
66 | case 9:
67 | case 13:
68 | case 10:
69 | clearTimeout( timeout );
70 | e.preventDefault();
71 | doQuickSearch();
72 | break;
73 |
74 | // Allow backspace
75 | case 8:
76 | return true;
77 | break;
78 |
79 | // Only allow valid search characters
80 | default:
81 | return validQSChar( e.charCode );
82 | }
83 | });
84 | };
85 |
86 | function focusOnLoad() {
87 | if ( !settings.focusOnLoad ) return false;
88 | $(searchBox).focus();
89 | };
90 |
91 | function onSearchKey ( code ) {
92 | clearTimeout( timeout );
93 | // console.debug( "...scheduling search." );
94 | timeout = setTimeout( doQuickSearch, settings.delay );
95 | };
96 |
97 | function validQSChar( code ) {
98 | var c = String.fromCharCode( code );
99 | return (
100 | (c == ':') ||
101 | (c >= 'a' && c <= 'z') ||
102 | (c >= 'A' && c <= 'Z')
103 | );
104 | };
105 |
106 | function doQuickSearch() {
107 | var searchText = searchBox.value;
108 | var pat = new RegExp( searchText, "im" );
109 | var shownCount = 0;
110 |
111 | if ( settings.noSearchResultsIndicator ) {
112 | $('#' + settings.noSearchResultsIndicator).hide();
113 | }
114 |
115 | // All elements start out hidden
116 | $(searchElems).each( function(index) {
117 | var str = $(this).text();
118 |
119 | if ( pat.test(str) ) {
120 | shownCount += 1;
121 | $(this).fadeIn();
122 | } else {
123 | $(this).hide();
124 | }
125 | });
126 |
127 | if ( shownCount == 0 && settings.noSearchResultsIndicator ) {
128 | $('#' + settings.noSearchResultsIndicator).slideDown();
129 | }
130 | };
131 |
132 | init();
133 | };
134 |
135 |
--------------------------------------------------------------------------------
/assets/javascripts/handlebars.runtime.js:
--------------------------------------------------------------------------------
1 | // lib/handlebars/base.js
2 | var Handlebars = {};
3 |
4 | Handlebars.VERSION = "1.0.beta.6";
5 |
6 | Handlebars.helpers = {};
7 | Handlebars.partials = {};
8 |
9 | Handlebars.registerHelper = function(name, fn, inverse) {
10 | if(inverse) { fn.not = inverse; }
11 | this.helpers[name] = fn;
12 | };
13 |
14 | Handlebars.registerPartial = function(name, str) {
15 | this.partials[name] = str;
16 | };
17 |
18 | Handlebars.registerHelper('helperMissing', function(arg) {
19 | if(arguments.length === 2) {
20 | return undefined;
21 | } else {
22 | throw new Error("Could not find property '" + arg + "'");
23 | }
24 | });
25 |
26 | var toString = Object.prototype.toString, functionType = "[object Function]";
27 |
28 | Handlebars.registerHelper('blockHelperMissing', function(context, options) {
29 | var inverse = options.inverse || function() {}, fn = options.fn;
30 |
31 |
32 | var ret = "";
33 | var type = toString.call(context);
34 |
35 | if(type === functionType) { context = context.call(this); }
36 |
37 | if(context === true) {
38 | return fn(this);
39 | } else if(context === false || context == null) {
40 | return inverse(this);
41 | } else if(type === "[object Array]") {
42 | if(context.length > 0) {
43 | for(var i=0, j=context.length; i 0) {
60 | for(var i=0, j=context.length; i": ">",
120 | '"': """,
121 | "'": "'",
122 | "`": "`"
123 | };
124 |
125 | var badChars = /&(?!\w+;)|[<>"'`]/g;
126 | var possible = /[&<>"'`]/;
127 |
128 | var escapeChar = function(chr) {
129 | return escape[chr] || "&";
130 | };
131 |
132 | Handlebars.Utils = {
133 | escapeExpression: function(string) {
134 | // don't escape SafeStrings, since they're already safe
135 | if (string instanceof Handlebars.SafeString) {
136 | return string.toString();
137 | } else if (string == null || string === false) {
138 | return "";
139 | }
140 |
141 | if(!possible.test(string)) { return string; }
142 | return string.replace(badChars, escapeChar);
143 | },
144 |
145 | isEmpty: function(value) {
146 | if (typeof value === "undefined") {
147 | return true;
148 | } else if (value === null) {
149 | return true;
150 | } else if (value === false) {
151 | return true;
152 | } else if(Object.prototype.toString.call(value) === "[object Array]" && value.length === 0) {
153 | return true;
154 | } else {
155 | return false;
156 | }
157 | }
158 | };
159 | })();;
160 | // lib/handlebars/runtime.js
161 | Handlebars.VM = {
162 | template: function(templateSpec) {
163 | // Just add water
164 | var container = {
165 | escapeExpression: Handlebars.Utils.escapeExpression,
166 | invokePartial: Handlebars.VM.invokePartial,
167 | programs: [],
168 | program: function(i, fn, data) {
169 | var programWrapper = this.programs[i];
170 | if(data) {
171 | return Handlebars.VM.program(fn, data);
172 | } else if(programWrapper) {
173 | return programWrapper;
174 | } else {
175 | programWrapper = this.programs[i] = Handlebars.VM.program(fn);
176 | return programWrapper;
177 | }
178 | },
179 | programWithDepth: Handlebars.VM.programWithDepth,
180 | noop: Handlebars.VM.noop
181 | };
182 |
183 | return function(context, options) {
184 | options = options || {};
185 | return templateSpec.call(container, Handlebars, context, options.helpers, options.partials, options.data);
186 | };
187 | },
188 |
189 | programWithDepth: function(fn, data, $depth) {
190 | var args = Array.prototype.slice.call(arguments, 2);
191 |
192 | return function(context, options) {
193 | options = options || {};
194 |
195 | return fn.apply(this, [context, options.data || data].concat(args));
196 | };
197 | },
198 | program: function(fn, data) {
199 | return function(context, options) {
200 | options = options || {};
201 |
202 | return fn(context, options.data || data);
203 | };
204 | },
205 | noop: function() { return ""; },
206 | invokePartial: function(partial, name, context, helpers, partials, data) {
207 | options = { helpers: helpers, partials: partials, data: data };
208 |
209 | if(partial === undefined) {
210 | throw new Handlebars.Exception("The partial " + name + " could not be found");
211 | } else if(partial instanceof Function) {
212 | return partial(context, options);
213 | } else if (!Handlebars.compile) {
214 | throw new Handlebars.Exception("The partial " + name + " could not be compiled when running in runtime-only mode");
215 | } else {
216 | partials[name] = Handlebars.compile(partial);
217 | return partials[name](context, options);
218 | }
219 | }
220 | };
221 |
222 | Handlebars.template = Handlebars.VM.template;
223 | ;
224 |
--------------------------------------------------------------------------------
/assets/javascripts/jquery.history.js:
--------------------------------------------------------------------------------
1 | /*
2 | * jQuery history plugin
3 | *
4 | * The MIT License
5 | *
6 | * Copyright (c) 2006-2009 Taku Sano (Mikage Sawatari)
7 | * Copyright (c) 2010 Takayuki Miwa
8 | *
9 | * Permission is hereby granted, free of charge, to any person obtaining a copy
10 | * of this software and associated documentation files (the "Software"), to deal
11 | * in the Software without restriction, including without limitation the rights
12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 | * copies of the Software, and to permit persons to whom the Software is
14 | * furnished to do so, subject to the following conditions:
15 | *
16 | * The above copyright notice and this permission notice shall be included in
17 | * all copies or substantial portions of the Software.
18 | *
19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | * THE SOFTWARE.
26 | */
27 |
28 | (function($) {
29 | var locationWrapper = {
30 | put: function(hash, win) {
31 | (win || window).location.hash = this.encoder(hash);
32 | },
33 | get: function(win) {
34 | var hash = ((win || window).location.hash).replace(/^#/, '');
35 | try {
36 | return $.browser.mozilla ? hash : decodeURIComponent(hash);
37 | }
38 | catch (error) {
39 | return hash;
40 | }
41 | },
42 | encoder: encodeURIComponent
43 | };
44 |
45 | var iframeWrapper = {
46 | id: "__jQuery_history",
47 | init: function() {
48 | var html = '';
49 | $("body").prepend(html);
50 | return this;
51 | },
52 | _document: function() {
53 | return $("#"+ this.id)[0].contentWindow.document;
54 | },
55 | put: function(hash) {
56 | var doc = this._document();
57 | doc.open();
58 | doc.close();
59 | locationWrapper.put(hash, doc);
60 | },
61 | get: function() {
62 | return locationWrapper.get(this._document());
63 | }
64 | };
65 |
66 | function initObjects(options) {
67 | options = $.extend({
68 | unescape: false
69 | }, options || {});
70 |
71 | locationWrapper.encoder = encoder(options.unescape);
72 |
73 | function encoder(unescape_) {
74 | if(unescape_ === true) {
75 | return function(hash){ return hash; };
76 | }
77 | if(typeof unescape_ == "string" &&
78 | (unescape_ = partialDecoder(unescape_.split("")))
79 | || typeof unescape_ == "function") {
80 | return function(hash) { return unescape_(encodeURIComponent(hash)); };
81 | }
82 | return encodeURIComponent;
83 | }
84 |
85 | function partialDecoder(chars) {
86 | var re = new RegExp($.map(chars, encodeURIComponent).join("|"), "ig");
87 | return function(enc) { return enc.replace(re, decodeURIComponent); };
88 | }
89 | }
90 |
91 | var implementations = {};
92 |
93 | implementations.base = {
94 | callback: undefined,
95 | type: undefined,
96 |
97 | check: function() {},
98 | load: function(hash) {},
99 | init: function(callback, options) {
100 | initObjects(options);
101 | self.callback = callback;
102 | self._options = options;
103 | self._init();
104 | },
105 |
106 | _init: function() {},
107 | _options: {}
108 | };
109 |
110 | implementations.timer = {
111 | _appState: undefined,
112 | _init: function() {
113 | var current_hash = locationWrapper.get();
114 | self._appState = current_hash;
115 | self.callback(current_hash);
116 | setInterval(self.check, 100);
117 | },
118 | check: function() {
119 | var current_hash = locationWrapper.get();
120 | if(current_hash != self._appState) {
121 | self._appState = current_hash;
122 | self.callback(current_hash);
123 | }
124 | },
125 | load: function(hash) {
126 | if(hash != self._appState) {
127 | locationWrapper.put(hash);
128 | self._appState = hash;
129 | self.callback(hash);
130 | }
131 | }
132 | };
133 |
134 | implementations.iframeTimer = {
135 | _appState: undefined,
136 | _init: function() {
137 | var current_hash = locationWrapper.get();
138 | self._appState = current_hash;
139 | iframeWrapper.init().put(current_hash);
140 | self.callback(current_hash);
141 | setInterval(self.check, 100);
142 | },
143 | check: function() {
144 | var iframe_hash = iframeWrapper.get(),
145 | location_hash = locationWrapper.get();
146 |
147 | if (location_hash != iframe_hash) {
148 | if (location_hash == self._appState) { // user used Back or Forward button
149 | self._appState = iframe_hash;
150 | locationWrapper.put(iframe_hash);
151 | self.callback(iframe_hash);
152 | } else { // user loaded new bookmark
153 | self._appState = location_hash;
154 | iframeWrapper.put(location_hash);
155 | self.callback(location_hash);
156 | }
157 | }
158 | },
159 | load: function(hash) {
160 | if(hash != self._appState) {
161 | locationWrapper.put(hash);
162 | iframeWrapper.put(hash);
163 | self._appState = hash;
164 | self.callback(hash);
165 | }
166 | }
167 | };
168 |
169 | implementations.hashchangeEvent = {
170 | _init: function() {
171 | self.callback(locationWrapper.get());
172 | $(window).bind('hashchange', self.check);
173 | },
174 | check: function() {
175 | self.callback(locationWrapper.get());
176 | },
177 | load: function(hash) {
178 | locationWrapper.put(hash);
179 | }
180 | };
181 |
182 | var self = $.extend({}, implementations.base);
183 |
184 | if($.browser.msie && ($.browser.version < 8 || document.documentMode < 8)) {
185 | self.type = 'iframeTimer';
186 | } else if("onhashchange" in window) {
187 | self.type = 'hashchangeEvent';
188 | } else {
189 | self.type = 'timer';
190 | }
191 |
192 | $.extend(self, implementations[self.type]);
193 | $.history = self;
194 | })(jQuery);
195 |
--------------------------------------------------------------------------------
/assets/javascripts/handlebars.helpers.js:
--------------------------------------------------------------------------------
1 | // rdoc convertor
2 | var rundown = new Rundown.converter(); /* TODO: support other formats */
3 |
4 | //
5 | // @todo handle format
6 | //
7 | Handlebars.registerHelper('markup', function(text, format) {
8 | var ret = rundown.makeHtml(text); //Rubyfaux.markup(text, format);
9 | return new Handlebars.SafeString(ret);
10 | });
11 |
12 | //
13 | // Capitalize word.
14 | //
15 | Handlebars.registerHelper('rubyfaux_version', function() {
16 | return Rubyfaux.version;
17 | });
18 |
19 | //
20 | // Capitalize word.
21 | //
22 | Handlebars.registerHelper('capitalize', function(word) {
23 | if (word != undefined) {
24 | return word.capitalize();
25 | };
26 | });
27 |
28 | //
29 | // Calcuate the documentation `id` given a `path`.
30 | //
31 | Handlebars.registerHelper('calc_id', function(path) {
32 | return Rubyfaux.id(path);
33 | });
34 |
35 |
36 | //
37 | // Calculate the internal href given the documentaiton `id`.
38 | //
39 | Handlebars.registerHelper('calc_href', function(id) {
40 | return Rubyfaux.href(id);
41 | });
42 |
43 | //
44 | // @todo Combine with above.
45 | //
46 | Handlebars.registerHelper('calc_method_href', function() {
47 | return Rubyfaux.method_href(this);
48 | });
49 |
50 | //
51 | //
52 | //
53 | Handlebars.registerHelper('declares', function(term, options) {
54 | var out = '';
55 | if ($.inArray(term, this.declarations) != -1) {
56 | out = options.fn(this);
57 | };
58 | return out;
59 | });
60 |
61 | //
62 | // If they the of documentation object is a `class`, then
63 | // render the given block.
64 | //
65 | Handlebars.registerHelper('if_class', function(options) {
66 | if (this['!'] == 'class') {
67 | return options.fn(this);
68 | } else {
69 | return '';
70 | };
71 | });
72 |
73 |
74 | //
75 | // If the `comment` starts with a header, as indicated by a `=` or `#`,
76 | // then do not render the given block.
77 | //
78 | Handlebars.registerHelper('unless_header', function(options) {
79 | if (! /^\s*[=#]/.test(this.comment)) {
80 | return options.fn(this);
81 | } else {
82 | return '';
83 | };
84 | });
85 |
86 | //
87 | // If the type of the documentation entry (`!`) matches the given
88 | // type name then render the block.
89 | //
90 | Handlebars.registerHelper('if_type', function(type, options) {
91 | if (this['!'] == type) {
92 | return options.fn(this);
93 | } else {
94 | return '';
95 | };
96 | });
97 |
98 |
99 | //
100 | // This helper ensures there is a least one class or module for the
101 | // given block to be rendered.
102 | //
103 | Handlebars.registerHelper('if_namespaces', function(options) {
104 | if (this.classes.length > 0 || this.modules.length > 0) {
105 | return options.fn(this);
106 | } else {
107 | return '';
108 | };
109 | });
110 |
111 | //
112 | //
113 | //
114 | Handlebars.registerHelper('namespaces', function(options) {
115 | var list = modules.concat(classes).sort(Rubyfaux.compareNames)
116 | var out = '';
117 | var doc;
118 |
119 | for(var i=0, l=list.length; i 0) {
201 | for (var i=0; i < scope.length; ++i) {
202 | scope_methods = meths[scope[i]];
203 | if (scope_methods == undefined) { continue };
204 | for (var j=0; j < sight.length; ++j) {
205 | sight_methods = scope_methods[sight[j]];
206 | if (sight_methods == undefined) { continue };
207 | if (sight_methods.length > 0) {
208 | sight_methods = sight_methods.sort(Rubyfaux.compareNames);
209 | out = out + "" + sight[j].capitalize() + " " + scope[i].capitalize() + " Methods \n";
210 | out = out + '' + "\n";
211 | for (k in sight_methods) {
212 | out = out + block(sight_methods[k]);
213 | };
214 | out = out + "\n ";
215 | };
216 | };
217 | };
218 | };
219 | return out;
220 | });
221 |
222 | //
223 | // This helper makes sure there are methods with a given scope and visibility.
224 | // If so it renders the given block with the current context.
225 | // It is intended to be used in the context of `methods_categorized`.
226 | //
227 | Handlebars.registerHelper('if_methods_by', function(scope, visibility, options) {
228 | var out = '';
229 |
230 | if (this[scope][visibility].length > 0) {
231 | out = options.fn(this);
232 | };
233 |
234 | return out;
235 | });
236 |
237 |
238 | //
239 | // This helper iterates over methods with a given scope and visibility.
240 | // It is intended to be used in the context of `methods_categorized`.
241 | //
242 | Handlebars.registerHelper('methods_by', function(scope, visibility, options) {
243 | var meths = this[scope][visibility];
244 | var out = '';
245 |
246 | for(var i=0, l=meths.length; i
5 | @debug = debug
6 | @convertor = new Rundown.converter()
7 |
8 | @current_menu = null
9 |
10 | @documentation_by_key = {}
11 | @documentation_by_id = {}
12 |
13 | @documentation =
14 | all: []
15 | methods: []
16 | classes: []
17 | scripts: []
18 | documents: []
19 |
20 | urlVars = getUrlVars()
21 | doc_url = urlVars['doc'] or 'doc.json'
22 | doc_id = urlVars['id']
23 |
24 | $.getJSON(doc_url, (data) =>
25 | # the url is good
26 | @doc_url = doc_url
27 |
28 | # set up documentation
29 | for key, doc of data
30 | doc.key = key
31 |
32 | if doc.path
33 | doc.id = id('api-' + doc['!'] + '-' + doc.path)
34 | else
35 | doc.id = 'metadata'
36 |
37 | @documentation_by_key[doc.key] = doc
38 | @documentation_by_id[doc.id] = doc
39 |
40 | @documentation['all'].push(doc)
41 |
42 | switch doc['!']
43 | when 'method'
44 | @documentation['methods'].push(doc)
45 | when 'class'
46 | @documentation['classes'].push(doc)
47 | when 'module'
48 | @documentation['classes'].push(doc)
49 | when 'document'
50 | @documentation['documents'].push(doc)
51 | when 'script'
52 | @documentation['scripts'].push(doc)
53 |
54 | @metadata = data['(metadata)']
55 |
56 | @documentation['all'] = @documentation['all'].sort(compareNames)
57 | @documentation['methods'] = @documentation['methods'].sort(compareNames)
58 | @documentation['classes'] = @documentation['classes'].sort(comparePaths)
59 |
60 | $("#title").append(template("title", @metadata))
61 | $('#nav').append(template("navigation", @metadata))
62 | $('#copyright').append(template("copyright"), @metadata)
63 | $('#searchbox').append(template("searchbox", {}))
64 |
65 | # routing
66 | $.history.init( (hash) ->
67 | if hash == ""
68 | show(readme().id)
69 | else
70 | x = hash.split('/',2)
71 | id = x[0]
72 | anchor = x[1]
73 | show(id,anchor) # restore the state from hash
74 | )
75 |
76 | # hookHighlightSyntax();
77 | # hookSourceViews();
78 | # hookDebuggingToggle();
79 | # hookQuickSearch();
80 | # highlightLocationTarget();
81 |
82 | #$('ul.link-list a').bind("click", highlightClickTarget);
83 | )
84 |
85 | #
86 | #
87 | #
88 | version: '2'
89 |
90 | #
91 | # Developer mode.
92 | #
93 | debug: ->
94 | @debug
95 |
96 | #
97 | # Toggle debug flag.
98 | #
99 | debugToggle: ->
100 | if @debug
101 | @debug = false
102 | else
103 | @debug = true
104 |
105 | #
106 | #
107 | #
108 | current_menu: ->
109 | @current_menu
110 |
111 | #
112 | #
113 | #
114 | doc_url: ->
115 | @doc_url
116 |
117 | #
118 | #
119 | #
120 | metadata: ->
121 | @metadata
122 |
123 | #
124 | # Stores documentation categorized into groups by type.
125 | #
126 | documentation: ->
127 | @documentation
128 |
129 | #
130 | #
131 | #
132 | documentation_by_key: ->
133 | @documentation_by_key
134 |
135 | #
136 | #
137 | #
138 | documentation_by_id: ->
139 | @documentation_by_id
140 |
141 | #
142 | # Determine primary "readme" document. This function first attempts
143 | # to find the document specified by the metadata.readme property.
144 | # If this document does not exist it will search for a document with
145 | # a name matching /^README/.
146 | #
147 | readme: ->
148 | readme = metadata['readme']
149 | unless readme
150 | for d of documentation['documents']
151 | if d.name.match(/^README/i)
152 | readme = d
153 | break
154 | readme
155 |
156 | #
157 | # This function constructs a valid Rubyfaux URI.
158 | #
159 | href: (id,anchor) ->
160 | if anchor
161 | '#' + id + '/' + anchor
162 | else
163 | '#' + id
164 |
165 | #
166 | #
167 | #
168 | method_href: (method) ->
169 | ns = documentation_by_key[method.namespace]
170 | if ns
171 | href(ns.id, method.id)
172 | else
173 | console.debug('Cannot find method: ' + method.id)
174 | ''
175 |
176 | #
177 | #
178 | #
179 | id: (key) ->
180 | # key = encodeURIComponent(key); DID NOT WORK
181 | key = key.replace(/\/g, "-g-")
183 | key = key.replace(/\=/g, "-e-")
184 | key = key.replace(/\?/g, "-q-")
185 | key = key.replace(/\!/g, "-x-")
186 | key = key.replace(/\~/g, "-t-")
187 | key = key.replace(/\[/g, "-b-")
188 | key = key.replace(/\]/g, "-k-")
189 | key = key.replace(/\#/g, "-h-")
190 | key = key.replace(/\./g, "-d-")
191 | key = key.replace(/\:\:/g,"-C-")
192 | key = key.replace(/\:/g, "-c-")
193 | key = key.replace(/[/]/g, "-s-")
194 | key = key.replace(/\W+/g, "-") # TOO GENERAL?
195 | key = key.replace(/\W+/g, "-") # For GOOD MEASURE
196 | key
197 |
198 | #
199 | #
200 | #
201 | compareNames: (a, b) ->
202 | return -1 if a.name < b.name
203 | return 1 if a.name > b.name
204 | return 0
205 |
206 | #
207 | #
208 | #
209 | comparePaths: (a, b) ->
210 | return -1 if a.path < b.path
211 | return 1 if a.path > b.path
212 | return 0
213 |
214 | #
215 | #
216 | #
217 | getUrlVars: ->
218 | vars = []
219 | index = window.location.href.indexOf('?') + 1
220 | hashes = window.location.href.slice(index).split('&')
221 | for hash in hashes
222 | h = hash.split('=')
223 | vars.push(h[0])
224 | vars[h[0]] = h[1]
225 | vars
226 |
227 | #
228 | #
229 | #
230 | show: (id, anchor) ->
231 | doc = documentation_by_id[id]
232 |
233 | console.debug(id)
234 | console.debug(doc)
235 |
236 | if doc != null
237 | type = doc['!']
238 |
239 | type = 'class' if type == 'module'
240 |
241 | $('#heading').empty().append(template(type + '-heading', doc))
242 | $('#content').empty().append(template(type + '-content', doc))
243 | $('#sidebar').empty().append(template(type + '-sidebar', doc))
244 |
245 | $('#content').find('pre code').each( (i, e) -> hljs.highlightBlock(e, ' ') )
246 |
247 | if anchor
248 | $('html, body').animate({ scrollTop: $('#'+anchor).offset().top }, 500)
249 | #$('.method-description,.method-heading').click(Rubyfaux.showSource);
250 | $('.highlighted').removeClass('highlighted')
251 | $('#'+anchor).addClass('highlighted')
252 |
253 | hookQuickSearch()
254 | else
255 | $('#heading').empty()
256 | $('#content').empty().append('Not Found ')
257 |
258 | #
259 | #
260 | #
261 | divy_methods: (methods) ->
262 | s = 'instance'
263 | v = 'public'
264 |
265 | list =
266 | class:
267 | public: []
268 | protected: []
269 | private: []
270 | instance:
271 | public: []
272 | protected: []
273 | private: []
274 |
275 | for x of methods
276 | doc = documentation_by_key[x]
277 |
278 | if doc.declarations.contains('class')
279 | s = 'class'
280 | else
281 | s = 'instance'
282 |
283 | if doc.declarations.contains('private')
284 | v = 'private'
285 | else
286 | if doc.declarations.contains('protected')
287 | v = 'protected'
288 | else
289 | v = 'public'
290 |
291 | list[s][v].push(doc)
292 |
293 | list
294 |
295 | #
296 | # Convert RDoc/Markdown document to HTML.
297 | #
298 | # @todo Support other formats besides RDoc
299 | #
300 | markup: (text,format) ->
301 | @rundown.makeHtml(text)
302 |
303 | #
304 | #
305 | #
306 | showSource: (e) ->
307 | target = e.target
308 |
309 | codeSections = $(target).
310 | parents('.method-detail').
311 | find('.method-source-code')
312 |
313 | $(target).
314 | parents('.method-detail').
315 | find('.method-source-code').
316 | slideToggle('fast', ->
317 | $(this).find('pre').each( (i, e) ->
318 | hljs.highlightBlock(e, ' ')
319 | )
320 | )
321 |
322 | #
323 | #
324 | #
325 | toggleSource: (id) ->
326 | $(id).toogle()
327 |
328 | #
329 | # @todo Replace with Eco template
330 | #
331 | template: (name, data) ->
332 | Handlebars.templates[name](data)
333 |
334 |
335 |
336 | ###
337 | # Show and hide navigation dropdown menus.
338 | menuToggle: function(menuId,navClass) {
339 | if (navClass == null) { navClass='.nav' };
340 | if( $(menuId).is(":visible") == true ){
341 | $(menuId).hide();
342 | }
343 | else{
344 | # $(navClass).hide();
345 | $(menuId).show();
346 | }
347 | },
348 |
349 | #function menuOn(menuId){
350 | # if (navClass == null) { navClass='.nav' };
351 | # $(menuId).show();
352 | #};
353 |
354 | #
355 | #
356 | #
357 | menuOn: function(menuId,navClass){
358 | if (navClass == null) { navClass='.nav-section' };
359 | $(navClass).hide();
360 | $(menuId).show();
361 | $('#search-section').show();
362 | },
363 |
364 | #
365 | #
366 | #
367 | menuOff: function(menuId,navClass){
368 | if (navClass == null) { navClass='.nav' };
369 | if( $(menuId).is(":visible") == true ){
370 | $(navClass).hide();
371 | }
372 | },
373 | ###
374 |
375 |
--------------------------------------------------------------------------------
/COPYING.md:
--------------------------------------------------------------------------------
1 | # COPYRIGHT NOTICES
2 |
3 | ## Rubyfaux
4 |
5 | Copyright:: (c) 2011 Rubyworks
6 | License:: BSD-2-Clause
7 | Website:: http://github.com/rubyworks/rubyfaux
8 |
9 | Copyright 2011 Rubyworks. All rights reserved.
10 |
11 | Redistribution and use in source and binary forms, with or without
12 | modification, are permitted provided that the following conditions are met:
13 |
14 | 1. Redistributions of source code must retain the above copyright notice,
15 | this list of conditions and the following disclaimer.
16 |
17 | 2. Redistributions in binary form must reproduce the above copyright
18 | notice, this list of conditions and the following disclaimer in the
19 | documentation and/or other materials provided with the distribution.
20 |
21 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
22 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
23 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24 | COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
28 | OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 |
32 | (http://spdx.org/licenses/BSD-2-Clause)
33 |
34 |
35 | ## jQuery
36 |
37 | Copyright:: (c) 2011 John Resig, http://jquery.com/
38 | License:: MIT
39 | Website:: http://jquery.com
40 |
41 | Copyright (c) 2011 John Resig, http://jquery.com/
42 |
43 | Permission is hereby granted, free of charge, to any person obtaining
44 | a copy of this software and associated documentation files (the
45 | "Software"), to deal in the Software without restriction, including
46 | without limitation the rights to use, copy, modify, merge, publish,
47 | distribute, sublicense, and/or sell copies of the Software, and to
48 | permit persons to whom the Software is furnished to do so, subject to
49 | the following conditions:
50 |
51 | The above copyright notice and this permission notice shall be
52 | included in all copies or substantial portions of the Software.
53 |
54 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
55 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
56 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
57 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
58 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
59 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
60 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
61 |
62 | (http://spdx.org/licenses/MIT)
63 |
64 |
65 | ## Highlight.js
66 |
67 | Copyright:: (c) 2006 Ivan Sagalaev
68 | License:: BSD-3-Caluse
69 | Website:: http://softwaremaniacs.org/soft/highlight/en/
70 |
71 | Copyright (c) 2006, Ivan Sagalaev
72 | All rights reserved.
73 |
74 | Redistribution and use in source and binary forms, with or without
75 | modification, are permitted provided that the following conditions are met:
76 |
77 | * Redistributions of source code must retain the above copyright
78 | notice, this list of conditions and the following disclaimer.
79 |
80 | * Redistributions in binary form must reproduce the above copyright
81 | notice, this list of conditions and the following disclaimer in the
82 | documentation and/or other materials provided with the distribution.
83 |
84 | * Neither the name of highlight.js nor the names of its contributors
85 | may be used to endorse or promote products derived from this software
86 | without specific prior written permission.
87 |
88 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
89 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
90 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
91 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
92 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
93 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
94 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
95 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
96 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
97 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
98 |
99 | (http://spdx.org/licenses/BSD-3-Clause)
100 |
101 |
102 | ## Showdown
103 |
104 | Copyright:: (c) 2007 John Fraser.
105 | License:: BSD-3-Clause
106 | Website:: http://www.attacklab.net/
107 |
108 | Copyright (c) 2007, John Fraser
109 |
110 | All rights reserved.
111 |
112 | Original Markdown copyright (c) 2004, John Gruber
113 |
114 | All rights reserved.
115 |
116 | Redistribution and use in source and binary forms, with or without
117 | modification, are permitted provided that the following conditions are
118 | met:
119 |
120 | * Redistributions of source code must retain the above copyright notice,
121 | this list of conditions and the following disclaimer.
122 |
123 | * Redistributions in binary form must reproduce the above copyright
124 | notice, this list of conditions and the following disclaimer in the
125 | documentation and/or other materials provided with the distribution.
126 |
127 | * Neither the name "Markdown" nor the names of its contributors may
128 | be used to endorse or promote products derived from this software
129 | without specific prior written permission.
130 |
131 | This software is provided by the copyright holders and contributors "as
132 | is" and any express or implied warranties, including, but not limited
133 | to, the implied warranties of merchantability and fitness for a
134 | particular purpose are disclaimed. In no event shall the copyright owner
135 | or contributors be liable for any direct, indirect, incidental, special,
136 | exemplary, or consequential damages (including, but not limited to,
137 | procurement of substitute goods or services; loss of use, data, or
138 | profits; or business interruption) however caused and on any theory of
139 | liability, whether in contract, strict liability, or tort (including
140 | negligence or otherwise) arising in any way out of the use of this
141 | software, even if advised of the possibility of such damage.
142 |
143 | (http://spdx.org/licenses/BSD-3-Clause)
144 |
145 |
146 | ## Quicksearch
147 |
148 | Copyright:: (c) Rik Lomas
149 | License:: MIT
150 | Website:: http://github.com/riklomas/quicksearch
151 |
152 | Permission is hereby granted, free of charge, to any person obtaining
153 | a copy of this software and associated documentation files (the
154 | "Software"), to deal in the Software without restriction, including
155 | without limitation the rights to use, copy, modify, merge, publish,
156 | distribute, sublicense, and/or sell copies of the Software, and to
157 | permit persons to whom the Software is furnished to do so, subject to
158 | the following conditions:
159 |
160 | The above copyright notice and this permission notice shall be
161 | included in all copies or substantial portions of the Software.
162 |
163 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
164 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
165 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
166 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
167 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
168 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
169 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
170 |
171 | (http://spdx.org/licenses/MIT)
172 |
173 |
174 | ## Keymaster
175 |
176 | Copyright:: (c) 2011 Thomas Fuchs
177 | License:: MIT
178 | Website:: https://github.com/madrobby/keymaster
179 |
180 | Copyright (c) 2011 Thomas Fuchs
181 |
182 | Permission is hereby granted, free of charge, to any person obtaining
183 | a copy of this software and associated documentation files (the
184 | "Software"), to deal in the Software without restriction, including
185 | without limitation the rights to use, copy, modify, merge, publish,
186 | distribute, sublicense, and/or sell copies of the Software, and to
187 | permit persons to whom the Software is furnished to do so, subject to
188 | the following conditions:
189 |
190 | The above copyright notice and this permission notice shall be
191 | included in all copies or substantial portions of the Software.
192 |
193 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
194 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
195 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
196 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
197 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
198 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
199 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
200 |
201 | (http://spdx.org/licenses/MIT)
202 |
203 |
--------------------------------------------------------------------------------
/source/coffeescripts/rubyfaux.js:
--------------------------------------------------------------------------------
1 | // Generated by CoffeeScript 1.3.1
2 | (function() {
3 | var RubyFauxApp;
4 |
5 | RubyFauxApp = (function() {
6 |
7 | RubyFauxApp.name = 'RubyFauxApp';
8 |
9 | function RubyFauxApp(debug) {
10 | var doc_id, doc_url, urlVars,
11 | _this = this;
12 | this.debug = debug;
13 | this.convertor = new Rundown.converter();
14 | this.current_menu = null;
15 | this.documentation_by_key = {};
16 | this.documentation_by_id = {};
17 | this.documentation = {
18 | all: [],
19 | methods: [],
20 | classes: [],
21 | scripts: [],
22 | documents: []
23 | };
24 | urlVars = getUrlVars();
25 | doc_url = urlVars['doc'] || 'doc.json';
26 | doc_id = urlVars['id'];
27 | $.getJSON(doc_url, function(data) {
28 | var doc, key;
29 | _this.doc_url = doc_url;
30 | for (key in data) {
31 | doc = data[key];
32 | doc.key = key;
33 | if (doc.path) {
34 | doc.id = id('api-' + doc['!'] + '-' + doc.path);
35 | } else {
36 | doc.id = 'metadata';
37 | }
38 | _this.documentation_by_key[doc.key] = doc;
39 | _this.documentation_by_id[doc.id] = doc;
40 | _this.documentation['all'].push(doc);
41 | switch (doc['!']) {
42 | case 'method':
43 | _this.documentation['methods'].push(doc);
44 | break;
45 | case 'class':
46 | _this.documentation['classes'].push(doc);
47 | break;
48 | case 'module':
49 | _this.documentation['classes'].push(doc);
50 | break;
51 | case 'document':
52 | _this.documentation['documents'].push(doc);
53 | break;
54 | case 'script':
55 | _this.documentation['scripts'].push(doc);
56 | }
57 | }
58 | _this.metadata = data['(metadata)'];
59 | _this.documentation['all'] = _this.documentation['all'].sort(compareNames);
60 | _this.documentation['methods'] = _this.documentation['methods'].sort(compareNames);
61 | _this.documentation['classes'] = _this.documentation['classes'].sort(comparePaths);
62 | $("#title").append(template("title", _this.metadata));
63 | $('#nav').append(template("navigation", _this.metadata));
64 | $('#copyright').append(template("copyright"), _this.metadata);
65 | $('#searchbox').append(template("searchbox", {}));
66 | return $.history.init(function(hash) {
67 | var anchor, id, x;
68 | if (hash === "") {
69 | return show(readme().id);
70 | } else {
71 | x = hash.split('/', 2);
72 | id = x[0];
73 | anchor = x[1];
74 | return show(id, anchor);
75 | }
76 | });
77 | });
78 | }
79 |
80 | RubyFauxApp.prototype.version = '2';
81 |
82 | RubyFauxApp.prototype.debug = function() {
83 | return this.debug;
84 | };
85 |
86 | RubyFauxApp.prototype.debugToggle = function() {
87 | if (this.debug) {
88 | return this.debug = false;
89 | } else {
90 | return this.debug = true;
91 | }
92 | };
93 |
94 | RubyFauxApp.prototype.current_menu = function() {
95 | return this.current_menu;
96 | };
97 |
98 | RubyFauxApp.prototype.doc_url = function() {
99 | return this.doc_url;
100 | };
101 |
102 | RubyFauxApp.prototype.metadata = function() {
103 | return this.metadata;
104 | };
105 |
106 | RubyFauxApp.prototype.documentation = function() {
107 | return this.documentation;
108 | };
109 |
110 | RubyFauxApp.prototype.documentation_by_key = function() {
111 | return this.documentation_by_key;
112 | };
113 |
114 | RubyFauxApp.prototype.documentation_by_id = function() {
115 | return this.documentation_by_id;
116 | };
117 |
118 | RubyFauxApp.prototype.readme = function() {
119 | var d, readme;
120 | readme = metadata['readme'];
121 | if (!readme) {
122 | for (d in documentation['documents']) {
123 | if (d.name.match(/^README/i)) {
124 | readme = d;
125 | break;
126 | }
127 | }
128 | }
129 | return readme;
130 | };
131 |
132 | RubyFauxApp.prototype.href = function(id, anchor) {
133 | if (anchor) {
134 | return '#' + id + '/' + anchor;
135 | } else {
136 | return '#' + id;
137 | }
138 | };
139 |
140 | RubyFauxApp.prototype.method_href = function(method) {
141 | var ns;
142 | ns = documentation_by_key[method.namespace];
143 | if (ns) {
144 | return href(ns.id, method.id);
145 | } else {
146 | console.debug('Cannot find method: ' + method.id);
147 | return '';
148 | }
149 | };
150 |
151 | RubyFauxApp.prototype.id = function(key) {
152 | key = key.replace(/\/g, "-g-");
154 | key = key.replace(/\=/g, "-e-");
155 | key = key.replace(/\?/g, "-q-");
156 | key = key.replace(/\!/g, "-x-");
157 | key = key.replace(/\~/g, "-t-");
158 | key = key.replace(/\[/g, "-b-");
159 | key = key.replace(/\]/g, "-k-");
160 | key = key.replace(/\#/g, "-h-");
161 | key = key.replace(/\./g, "-d-");
162 | key = key.replace(/\:\:/g, "-C-");
163 | key = key.replace(/\:/g, "-c-");
164 | key = key.replace(/[/]/g, "-s-");
165 | key = key.replace(/\W+/g, "-");
166 | key = key.replace(/\W+/g, "-");
167 | return key;
168 | };
169 |
170 | RubyFauxApp.prototype.compareNames = function(a, b) {
171 | if (a.name < b.name) {
172 | return -1;
173 | }
174 | if (a.name > b.name) {
175 | return 1;
176 | }
177 | return 0;
178 | };
179 |
180 | RubyFauxApp.prototype.comparePaths = function(a, b) {
181 | if (a.path < b.path) {
182 | return -1;
183 | }
184 | if (a.path > b.path) {
185 | return 1;
186 | }
187 | return 0;
188 | };
189 |
190 | RubyFauxApp.prototype.getUrlVars = function() {
191 | var h, hash, hashes, index, vars, _i, _len;
192 | vars = [];
193 | index = window.location.href.indexOf('?') + 1;
194 | hashes = window.location.href.slice(index).split('&');
195 | for (_i = 0, _len = hashes.length; _i < _len; _i++) {
196 | hash = hashes[_i];
197 | h = hash.split('=');
198 | vars.push(h[0]);
199 | vars[h[0]] = h[1];
200 | }
201 | return vars;
202 | };
203 |
204 | RubyFauxApp.prototype.show = function(id, anchor) {
205 | var doc, type;
206 | doc = documentation_by_id[id];
207 | console.debug(id);
208 | console.debug(doc);
209 | if (doc !== null) {
210 | type = doc['!'];
211 | if (type === 'module') {
212 | type = 'class';
213 | }
214 | $('#heading').empty().append(template(type + '-heading', doc));
215 | $('#content').empty().append(template(type + '-content', doc));
216 | $('#sidebar').empty().append(template(type + '-sidebar', doc));
217 | $('#content').find('pre code').each(function(i, e) {
218 | return hljs.highlightBlock(e, ' ');
219 | });
220 | if (anchor) {
221 | $('html, body').animate({
222 | scrollTop: $('#' + anchor).offset().top
223 | }, 500);
224 | $('.highlighted').removeClass('highlighted');
225 | $('#' + anchor).addClass('highlighted');
226 | }
227 | return hookQuickSearch();
228 | } else {
229 | $('#heading').empty();
230 | return $('#content').empty().append('Not Found ');
231 | }
232 | };
233 |
234 | RubyFauxApp.prototype.divy_methods = function(methods) {
235 | var doc, list, s, v, x;
236 | s = 'instance';
237 | v = 'public';
238 | list = {
239 | "class": {
240 | "public": [],
241 | "protected": [],
242 | "private": []
243 | },
244 | instance: {
245 | "public": [],
246 | "protected": [],
247 | "private": []
248 | }
249 | };
250 | for (x in methods) {
251 | doc = documentation_by_key[x];
252 | if (doc.declarations.contains('class')) {
253 | s = 'class';
254 | } else {
255 | s = 'instance';
256 | }
257 | if (doc.declarations.contains('private')) {
258 | v = 'private';
259 | } else {
260 | if (doc.declarations.contains('protected')) {
261 | v = 'protected';
262 | } else {
263 | v = 'public';
264 | }
265 | }
266 | list[s][v].push(doc);
267 | }
268 | return list;
269 | };
270 |
271 | RubyFauxApp.prototype.markup = function(text, format) {
272 | return this.rendown.makeHtml(text);
273 | };
274 |
275 | RubyFauxApp.prototype.showSource = function(e) {
276 | var codeSections, target;
277 | target = e.target;
278 | return codeSections = $(target).parents('.method-detail').find('.method-source-code');
279 | };
280 |
281 | $(target).parents('.method-detail').find('.method-source-code').slideToggle('fast', function() {
282 | return $(this).find('pre').each(function(i, e) {
283 | return hljs.highlightBlock(e, ' ');
284 | });
285 | });
286 |
287 | RubyFauxApp.prototype.toggleSource = function(id) {
288 | return $(id).toogle();
289 | };
290 |
291 | RubyFauxApp.prototype.template = function(name, data) {
292 | return Handlebars.templates[name](data);
293 | };
294 |
295 | return RubyFauxApp;
296 |
297 | })();
298 |
299 | /*
300 | # Show and hide navigation dropdown menus.
301 | menuToggle: function(menuId,navClass) {
302 | if (navClass == null) { navClass='.nav' };
303 | if( $(menuId).is(":visible") == true ){
304 | $(menuId).hide();
305 | }
306 | else{
307 | # $(navClass).hide();
308 | $(menuId).show();
309 | }
310 | },
311 |
312 | #function menuOn(menuId){
313 | # if (navClass == null) { navClass='.nav' };
314 | # $(menuId).show();
315 | #};
316 |
317 | #
318 | #
319 | #
320 | menuOn: function(menuId,navClass){
321 | if (navClass == null) { navClass='.nav-section' };
322 | $(navClass).hide();
323 | $(menuId).show();
324 | $('#search-section').show();
325 | },
326 |
327 | #
328 | #
329 | #
330 | menuOff: function(menuId,navClass){
331 | if (navClass == null) { navClass='.nav' };
332 | if( $(menuId).is(":visible") == true ){
333 | $(navClass).hide();
334 | }
335 | },
336 | */
337 |
338 |
339 | }).call(this);
340 |
--------------------------------------------------------------------------------
/assets/javascripts/rubyfaux.js:
--------------------------------------------------------------------------------
1 | // Rubyfaux's Javascript
2 |
3 | Rubyfaux = {
4 |
5 | version: '1',
6 |
7 | // Developer mode.
8 | debug: true,
9 |
10 | //
11 | debugToggle: function(){
12 | if (Rubyfaux.debug == true) {
13 | Rubyfaux.debug == false;
14 | } else{
15 | Rubyfaux.debug == true;
16 | }
17 | },
18 |
19 | //
20 | current_menu: null,
21 |
22 | //
23 | doc_url: null,
24 |
25 | //
26 | documentation: {
27 | 'all' : new Array(),
28 | 'methods': new Array(),
29 | 'classes': new Array(),
30 | 'scripts': new Array(),
31 | 'documents': new Array()
32 | },
33 |
34 | //
35 | documentation_by_key: {},
36 |
37 | //
38 | documentation_by_id: {},
39 |
40 | //
41 | metadata: {},
42 |
43 | //
44 | bootup: function() {
45 | var urlVars = Rubyfaux.getUrlVars();
46 | var doc_url = urlVars['doc'] || 'doc.json';
47 | var doc_id = urlVars['id']
48 |
49 | $.getJSON(doc_url, function(data) {
50 |
51 | // the url is good
52 | Rubyfaux.doc_url = doc_url;
53 |
54 | // set up documentation
55 | $.each(data, function(key, doc) {
56 | doc.key = key;
57 |
58 | if (doc.path != undefined) {
59 | doc.id = Rubyfaux.id('api-' + doc['!'] + '-' + doc.path);
60 | } else {
61 | doc.id = 'metadata'
62 | }
63 |
64 | Rubyfaux.documentation_by_key[doc.key] = doc;
65 | Rubyfaux.documentation_by_id[doc.id] = doc;
66 |
67 | Rubyfaux.documentation['all'].push(doc);
68 |
69 | switch(doc['!']) {
70 | case 'method':
71 | Rubyfaux.documentation['methods'].push(doc);
72 | break;
73 | case 'class':
74 | Rubyfaux.documentation['classes'].push(doc);
75 | break;
76 | case 'module':
77 | Rubyfaux.documentation['classes'].push(doc);
78 | break;
79 | case 'document':
80 | Rubyfaux.documentation['documents'].push(doc);
81 | break;
82 | case 'script':
83 | Rubyfaux.documentation['scripts'].push(doc);
84 | break;
85 | };
86 | });
87 |
88 | Rubyfaux.metadata = data['(metadata)'];
89 |
90 | Rubyfaux.documentation['all'] = Rubyfaux.documentation['all'].sort(Rubyfaux.compareNames);
91 | Rubyfaux.documentation['methods'] = Rubyfaux.documentation['methods'].sort(Rubyfaux.compareNames);
92 | Rubyfaux.documentation['classes'] = Rubyfaux.documentation['classes'].sort(Rubyfaux.comparePaths);
93 |
94 | //$("#template-title").tmpl(Rubyfaux.metadata).appendTo("#title");
95 | //$('#template-navigation').tmpl({}).appendTo('#nav');
96 | //$("#template-copyright").tmpl(Rubyfaux.metadata).appendTo("#copyright");
97 | //$('#template-searchbox').tmpl({}).appendTo('#searchbox');
98 |
99 | $("#title").append(Rubyfaux.template("title", Rubyfaux.metadata));
100 | $('#nav').append(Rubyfaux.template("navigation", Rubyfaux.metadata));
101 | $('#copyright').append(Rubyfaux.template("copyright"), Rubyfaux.metadata);
102 | $('#searchbox').append(Rubyfaux.template("searchbox", {}));
103 |
104 | // Routing
105 | $.history.init(function(hash){
106 | if (hash == "") {
107 | Rubyfaux.show(Rubyfaux.readme().id);
108 | } else {
109 | var x = hash.split('/',2);
110 | var id = x[0];
111 | var anchor = x[1];
112 | Rubyfaux.show(id,anchor); // restore the state from hash
113 | }
114 | });
115 |
116 | /*
117 | hookHighlightSyntax();
118 | hookSourceViews();
119 | hookDebuggingToggle();
120 | hookQuickSearch();
121 | highlightLocationTarget();
122 | */
123 |
124 | //$('ul.link-list a').bind("click", highlightClickTarget);
125 | });
126 | },
127 |
128 | // Determine primary "readme" document. This function first attempts
129 | // to find the document specified by the metadata.readme property.
130 | // If this document does not exist it will search for a document with
131 | // a name matching /^README/.
132 | readme: function() {
133 | var readme = Rubyfaux.metadata['readme'];
134 | if (readme == undefined) {
135 | for(i in Rubyfaux.documentation['documents']) {
136 | d = Rubyfaux.documentation['documents'][i];
137 | if (d.name.match(/^README/i)) {
138 | readme = d; break;
139 | }
140 | }
141 | };
142 | return(readme);
143 | },
144 |
145 | // This function constructs a valid Rubyfaux URI.
146 | href: function(id,anchor) {
147 | if (anchor != undefined) {
148 | return('#' + id + '/' + anchor);
149 | } else {
150 | return('#' + id);
151 | };
152 | },
153 |
154 | //
155 | method_href: function(method) {
156 | var ns = Rubyfaux.documentation_by_key[method.namespace];
157 | if (ns == null || ns == undefined) {
158 | console.debug('Cannot find method: ' + method.id);
159 | return '';
160 | } else {
161 | return(Rubyfaux.href(ns.id, method.id));
162 | };
163 | },
164 |
165 | //
166 | id: function(key) {
167 | // key = encodeURIComponent(key); DID NOT WORK
168 | key = key.replace(/\/g, "-g-");
170 | key = key.replace(/\=/g, "-e-");
171 | key = key.replace(/\?/g, "-q-");
172 | key = key.replace(/\!/g, "-x-");
173 | key = key.replace(/\~/g, "-t-");
174 | key = key.replace(/\[/g, "-b-");
175 | key = key.replace(/\]/g, "-k-");
176 | key = key.replace(/\#/g, "-h-");
177 | key = key.replace(/\./g, "-d-");
178 | key = key.replace(/\:\:/g,"-C-");
179 | key = key.replace(/\:/g, "-c-");
180 | key = key.replace(/[/]/g, "-s-");
181 | key = key.replace(/\W+/g, "-"); // TOO GENERAL?
182 | key = key.replace(/\W+/g, "-"); // For GOOD MEASURE
183 | return(key);
184 | },
185 |
186 | //
187 | compareNames: function(a, b){
188 | if (a.name < b.name) {return -1}
189 | if (a.name > b.name) {return 1}
190 | return 0;
191 | },
192 |
193 | //
194 | comparePaths: function(a, b){
195 | if (a.path < b.path) {return -1}
196 | if (a.path > b.path) {return 1}
197 | return 0;
198 | },
199 |
200 | //
201 | getUrlVars: function() {
202 | var vars = [], hash;
203 | var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
204 | for(var i = 0; i < hashes.length; i++)
205 | {
206 | hash = hashes[i].split('=');
207 | vars.push(hash[0]);
208 | vars[hash[0]] = hash[1];
209 | }
210 | return vars;
211 | },
212 |
213 | //
214 | show: function(id,anchor) {
215 | var doc = Rubyfaux.documentation_by_id[id];
216 |
217 | console.debug(id);
218 | console.debug(doc);
219 |
220 | if (doc != null) {
221 | var type = doc['!'];
222 | if(type == 'module'){ type = 'class' };
223 | $('#heading').empty().append(Rubyfaux.template(type + '_heading', doc));
224 | $('#content').empty().append(Rubyfaux.template(type + '_content', doc));
225 |
226 | if (type == 'document') {
227 | $('#sidebar').empty().append(Rubyfaux.template(type + '_sidebar', Rubyfaux.documentation));
228 | } else {
229 | $('#sidebar').empty().append(Rubyfaux.template(type + '_sidebar', doc));
230 | };
231 |
232 | $('#content').find('pre code').each(function(i, e){hljs.highlightBlock(e, ' ')});
233 | if(anchor != undefined) {
234 | $('html, body').animate({ scrollTop: $('#'+anchor).offset().top }, 500);
235 | //$('.method-description,.method-heading').click(Rubyfaux.showSource);
236 | $('.highlighted').removeClass('highlighted');
237 | $('#'+anchor).addClass('highlighted');
238 | }
239 | hookQuickSearch();
240 | } else {
241 | $('#heading').empty();
242 | $('#content').empty().append('Not Found ');
243 | };
244 | },
245 |
246 | //
247 | divy_methods: function(methods) {
248 | var s = 'instance';
249 | var v = 'public';
250 |
251 | var list = {
252 | 'class': {'public': new Array(), 'protected': new Array(), 'private': new Array()},
253 | 'instance': {'public': new Array(), 'protected': new Array(), 'private': new Array()}
254 | }
255 |
256 | $.each(methods, function(i, x) {
257 | var doc = Rubyfaux.documentation_by_key[x];
258 |
259 | if (doc.declarations.indexOf('class') != -1) {
260 | s = 'class'
261 | } else {
262 | s = 'instance'
263 | };
264 |
265 | if (doc.declarations.indexOf('private') != -1) {
266 | v = 'private';
267 | } else if (doc.declarations.indexOf('protected') != -1) {
268 | v = 'protected';
269 | } else {
270 | v = 'public';
271 | }
272 |
273 | list[s][v].push(doc);
274 | });
275 |
276 | return(list);
277 | },
278 |
279 | // Used to convert RDoc document to HTML.
280 | // TODO: support other formats besides RDoc Simple Markup ?
281 | markup: function(text,format) {
282 | convertor = new Rundown.converter();
283 | return(convertor.makeHtml(text));
284 | },
285 |
286 | /*
287 | // Show and hide navigation dropdown menus.
288 | menuToggle: function(menuId,navClass) {
289 | if (navClass == null) { navClass='.nav' };
290 | if( $(menuId).is(":visible") == true ){
291 | $(menuId).hide();
292 | }
293 | else{
294 | // $(navClass).hide();
295 | $(menuId).show();
296 | }
297 | },
298 |
299 | //function menuOn(menuId){
300 | // if (navClass == null) { navClass='.nav' };
301 | // $(menuId).show();
302 | //};
303 |
304 | //
305 | menuOn: function(menuId,navClass){
306 | if (navClass == null) { navClass='.nav-section' };
307 | $(navClass).hide();
308 | $(menuId).show();
309 | $('#search-section').show();
310 | },
311 |
312 | //
313 | menuOff: function(menuId,navClass){
314 | if (navClass == null) { navClass='.nav' };
315 | if( $(menuId).is(":visible") == true ){
316 | $(navClass).hide();
317 | }
318 | },
319 | */
320 |
321 | showSource: function(e) {
322 | var target = e.target;
323 | var codeSections = $(target).
324 | parents('.method-detail').
325 | find('.method-source-code');
326 |
327 | $(target).
328 | parents('.method-detail').
329 | find('.method-source-code').
330 | slideToggle('fast', function(){
331 | $(this).find('pre').each(function(i, e){hljs.highlightBlock(e, ' ')});
332 | });
333 | },
334 |
335 | //
336 | toggleSource: function(id) {
337 | $(id).toogle();
338 | },
339 |
340 | //
341 | template: function(name, data) {
342 | return Handlebars.templates[name](data);
343 | }
344 |
345 | }
346 |
347 | /*
348 | String.prototype.escapeHTML = function () {
349 | return(
350 | this.replace(/\&/g,'&').
351 | replace(/\>/g,'>').
352 | replace(/\"}while(x.length||v.length){var u=t().splice(0,1)[0];y+=l(w.substr(p,u.offset-p));p=u.offset;if(u.event=="start"){y+=s(u.node);r.push(u.node)}else{if(u.event=="stop"){var q=r.length;do{q--;var o=r[q];y+=(""+o.nodeName.toLowerCase()+">")}while(o!=u.node);r.splice(q,1);while(q'+l(L[0])+""}else{r+=l(L[0])}N=O.lR.lastIndex;L=O.lR.exec(K)}r+=l(K.substr(N,K.length-N));return r}function I(K,L){if(L.sL&&e[L.sL]){var r=d(L.sL,K);w+=r.keyword_count;return r.value}else{return E(K,L)}}function H(L,r){var K=L.cN?'':"";if(L.rB){x+=K;L.buffer=""}else{if(L.eB){x+=l(r)+K;L.buffer=""}else{x+=K;L.buffer=r}}C.push(L);z+=L.r}function F(M,L,P){var Q=C[C.length-1];if(P){x+=I(Q.buffer+M,Q);return false}var O=p(L,Q);if(O){x+=I(Q.buffer+M,Q);H(O,L);return O.rB}var K=u(C.length-1,L);if(K){var N=Q.cN?" ":"";if(Q.rE){x+=I(Q.buffer+M,Q)+N}else{if(Q.eE){x+=I(Q.buffer+M,Q)+N+l(L)}else{x+=I(Q.buffer+M+L,Q)+N}}while(K>1){N=C[C.length-2].cN?"":"";x+=N;K--;C.length--}var r=C[C.length-1];C.length--;C[C.length-1].buffer="";if(r.starts){H(r.starts,"")}return Q.rE}if(v(L,Q)){throw"Illegal"}}var D=e[A];var C=[D.dM];var z=0;var w=0;var x="";try{var t=0;D.dM.buffer="";do{var q=o(B,t);var s=F(q[0],q[1],q[2]);t+=q[0].length;if(!s){t+=q[1].length}}while(!q[2]);if(C.length>1){throw"Illegal"}return{language:A,r:z,keyword_count:w,value:x}}catch(G){if(G=="Illegal"){return{language:null,r:0,keyword_count:0,value:l(B)}}else{throw G}}}function i(){function p(t,u,s){if(t.compiled){return}if(!s){t.bR=g(u,t.b?t.b:"\\B|\\b");if(!t.e&&!t.eW){t.e="\\B|\\b"}if(t.e){t.eR=g(u,t.e)}}if(t.i){t.iR=g(u,t.i)}if(t.r==undefined){t.r=1}if(t.k){t.lR=g(u,t.l||hljs.IR,true)}for(var r in t.k){if(!t.k.hasOwnProperty(r)){continue}if(t.k[r] instanceof Object){t.kG=t.k}else{t.kG={keyword:t.k}}break}if(!t.c){t.c=[]}t.compiled=true;for(var q=0;qx.keyword_count+x.r){x=v}if(v.keyword_count+v.r>A.keyword_count+A.r){x=A;A=v}}}var t=s.className;if(!t.match(A.language)){t=t?(t+" "+A.language):A.language}var p=c(s);if(p.length){var r=document.createElement("pre");r.innerHTML=A.value;A.value=j(p,c(r),z)}if(w){A.value=A.value.replace(/^((<[^>]+>|\t)+)/gm,function(B,E,D,C){return E.replace(/\t/g,w)})}if(q){A.value=A.value.replace(/\n/g," ")}if(/MSIE [678]/.test(navigator.userAgent)&&s.tagName=="CODE"&&s.parentNode.tagName=="PRE"){var r=s.parentNode;var o=document.createElement("div");o.innerHTML=""+A.value+" ";s=o.firstChild.firstChild;o.firstChild.cN=r.cN;r.parentNode.replaceChild(o.firstChild,r)}else{s.innerHTML=A.value}s.className=t;s.dataset={};s.dataset.result={language:A.language,kw:A.keyword_count,re:A.r};if(x&&x.language){s.dataset.second_best={language:x.language,kw:x.keyword_count,re:x.r}}}function n(){if(n.called){return}n.called=true;f();var q=document.getElementsByTagName("pre");for(var o=0;o|>=|>>|>>=|>>>|>>>=|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~";this.BE={b:"\\\\.",r:0};this.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[this.BE],r:0};this.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[this.BE],r:0};this.CLCM={cN:"comment",b:"//",e:"$"};this.CBLCLM={cN:"comment",b:"/\\*",e:"\\*/"};this.HCM={cN:"comment",b:"#",e:"$"};this.NM={cN:"number",b:this.NR,r:0};this.CNM={cN:"number",b:this.CNR,r:0};this.inherit=function(q,r){var o={};for(var p in q){o[p]=q[p]}if(r){for(var p in r){o[p]=r[p]}}return o}}();hljs.LANGUAGES.bash=function(){var e={"true":1,"false":1};var c={cN:"variable",b:"\\$([a-zA-Z0-9_]+)\\b"};var b={cN:"variable",b:"\\$\\{(([^}])|(\\\\}))+\\}",c:[hljs.CNM]};var a={cN:"string",b:'"',e:'"',i:"\\n",c:[hljs.BE,c,b],r:0};var d={cN:"test_condition",b:"",e:"",c:[a,c,b,hljs.CNM],k:{literal:e},r:0};return{dM:{k:{keyword:{"if":1,then:1,"else":1,fi:1,"for":1,"break":1,"continue":1,"while":1,"in":1,"do":1,done:1,echo:1,exit:1,"return":1,set:1,declare:1},literal:e},c:[{cN:"shebang",b:"(#!\\/bin\\/bash)|(#!\\/bin\\/sh)",r:10},hljs.HCM,{cN:"comment",b:"\\/\\/",e:"$",i:"."},hljs.CNM,a,c,b,hljs.inherit(d,{b:"\\[ ",e:" \\]",r:0}),hljs.inherit(d,{b:"\\[\\[ ",e:" \\]\\]"})]}}}();hljs.LANGUAGES.java={dM:{k:{"false":1,"synchronized":1,"int":1,"abstract":1,"float":1,"private":1,"char":1,"interface":1,"boolean":1,"static":1,"null":1,"if":1,"const":1,"for":1,"true":1,"while":1,"long":1,"throw":1,strictfp:1,"finally":1,"protected":1,"extends":1,"import":1,"native":1,"final":1,"implements":1,"return":1,"void":1,"enum":1,"else":1,"break":1,"transient":1,"new":1,"catch":1,"instanceof":1,"byte":1,"super":1,"class":1,"volatile":1,"case":1,assert:1,"short":1,"package":1,"default":1,"double":1,"public":1,"try":1,"this":1,"switch":1,"continue":1,"throws":1},c:[{cN:"javadoc",b:"/\\*\\*",e:"\\*/",c:[{cN:"javadoctag",b:"@[A-Za-z]+"}],r:10},hljs.CLCM,hljs.CBLCLM,hljs.ASM,hljs.QSM,{cN:"class",b:"(class |interface )",e:"{",k:{"class":1,"interface":1},i:":",c:[{b:"(implements|extends)",k:{"extends":1,"implements":1},r:10},{cN:"title",b:hljs.UIR}]},hljs.CNM,{cN:"annotation",b:"@[A-Za-z]+"}]}};hljs.LANGUAGES.ini={cI:true,dM:{i:"[^\\s]",c:[{cN:"comment",b:";",e:"$"},{cN:"title",b:"^\\[",e:"\\]"},{cN:"setting",b:"^[a-z0-9_\\[\\]]+[ \\t]*=[ \\t]*",e:"$",c:[{cN:"value",eW:true,k:{on:1,off:1,"true":1,"false":1,yes:1,no:1},c:[hljs.QSM,hljs.NM]}]}]}};hljs.LANGUAGES.sql={cI:true,dM:{i:"[^\\s]",c:[{cN:"operator",b:"(begin|start|commit|rollback|savepoint|lock|alter|create|drop|rename|call|delete|do|handler|insert|load|replace|select|truncate|update|set|show|pragma)\\b",e:";|$",k:{keyword:{all:1,partial:1,global:1,month:1,current_timestamp:1,using:1,go:1,revoke:1,smallint:1,indicator:1,"end-exec":1,disconnect:1,zone:1,"with":1,character:1,assertion:1,to:1,add:1,current_user:1,usage:1,input:1,local:1,alter:1,match:1,collate:1,real:1,then:1,rollback:1,get:1,read:1,timestamp:1,session_user:1,not:1,integer:1,bit:1,unique:1,day:1,minute:1,desc:1,insert:1,execute:1,like:1,ilike:2,level:1,decimal:1,drop:1,"continue":1,isolation:1,found:1,where:1,constraints:1,domain:1,right:1,national:1,some:1,module:1,transaction:1,relative:1,second:1,connect:1,escape:1,close:1,system_user:1,"for":1,deferred:1,section:1,cast:1,current:1,sqlstate:1,allocate:1,intersect:1,deallocate:1,numeric:1,"public":1,preserve:1,full:1,"goto":1,initially:1,asc:1,no:1,key:1,output:1,collation:1,group:1,by:1,union:1,session:1,both:1,last:1,language:1,constraint:1,column:1,of:1,space:1,foreign:1,deferrable:1,prior:1,connection:1,unknown:1,action:1,commit:1,view:1,or:1,first:1,into:1,"float":1,year:1,primary:1,cascaded:1,except:1,restrict:1,set:1,references:1,names:1,table:1,outer:1,open:1,select:1,size:1,are:1,rows:1,from:1,prepare:1,distinct:1,leading:1,create:1,only:1,next:1,inner:1,authorization:1,schema:1,corresponding:1,option:1,declare:1,precision:1,immediate:1,"else":1,timezone_minute:1,external:1,varying:1,translation:1,"true":1,"case":1,exception:1,join:1,hour:1,"default":1,"double":1,scroll:1,value:1,cursor:1,descriptor:1,values:1,dec:1,fetch:1,procedure:1,"delete":1,and:1,"false":1,"int":1,is:1,describe:1,"char":1,as:1,at:1,"in":1,varchar:1,"null":1,trailing:1,any:1,absolute:1,current_time:1,end:1,grant:1,privileges:1,when:1,cross:1,check:1,write:1,current_date:1,pad:1,begin:1,temporary:1,exec:1,time:1,update:1,catalog:1,user:1,sql:1,date:1,on:1,identity:1,timezone_hour:1,natural:1,whenever:1,interval:1,work:1,order:1,cascade:1,diagnostics:1,nchar:1,having:1,left:1,call:1,"do":1,handler:1,load:1,replace:1,truncate:1,start:1,lock:1,show:1,pragma:1},aggregate:{count:1,sum:1,min:1,max:1,avg:1}},c:[{cN:"string",b:"'",e:"'",c:[hljs.BE,{b:"''"}],r:0},{cN:"string",b:'"',e:'"',c:[hljs.BE,{b:'""'}],r:0},{cN:"string",b:"`",e:"`",c:[hljs.BE]},hljs.CNM,{b:"\\n"}]},hljs.CBLCLM,{cN:"comment",b:"--",e:"$"}]}};hljs.LANGUAGES.diff={cI:true,dM:{c:[{cN:"chunk",b:"^\\@\\@ +\\-\\d+,\\d+ +\\+\\d+,\\d+ +\\@\\@$",r:10},{cN:"chunk",b:"^\\*\\*\\* +\\d+,\\d+ +\\*\\*\\*\\*$",r:10},{cN:"chunk",b:"^\\-\\-\\- +\\d+,\\d+ +\\-\\-\\-\\-$",r:10},{cN:"header",b:"Index: ",e:"$"},{cN:"header",b:"=====",e:"=====$"},{cN:"header",b:"^\\-\\-\\-",e:"$"},{cN:"header",b:"^\\*{3} ",e:"$"},{cN:"header",b:"^\\+\\+\\+",e:"$"},{cN:"header",b:"\\*{5}",e:"\\*{5}$"},{cN:"addition",b:"^\\+",e:"$"},{cN:"deletion",b:"^\\-",e:"$"},{cN:"change",b:"^\\!",e:"$"}]}};hljs.LANGUAGES.php={cI:true,dM:{k:{and:1,include_once:1,list:1,"abstract":1,global:1,"private":1,echo:1,"interface":1,as:1,"static":1,endswitch:1,array:1,"null":1,"if":1,endwhile:1,or:1,"const":1,"for":1,endforeach:1,self:1,"var":1,"while":1,isset:1,"public":1,"protected":1,exit:1,foreach:1,"throw":1,elseif:1,"extends":1,include:1,__FILE__:1,empty:1,require_once:1,"function":1,"do":1,xor:1,"return":1,"implements":1,parent:1,clone:1,use:1,__CLASS__:1,__LINE__:1,"else":1,"break":1,print:1,"eval":1,"new":1,"catch":1,__METHOD__:1,"class":1,"case":1,exception:1,php_user_filter:1,"default":1,die:1,require:1,__FUNCTION__:1,enddeclare:1,"final":1,"try":1,"this":1,"switch":1,"continue":1,endfor:1,endif:1,declare:1,unset:1,"true":1,"false":1,namespace:1},c:[hljs.CLCM,hljs.HCM,{cN:"comment",b:"/\\*",e:"\\*/",c:[{cN:"phpdoc",b:"\\s@[A-Za-z]+",r:10}]},hljs.CNM,hljs.inherit(hljs.ASM,{i:null}),hljs.inherit(hljs.QSM,{i:null}),{cN:"variable",b:"\\$[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*"},{cN:"preprocessor",b:"<\\?php",r:10},{cN:"preprocessor",b:"\\?>"}]}};hljs.LANGUAGES.cs={dM:{k:{"abstract":1,as:1,base:1,bool:1,"break":1,"byte":1,"case":1,"catch":1,"char":1,checked:1,"class":1,"const":1,"continue":1,decimal:1,"default":1,delegate:1,"do":1,"do":1,"double":1,"else":1,"enum":1,event:1,explicit:1,extern:1,"false":1,"finally":1,fixed:1,"float":1,"for":1,foreach:1,"goto":1,"if":1,implicit:1,"in":1,"int":1,"interface":1,internal:1,is:1,lock:1,"long":1,namespace:1,"new":1,"null":1,object:1,operator:1,out:1,override:1,params:1,"private":1,"protected":1,"public":1,readonly:1,ref:1,"return":1,sbyte:1,sealed:1,"short":1,sizeof:1,stackalloc:1,"static":1,string:1,struct:1,"switch":1,"this":1,"throw":1,"true":1,"try":1,"typeof":1,uint:1,ulong:1,unchecked:1,unsafe:1,ushort:1,using:1,virtual:1,"volatile":1,"void":1,"while":1,ascending:1,descending:1,from:1,get:1,group:1,into:1,join:1,let:1,orderby:1,partial:1,select:1,set:1,value:1,"var":1,where:1,yield:1},c:[{cN:"comment",b:"///",e:"$",rB:true,c:[{cN:"xmlDocTag",b:"///|"},{cN:"xmlDocTag",b:"?",e:">"}]},hljs.CLCM,hljs.CBLCLM,{cN:"string",b:'@"',e:'"',c:[{b:'""'}]},hljs.ASM,hljs.QSM,hljs.CNM]}};hljs.LANGUAGES.cpp=function(){var b={keyword:{"false":1,"int":1,"float":1,"while":1,"private":1,"char":1,"catch":1,"export":1,virtual:1,operator:2,sizeof:2,dynamic_cast:2,typedef:2,const_cast:2,"const":1,struct:1,"for":1,static_cast:2,union:1,namespace:1,unsigned:1,"long":1,"throw":1,"volatile":2,"static":1,"protected":1,bool:1,template:1,mutable:1,"if":1,"public":1,friend:2,"do":1,"return":1,"goto":1,auto:1,"void":2,"enum":1,"else":1,"break":1,"new":1,extern:1,using:1,"true":1,"class":1,asm:1,"case":1,typeid:1,"short":1,reinterpret_cast:2,"default":1,"double":1,register:1,explicit:1,signed:1,typename:1,"try":1,"this":1,"switch":1,"continue":1,wchar_t:1,inline:1,"delete":1,alignof:1,char16_t:1,char32_t:1,constexpr:1,decltype:1,noexcept:1,nullptr:1,static_assert:1,thread_local:1},built_in:{std:1,string:1,cin:1,cout:1,cerr:1,clog:1,stringstream:1,istringstream:1,ostringstream:1,auto_ptr:1,deque:1,list:1,queue:1,stack:1,vector:1,map:1,set:1,bitset:1,multiset:1,multimap:1,unordered_set:1,unordered_map:1,unordered_multiset:1,unordered_multimap:1,array:1,shared_ptr:1}};var a={cN:"stl_container",b:"\\b(deque|list|queue|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array)\\s*<",e:">",k:b.built_in,r:10};a.c=[a];return{dM:{k:b,i:"",c:[hljs.CLCM,hljs.CBLCLM,hljs.QSM,{cN:"string",b:"'",e:"[^\\\\]'",i:"[^\\\\][^']"},hljs.CNM,{cN:"preprocessor",b:"#",e:"$"},a]}}}();hljs.LANGUAGES.ruby=function(){var g="[a-zA-Z_][a-zA-Z0-9_]*(\\!|\\?)?";var a="[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?";var v={keyword:{and:1,"false":1,then:1,defined:1,module:1,"in":1,"return":1,redo:1,"if":1,BEGIN:1,retry:1,end:1,"for":1,"true":1,self:1,when:1,next:1,until:1,"do":1,begin:1,unless:1,END:1,rescue:1,nil:1,"else":1,"break":1,undef:1,not:1,"super":1,"class":1,"case":1,require:1,yield:1,alias:1,"while":1,ensure:1,elsif:1,or:1,def:1},keymethods:{__id__:1,__send__:1,abort:1,abs:1,"all?":1,allocate:1,ancestors:1,"any?":1,arity:1,assoc:1,at:1,at_exit:1,autoload:1,"autoload?":1,"between?":1,binding:1,binmode:1,"block_given?":1,call:1,callcc:1,caller:1,capitalize:1,"capitalize!":1,casecmp:1,"catch":1,ceil:1,center:1,chomp:1,"chomp!":1,chop:1,"chop!":1,chr:1,"class":1,class_eval:1,"class_variable_defined?":1,class_variables:1,clear:1,clone:1,close:1,close_read:1,close_write:1,"closed?":1,coerce:1,collect:1,"collect!":1,compact:1,"compact!":1,concat:1,"const_defined?":1,const_get:1,const_missing:1,const_set:1,constants:1,count:1,crypt:1,"default":1,default_proc:1,"delete":1,"delete!":1,delete_at:1,delete_if:1,detect:1,display:1,div:1,divmod:1,downcase:1,"downcase!":1,downto:1,dump:1,dup:1,each:1,each_byte:1,each_index:1,each_key:1,each_line:1,each_pair:1,each_value:1,each_with_index:1,"empty?":1,entries:1,eof:1,"eof?":1,"eql?":1,"equal?":1,"eval":1,exec:1,exit:1,"exit!":1,extend:1,fail:1,fcntl:1,fetch:1,fileno:1,fill:1,find:1,find_all:1,first:1,flatten:1,"flatten!":1,floor:1,flush:1,for_fd:1,foreach:1,fork:1,format:1,freeze:1,"frozen?":1,fsync:1,getc:1,gets:1,global_variables:1,grep:1,gsub:1,"gsub!":1,"has_key?":1,"has_value?":1,hash:1,hex:1,id:1,include:1,"include?":1,included_modules:1,index:1,indexes:1,indices:1,induced_from:1,inject:1,insert:1,inspect:1,instance_eval:1,instance_method:1,instance_methods:1,"instance_of?":1,"instance_variable_defined?":1,instance_variable_get:1,instance_variable_set:1,instance_variables:1,"integer?":1,intern:1,invert:1,ioctl:1,"is_a?":1,isatty:1,"iterator?":1,join:1,"key?":1,keys:1,"kind_of?":1,lambda:1,last:1,length:1,lineno:1,ljust:1,load:1,local_variables:1,loop:1,lstrip:1,"lstrip!":1,map:1,"map!":1,match:1,max:1,"member?":1,merge:1,"merge!":1,method:1,"method_defined?":1,method_missing:1,methods:1,min:1,module_eval:1,modulo:1,name:1,nesting:1,"new":1,next:1,"next!":1,"nil?":1,nitems:1,"nonzero?":1,object_id:1,oct:1,open:1,pack:1,partition:1,pid:1,pipe:1,pop:1,popen:1,pos:1,prec:1,prec_f:1,prec_i:1,print:1,printf:1,private_class_method:1,private_instance_methods:1,"private_method_defined?":1,private_methods:1,proc:1,protected_instance_methods:1,"protected_method_defined?":1,protected_methods:1,public_class_method:1,public_instance_methods:1,"public_method_defined?":1,public_methods:1,push:1,putc:1,puts:1,quo:1,raise:1,rand:1,rassoc:1,read:1,read_nonblock:1,readchar:1,readline:1,readlines:1,readpartial:1,rehash:1,reject:1,"reject!":1,remainder:1,reopen:1,replace:1,require:1,"respond_to?":1,reverse:1,"reverse!":1,reverse_each:1,rewind:1,rindex:1,rjust:1,round:1,rstrip:1,"rstrip!":1,scan:1,seek:1,select:1,send:1,set_trace_func:1,shift:1,singleton_method_added:1,singleton_methods:1,size:1,sleep:1,slice:1,"slice!":1,sort:1,"sort!":1,sort_by:1,split:1,sprintf:1,squeeze:1,"squeeze!":1,srand:1,stat:1,step:1,store:1,strip:1,"strip!":1,sub:1,"sub!":1,succ:1,"succ!":1,sum:1,superclass:1,swapcase:1,"swapcase!":1,sync:1,syscall:1,sysopen:1,sysread:1,sysseek:1,system:1,syswrite:1,taint:1,"tainted?":1,tell:1,test:1,"throw":1,times:1,to_a:1,to_ary:1,to_f:1,to_hash:1,to_i:1,to_int:1,to_io:1,to_proc:1,to_s:1,to_str:1,to_sym:1,tr:1,"tr!":1,tr_s:1,"tr_s!":1,trace_var:1,transpose:1,trap:1,truncate:1,"tty?":1,type:1,ungetc:1,uniq:1,"uniq!":1,unpack:1,unshift:1,untaint:1,untrace_var:1,upcase:1,"upcase!":1,update:1,upto:1,"value?":1,values:1,values_at:1,warn:1,write:1,write_nonblock:1,"zero?":1,zip:1}};var h={cN:"yardoctag",b:"@[A-Za-z]+"};var d={cN:"comment",b:"#",e:"$",c:[h]};var c={cN:"comment",b:"^\\=begin",e:"^\\=end",c:[h],r:10};var b={cN:"comment",b:"^__END__",e:"\\n$"};var t={cN:"subst",b:"#\\{",e:"}",l:g,k:v};var u=[hljs.BE,t];var r={cN:"string",b:"'",e:"'",c:u,r:0};var q={cN:"string",b:'"',e:'"',c:u,r:0};var p={cN:"string",b:"%[qw]?\\(",e:"\\)",c:u,r:10};var o={cN:"string",b:"%[qw]?\\[",e:"\\]",c:u,r:10};var n={cN:"string",b:"%[qw]?{",e:"}",c:u,r:10};var m={cN:"string",b:"%[qw]?<",e:">",c:u,r:10};var l={cN:"string",b:"%[qw]?/",e:"/",c:u,r:10};var k={cN:"string",b:"%[qw]?%",e:"%",c:u,r:10};var i={cN:"string",b:"%[qw]?-",e:"-",c:u,r:10};var s={cN:"string",b:"%[qw]?\\|",e:"\\|",c:u,r:10};var f={cN:"function",b:"\\bdef\\s+",e:" |$|;",l:g,k:v,c:[{cN:"title",b:a,l:g,k:v},{cN:"params",b:"\\(",e:"\\)",l:g,k:v},d,c,b]};var e={cN:"identifier",b:g,l:g,k:v,r:0};var j=[d,c,b,r,q,p,o,n,m,l,k,i,s,{cN:"class",b:"\\b(class|module)\\b",e:"$|;",k:{"class":1,module:1},c:[{cN:"title",b:"[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?",r:0},{cN:"inheritance",b:"<\\s*",c:[{cN:"parent",b:"("+hljs.IR+"::)?"+hljs.IR}]},d,c,b]},f,{cN:"constant",b:"(::)?([A-Z]\\w*(::)?)+",r:0},{cN:"symbol",b:":",c:[r,q,p,o,n,m,l,k,i,s,e],r:0},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{cN:"number",b:"\\?\\w"},{cN:"variable",b:"(\\$\\W)|((\\$|\\@\\@?)(\\w+))"},e,{b:"("+hljs.RSR+")\\s*",c:[d,c,b,{cN:"regexp",b:"/",e:"/[a-z]*",i:"\\n",c:[hljs.BE]}],r:0}];t.c=j;f.c[1].c=j;return{dM:{l:g,k:v,c:j}}}();hljs.LANGUAGES.python=function(){var c={cN:"string",b:"u?r?'''",e:"'''",r:10};var b={cN:"string",b:'u?r?"""',e:'"""',r:10};var a={cN:"string",b:"(u|r|ur)'",e:"'",c:[hljs.BE],r:10};var f={cN:"string",b:'(u|r|ur)"',e:'"',c:[hljs.BE],r:10};var e={cN:"title",b:hljs.UIR};var d={cN:"params",b:"\\(",e:"\\)",c:[c,b,a,f,hljs.ASM,hljs.QSM]};return{dM:{k:{keyword:{and:1,elif:1,is:1,global:1,as:1,"in":1,"if":1,from:1,raise:1,"for":1,except:1,"finally":1,print:1,"import":1,pass:1,"return":1,exec:1,"else":1,"break":1,not:1,"with":1,"class":1,assert:1,yield:1,"try":1,"while":1,"continue":1,del:1,or:1,def:1,lambda:1,nonlocal:10},built_in:{None:1,True:1,False:1,Ellipsis:1,NotImplemented:1}},i:"(|->|\\?)",c:[hljs.HCM,c,b,a,f,hljs.ASM,hljs.QSM,{cN:"function",b:"\\bdef ",e:":",i:"$",k:{def:1},c:[e,d],r:10},{cN:"class",b:"\\bclass ",e:":",i:"[${]",k:{"class":1},c:[e,d],r:10},hljs.CNM,{cN:"decorator",b:"@",e:"$"}]}}}();hljs.LANGUAGES.css=function(){var a={cN:"function",b:hljs.IR+"\\(",e:"\\)",c:[{eW:true,eE:true,c:[hljs.NM,hljs.ASM,hljs.QSM]}]};return{cI:true,dM:{i:"[=/|']",c:[hljs.CBLCLM,{cN:"id",b:"\\#[A-Za-z0-9_-]+"},{cN:"class",b:"\\.[A-Za-z0-9_-]+",r:0},{cN:"attr_selector",b:"\\[",e:"\\]",i:"$"},{cN:"pseudo",b:":(:)?[a-zA-Z0-9\\_\\-\\+\\(\\)\\\"\\']+"},{cN:"at_rule",b:"@font-face",l:"[a-z-]+",k:{"font-face":1}},{cN:"at_rule",b:"@",e:"[{;]",eE:true,k:{"import":1,page:1,media:1,charset:1},c:[a,hljs.ASM,hljs.QSM,hljs.NM]},{cN:"tag",b:hljs.IR,r:0},{cN:"rules",b:"{",e:"}",i:"[^\\s]",r:0,c:[hljs.CBLCLM,{cN:"rule",b:"[^\\s]",rB:true,e:";",eW:true,c:[{cN:"attribute",b:"[A-Z\\_\\.\\-]+",e:":",eE:true,i:"[^\\s]",starts:{cN:"value",eW:true,eE:true,c:[a,hljs.NM,hljs.QSM,hljs.ASM,hljs.CBLCLM,{cN:"hexcolor",b:"\\#[0-9A-F]+"},{cN:"important",b:"!important"}]}}]}]}]}}}();hljs.LANGUAGES.perl=function(){var d={getpwent:1,getservent:1,quotemeta:1,msgrcv:1,scalar:1,kill:1,dbmclose:1,undef:1,lc:1,ma:1,syswrite:1,tr:1,send:1,umask:1,sysopen:1,shmwrite:1,vec:1,qx:1,utime:1,local:1,oct:1,semctl:1,localtime:1,readpipe:1,"do":1,"return":1,format:1,read:1,sprintf:1,dbmopen:1,pop:1,getpgrp:1,not:1,getpwnam:1,rewinddir:1,qq:1,fileno:1,qw:1,endprotoent:1,wait:1,sethostent:1,bless:1,s:1,opendir:1,"continue":1,each:1,sleep:1,endgrent:1,shutdown:1,dump:1,chomp:1,connect:1,getsockname:1,die:1,socketpair:1,close:1,flock:1,exists:1,index:1,shmget:1,sub:1,"for":1,endpwent:1,redo:1,lstat:1,msgctl:1,setpgrp:1,abs:1,exit:1,select:1,print:1,ref:1,gethostbyaddr:1,unshift:1,fcntl:1,syscall:1,"goto":1,getnetbyaddr:1,join:1,gmtime:1,symlink:1,semget:1,splice:1,x:1,getpeername:1,recv:1,log:1,setsockopt:1,cos:1,last:1,reverse:1,gethostbyname:1,getgrnam:1,study:1,formline:1,endhostent:1,times:1,chop:1,length:1,gethostent:1,getnetent:1,pack:1,getprotoent:1,getservbyname:1,rand:1,mkdir:1,pos:1,chmod:1,y:1,substr:1,endnetent:1,printf:1,next:1,open:1,msgsnd:1,readdir:1,use:1,unlink:1,getsockopt:1,getpriority:1,rindex:1,wantarray:1,hex:1,system:1,getservbyport:1,endservent:1,"int":1,chr:1,untie:1,rmdir:1,prototype:1,tell:1,listen:1,fork:1,shmread:1,ucfirst:1,setprotoent:1,"else":1,sysseek:1,link:1,getgrgid:1,shmctl:1,waitpid:1,unpack:1,getnetbyname:1,reset:1,chdir:1,grep:1,split:1,require:1,caller:1,lcfirst:1,until:1,warn:1,"while":1,values:1,shift:1,telldir:1,getpwuid:1,my:1,getprotobynumber:1,"delete":1,and:1,sort:1,uc:1,defined:1,srand:1,accept:1,"package":1,seekdir:1,getprotobyname:1,semop:1,our:1,rename:1,seek:1,"if":1,q:1,chroot:1,sysread:1,setpwent:1,no:1,crypt:1,getc:1,chown:1,sqrt:1,write:1,setnetent:1,setpriority:1,foreach:1,tie:1,sin:1,msgget:1,map:1,stat:1,getlogin:1,unless:1,elsif:1,truncate:1,exec:1,keys:1,glob:1,tied:1,closedir:1,ioctl:1,socket:1,readlink:1,"eval":1,xor:1,readline:1,binmode:1,setservent:1,eof:1,ord:1,bind:1,alarm:1,pipe:1,atan2:1,getgrent:1,exp:1,time:1,push:1,setgrent:1,gt:1,lt:1,or:1,ne:1,m:1};var e={cN:"subst",b:"[$@]\\{",e:"}",k:d,r:10};var c={cN:"variable",b:"\\$\\d"};var b={cN:"variable",b:"[\\$\\%\\@\\*](\\^\\w\\b|#\\w+(\\:\\:\\w+)*|[^\\s\\w{]|{\\w+}|\\w+(\\:\\:\\w*)*)"};var f=[hljs.BE,e,c,b];var a=[hljs.HCM,{cN:"comment",b:"^(__END__|__DATA__)",e:"\\n$",r:5},{cN:"string",b:"q[qwxr]?\\s*\\(",e:"\\)",c:f,r:5},{cN:"string",b:"q[qwxr]?\\s*\\[",e:"\\]",c:f,r:5},{cN:"string",b:"q[qwxr]?\\s*\\{",e:"\\}",c:f,r:5},{cN:"string",b:"q[qwxr]?\\s*\\|",e:"\\|",c:f,r:5},{cN:"string",b:"q[qwxr]?\\s*\\<",e:"\\>",c:f,r:5},{cN:"string",b:"qw\\s+q",e:"q",c:f,r:5},{cN:"string",b:"'",e:"'",c:[hljs.BE],r:0},{cN:"string",b:'"',e:'"',c:f,r:0},{cN:"string",b:"`",e:"`",c:[hljs.BE]},{cN:"string",b:"{\\w+}",r:0},{cN:"string",b:"-?\\w+\\s*\\=\\>",r:0},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{cN:"regexp",b:"(s|tr|y)/(\\\\.|[^/])*/(\\\\.|[^/])*/[a-z]*",r:10},{cN:"regexp",b:"(m|qr)?/",e:"/[a-z]*",c:[hljs.BE],r:0},{cN:"sub",b:"\\bsub\\b",e:"(\\s*\\(.*?\\))?[;{]",k:{sub:1},r:5},c,b,{cN:"operator",b:"-\\w\\b",r:0},{cN:"pod",b:"\\=\\w",e:"\\=cut"}];e.c=a;return{dM:{k:d,c:a}}}();hljs.LANGUAGES.xml=function(){var b="[A-Za-z0-9\\._:-]+";var a={eW:true,c:[{cN:"attribute",b:b,r:0},{b:'="',rB:true,e:'"',c:[{cN:"value",b:'"',eW:true}]},{b:"='",rB:true,e:"'",c:[{cN:"value",b:"'",eW:true}]},{b:"=",c:[{cN:"value",b:"[^\\s/>]+"}]}]};return{cI:true,dM:{c:[{cN:"pi",b:"<\\?",e:"\\?>",r:10},{cN:"doctype",b:"",r:10},{cN:"comment",b:"",r:10},{cN:"cdata",b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},{cN:"tag",b:"",rE:true,sL:"css"}},{cN:"tag",b:"