madness 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -17,5 +17,10 @@ html
17
17
  script src="#{config.base_uri}/js/vendor/clipboard.min.js"
18
18
  script src="#{config.base_uri}/js/clipboard.js"
19
19
 
20
+ - if config.mermaid
21
+ script src="#{config.base_uri}/js/vendor/mermaid.min.js"
22
+ javascript:
23
+ mermaid.initialize({startOnLoad:true});
24
+
20
25
  body
21
26
  == yield
@@ -6,7 +6,7 @@ module Madness
6
6
  class Handler
7
7
  HANDLERS = {
8
8
  redcarpet: Redcarpet,
9
- pandoc: Pandoc,
9
+ pandoc: Pandoc,
10
10
  }
11
11
 
12
12
  attr_reader :selector
@@ -20,4 +20,4 @@ module Madness
20
20
  def handler_class = @handler_class ||= HANDLERS[selector] || HANDLERS.values.first
21
21
  end
22
22
  end
23
- end
23
+ end
@@ -6,7 +6,7 @@ module Madness
6
6
  include ServerHelper
7
7
 
8
8
  def render(text)
9
- PandocRuby.new(text, [{ from: :markdown, to: :html }], *options).convert
9
+ PandocRuby.new(text, [{ from: :gfm, to: :html }], *options).convert
10
10
  end
11
11
 
12
12
  private
@@ -14,6 +14,6 @@ module Madness
14
14
  def options
15
15
  @options ||= config.highlighter ? [] : :no_highlight
16
16
  end
17
- end
17
+ end
18
18
  end
19
- end
19
+ end
@@ -16,7 +16,7 @@ module Madness
16
16
  end
17
17
 
18
18
  def options
19
- @redcarpet_options ||= {
19
+ @options ||= {
20
20
  no_intra_emphasis: true,
21
21
  autolink: true,
22
22
  tables: true,
@@ -38,7 +38,6 @@ module Madness
38
38
  def handler_class
39
39
  config.highlighter ? HighlightRenderer : ::Redcarpet::Render::HTML
40
40
  end
41
-
42
41
  end
43
42
  end
44
- end
43
+ end
@@ -64,6 +64,7 @@ module Madness
64
64
  auto_nav: true,
65
65
  auto_toc: true,
66
66
  highlighter: true,
67
+ mermaid: false,
67
68
  copy_code: true,
68
69
  shortlinks: false,
69
70
  source_link: nil,
@@ -42,6 +42,10 @@ auto_toc: true
42
42
  # enable syntax highlighter for code snippets
43
43
  highlighter: true
44
44
 
45
+ # enable mermaid diagramming and charting
46
+ # put your diagram code inside <div class='mermaid'>...</div>
47
+ mermaid: false
48
+
45
49
  # enable the copy to clipboard icon for code snippets
46
50
  copy_code: true
47
51
 
@@ -1,3 +1,3 @@
1
1
  module Madness
2
- VERSION = '1.2.0'
2
+ VERSION = '1.2.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: madness
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danny Ben Shitrit
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-04-18 00:00:00.000000000 Z
11
+ date: 2024-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -94,6 +94,20 @@ dependencies:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: '1.0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: pandoc-ruby
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '2.1'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '2.1'
97
111
  - !ruby/object:Gem::Dependency
98
112
  name: puma
99
113
  requirement: !ruby/object:Gem::Requirement
@@ -142,20 +156,6 @@ dependencies:
142
156
  - - "~>"
143
157
  - !ruby/object:Gem::Version
144
158
  version: '3.5'
145
- - !ruby/object:Gem::Dependency
146
- name: pandoc-ruby
147
- requirement: !ruby/object:Gem::Requirement
148
- requirements:
149
- - - "~>"
150
- - !ruby/object:Gem::Version
151
- version: '2.1'
152
- type: :runtime
153
- prerelease: false
154
- version_requirements: !ruby/object:Gem::Requirement
155
- requirements:
156
- - - "~>"
157
- - !ruby/object:Gem::Version
158
- version: '2.1'
159
159
  - !ruby/object:Gem::Dependency
160
160
  name: requires
161
161
  requirement: !ruby/object:Gem::Requirement
@@ -243,6 +243,7 @@ files:
243
243
  - app/public/js/clipboard.js
244
244
  - app/public/js/vendor/clipboard.min.js
245
245
  - app/public/js/vendor/jquery.min.js
246
+ - app/public/js/vendor/mermaid.min.js
246
247
  - app/styles/_anchor.scss
247
248
  - app/styles/_breadcrumbs.scss
248
249
  - app/styles/_code.scss
@@ -328,7 +329,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
328
329
  - !ruby/object:Gem::Version
329
330
  version: '0'
330
331
  requirements: []
331
- rubygems_version: 3.5.7
332
+ rubygems_version: 3.5.11
332
333
  signing_key:
333
334
  specification_version: 4
334
335
  summary: Instant Markdown Server