Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConnor Shea <connor.james.shea@gmail.com>2016-10-28 01:51:15 +0300
committerConnor Shea <connor.james.shea@gmail.com>2016-10-28 01:51:15 +0300
commitc6bcba9ce93e75326bde811b622db53aa36508ef (patch)
tree67fc94efe399056e6636c83a42e5fbb09fbeb1fc
parent842318016d6d80d7f2ec600db24410bcdda47603 (diff)
Use Redcarpet instead of Kramdown, get Rouge syntax highlighting working for it.
-rw-r--r--Gemfile2
-rw-r--r--Gemfile.lock4
-rw-r--r--Rules16
-rw-r--r--content/assets/stylesheets/highlight.scss19
-rw-r--r--lib/helpers_.rb8
5 files changed, 32 insertions, 17 deletions
diff --git a/Gemfile b/Gemfile
index a2fb5a44..0ce9b5fa 100644
--- a/Gemfile
+++ b/Gemfile
@@ -4,7 +4,7 @@ ruby '2.3.1'
gem 'nanoc', '~> 4.0'
gem 'adsf'
gem 'sass'
-gem 'kramdown'
+gem 'redcarpet'
gem 'rouge', '~> 1.11'
gem 'rake', '~> 11.3'
diff --git a/Gemfile.lock b/Gemfile.lock
index e010ab25..b2a7f8a3 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -27,7 +27,6 @@ GEM
nanoc (~> 4.0)
hamster (3.0.0)
concurrent-ruby (~> 1.0)
- kramdown (1.12.0)
listen (3.1.5)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
@@ -56,6 +55,7 @@ GEM
rb-fsevent (0.9.8)
rb-inotify (0.9.7)
ffi (>= 0.5.0)
+ redcarpet (3.3.4)
ref (2.0.0)
rouge (1.11.1)
ruby_dep (1.5.0)
@@ -71,10 +71,10 @@ DEPENDENCIES
adsf
builder
guard-nanoc
- kramdown
nanoc (~> 4.0)
nokogiri (~> 1.6.8)
rake (~> 11.3)
+ redcarpet
rouge (~> 1.11)
sass
diff --git a/Rules b/Rules
index 4cd78c89..c10ac443 100644
--- a/Rules
+++ b/Rules
@@ -21,10 +21,18 @@ compile '/**/*.html' do
end
compile '/**/*.md' do
- filter :kramdown,
- input: 'GFM',
- syntax_highlighter: 'rouge',
- hard_wrap: false
+ filter :redcarpet,
+ renderer: HTML,
+ options: {
+ fenced_code_blocks: true,
+ footnotes: true,
+ lax_spacing: true,
+ no_intra_emphasis: true,
+ space_after_headers: true,
+ strikethrough: true,
+ superscript: true,
+ tables: true
+ }
layout '/default.*'
diff --git a/content/assets/stylesheets/highlight.scss b/content/assets/stylesheets/highlight.scss
index e2a58712..b2ec4d60 100644
--- a/content/assets/stylesheets/highlight.scss
+++ b/content/assets/stylesheets/highlight.scss
@@ -1,17 +1,16 @@
/* https://github.com/aahan/pygments-github-style */
-.highlighter-rouge {
- pre {
- padding: 10px 15px;
- border-radius: 5px;
- border: 1px solid #e5e5e5;
- overflow-x: auto;
- margin: 20px 0;
- }
+pre.highlight {
+ padding: 10px 15px;
+ border-radius: 5px;
+ border: 1px solid #e5e5e5;
+ overflow-x: auto;
+ margin: 20px 0;
// Code itself
- pre.code {
- border-color: #f0f0f0;
+ code {
+ border-color: transparent;
+ color: inherit;
background-color: transparent;
}
diff --git a/lib/helpers_.rb b/lib/helpers_.rb
index 8b95e3ef..270ec69a 100644
--- a/lib/helpers_.rb
+++ b/lib/helpers_.rb
@@ -1,3 +1,11 @@
include Nanoc::Helpers::LinkTo
include Nanoc::Helpers::XMLSitemap
include Nanoc::Helpers::ChildParentBetter
+
+require 'redcarpet'
+require 'rouge'
+require 'rouge/plugins/redcarpet'
+
+class HTML < Redcarpet::Render::HTML
+ include Rouge::Plugins::Redcarpet
+end