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:
authorMarcia Ramos <virtua.creative@gmail.com>2017-08-07 19:51:59 +0300
committerGabriel Mazetto <brodock@gmail.com>2018-10-31 17:50:22 +0300
commitc76c418e865ed93fcd9fd45105d8b87c3d76f5ce (patch)
tree81315067388fe620a02fee502c9c5dcc28301371 /lib/helpers
parent3fb1fc62dc4d461c041d9554c56e816a0c54caeb (diff)
add kramdown as markdown engine
Diffstat (limited to 'lib/helpers')
-rw-r--r--lib/helpers/redcarpet_render.rb27
1 files changed, 0 insertions, 27 deletions
diff --git a/lib/helpers/redcarpet_render.rb b/lib/helpers/redcarpet_render.rb
deleted file mode 100644
index 35f100eb..00000000
--- a/lib/helpers/redcarpet_render.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-require 'redcarpet'
-require 'rouge'
-require 'rouge/plugins/redcarpet'
-
-module Nanoc::Helpers
- module RedcarpetRender
- class HTML < Redcarpet::Render::HTML
- include Rouge::Plugins::Redcarpet
-
- def header(text, header_level)
- # https://github.com/cookpad/garage/blob/c817733e382c734eedba743e9103cd8a124f24eb/lib/garage/docs/anchor_building.rb#L24
- anchor = text.gsub(/\s+/, '-').gsub(/<\/?[^>]*>/, '').downcase
- # https://github.com/rails/rails/blob/e491b2c06329afb3c989261a2865d2a93c8b84b8/activesupport/lib/active_support/inflector/transliterate.rb#L86
- anchor.gsub!(/[^a-z0-9\-_]+/i, '-')
- anchor.gsub!(/39-/, '') # remove weird symbol https://gitlab.com/gitlab-com/gitlab-docs/issues/84
- anchor.squeeze!('-') # replace multiple dashes with one
- anchor.gsub!(/^-|-$/, '') # remove any first or last dashes
-
- %(<h#{header_level} id='#{anchor}'>#{text} <a class='anchor' href='##{anchor}'></a></h#{header_level}>)
- end
-
- def image(link, title, alt_text)
- %(<a target="_blank" href="#{link}"><img src="#{link}" title="#{title}" alt="#{alt_text}"/></a>)
- end
- end
- end
-end