From 3699065086ec37024d664d21d14935fdd44f57da Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Mon, 15 Nov 2010 14:41:45 -0800 Subject: [PATCH] Use a javascript based syntax highlighter. --- doc-src/Rules | 4 +- doc-src/assets/javascripts/shAutoloader.js | 17 ++ doc-src/assets/javascripts/shBrushCss.js | 91 ++++++++ doc-src/assets/javascripts/shBrushSass.js | 94 ++++++++ doc-src/assets/javascripts/shBrushScss.js | 91 ++++++++ doc-src/assets/javascripts/shCore.js | 17 ++ doc-src/content/stylesheets/_syntax.scss | 2 - doc-src/content/stylesheets/screen.sass | 1 - .../content/stylesheets/syntax/_coderay.scss | 211 ----------------- .../content/stylesheets/syntax/_pygments.scss | 151 ------------ .../stylesheets/syntax/_theme_template.scss | 120 ++++++++++ .../content/stylesheets/syntax/shCore.scss | 216 ++++++++++++++++++ .../stylesheets/syntax/shCoreDefault.scss | 2 + .../stylesheets/syntax/shThemeDefault.scss | 7 + doc-src/layouts/basic.haml | 2 + doc-src/layouts/main.haml | 4 + doc-src/layouts/partials/analytics.haml | 3 + .../layouts/partials/reference/mixins.haml | 6 +- doc-src/lib/data_sources/syntax_highter.rb | 9 +- 19 files changed, 672 insertions(+), 376 deletions(-) create mode 100644 doc-src/assets/javascripts/shAutoloader.js create mode 100644 doc-src/assets/javascripts/shBrushCss.js create mode 100644 doc-src/assets/javascripts/shBrushSass.js create mode 100644 doc-src/assets/javascripts/shBrushScss.js create mode 100644 doc-src/assets/javascripts/shCore.js delete mode 100644 doc-src/content/stylesheets/_syntax.scss delete mode 100644 doc-src/content/stylesheets/syntax/_coderay.scss delete mode 100644 doc-src/content/stylesheets/syntax/_pygments.scss create mode 100644 doc-src/content/stylesheets/syntax/_theme_template.scss create mode 100644 doc-src/content/stylesheets/syntax/shCore.scss create mode 100644 doc-src/content/stylesheets/syntax/shCoreDefault.scss create mode 100644 doc-src/content/stylesheets/syntax/shThemeDefault.scss diff --git a/doc-src/Rules b/doc-src/Rules index 0e3d13c433..56d49d9f48 100644 --- a/doc-src/Rules +++ b/doc-src/Rules @@ -27,7 +27,7 @@ end compile '/examples/*/' do filter :haml, :ugly => true - filter :highlight if ENV['SYNTAX'] + filter :highlight layout 'example' end @@ -43,7 +43,7 @@ end compile '/reference/*/' do filter :haml, :ugly => true - filter :highlight if ENV['SYNTAX'] + filter :highlight layout item[:layout] || 'main' end diff --git a/doc-src/assets/javascripts/shAutoloader.js b/doc-src/assets/javascripts/shAutoloader.js new file mode 100644 index 0000000000..4e29bddecb --- /dev/null +++ b/doc-src/assets/javascripts/shAutoloader.js @@ -0,0 +1,17 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(2(){1 h=5;h.I=2(){2 n(c,a){4(1 d=0;d