fortitude 0.9.1 → 0.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -1
- data/.travis.yml +28 -22
- data/CHANGES.md +50 -0
- data/CONTRIBUTORS.md +1 -0
- data/doc/.gitignore +18 -0
- data/doc/Gemfile +21 -0
- data/doc/config.rb +92 -0
- data/doc/source/images/background.png +0 -0
- data/doc/source/images/middleman.png +0 -0
- data/doc/source/images/why/icon_button.png +0 -0
- data/doc/source/images/why/icon_button@2x.png +0 -0
- data/doc/source/images/why/modal_dialog@2x.png +0 -0
- data/doc/source/index.html.pcss +96 -0
- data/doc/source/index.html.rb +66 -0
- data/doc/source/javascripts/all.js +1 -0
- data/doc/source/javascripts/highlight.pack.js +1 -0
- data/doc/source/layouts/layout.rb +55 -0
- data/doc/source/portable/fortitude-bootstrap.rb +53 -0
- data/doc/source/shared/base.pcss +62 -0
- data/doc/source/shared/base.rb +30 -0
- data/doc/source/shared/common.rb +55 -0
- data/doc/source/shared/standard_page.rb +40 -0
- data/doc/source/stylesheets/_shared_prefix.scss +25 -0
- data/doc/source/stylesheets/all.css.scss +7 -0
- data/doc/source/stylesheets/basics.css.scss +20 -0
- data/doc/source/stylesheets/bootstrap_importer.css.scss +1 -0
- data/doc/source/stylesheets/highlight/arta.css +140 -0
- data/doc/source/stylesheets/highlight/ascetic.css +52 -0
- data/doc/source/stylesheets/highlight/atelier-dune.dark.css +95 -0
- data/doc/source/stylesheets/highlight/atelier-dune.light.css +95 -0
- data/doc/source/stylesheets/highlight/atelier-forest.dark.css +95 -0
- data/doc/source/stylesheets/highlight/atelier-forest.light.css +95 -0
- data/doc/source/stylesheets/highlight/atelier-heath.dark.css +95 -0
- data/doc/source/stylesheets/highlight/atelier-heath.light.css +95 -0
- data/doc/source/stylesheets/highlight/atelier-lakeside.dark.css +95 -0
- data/doc/source/stylesheets/highlight/atelier-lakeside.light.css +95 -0
- data/doc/source/stylesheets/highlight/atelier-seaside.dark.css +95 -0
- data/doc/source/stylesheets/highlight/atelier-seaside.light.css +95 -0
- data/doc/source/stylesheets/highlight/brown_paper.css +104 -0
- data/doc/source/stylesheets/highlight/brown_papersq.png +0 -0
- data/doc/source/stylesheets/highlight/codepen-embed.css +108 -0
- data/doc/source/stylesheets/highlight/color-brewer.css +168 -0
- data/doc/source/stylesheets/highlight/dark.css +104 -0
- data/doc/source/stylesheets/highlight/default.css +152 -0
- data/doc/source/stylesheets/highlight/docco.css +135 -0
- data/doc/source/stylesheets/highlight/far.css +111 -0
- data/doc/source/stylesheets/highlight/foundation.css +136 -0
- data/doc/source/stylesheets/highlight/github.css +124 -0
- data/doc/source/stylesheets/highlight/googlecode.css +147 -0
- data/doc/source/stylesheets/highlight/hybrid.css +170 -0
- data/doc/source/stylesheets/highlight/idea.css +125 -0
- data/doc/source/stylesheets/highlight/ir_black.css +109 -0
- data/doc/source/stylesheets/highlight/kimbie.dark.css +96 -0
- data/doc/source/stylesheets/highlight/kimbie.light.css +96 -0
- data/doc/source/stylesheets/highlight/magula.css +121 -0
- data/doc/source/stylesheets/highlight/mono-blue.css +69 -0
- data/doc/source/stylesheets/highlight/monokai.css +127 -0
- data/doc/source/stylesheets/highlight/monokai_sublime.css +154 -0
- data/doc/source/stylesheets/highlight/obsidian.css +153 -0
- data/doc/source/stylesheets/highlight/paraiso.dark.css +95 -0
- data/doc/source/stylesheets/highlight/paraiso.light.css +95 -0
- data/doc/source/stylesheets/highlight/pojoaque.css +107 -0
- data/doc/source/stylesheets/highlight/pojoaque.jpg +0 -0
- data/doc/source/stylesheets/highlight/railscasts.css +187 -0
- data/doc/source/stylesheets/highlight/rainbow.css +108 -0
- data/doc/source/stylesheets/highlight/school_book.css +112 -0
- data/doc/source/stylesheets/highlight/school_book.png +0 -0
- data/doc/source/stylesheets/highlight/solarized_dark.css +108 -0
- data/doc/source/stylesheets/highlight/solarized_light.css +108 -0
- data/doc/source/stylesheets/highlight/sunburst.css +164 -0
- data/doc/source/stylesheets/highlight/tomorrow-night-blue.css +95 -0
- data/doc/source/stylesheets/highlight/tomorrow-night-bright.css +94 -0
- data/doc/source/stylesheets/highlight/tomorrow-night-eighties.css +94 -0
- data/doc/source/stylesheets/highlight/tomorrow-night.css +95 -0
- data/doc/source/stylesheets/highlight/tomorrow.css +92 -0
- data/doc/source/stylesheets/highlight/vs.css +93 -0
- data/doc/source/stylesheets/highlight/xcode.css +158 -0
- data/doc/source/stylesheets/highlight/zenburn.css +118 -0
- data/doc/source/why/a_larger_view.html.rb +774 -0
- data/doc/source/why/a_simple_helper.html.rb +332 -0
- data/doc/source/why/building_a_rich_modal_dialog.html.rb +156 -0
- data/doc/source/why/commonality_and_inheritance.html.rb +564 -0
- data/doc/source/why/example_list.rb +60 -0
- data/doc/source/why/example_page.rb +116 -0
- data/doc/source/why/index.html.rb +86 -0
- data/doc/source/why/other_benefits.html.rb +110 -0
- data/fortitude.gemspec +6 -1
- data/lib/fortitude/doctypes/html4_tags_strict.rb +1 -0
- data/lib/fortitude/doctypes/html5.rb +1 -0
- data/lib/fortitude/method_templates/tag_method_template.rb.smpl +27 -14
- data/lib/fortitude/rails/helpers.rb +2 -2
- data/lib/fortitude/rendering_context.rb +10 -1
- data/lib/fortitude/tags/tag.rb +3 -2
- data/lib/fortitude/tags/tag_support.rb +8 -3
- data/lib/fortitude/tilt/fortitude_template.rb +6 -2
- data/lib/fortitude/version.rb +1 -1
- data/lib/fortitude/widget.rb +2 -0
- data/lib/fortitude/widget/convenience.rb +30 -0
- data/lib/fortitude/widget/files.rb +22 -11
- data/lib/fortitude/widget/needs.rb +5 -3
- data/spec/helpers/system_helpers.rb +1 -0
- data/spec/rails/development_mode_system_spec.rb +0 -1
- data/spec/rails/rendering_system_spec.rb +20 -1
- data/spec/rails/templates/rendering_system_spec/app/controllers/rendering_system_spec_controller.rb +13 -0
- data/spec/rails/templates/rendering_system_spec/app/views/rendering_system_spec/render_hash_subclass.rb +18 -0
- data/spec/rails/templates/rendering_system_spec/lib/my_hash.rb +5 -0
- data/spec/system/convenience_methods_system_spec.rb +166 -0
- data/spec/system/formatting_system_spec.rb +25 -1
- data/spec/system/tag_rendering_system_spec.rb +73 -0
- data/spec/system/tilt_system_spec.rb +31 -0
- data/spec/system/widget_class_from_spec.rb +20 -4
- metadata +92 -4
@@ -0,0 +1 @@
|
|
1
|
+
//= require_tree .
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(e){"undefined"!=typeof exports?e(exports):(window.hljs=e({}),"function"==typeof define&&define.amd&&define([],function(){return window.hljs}))}(function(e){function n(e){return e.replace(/&/gm,"&").replace(/</gm,"<").replace(/>/gm,">")}function t(e){return e.nodeName.toLowerCase()}function r(e,n){var t=e&&e.exec(n);return t&&0==t.index}function a(e){var n=(e.className+" "+(e.parentNode?e.parentNode.className:"")).split(/\s+/);return n=n.map(function(e){return e.replace(/^lang(uage)?-/,"")}),n.filter(function(e){return N(e)||/no(-?)highlight/.test(e)})[0]}function o(e,n){var t={};for(var r in e)t[r]=e[r];if(n)for(var r in n)t[r]=n[r];return t}function i(e){var n=[];return function r(e,a){for(var o=e.firstChild;o;o=o.nextSibling)3==o.nodeType?a+=o.nodeValue.length:1==o.nodeType&&(n.push({event:"start",offset:a,node:o}),a=r(o,a),t(o).match(/br|hr|img|input/)||n.push({event:"stop",offset:a,node:o}));return a}(e,0),n}function c(e,r,a){function o(){return e.length&&r.length?e[0].offset!=r[0].offset?e[0].offset<r[0].offset?e:r:"start"==r[0].event?e:r:e.length?e:r}function i(e){function r(e){return" "+e.nodeName+'="'+n(e.value)+'"'}l+="<"+t(e)+Array.prototype.map.call(e.attributes,r).join("")+">"}function c(e){l+="</"+t(e)+">"}function u(e){("start"==e.event?i:c)(e.node)}for(var s=0,l="",f=[];e.length||r.length;){var g=o();if(l+=n(a.substr(s,g[0].offset-s)),s=g[0].offset,g==e){f.reverse().forEach(c);do u(g.splice(0,1)[0]),g=o();while(g==e&&g.length&&g[0].offset==s);f.reverse().forEach(i)}else"start"==g[0].event?f.push(g[0].node):f.pop(),u(g.splice(0,1)[0])}return l+n(a.substr(s))}function u(e){function n(e){return e&&e.source||e}function t(t,r){return RegExp(n(t),"m"+(e.cI?"i":"")+(r?"g":""))}function r(a,i){if(!a.compiled){if(a.compiled=!0,a.k=a.k||a.bK,a.k){var c={},u=function(n,t){e.cI&&(t=t.toLowerCase()),t.split(" ").forEach(function(e){var t=e.split("|");c[t[0]]=[n,t[1]?Number(t[1]):1]})};"string"==typeof a.k?u("keyword",a.k):Object.keys(a.k).forEach(function(e){u(e,a.k[e])}),a.k=c}a.lR=t(a.l||/\b[A-Za-z0-9_]+\b/,!0),i&&(a.bK&&(a.b="\\b("+a.bK.split(" ").join("|")+")\\b"),a.b||(a.b=/\B|\b/),a.bR=t(a.b),a.e||a.eW||(a.e=/\B|\b/),a.e&&(a.eR=t(a.e)),a.tE=n(a.e)||"",a.eW&&i.tE&&(a.tE+=(a.e?"|":"")+i.tE)),a.i&&(a.iR=t(a.i)),void 0===a.r&&(a.r=1),a.c||(a.c=[]);var s=[];a.c.forEach(function(e){e.v?e.v.forEach(function(n){s.push(o(e,n))}):s.push("self"==e?a:e)}),a.c=s,a.c.forEach(function(e){r(e,a)}),a.starts&&r(a.starts,i);var l=a.c.map(function(e){return e.bK?"\\.?("+e.b+")\\.?":e.b}).concat([a.tE,a.i]).map(n).filter(Boolean);a.t=l.length?t(l.join("|"),!0):{exec:function(){return null}}}}r(e)}function s(e,t,a,o){function i(e,n){for(var t=0;t<n.c.length;t++)if(r(n.c[t].bR,e))return n.c[t]}function c(e,n){return r(e.eR,n)?e:e.eW?c(e.parent,n):void 0}function f(e,n){return!a&&r(n.iR,e)}function g(e,n){var t=x.cI?n[0].toLowerCase():n[0];return e.k.hasOwnProperty(t)&&e.k[t]}function p(e,n,t,r){var a=r?"":E.classPrefix,o='<span class="'+a,i=t?"":"</span>";return o+=e+'">',o+n+i}function d(){if(!w.k)return n(y);var e="",t=0;w.lR.lastIndex=0;for(var r=w.lR.exec(y);r;){e+=n(y.substr(t,r.index-t));var a=g(w,r);a?(B+=a[1],e+=p(a[0],n(r[0]))):e+=n(r[0]),t=w.lR.lastIndex,r=w.lR.exec(y)}return e+n(y.substr(t))}function h(){if(w.sL&&!R[w.sL])return n(y);var e=w.sL?s(w.sL,y,!0,L[w.sL]):l(y);return w.r>0&&(B+=e.r),"continuous"==w.subLanguageMode&&(L[w.sL]=e.top),p(e.language,e.value,!1,!0)}function v(){return void 0!==w.sL?h():d()}function b(e,t){var r=e.cN?p(e.cN,"",!0):"";e.rB?(M+=r,y=""):e.eB?(M+=n(t)+r,y=""):(M+=r,y=t),w=Object.create(e,{parent:{value:w}})}function m(e,t){if(y+=e,void 0===t)return M+=v(),0;var r=i(t,w);if(r)return M+=v(),b(r,t),r.rB?0:t.length;var a=c(w,t);if(a){var o=w;o.rE||o.eE||(y+=t),M+=v();do w.cN&&(M+="</span>"),B+=w.r,w=w.parent;while(w!=a.parent);return o.eE&&(M+=n(t)),y="",a.starts&&b(a.starts,""),o.rE?0:t.length}if(f(t,w))throw new Error('Illegal lexeme "'+t+'" for mode "'+(w.cN||"<unnamed>")+'"');return y+=t,t.length||1}var x=N(e);if(!x)throw new Error('Unknown language: "'+e+'"');u(x);for(var w=o||x,L={},M="",k=w;k!=x;k=k.parent)k.cN&&(M=p(k.cN,"",!0)+M);var y="",B=0;try{for(var C,j,I=0;;){if(w.t.lastIndex=I,C=w.t.exec(t),!C)break;j=m(t.substr(I,C.index-I),C[0]),I=C.index+j}m(t.substr(I));for(var k=w;k.parent;k=k.parent)k.cN&&(M+="</span>");return{r:B,value:M,language:e,top:w}}catch(A){if(-1!=A.message.indexOf("Illegal"))return{r:0,value:n(t)};throw A}}function l(e,t){t=t||E.languages||Object.keys(R);var r={r:0,value:n(e)},a=r;return t.forEach(function(n){if(N(n)){var t=s(n,e,!1);t.language=n,t.r>a.r&&(a=t),t.r>r.r&&(a=r,r=t)}}),a.language&&(r.second_best=a),r}function f(e){return E.tabReplace&&(e=e.replace(/^((<[^>]+>|\t)+)/gm,function(e,n){return n.replace(/\t/g,E.tabReplace)})),E.useBR&&(e=e.replace(/\n/g,"<br>")),e}function g(e,n,t){var r=n?x[n]:t,a=[e.trim()];return e.match(/(\s|^)hljs(\s|$)/)||a.push("hljs"),r&&a.push(r),a.join(" ").trim()}function p(e){var n=a(e);if(!/no(-?)highlight/.test(n)){var t;E.useBR?(t=document.createElementNS("http://www.w3.org/1999/xhtml","div"),t.innerHTML=e.innerHTML.replace(/\n/g,"").replace(/<br[ \/]*>/g,"\n")):t=e;var r=t.textContent,o=n?s(n,r,!0):l(r),u=i(t);if(u.length){var p=document.createElementNS("http://www.w3.org/1999/xhtml","div");p.innerHTML=o.value,o.value=c(u,i(p),r)}o.value=f(o.value),e.innerHTML=o.value,e.className=g(e.className,n,o.language),e.result={language:o.language,re:o.r},o.second_best&&(e.second_best={language:o.second_best.language,re:o.second_best.r})}}function d(e){E=o(E,e)}function h(){if(!h.called){h.called=!0;var e=document.querySelectorAll("pre code");Array.prototype.forEach.call(e,p)}}function v(){addEventListener("DOMContentLoaded",h,!1),addEventListener("load",h,!1)}function b(n,t){var r=R[n]=t(e);r.aliases&&r.aliases.forEach(function(e){x[e]=n})}function m(){return Object.keys(R)}function N(e){return R[e]||R[x[e]]}var E={classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:void 0},R={},x={};return e.highlight=s,e.highlightAuto=l,e.fixMarkup=f,e.highlightBlock=p,e.configure=d,e.initHighlighting=h,e.initHighlightingOnLoad=v,e.registerLanguage=b,e.listLanguages=m,e.getLanguage=N,e.inherit=o,e.IR="[a-zA-Z][a-zA-Z0-9_]*",e.UIR="[a-zA-Z_][a-zA-Z0-9_]*",e.NR="\\b\\d+(\\.\\d+)?",e.CNR="(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",e.BNR="\\b(0b[01]+)",e.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",e.BE={b:"\\\\[\\s\\S]",r:0},e.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[e.BE]},e.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[e.BE]},e.PWM={b:/\b(a|an|the|are|I|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such)\b/},e.CLCM={cN:"comment",b:"//",e:"$",c:[e.PWM]},e.CBCM={cN:"comment",b:"/\\*",e:"\\*/",c:[e.PWM]},e.HCM={cN:"comment",b:"#",e:"$",c:[e.PWM]},e.NM={cN:"number",b:e.NR,r:0},e.CNM={cN:"number",b:e.CNR,r:0},e.BNM={cN:"number",b:e.BNR,r:0},e.CSSNM={cN:"number",b:e.NR+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",r:0},e.RM={cN:"regexp",b:/\//,e:/\/[gimuy]*/,i:/\n/,c:[e.BE,{b:/\[/,e:/\]/,r:0,c:[e.BE]}]},e.TM={cN:"title",b:e.IR,r:0},e.UTM={cN:"title",b:e.UIR,r:0},e});hljs.registerLanguage("xml",function(){var t="[A-Za-z0-9\\._:-]+",e={b:/<\?(php)?(?!\w)/,e:/\?>/,sL:"php",subLanguageMode:"continuous"},c={eW:!0,i:/</,r:0,c:[e,{cN:"attribute",b:t,r:0},{b:"=",r:0,c:[{cN:"value",c:[e],v:[{b:/"/,e:/"/},{b:/'/,e:/'/},{b:/[^\s\/>]+/}]}]}]};return{aliases:["html","xhtml","rss","atom","xsl","plist"],cI:!0,c:[{cN:"doctype",b:"<!DOCTYPE",e:">",r:10,c:[{b:"\\[",e:"\\]"}]},{cN:"comment",b:"<!--",e:"-->",r:10},{cN:"cdata",b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},{cN:"tag",b:"<style(?=\\s|>|$)",e:">",k:{title:"style"},c:[c],starts:{e:"</style>",rE:!0,sL:"css"}},{cN:"tag",b:"<script(?=\\s|>|$)",e:">",k:{title:"script"},c:[c],starts:{e:"</script>",rE:!0,sL:"javascript"}},e,{cN:"pi",b:/<\?\w+/,e:/\?>/,r:10},{cN:"tag",b:"</?",e:"/?>",c:[{cN:"title",b:/[^ \/><\n\t]+/,r:0},c]}]}});hljs.registerLanguage("haml",function(){return{cI:!0,c:[{cN:"doctype",b:"^!!!( (5|1\\.1|Strict|Frameset|Basic|Mobile|RDFa|XML\\b.*))?$",r:10},{cN:"comment",b:"^\\s*(!=#|=#|-#|/).*$",r:0},{b:"^\\s*(-|=|!=)(?!#)",starts:{e:"\\n",sL:"ruby"}},{cN:"tag",b:"^\\s*%",c:[{cN:"title",b:"\\w+"},{cN:"value",b:"[#\\.]\\w+"},{b:"{\\s*",e:"\\s*}",eE:!0,c:[{b:":\\w+\\s*=>",e:",\\s+",rB:!0,eW:!0,c:[{cN:"symbol",b:":\\w+"},{cN:"string",b:'"',e:'"'},{cN:"string",b:"'",e:"'"},{b:"\\w+",r:0}]}]},{b:"\\(\\s*",e:"\\s*\\)",eE:!0,c:[{b:"\\w+\\s*=",e:"\\s+",rB:!0,eW:!0,c:[{cN:"attribute",b:"\\w+",r:0},{cN:"string",b:'"',e:'"'},{cN:"string",b:"'",e:"'"},{b:"\\w+",r:0}]}]}]},{cN:"bullet",b:"^\\s*[=~]\\s*",r:0},{b:"#{",starts:{e:"}",sL:"ruby"}}]}});hljs.registerLanguage("ruby",function(e){var b="[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?",r="and false then defined module in return redo if BEGIN retry end for true self when next until do begin unless END rescue nil else break undef not super class case require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor",c={cN:"yardoctag",b:"@[A-Za-z]+"},a={cN:"value",b:"#<",e:">"},s={cN:"comment",v:[{b:"#",e:"$",c:[c]},{b:"^\\=begin",e:"^\\=end",c:[c],r:10},{b:"^__END__",e:"\\n$"}]},n={cN:"subst",b:"#\\{",e:"}",k:r},t={cN:"string",c:[e.BE,n],v:[{b:/'/,e:/'/},{b:/"/,e:/"/},{b:/`/,e:/`/},{b:"%[qQwWx]?\\(",e:"\\)"},{b:"%[qQwWx]?\\[",e:"\\]"},{b:"%[qQwWx]?{",e:"}"},{b:"%[qQwWx]?<",e:">"},{b:"%[qQwWx]?/",e:"/"},{b:"%[qQwWx]?%",e:"%"},{b:"%[qQwWx]?-",e:"-"},{b:"%[qQwWx]?\\|",e:"\\|"},{b:/\B\?(\\\d{1,3}|\\x[A-Fa-f0-9]{1,2}|\\u[A-Fa-f0-9]{4}|\\?\S)\b/}]},i={cN:"params",b:"\\(",e:"\\)",k:r},d=[t,a,s,{cN:"class",bK:"class module",e:"$|;",i:/=/,c:[e.inherit(e.TM,{b:"[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?"}),{cN:"inheritance",b:"<\\s*",c:[{cN:"parent",b:"("+e.IR+"::)?"+e.IR}]},s]},{cN:"function",bK:"def",e:" |$|;",r:0,c:[e.inherit(e.TM,{b:b}),i,s]},{cN:"constant",b:"(::)?(\\b[A-Z]\\w*(::)?)+",r:0},{cN:"symbol",b:e.UIR+"(\\!|\\?)?:",r:0},{cN:"symbol",b:":",c:[t,{b:b}],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:"variable",b:"(\\$\\W)|((\\$|\\@\\@?)(\\w+))"},{b:"("+e.RSR+")\\s*",c:[a,s,{cN:"regexp",c:[e.BE,n],i:/\n/,v:[{b:"/",e:"/[a-z]*"},{b:"%r{",e:"}[a-z]*"},{b:"%r\\(",e:"\\)[a-z]*"},{b:"%r!",e:"![a-z]*"},{b:"%r\\[",e:"\\][a-z]*"}]}],r:0}];n.c=d,i.c=d;var l="[>?]>",u="[\\w#]+\\(\\w+\\):\\d+:\\d+>",N="(\\w+-)?\\d+\\.\\d+\\.\\d(p\\d+)?[^>]+>",o=[{b:/^\s*=>/,cN:"status",starts:{e:"$",c:d}},{cN:"prompt",b:"^("+l+"|"+u+"|"+N+")",starts:{e:"$",c:d}}];return{aliases:["rb","gemspec","podspec","thor","irb"],k:r,c:[s].concat(o).concat(d)}});hljs.registerLanguage("javascript",function(r){return{aliases:["js"],k:{keyword:"in if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const class",literal:"true false null undefined NaN Infinity",built_in:"eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require module console window document"},c:[{cN:"pi",r:10,v:[{b:/^\s*('|")use strict('|")/},{b:/^\s*('|")use asm('|")/}]},r.ASM,r.QSM,r.CLCM,r.CBCM,r.CNM,{b:"("+r.RSR+"|\\b(case|return|throw)\\b)\\s*",k:"return throw case",c:[r.CLCM,r.CBCM,r.RM,{b:/</,e:/>;/,r:0,sL:"xml"}],r:0},{cN:"function",bK:"function",e:/\{/,eE:!0,c:[r.inherit(r.TM,{b:/[A-Za-z$_][0-9A-Za-z$_]*/}),{cN:"params",b:/\(/,e:/\)/,c:[r.CLCM,r.CBCM],i:/["'\(]/}],i:/\[|%/},{b:/\$[(.]/},{b:"\\."+r.IR,r:0}]}});hljs.registerLanguage("erb",function(){return{sL:"xml",subLanguageMode:"continuous",c:[{cN:"comment",b:"<%#",e:"%>"},{b:"<%[%=-]?",e:"[%-]?%>",sL:"ruby",eB:!0,eE:!0}]}});hljs.registerLanguage("css",function(e){var c="[a-zA-Z-][a-zA-Z0-9_-]*",a={cN:"function",b:c+"\\(",rB:!0,eE:!0,e:"\\("};return{cI:!0,i:"[=/|']",c:[e.CBCM,{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|page)",l:"[a-z-]+",k:"font-face page"},{cN:"at_rule",b:"@",e:"[{;]",c:[{cN:"keyword",b:/\S+/},{b:/\s/,eW:!0,eE:!0,r:0,c:[a,e.ASM,e.QSM,e.CSSNM]}]},{cN:"tag",b:c,r:0},{cN:"rules",b:"{",e:"}",i:"[^\\s]",r:0,c:[e.CBCM,{cN:"rule",b:"[^\\s]",rB:!0,e:";",eW:!0,c:[{cN:"attribute",b:"[A-Z\\_\\.\\-]+",e:":",eE:!0,i:"[^\\s]",starts:{cN:"value",eW:!0,eE:!0,c:[a,e.CSSNM,e.QSM,e.ASM,e.CBCM,{cN:"hexcolor",b:"#[0-9A-Fa-f]+"},{cN:"important",b:"!important"}]}}]}]}]}});
|
@@ -0,0 +1,55 @@
|
|
1
|
+
class Views::Layout < Views::Shared::Base
|
2
|
+
def content
|
3
|
+
doctype!
|
4
|
+
|
5
|
+
html {
|
6
|
+
head {
|
7
|
+
meta :charset => 'utf-8'
|
8
|
+
meta :content => "IE=edge,chrome=1", :'http-equiv' => "X-UA-Compatible"
|
9
|
+
meta :name => 'viewport', :content => 'width=device-width, initial-scale=1'
|
10
|
+
|
11
|
+
comment %{[if lt IE 9]>
|
12
|
+
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
|
13
|
+
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
14
|
+
<![endif]}
|
15
|
+
|
16
|
+
stylesheet_link_tag 'all'
|
17
|
+
javascript_include_tag 'all'
|
18
|
+
|
19
|
+
link :rel => 'stylesheet', :type => 'text/css', :href => "http://fonts.googleapis.com/css?family=Oswald:400,300,700|Gentium+Basic:400,700,400italic,700italic|Inconsolata:400,700"
|
20
|
+
|
21
|
+
javascript_include_tag 'https://code.jquery.com/jquery-2.1.3.min.js'
|
22
|
+
javascript <<-EOS
|
23
|
+
$(document).ready(function() {
|
24
|
+
$('figure.source pre code').each(function(i, block) {
|
25
|
+
hljs.highlightBlock(block);
|
26
|
+
});
|
27
|
+
});
|
28
|
+
EOS
|
29
|
+
|
30
|
+
javascript "hljs.initHighlightingOnLoad();"
|
31
|
+
|
32
|
+
render_title
|
33
|
+
}
|
34
|
+
|
35
|
+
body {
|
36
|
+
rawtext(yield)
|
37
|
+
|
38
|
+
footer_javascript
|
39
|
+
}
|
40
|
+
}
|
41
|
+
end
|
42
|
+
|
43
|
+
def page_title
|
44
|
+
nil
|
45
|
+
end
|
46
|
+
|
47
|
+
def render_title
|
48
|
+
title(page_title || "Fortitude")
|
49
|
+
end
|
50
|
+
|
51
|
+
def footer_javascript
|
52
|
+
script :src => 'https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js'
|
53
|
+
script :src => '/javascripts/bootstrap.js'
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
require 'active_support/concern'
|
2
|
+
|
3
|
+
module ::FortitudeBootstrap
|
4
|
+
extend ActiveSupport::Concern
|
5
|
+
|
6
|
+
def self._fortitude_bootstrap_class_adding_method(method_name, tag_name, classes_to_add)
|
7
|
+
define_method(method_name) do |*args, &block|
|
8
|
+
send(tag_name, *add_css_classes(classes_to_add, *args), &block)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
_fortitude_bootstrap_class_adding_method :container, :div, :container
|
13
|
+
_fortitude_bootstrap_class_adding_method :fluid_container, :div, :'container-fluid'
|
14
|
+
_fortitude_bootstrap_class_adding_method :jumbotron, :div, :jumbotron
|
15
|
+
_fortitude_bootstrap_class_adding_method :row, :div, :row
|
16
|
+
|
17
|
+
COLUMNS_SPEC_KEYS = [ :xs, :small, :medium, :large ]
|
18
|
+
|
19
|
+
def _fortitude_bootstrap_column_classes(column_spec)
|
20
|
+
column_spec.assert_valid_keys(COLUMNS_SPEC_KEYS)
|
21
|
+
column_spec.map do |key, number|
|
22
|
+
raise TypeError, "Column must be an integer between 1 and 12" unless number.kind_of?(Integer) && (1..12).include?(number)
|
23
|
+
class_fragment = case key
|
24
|
+
when :xs then 'xs'
|
25
|
+
when :small then 'sm'
|
26
|
+
when :medium then 'md'
|
27
|
+
when :large then 'lg'
|
28
|
+
else raise "Invalid class fragment: #{class_fragment.inspect}"
|
29
|
+
end
|
30
|
+
"col-#{class_fragment}-#{number}"
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def columns(*args, &block)
|
35
|
+
column_spec = args[0]
|
36
|
+
|
37
|
+
if args.length == 1 && args[0].kind_of?(Hash)
|
38
|
+
attributes = { }
|
39
|
+
column_spec = { }
|
40
|
+
args[0].each do |key, value|
|
41
|
+
if COLUMNS_SPEC_KEYS.include?(key.to_sym)
|
42
|
+
column_spec[key] = value
|
43
|
+
else
|
44
|
+
attributes[key] = value
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
args = [ attributes ]
|
49
|
+
end
|
50
|
+
|
51
|
+
div(*add_css_classes(_fortitude_bootstrap_column_classes(column_spec), *args), &block)
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
.jumbotron {
|
2
|
+
color: $bold-color;
|
3
|
+
background-color: $background-color;
|
4
|
+
padding-top: 20px;
|
5
|
+
padding-bottom: 20px;
|
6
|
+
padding-left: 40px;
|
7
|
+
margin-bottom: 20px;
|
8
|
+
border-radius: 0;
|
9
|
+
|
10
|
+
h1, h2, h3, h4, h5, h6 { margin-top: 10px; }
|
11
|
+
}
|
12
|
+
|
13
|
+
figure.source {
|
14
|
+
figcaption {
|
15
|
+
font-family: $monospace-font;
|
16
|
+
font-weight: $monospace-font-medium-weight;
|
17
|
+
text-align: right;
|
18
|
+
background-color: $faint-highlight;
|
19
|
+
border-bottom: 1px solid black;
|
20
|
+
padding-right: 6px;
|
21
|
+
}
|
22
|
+
|
23
|
+
pre {
|
24
|
+
background: none;
|
25
|
+
padding: 0;
|
26
|
+
margin: 0;
|
27
|
+
font-size: 11px;
|
28
|
+
}
|
29
|
+
|
30
|
+
margin-bottom: 10px;
|
31
|
+
}
|
32
|
+
|
33
|
+
h4, h5, h6 {
|
34
|
+
font-weight: $body-font-medium-weight;
|
35
|
+
}
|
36
|
+
|
37
|
+
blockquote.emphatic {
|
38
|
+
border-left: none;
|
39
|
+
padding-left: 40px;
|
40
|
+
font-size: 20px;
|
41
|
+
font-style: italic;
|
42
|
+
font-weight: $body-font-heavy-weight;
|
43
|
+
margin-bottom: 10px;
|
44
|
+
}
|
45
|
+
|
46
|
+
blockquote.small {
|
47
|
+
font-size: 13px;
|
48
|
+
border: none;
|
49
|
+
background: $light-background-highlight;
|
50
|
+
margin: 20px;
|
51
|
+
}
|
52
|
+
|
53
|
+
div.vertical-space {
|
54
|
+
margin-top: 20px;
|
55
|
+
}
|
56
|
+
|
57
|
+
.featured_image {
|
58
|
+
margin-left: auto;
|
59
|
+
margin-right: auto;
|
60
|
+
margin-top: 20px;
|
61
|
+
margin-bottom: 20px;
|
62
|
+
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'source/shared/common'
|
2
|
+
require 'source/portable/fortitude-bootstrap'
|
3
|
+
|
4
|
+
module Views
|
5
|
+
module Shared
|
6
|
+
class Base < Fortitude::Widget
|
7
|
+
doctype :html5
|
8
|
+
|
9
|
+
format_output true
|
10
|
+
start_and_end_comments true
|
11
|
+
debug true
|
12
|
+
enforce_element_nesting_rules true
|
13
|
+
enforce_attribute_rules true
|
14
|
+
enforce_id_uniqueness true
|
15
|
+
|
16
|
+
enable_parcels!
|
17
|
+
|
18
|
+
helper :stylesheet_link_tag, :transform => :output_return_value
|
19
|
+
helper :javascript_include_tag, :transform => :output_return_value
|
20
|
+
|
21
|
+
css_prefix %{
|
22
|
+
@import "#{File.expand_path(File.join(File.dirname(__FILE__), '..', 'stylesheets', '_shared_prefix.scss'))}";
|
23
|
+
}
|
24
|
+
|
25
|
+
include ::FortitudeBootstrap
|
26
|
+
include ::Views::Shared::Common
|
27
|
+
include ::RetinaImages::Helpers
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
module Views
|
2
|
+
module Shared
|
3
|
+
module Common
|
4
|
+
def retina_image(canonical_path, attributes = { })
|
5
|
+
classes = retina_image_div_based_image_classes(canonical_path)
|
6
|
+
div(*add_css_classes(classes, attributes))
|
7
|
+
end
|
8
|
+
|
9
|
+
def emphatic_pullquote(*args, &block)
|
10
|
+
blockquote(*add_css_classes(:emphatic, *args), &block)
|
11
|
+
end
|
12
|
+
|
13
|
+
def small_pullquote(*args, &block)
|
14
|
+
blockquote(*add_css_classes(:small, *args), &block)
|
15
|
+
end
|
16
|
+
|
17
|
+
def vertical_space
|
18
|
+
div(:class => 'vertical-space')
|
19
|
+
end
|
20
|
+
|
21
|
+
def erb(*args)
|
22
|
+
source_code(:erb, *args)
|
23
|
+
end
|
24
|
+
|
25
|
+
def fortitude(*args)
|
26
|
+
source_code(:rb, *args)
|
27
|
+
end
|
28
|
+
|
29
|
+
def ruby(*args)
|
30
|
+
source_code(:rb, *args)
|
31
|
+
end
|
32
|
+
|
33
|
+
def html_source(*args)
|
34
|
+
source_code(:html, *args)
|
35
|
+
end
|
36
|
+
|
37
|
+
def source_code(language, *args)
|
38
|
+
title = args.shift if args.length > 1
|
39
|
+
the_code = args.shift
|
40
|
+
raise ArgumentError, "Too many arguments: #{args.inspect}" if args.length > 0
|
41
|
+
|
42
|
+
figure(:class => :source) {
|
43
|
+
figcaption title if title
|
44
|
+
pre(:class => language) {
|
45
|
+
code the_code
|
46
|
+
}
|
47
|
+
}
|
48
|
+
end
|
49
|
+
|
50
|
+
def featured_image(image_path)
|
51
|
+
retina_image(image_path, :class => 'featured_image')
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module Views
|
2
|
+
module Shared
|
3
|
+
class StandardPage < Views::Shared::Base
|
4
|
+
def content
|
5
|
+
container {
|
6
|
+
page_content
|
7
|
+
}
|
8
|
+
end
|
9
|
+
|
10
|
+
def page_content
|
11
|
+
raise "Must override in #{self.class.name}"
|
12
|
+
end
|
13
|
+
|
14
|
+
def big_title(title = nil)
|
15
|
+
jumbotron {
|
16
|
+
if block_given?
|
17
|
+
yield
|
18
|
+
else
|
19
|
+
h2 title
|
20
|
+
end
|
21
|
+
}
|
22
|
+
end
|
23
|
+
|
24
|
+
def standard_text_row(&block)
|
25
|
+
row {
|
26
|
+
columns(:small => 3)
|
27
|
+
columns(:small => 7, &block)
|
28
|
+
columns(:small => 2)
|
29
|
+
}
|
30
|
+
end
|
31
|
+
|
32
|
+
def heading_row(&block)
|
33
|
+
row {
|
34
|
+
columns(:small => 3)
|
35
|
+
columns(:small => 9, &block)
|
36
|
+
}
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
$background-color: #023A69;
|
2
|
+
|
3
|
+
$bold-color: rgba(164, 214, 255, 1.0);
|
4
|
+
$bold-translucent: rgba(164, 214, 255, 0.4);
|
5
|
+
|
6
|
+
$highlight-color: rgba(255, 254, 214, 1.0);
|
7
|
+
$highlight-translucent: rgba(255, 254, 214, 0.4);
|
8
|
+
|
9
|
+
$faint-highlight: $highlight-translucent;
|
10
|
+
|
11
|
+
$light-background-highlight: rgb(239, 239, 239);
|
12
|
+
|
13
|
+
|
14
|
+
$body-font: "Gentium Basic";
|
15
|
+
$body-font-medium-weight: 400;
|
16
|
+
$body-font-heavy-weight: 700;
|
17
|
+
|
18
|
+
$heading-font: "Oswald";
|
19
|
+
$heading-font-light-weight: 300;
|
20
|
+
$heading-font-medium-weight: 400;
|
21
|
+
$heading-font-heavy-weight: 700;
|
22
|
+
|
23
|
+
$monospace-font: "Inconsolata";
|
24
|
+
$monospace-font-medium-weight: 400;
|
25
|
+
$monospace-font-heavy-weight: 700;
|
@@ -0,0 +1,20 @@
|
|
1
|
+
@import "shared_prefix";
|
2
|
+
|
3
|
+
body {
|
4
|
+
font-family: $body-font, serif;
|
5
|
+
}
|
6
|
+
|
7
|
+
h1, h2, h3, h4, h5, h6 {
|
8
|
+
font: {
|
9
|
+
family: $heading-font, sans-serif;
|
10
|
+
weight: 700;
|
11
|
+
}
|
12
|
+
}
|
13
|
+
|
14
|
+
pre {
|
15
|
+
font-family: $monospace-font;
|
16
|
+
font-size: 13px;
|
17
|
+
border: none;
|
18
|
+
margin: 0;
|
19
|
+
padding: 5px;
|
20
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "bootstrap";
|
@@ -0,0 +1,140 @@
|
|
1
|
+
/*
|
2
|
+
Date: 17.V.2011
|
3
|
+
Author: pumbur <pumbur@pumbur.net>
|
4
|
+
*/
|
5
|
+
|
6
|
+
.hljs {
|
7
|
+
display: block;
|
8
|
+
overflow-x: auto;
|
9
|
+
padding: 0.5em;
|
10
|
+
background: #222;
|
11
|
+
-webkit-text-size-adjust: none;
|
12
|
+
}
|
13
|
+
|
14
|
+
.profile .hljs-header *,
|
15
|
+
.ini .hljs-title,
|
16
|
+
.nginx .hljs-title {
|
17
|
+
color: #fff;
|
18
|
+
}
|
19
|
+
|
20
|
+
.hljs-comment,
|
21
|
+
.hljs-javadoc,
|
22
|
+
.hljs-preprocessor,
|
23
|
+
.hljs-preprocessor .hljs-title,
|
24
|
+
.hljs-pragma,
|
25
|
+
.hljs-shebang,
|
26
|
+
.profile .hljs-summary,
|
27
|
+
.diff,
|
28
|
+
.hljs-pi,
|
29
|
+
.hljs-doctype,
|
30
|
+
.hljs-tag,
|
31
|
+
.css .hljs-rules,
|
32
|
+
.tex .hljs-special {
|
33
|
+
color: #444;
|
34
|
+
}
|
35
|
+
|
36
|
+
.hljs-string,
|
37
|
+
.hljs-symbol,
|
38
|
+
.diff .hljs-change,
|
39
|
+
.hljs-regexp,
|
40
|
+
.xml .hljs-attribute,
|
41
|
+
.smalltalk .hljs-char,
|
42
|
+
.xml .hljs-value,
|
43
|
+
.ini .hljs-value,
|
44
|
+
.clojure .hljs-attribute,
|
45
|
+
.coffeescript .hljs-attribute {
|
46
|
+
color: #ffcc33;
|
47
|
+
}
|
48
|
+
|
49
|
+
.hljs-number,
|
50
|
+
.hljs-addition {
|
51
|
+
color: #00cc66;
|
52
|
+
}
|
53
|
+
|
54
|
+
.hljs-built_in,
|
55
|
+
.hljs-literal,
|
56
|
+
.hljs-type,
|
57
|
+
.hljs-typename,
|
58
|
+
.go .hljs-constant,
|
59
|
+
.ini .hljs-keyword,
|
60
|
+
.lua .hljs-title,
|
61
|
+
.perl .hljs-variable,
|
62
|
+
.php .hljs-variable,
|
63
|
+
.mel .hljs-variable,
|
64
|
+
.django .hljs-variable,
|
65
|
+
.css .funtion,
|
66
|
+
.smalltalk .method,
|
67
|
+
.hljs-hexcolor,
|
68
|
+
.hljs-important,
|
69
|
+
.hljs-flow,
|
70
|
+
.hljs-inheritance,
|
71
|
+
.parser3 .hljs-variable {
|
72
|
+
color: #32aaee;
|
73
|
+
}
|
74
|
+
|
75
|
+
.hljs-keyword,
|
76
|
+
.hljs-tag .hljs-title,
|
77
|
+
.css .hljs-tag,
|
78
|
+
.css .hljs-class,
|
79
|
+
.css .hljs-id,
|
80
|
+
.css .hljs-pseudo,
|
81
|
+
.css .hljs-attr_selector,
|
82
|
+
.hljs-winutils,
|
83
|
+
.tex .hljs-command,
|
84
|
+
.hljs-request,
|
85
|
+
.hljs-status {
|
86
|
+
color: #6644aa;
|
87
|
+
}
|
88
|
+
|
89
|
+
.hljs-title,
|
90
|
+
.ruby .hljs-constant,
|
91
|
+
.vala .hljs-constant,
|
92
|
+
.hljs-parent,
|
93
|
+
.hljs-deletion,
|
94
|
+
.hljs-template_tag,
|
95
|
+
.css .hljs-keyword,
|
96
|
+
.objectivec .hljs-class .hljs-id,
|
97
|
+
.smalltalk .hljs-class,
|
98
|
+
.lisp .hljs-keyword,
|
99
|
+
.apache .hljs-tag,
|
100
|
+
.nginx .hljs-variable,
|
101
|
+
.hljs-envvar,
|
102
|
+
.bash .hljs-variable,
|
103
|
+
.go .hljs-built_in,
|
104
|
+
.vbscript .hljs-built_in,
|
105
|
+
.lua .hljs-built_in,
|
106
|
+
.rsl .hljs-built_in,
|
107
|
+
.tail,
|
108
|
+
.avrasm .hljs-label,
|
109
|
+
.tex .hljs-formula,
|
110
|
+
.tex .hljs-formula * {
|
111
|
+
color: #bb1166;
|
112
|
+
}
|
113
|
+
|
114
|
+
.hljs-yardoctag,
|
115
|
+
.hljs-phpdoc,
|
116
|
+
.hljs-dartdoc,
|
117
|
+
.profile .hljs-header,
|
118
|
+
.ini .hljs-title,
|
119
|
+
.apache .hljs-tag,
|
120
|
+
.parser3 .hljs-title {
|
121
|
+
font-weight: bold;
|
122
|
+
}
|
123
|
+
|
124
|
+
.coffeescript .javascript,
|
125
|
+
.javascript .xml,
|
126
|
+
.tex .hljs-formula,
|
127
|
+
.xml .javascript,
|
128
|
+
.xml .vbscript,
|
129
|
+
.xml .css,
|
130
|
+
.xml .hljs-cdata {
|
131
|
+
opacity: 0.6;
|
132
|
+
}
|
133
|
+
|
134
|
+
.hljs,
|
135
|
+
.hljs-subst,
|
136
|
+
.diff .hljs-chunk,
|
137
|
+
.css .hljs-value,
|
138
|
+
.css .hljs-attribute {
|
139
|
+
color: #aaa;
|
140
|
+
}
|