github-markdown-preview 3.0.0 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2ab69bdfd011f36027d804f69500cad250584537
4
- data.tar.gz: 4f3785a46bec4b000c450bcb77657f27da86fb50
3
+ metadata.gz: fddee4db6c56bdf780f90d4660204917dcf583e2
4
+ data.tar.gz: be0534e36ac9d885bec975a5245cbb3273763dba
5
5
  SHA512:
6
- metadata.gz: 527beb16d182a4754d1569398b254a859526040d7aa6d9ae6f8ea23560ba5d9d6bc2e294c6b29f2e3fb51103305a3b746d437301516f4f3163b84d9242b3d6a6
7
- data.tar.gz: 04f085cba9b66e37bad2b1d1a207d66e49782d78bc0e6dac027d45337dd8a1799277d021d7577e3e1af19c89ba59b6b852e24e68b7fb310b52486a592d609cb3
6
+ metadata.gz: 2ec8668c6455da1113937d57adc3d877310419cde82a881242f28b64a2e1a123b01ceff0de3cef98d703f7fa649d356b06f6cb2794f3c946049ec6cae178f356
7
+ data.tar.gz: 287ecf069ad8e5ab61a61f6664a6665ba494113e54bccb53bcab238af0c28645bc244adb23fa42699916058630ca7b126f464791211058ead036e7eacc12a1b6
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## v3.1.0
4
+ * Add anchor links in default mode [#30](https://github.com/dmarcotte/github-markdown-preview/pull/30), [#30](https://github.com/dmarcotte/github-markdown-preview/pull/30)
5
+
3
6
  ## v3.0.0
4
7
  * Render task lists for readmes [#25](https://github.com/dmarcotte/github-markdown-preview/pull/25) ([Github announcement](https://github.com/blog/1825-task-lists-in-all-markdown-documents))
5
8
  * **Breaking changes:**
@@ -88,6 +88,8 @@ module GithubMarkdownPreview
88
88
 
89
89
  if options[:comment_mode]
90
90
  filters << HTML::Pipeline::MentionFilter
91
+ else
92
+ filters << HTML::Pipeline::TableOfContentsFilter
91
93
  end
92
94
 
93
95
  filters
@@ -173,9 +175,21 @@ module GithubMarkdownPreview
173
175
  .readme-content {
174
176
  width: #{@preview_width}px;
175
177
  }
178
+
179
+ /* hack in an anchor icon */
180
+ .markdown-body h1:hover a.anchor, .markdown-body h2:hover a.anchor, .markdown-body h3:hover a.anchor, .markdown-body h4:hover a.anchor, .markdown-body h5:hover a.anchor, .markdown-body h6:hover a.anchor {
181
+ padding: 8px 13px;
182
+ margin: 0px 0px 12px -27px;
183
+ background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABsAAAAdCAIAAADU74AfAAAYHWlDQ1BJQ0MgUHJvZmlsZQAAWAmtWWdYFEuz7pmNwC45ZyTnnCXnnKOoLDmDS0YJIiJJAQmigCgggigYSSIgiCgiSYKiIAoKKCoGQJLcgaPnnO/57v1353lm5t3qt6urq3p6pmoBYL9NCgsLgmkBCA6JINsa6fI6u7jy4qYABDCAgJw8JM/wMB1ra3Pwfx4rYwgbOZ5J7uj6P2n/ewOdl3e4JwCQNdLs4RXuGYzg2wCgmjzDyBEAYHb0CURHhO3gHAQzkhEDEVy5g33/wk072OMv3LfLsbfVQzjTAOAJJBLZFwDiIiLnjfL0RfRQEwDA0od4+Ycg3XgRrOnpR/ICgN0d4UgEB4fu4CwEi3j8S4/vvzCJ5PG3ThLJ92/811yQnsjA+v7hYUGk2N0f/5+X4KBIxF+7BzdyJYQH2pkhd2bEbzGeJAM7BLMi+JSft4n5b3lVWISu7W95q3+EiT2CGRHOiF+kscNvPB8Z6KCDYE5EvhkYarbDR/wEs4Z4WFohmB7BAp7heojvd8aCleL87J1+c8y9vPUNEIysItiZHGr7h+8XHmX3Rx4X56dn+YcfQDLdiTc1ws8gkRG0aw9c5B1ktDPuHkR+NSzCesfOnbH6Q4Isf88FnvUhG+5wduTr3uG7892xzS/Cz94YkSM2o2gjyPY7HGSOKE4ff0MTBCO2oWT8yMZ/5NphQbtrGumLsidH2u74QQDBPt4hDjs+3JFneJH0d3yL+ARVAgwBCZCBN/AAIWAB8AJzoAf0f195EXkIIvM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Dp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJYTVAgQ29yZSA1LjEuMiI+CiAgIDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOmV4aWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vZXhpZi8xLjAvIj4KICAgICAgICAgPGV4aWY6UGl4ZWxYRGltZW5zaW9uPjI3PC9leGlmOlBpeGVsWERpbWVuc2lvbj4KICAgICAgICAgPGV4aWY6UGl4ZWxZRGltZW5zaW9uPjI5PC9leGlmOlBpeGVsWURpbWVuc2lvbj4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgIDwvcmRmOlJERj4KPC94OnhtcG1ldGE+Ck5zsgcAAAEqSURBVEgN7VS7joNADEz4AR6ClpI/gQIJGgqgpqRDfCYFlLzhB2jo4YazsiKrKHe6rK7CBRqvxyPveMV93/eb0JCEqh1il6IYSy8fLx//7sC/vJ6+7+M41jTt/ghVVcMwrOsak/u+jxIIoL2+CP5m56iqyjCMl1QIFUXRNA1VQQP53Ev4xh2laYoGz/OGYWClaZqCIMB5kiQ4RAkEpCAzDgO8omVZoOKCxJBlGek4jvM8A5imSefkAMhMiIEfNqPrOoQkSdq2DWBZFnzfB69o2zYa8jzHXACO4+CbZRmWhCnWdUWKEggARAZ4CjYtgfNmsM2yLGnMp57v5LebgW7XdVEU4cW4rou0bVs8HUVRmChKIIDGTUPpcRdGFQJ4Hz8XvRQ/9/BQEO/jF3oLKusHZ04pAAAAAElFTkSuQmCC')
184
+ no-repeat
185
+ left center;
186
+ }
187
+ .markdown-body h1:hover a.anchor .octicon-link, .markdown-body h2:hover a.anchor .octicon-link, .markdown-body h3:hover a.anchor .octicon-link, .markdown-body h4:hover a.anchor .octicon-link, .markdown-body h5:hover a.anchor .octicon-link, .markdown-body h6:hover a.anchor .octicon-link {
188
+ display: none;
189
+ }
176
190
  </style>
177
191
  </head>
178
- <body class="markdown-body" style="padding:20px;">
192
+ <body class="markdown-body" style="padding:10px 40px;">
179
193
  <div class="readme-content">
180
194
  #{preview_html}
181
195
  </div>
@@ -1,3 +1,3 @@
1
1
  module GithubMarkdownPreview
2
- VERSION = '3.0.0'
2
+ VERSION = '3.1.0'
3
3
  end
@@ -46,17 +46,17 @@ class TestHtmlPreview < Minitest::Test
46
46
  end
47
47
 
48
48
  def test_create_preview_on_init
49
- write(@source_file_path, '## foo')
49
+ write(@source_file_path, 'foo')
50
50
  markdown_preview = @ghp.new( @source_file_path )
51
- assert_equal markdown_preview.wrap_preview('<h2>foo</h2>'),
51
+ assert_equal markdown_preview.wrap_preview('<p>foo</p>'),
52
52
  read(markdown_preview.preview_file),
53
53
  'Preview should be correct on initialization'
54
54
  end
55
55
 
56
56
  def test_word_immediately_after_hash
57
- write(@source_file_path, '#foo')
57
+ write(@source_file_path, 'foo')
58
58
  markdown_preview = @ghp.new( @source_file_path )
59
- assert_equal markdown_preview.wrap_preview('<h1>foo</h1>'),
59
+ assert_equal markdown_preview.wrap_preview('<p>foo</p>'),
60
60
  read(markdown_preview.preview_file),
61
61
  'Preview should render #foo as a header'
62
62
  end
@@ -69,6 +69,22 @@ class TestHtmlPreview < Minitest::Test
69
69
  'Preview should render #foo directly'
70
70
  end
71
71
 
72
+ def test_default_mode_anchors
73
+ write(@source_file_path, "# foo\n## bar")
74
+ markdown_preview = @ghp.new( @source_file_path )
75
+ assert_equal markdown_preview.wrap_preview("<h1>\n<a name=\"foo\" class=\"anchor\" href=\"#foo\"><span class=\"octicon octicon-link\"></span></a>foo</h1>\n\n<h2>\n<a name=\"bar\" class=\"anchor\" href=\"#bar\"><span class=\"octicon octicon-link\"></span></a>bar</h2>"),
76
+ read(markdown_preview.preview_file),
77
+ 'Should contain anchor link markup in default mode'
78
+ end
79
+
80
+ def test_comment_mode_anchors
81
+ write(@source_file_path, "# foo\n## bar")
82
+ markdown_preview = @ghp.new( @source_file_path, { :comment_mode => true } )
83
+ assert_equal markdown_preview.wrap_preview("<h1>foo</h1>\n\n<h2>bar</h2>"),
84
+ read(markdown_preview.preview_file),
85
+ 'Should NOT contain anchor link markup in comment mode'
86
+ end
87
+
72
88
  def test_default_mode_task_lists
73
89
  write(@source_file_path, '- [ ] task')
74
90
  markdown_preview = @ghp.new( @source_file_path )
@@ -118,9 +134,9 @@ class TestHtmlPreview < Minitest::Test
118
134
  end
119
135
 
120
136
  def test_wrapper_markup_included
121
- write(@source_file_path, '## foo')
137
+ write(@source_file_path, 'foo')
122
138
  markdown_preview = @ghp.new( @source_file_path )
123
- assert_equal markdown_preview.wrap_preview("<h2>foo</h2>"),
139
+ assert_equal markdown_preview.wrap_preview("<p>foo</p>"),
124
140
  read(markdown_preview.preview_file),
125
141
  'Wrapper markup should be in preview file'
126
142
  end
@@ -145,15 +161,15 @@ class TestHtmlPreview < Minitest::Test
145
161
  end
146
162
 
147
163
  def test_update_preview
148
- write(@source_file_path, '## foo')
164
+ write(@source_file_path, 'foo')
149
165
  markdown_preview = @ghp.new( @source_file_path )
150
- assert_equal markdown_preview.wrap_preview('<h2>foo</h2>'),
166
+ assert_equal markdown_preview.wrap_preview('<p>foo</p>'),
151
167
  read(markdown_preview.preview_file),
152
168
  'Preview should be initially rendered correctly'
153
169
 
154
- write(@source_file_path, '## foo bar')
170
+ write(@source_file_path, 'foo bar')
155
171
  markdown_preview.update
156
- assert_equal markdown_preview.wrap_preview('<h2>foo bar</h2>'),
172
+ assert_equal markdown_preview.wrap_preview('<p>foo bar</p>'),
157
173
  read(markdown_preview.preview_file),
158
174
  'Preview should be updated correctly'
159
175
  end
@@ -192,20 +208,20 @@ class TestHtmlPreview < Minitest::Test
192
208
  end
193
209
 
194
210
  def test_watch_source_file
195
- write(@source_file_path, '## foo')
211
+ write(@source_file_path, 'foo')
196
212
  markdown_preview = @ghp.new( @source_file_path )
197
213
  updated_by_watch = false
198
214
  markdown_preview.on_update { updated_by_watch = true }
199
215
  markdown_preview.watch
200
216
 
201
217
  wait_for_async_operation {
202
- write(@source_file_path, '## foo bar')
218
+ write(@source_file_path, 'foo bar')
203
219
  updated_by_watch
204
220
  }
205
221
 
206
222
  markdown_preview.end_watch
207
223
 
208
- assert_equal markdown_preview.wrap_preview('<h2>foo bar</h2>'),
224
+ assert_equal markdown_preview.wrap_preview('<p>foo bar</p>'),
209
225
  read(markdown_preview.preview_file)
210
226
  'Preview file should be updated correctly by file watcher'
211
227
  end
@@ -226,12 +242,12 @@ class TestHtmlPreview < Minitest::Test
226
242
  end
227
243
 
228
244
  def test_custom_preview_file
229
- write(@source_file_path, '## foo')
245
+ write(@source_file_path, 'foo')
230
246
  custom_preview = File.join(Dir.tmpdir, 'custom_preview.html')
231
247
  markdown_preview = @ghp.new( @source_file_path, { :preview_file => custom_preview} )
232
248
  assert_equal custom_preview,
233
249
  markdown_preview.preview_file
234
- assert_equal markdown_preview.wrap_preview('<h2>foo</h2>'),
250
+ assert_equal markdown_preview.wrap_preview("<p>foo</p>"),
235
251
  read(markdown_preview.preview_file),
236
252
  'Should write to the custom preview file'
237
253
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: github-markdown-preview
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Marcotte
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-04 00:00:00.000000000 Z
11
+ date: 2014-05-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: listen