Skip to content

Commit 7f79ff1

Browse files
authored
Merge pull request #178 from dynamsoft-docs/preview
update to internal commit 6066135c
2 parents 08acb7f + 2ee62f4 commit 7f79ff1

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11

22
.DS_Store
33
/.vs
4+
/.history

_plugins/custom_alerts.rb

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
module Jekyll
2+
class AlertsConverter < Converter
3+
4+
def matches(ext)
5+
ext =~ /^\.md|\.markdown$/i
6+
end
7+
8+
def output_ext(ext)
9+
".html"
10+
end
11+
12+
def convert(content)
13+
content.gsub(/^> \[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*(.*)/i) do
14+
type = $1.downcase
15+
text = $2.strip.gsub(/^>\s*/, "")
16+
<<~HTML
17+
<div class="blockquote-#{type}"></div>
18+
<blockquote>#{text}</blockquote>
19+
HTML
20+
end
21+
end
22+
end
23+
end

0 commit comments

Comments
 (0)