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
path: root/lib
diff options
context:
space:
mode:
authorSuzanne Selhorn <sselhorn@gitlab.com>2021-08-05 04:02:16 +0300
committerEvan Read <eread@gitlab.com>2021-08-26 02:00:07 +0300
commit8a05bc3c3cdde29be983075fb1a3556df7ee4722 (patch)
tree9fa18339127ca7017b6e2ecea5882d434be63cd1 /lib
parent10f7b5a382067f7282630ee2960c19798c9a9223 (diff)
Text box for marketing content
Diffstat (limited to 'lib')
-rw-r--r--lib/filters/admonition.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/filters/admonition.rb b/lib/filters/admonition.rb
index b5040bbf..b55620b9 100644
--- a/lib/filters/admonition.rb
+++ b/lib/filters/admonition.rb
@@ -5,13 +5,15 @@ class AdmonitionFilter < Nanoc::Filter
BOOTSTRAP_MAPPING = {
'note' => 'info',
'warning' => 'warning',
- 'flag' => 'flag'
+ 'flag' => 'flag',
+ 'info' => 'info'
}.freeze
GITLAB_SVGS_MAPPING = {
'note' => 'information-o',
'warning' => 'warning',
- 'flag' => 'flag'
+ 'flag' => 'flag',
+ 'info' => 'tanuki'
}.freeze
def run(content, params = {})
@@ -20,7 +22,7 @@ class AdmonitionFilter < Nanoc::Filter
doc = Nokogiri::HTML.fragment(content.dup)
doc.css('p').each do |para|
content = para.inner_html
- match = content.match(/\A(?<type>NOTE|WARNING|FLAG):\s?(?<content>.*)\Z/m)
+ match = content.match(/\A(?<type>NOTE|WARNING|FLAG|INFO):\s?(?<content>.*)\Z/m)
next unless match
new_content = generate(match[:type].downcase, match[:content])