extended-markdown-filter 0.4.6 → 0.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e569e5b9e033f4ea11723b2d3fc1fd6686f198d2
4
- data.tar.gz: 84df74f4cd5b2876eecd5ea183c6f2494138d6a8
3
+ metadata.gz: 5fbd677ca783661a274b905b28823a0f3caa7ab0
4
+ data.tar.gz: 01b74dc9163510f34cf772043b778b8b22e9c6f6
5
5
  SHA512:
6
- metadata.gz: 41188b4985ad1e114413660bb787639e9c0950cd81f31f8c36de14b6c72461ef07952b12727f501921c57b3582d5d6eae07d98ae3581918be9d814da6bc4f64d
7
- data.tar.gz: d3a04b1fa512dc65f96e03a8c520a99d034c400f0472c69bd5a08d06295f1ec9d005409102a3cb84dcfa590826e12e4749de498a40a3b80333fe2aa38b02eb8f
6
+ metadata.gz: 05317b1c16e27dbd2523980fa5861e8b7147a7b435144faf879ef25f0dd983284fb07c51dd3a2789b2eb00b9a5cc8213fb530c5deaa5824bd4d910315af68f79
7
+ data.tar.gz: e25e070dbac753840d2e9594aef9282ceebdf0bb3a515455d35e5a3c4e243b94aab8856ef6be2b5accf23b7c1afad4048f7aca65718db49eda830ed04245e896
data/.travis.yml CHANGED
@@ -1,4 +1,10 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.9.3
4
- - 2.0.0
3
+ - 2.0
4
+ - 2.1
5
+ - 2.2
6
+
7
+ sudo: false
8
+ cache: bundler
9
+ git:
10
+ depth: 10
data/README.md CHANGED
@@ -1,5 +1,4 @@
1
- extended-markdown-filter
2
- ====================
1
+ # extended-markdown-filter
3
2
 
4
3
  Extended Markdown filters for the [HTML::Pipeline](https://github.com/jch/html-pipeline).
5
4
 
@@ -27,7 +26,21 @@ The simplest way to do this is
27
26
  require 'extended-markdown-filter'
28
27
  ```
29
28
 
30
- Then just use the HTML pipeline normally.
29
+ Then just use the HTML pipeline normally. With Jekyll, this is meant to be used with another plugin in conjunction, https://github.com/gjtorikian/jekyll-html-pipeline.
30
+
31
+ A minimum config file might look like:
32
+ ``` yaml
33
+ gems:
34
+ - extended-markdown-filter
35
+ - jekyll-html-pipeline
36
+
37
+ markdown: HTMLPipeline
38
+ html_pipeline:
39
+ filters:
40
+ - "ExtendedMarkdownFilter"
41
+ context:
42
+ emf_use_blocks: true
43
+ ```
31
44
 
32
45
  ### Within Jekyll
33
46
 
@@ -78,12 +91,12 @@ You can create separate, priority-colored callouts with `{{#tip}}`, `{{#note}}`,
78
91
  Here's a hot tip: line two
79
92
 
80
93
  {{/tip}}
81
-
94
+
82
95
  {{#note}}
83
-
96
+
84
97
  You should probably know this! line one
85
98
  You should probably know this! line two
86
-
99
+
87
100
  {{/note}}
88
101
 
89
102
  {{#warning}}
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "extended-markdown-filter"
3
- spec.version = "0.4.6"
3
+ spec.version = "0.4.7"
4
4
  spec.authors = ["Garen Torikian"]
5
5
  spec.email = ["gjtorikian@gmail.com"]
6
6
  spec.summary = %q{Add extended markup syntax to the HTML::Pipeline}
@@ -1,12 +1,12 @@
1
1
  module Filters
2
2
  module PreFilter
3
3
  def format_command_line(text)
4
- text.gsub /\n?``` command-line(.+?)```/m do |block|
5
- block.gsub! /^``` command-line/, '<pre class="command-line">'
6
- block.gsub! /^```$/, "</pre>\n"
7
- block.gsub!(/^\$ (.+)$/) { %(<span class="command">#{$1.rstrip}</span>) }
8
- block.gsub!(/^(\# .+)$/) { %(<span class="comment">#{$1.rstrip}</span>) }
9
- block.gsub!(/^> (.+)$/) { %(<span class="output">#{$1.rstrip}</span>) }
4
+ text.gsub /\n?\s*``` command-line(.+?)```/m do |block|
5
+ block.gsub! /^\s*``` command-line/, '<pre class="command-line">'
6
+ block.gsub! /^\s*```$/, "</pre>\n"
7
+ block.gsub!(/^\s*\$ (.+)$/) { %(<span class="command">#{$1.rstrip}</span>) }
8
+ block.gsub!(/^\s*(\# .+)$/) { %(<span class="comment">#{$1.rstrip}</span>) }
9
+ block.gsub!(/^\s*> (.+)$/) { %(<span class="output">#{$1.rstrip}</span>) }
10
10
 
11
11
  block
12
12
  end
@@ -0,0 +1,6 @@
1
+ ``` command-line
2
+ $ git remote add origin https://github.com/<em>user</em>/<em>repo</em>.git
3
+ # Set a new remote
4
+ > origin https://github.com/user/repo.git
5
+ $ git remote add -f spoon-knife git@github.com:octocat/Spoon-Knife.git
6
+ ```
@@ -18,6 +18,19 @@ class HTML::Pipeline::ExtendedMarkdownFilterTest < Minitest::Test
18
18
  assert_equal 0, doc.css('.command-line a').size
19
19
  end
20
20
 
21
+ def test_command_line_indented
22
+ doc = ExtendedMarkdownFilter.to_document(fixture("command_line_indented.md"), {})
23
+ assert doc.kind_of?(HTML::Pipeline::DocumentFragment)
24
+
25
+ assert_equal 1, doc.css('pre').size
26
+ assert_equal 2, doc.css('span.command').size
27
+ assert_equal 1, doc.css('span.comment').size
28
+ assert_equal 2, doc.css('em').size
29
+ assert_equal 1, doc.css('span.output').size
30
+
31
+ assert_equal 0, doc.css('.command-line a').size
32
+ end
33
+
21
34
  def test_helper
22
35
  doc = ExtendedMarkdownFilter.to_document(fixture("helper.md"), {})
23
36
  assert doc.kind_of?(HTML::Pipeline::DocumentFragment)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: extended-markdown-filter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.6
4
+ version: 0.4.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen Torikian
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-17 00:00:00.000000000 Z
11
+ date: 2016-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: html-pipeline
@@ -123,6 +123,7 @@ files:
123
123
  - test/fixtures/block_octicon.md
124
124
  - test/fixtures/block_os_blocks.md
125
125
  - test/fixtures/command_line.md
126
+ - test/fixtures/command_line_indented.md
126
127
  - test/fixtures/helper.md
127
128
  - test/fixtures/intro.md
128
129
  - test/fixtures/octicon.md
@@ -160,6 +161,7 @@ test_files:
160
161
  - test/fixtures/block_octicon.md
161
162
  - test/fixtures/block_os_blocks.md
162
163
  - test/fixtures/command_line.md
164
+ - test/fixtures/command_line_indented.md
163
165
  - test/fixtures/helper.md
164
166
  - test/fixtures/intro.md
165
167
  - test/fixtures/octicon.md