You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by db...@apache.org on 2015/09/23 21:46:06 UTC

[3/3] docs commit: Adding syntax highlighting code. Switching to redcarpet for Markdown because Kramdown willingly doesn't comply with GFM (https://github.com/jekyll/jekyll/issues/2711).

Adding syntax highlighting code. Switching to redcarpet for Markdown because Kramdown willingly doesn't comply with GFM (https://github.com/jekyll/jekyll/issues/2711).


Project: http://git-wip-us.apache.org/repos/asf/cordova-docs/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-docs/commit/da348778
Tree: http://git-wip-us.apache.org/repos/asf/cordova-docs/tree/da348778
Diff: http://git-wip-us.apache.org/repos/asf/cordova-docs/diff/da348778

Branch: refs/heads/cordova-website
Commit: da3487783f836c63ad6a47030e31754b2bb9ad9c
Parents: b035565
Author: Dmitry Blotsky <dm...@gmail.com>
Authored: Tue Sep 22 19:31:26 2015 -0700
Committer: Dmitry Blotsky <dm...@gmail.com>
Committed: Wed Sep 23 12:44:41 2015 -0700

----------------------------------------------------------------------
 Gemfile                      |  3 +--
 _config.yml                  | 18 +++++++++++++++++-
 www/_includes/footer.html    |  1 +
 www/_includes/head.html      |  1 +
 www/static/css-src/main.scss | 12 ++++++++----
 www/static/js/index.js       |  7 +++++++
 6 files changed, 35 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/da348778/Gemfile
----------------------------------------------------------------------
diff --git a/Gemfile b/Gemfile
index 9faeae8..400919c 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,4 +1,3 @@
 source 'https://rubygems.org'
 gem 'jekyll', '>= 2.5.3'
-gem 'kramdown', '>= 1.8.0'
-gem 'rouge', '>= 1.5.0'
+gem 'redcarpet'

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/da348778/_config.yml
----------------------------------------------------------------------
diff --git a/_config.yml b/_config.yml
index 842cf5b..eefb5b8 100644
--- a/_config.yml
+++ b/_config.yml
@@ -28,7 +28,23 @@ keep_files: [".git", ".svn", "wiki-images", "images", "downloads"]
 lsi:  false # don't produce an index for related posts
 safe: true  # disables plugins
 
-markdown: kramdown
+markdown: redcarpet
+
+redcarpet:
+    extensions:
+
+        # this adds the ".prettyprint" class to <code> and <pre> tags
+        - prettify
+
+        # this enables code blocks denoted by backticks, like in GFM
+        # NOTE:
+        #      this is turned on by default by Jekyll, but is still
+        #      specified explicitly here in case the defaults change
+        - fenced_code_blocks
+
+        # this allows code blocks and HTML blocks to
+        # not have a leading or trailing newline
+        - lax_spacing
 
 kramdown:
     input: GFM

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/da348778/www/_includes/footer.html
----------------------------------------------------------------------
diff --git a/www/_includes/footer.html b/www/_includes/footer.html
index 06ecd28..6a7828b 100644
--- a/www/_includes/footer.html
+++ b/www/_includes/footer.html
@@ -66,5 +66,6 @@
     </div>
 </footer>
 
+<script defer type="text/javascript" src="{{ site.baseurl }}/static/js/lib/prettify/prettify.js"></script>
 <script defer type="text/javascript" src="{{ site.baseurl }}/static/js/index.js"></script>
 <script defer type="text/javascript" src="{{ site.baseurl }}/static/js/twitter.js"></script>

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/da348778/www/_includes/head.html
----------------------------------------------------------------------
diff --git a/www/_includes/head.html b/www/_includes/head.html
index adfce81..85c8816 100644
--- a/www/_includes/head.html
+++ b/www/_includes/head.html
@@ -23,6 +23,7 @@
 
     <!-- CSS -->
     <link rel="stylesheet" type="text/css" href="{{ site.baseurl }}/static/css/main.css">
+    <link rel="stylesheet" type="text/css" href="{{ site.baseurl }}/static/js/lib/prettify/prettify.css">
 
     <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
     <!--[if lt IE 9]>

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/da348778/www/static/css-src/main.scss
----------------------------------------------------------------------
diff --git a/www/static/css-src/main.scss b/www/static/css-src/main.scss
index 99920ed..7aa7ec2 100644
--- a/www/static/css-src/main.scss
+++ b/www/static/css-src/main.scss
@@ -125,11 +125,15 @@ h2 {
 	background-color: $brand-primary;
 }
 
-/*
-code {
-    color: rgb(133, 133, 133);
+/* fixing prettyprint formatting */
+pre.prettyprint {
+    padding: 10px !important;
+    font-size: 13px !important;
+    border: 1px solid #cccccc !important;
+}
+code.prettyprint {
+    border: none !important;
 }
-*/
 
 @import 'home';
 @import 'blog';

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/da348778/www/static/js/index.js
----------------------------------------------------------------------
diff --git a/www/static/js/index.js b/www/static/js/index.js
index c23b4e3..d0176ce 100644
--- a/www/static/js/index.js
+++ b/www/static/js/index.js
@@ -167,4 +167,11 @@ $(document).ready(function () {
     $("#jira-search-box").on("keypress", function searchKeypressEventHandler (e) {
         if(e.keyCode == 13) submitJiraSearchForm();
     });
+
+    // add prettyprint class to code blocks for prettify.js
+    var all_code = $('pre');
+    all_code.attr('class', 'prettyprint');
+
+    // run syntax highlighter
+    prettyPrint();
 });


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org