yard-redcarpet-ext 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES.md +6 -0
- data/README.md +13 -3
- data/lib/yard/redcarpet/ext.rb +15 -3
- data/lib/yard/redcarpet/ext/version.rb +1 -1
- metadata +5 -4
data/CHANGES.md
ADDED
data/README.md
CHANGED
@@ -8,7 +8,9 @@ Enables Redcarpet extensions for YARD.
|
|
8
8
|
|
9
9
|
Add this line to your application's Gemfile:
|
10
10
|
|
11
|
-
|
11
|
+
```ruby
|
12
|
+
gem 'yard-redcarpet-ext'
|
13
|
+
```
|
12
14
|
|
13
15
|
And then execute:
|
14
16
|
|
@@ -22,12 +24,20 @@ Or install it yourself as:
|
|
22
24
|
|
23
25
|
Add `--plugin redcarpet-ext` option to your `.yardopts` or call `yard` with this option.
|
24
26
|
|
25
|
-
Create new file named `.yard_redcarpet_ext` with all needed Redcarpet extensions like tables separated by comma or newline.
|
27
|
+
Create new file named `.yard_redcarpet_ext` with all needed Redcarpet extensions like `tables` separated by comma or newline.
|
26
28
|
|
27
|
-
Another way to specify extensions is setting of YARD_REDCARPET_EXTS environment variable. Extensions should be separated by comma.
|
29
|
+
Another way to specify extensions is setting of `YARD_REDCARPET_EXTS` environment variable. Extensions should be separated by comma.
|
28
30
|
|
29
31
|
You must have `gem 'yard-redcarpet-ext'` string in your Gemfile or development dependency in gemspec if it exists.
|
30
32
|
|
33
|
+
Allowed Redcarpet extensions listed at: https://github.com/vmg/redcarpet#and-its-like-really-simple-to-use
|
34
|
+
|
35
|
+
By default `yard-redcarpet-ext` enable these ones: `no_intraemphasis`, `gh_blockcode`, `fenced_code`, `autolink` and `tables`.
|
36
|
+
|
37
|
+
### Removing of extensions from the list
|
38
|
+
|
39
|
+
Simply add extension to be removed to the list prefixed by minus sign, like `-tables`.
|
40
|
+
|
31
41
|
## Contributing
|
32
42
|
|
33
43
|
1. Fork it
|
data/lib/yard/redcarpet/ext.rb
CHANGED
@@ -13,26 +13,38 @@ module YARD
|
|
13
13
|
gh_blockcode
|
14
14
|
fenced_code
|
15
15
|
autolink
|
16
|
+
tables
|
16
17
|
].freeze
|
17
18
|
|
18
19
|
def self.exts_from_config
|
19
20
|
return [] unless File.readable?(CONFIG_FILE)
|
20
|
-
IO.read(CONFIG_FILE).split(/(?:\s*,\s*)|\n/)
|
21
|
+
IO.read(CONFIG_FILE).split(/(?:\s*,\s*)|\n/)
|
21
22
|
end
|
22
23
|
|
23
24
|
def self.exts_from_env
|
24
25
|
val = ENV[ENV_VAR]
|
25
26
|
return [] unless val
|
26
|
-
val.split(/\s*,\s*/)
|
27
|
+
val.split(/\s*,\s*/)
|
27
28
|
end
|
28
29
|
|
29
30
|
def self.redcarpet_exts
|
30
31
|
@redcarpet_exts ||= begin
|
31
32
|
exts = []
|
33
|
+
exts_to_remove = []
|
32
34
|
exts += DEFAULT_REDCARPET_EXTS
|
33
35
|
exts += exts_from_config
|
34
36
|
exts += exts_from_env
|
35
|
-
exts.uniq.
|
37
|
+
exts = exts.uniq.select { |ext| !ext.empty? }
|
38
|
+
exts.each do |ext|
|
39
|
+
if ext =~ /\A\-(.+)\z/
|
40
|
+
exts_to_remove << $1
|
41
|
+
end
|
42
|
+
end
|
43
|
+
exts.delete_if { |elem| elem =~ /\A\-/ }
|
44
|
+
exts_to_remove.each do |ext_to_remove|
|
45
|
+
exts.delete_if { |elem| elem == ext_to_remove }
|
46
|
+
end
|
47
|
+
exts.map { |ext| ext.to_sym }
|
36
48
|
end
|
37
49
|
end
|
38
50
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yard-redcarpet-ext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-10-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: yard
|
@@ -67,6 +67,7 @@ extensions: []
|
|
67
67
|
extra_rdoc_files: []
|
68
68
|
files:
|
69
69
|
- .gitignore
|
70
|
+
- CHANGES.md
|
70
71
|
- Gemfile
|
71
72
|
- LICENSE
|
72
73
|
- README.md
|
@@ -90,7 +91,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
90
91
|
version: '0'
|
91
92
|
segments:
|
92
93
|
- 0
|
93
|
-
hash:
|
94
|
+
hash: 138193709688501473
|
94
95
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
95
96
|
none: false
|
96
97
|
requirements:
|
@@ -99,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
99
100
|
version: '0'
|
100
101
|
segments:
|
101
102
|
- 0
|
102
|
-
hash:
|
103
|
+
hash: 138193709688501473
|
103
104
|
requirements: []
|
104
105
|
rubyforge_project:
|
105
106
|
rubygems_version: 1.8.24
|