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

gitlab_kramdown.rb « helpers « lib - gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c409a579e11cd413e01aa980c56189d31d82f4cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# frozen_string_literal: true

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