diff options
author | Kamil TrzciĆski <ayufan@ayufan.eu> | 2021-04-23 13:28:02 +0300 |
---|---|---|
committer | Achilleas Pipinellis <axil@gitlab.com> | 2021-04-23 13:28:02 +0300 |
commit | 0937692dbb9b8a68b4cd4d8397676a0fd5b80230 (patch) | |
tree | 4660677b9bd99a54af1b9b67040a663c6c46fcf2 /lib | |
parent | fb7ce2e82d38f5a3367dcac9490ca71bad8cc312 (diff) |
Extends `docs.gitlab.com` with feature flags table
Diffstat (limited to 'lib')
-rw-r--r-- | lib/helpers/gitlab_kramdown.rb | 24 | ||||
-rw-r--r-- | lib/helpers_.rb | 1 |
2 files changed, 25 insertions, 0 deletions
diff --git a/lib/helpers/gitlab_kramdown.rb b/lib/helpers/gitlab_kramdown.rb new file mode 100644 index 00000000..f9235581 --- /dev/null +++ b/lib/helpers/gitlab_kramdown.rb @@ -0,0 +1,24 @@ +module Nanoc::Helpers + module GitLabKramdown + require 'kramdown' + def markdown(item, params = {}) + Nanoc::Filters::GitLabKramdown.new.run(item, { + input: 'GitlabKramdown', + syntax_highlighter: 'rouge', + syntax_highlighter_opts: { + # In kramdown 2.0, the plaintext parser was removed and replaced by the + # :guess_lang option: + # + # - https://github.com/gettalong/kramdown/blob/master/doc/news/release_2_0_0.page + # - https://github.com/gettalong/kramdown/pull/573 + guess_lang: true + }, + default_lang: 'Plain Text', + hard_wrap: false, + auto_ids: true, + toc_levels: 2..5, + with_toc: true + }) + end + end +end diff --git a/lib/helpers_.rb b/lib/helpers_.rb index 9a03d513..99849b77 100644 --- a/lib/helpers_.rb +++ b/lib/helpers_.rb @@ -7,3 +7,4 @@ include Nanoc::Helpers::VersionsDropdown include Nanoc::Helpers::IconsHelper include Nanoc::Helpers::ReadingTimeHelper include Nanoc::Helpers::Generic +include Nanoc::Helpers::GitLabKramdown |