asciidoctor-jenkins-extensions 0.4.0 → 0.8.0
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 +5 -5
- data/asciidoctor-jenkins-extensions.gemspec +2 -2
- data/lib/asciidoctor/jenkins/extensions/author-link.rb +24 -0
- data/lib/asciidoctor/jenkins/extensions/javadoc-link.rb +49 -11
- data/lib/asciidoctor/jenkins/extensions/jep-link.rb +23 -0
- data/lib/asciidoctor/jenkins/extensions/jira-link.rb +30 -0
- data/lib/asciidoctor/jenkins/extensions/security-link.rb +36 -0
- data/lib/asciidoctor/jenkins/extensions/version.rb +1 -1
- metadata +11 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 44db75a4df011538a44e50cbdc49212d4f82f8a8b8ce781994edfca135ba1759
|
4
|
+
data.tar.gz: 761ef5559a64cc161b9bf7cae7270a0fcfe089db18d911c7109f26040c8152aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d015413168e06e810655ad5095056ed50cebd946526925cdcf9578add61eb53ee28d40acf2a8866c135898dcdd0ae2b5b9fbcdf59377601a9640182937924bb
|
7
|
+
data.tar.gz: f84b081cb1d5162d2230ebfadf588d52050ff908e9fdfcd806f2a23eebf06abd9028fd9db1e52245bc75aa4a00d958461df148e1a1a3e5796e22c142974b6bb9
|
@@ -26,11 +26,11 @@ formatting in Jenkins-related content.
|
|
26
26
|
spec.require_paths = ["lib"]
|
27
27
|
|
28
28
|
|
29
|
-
spec.add_dependency 'asciidoctor', '
|
29
|
+
spec.add_dependency 'asciidoctor', '>= 1.5.5'
|
30
30
|
spec.add_dependency 'coderay', '~> 1.1.1'
|
31
31
|
spec.add_dependency 'colorize', '~> 0.8.1'
|
32
32
|
|
33
|
-
spec.add_development_dependency "bundler", "~>
|
33
|
+
spec.add_development_dependency "bundler", "~> 2.0"
|
34
34
|
spec.add_development_dependency "rake", "~> 10.0"
|
35
35
|
spec.add_development_dependency "rspec"
|
36
36
|
spec.add_development_dependency "rspec-its"
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'asciidoctor'
|
2
|
+
require 'asciidoctor/extensions'
|
3
|
+
|
4
|
+
#
|
5
|
+
# Usage:
|
6
|
+
# author:timja[Tim Jacomb]
|
7
|
+
# author:timja[]
|
8
|
+
#
|
9
|
+
Asciidoctor::Extensions.register do
|
10
|
+
inline_macro do
|
11
|
+
named :author
|
12
|
+
name_positional_attributes 'label'
|
13
|
+
|
14
|
+
process do |parent, target, attrs|
|
15
|
+
if attrs['label']
|
16
|
+
label = %(#{attrs['label']})
|
17
|
+
else
|
18
|
+
label = %(#{target})
|
19
|
+
end
|
20
|
+
target = %(/blog/authors/#{target})
|
21
|
+
(create_anchor parent, label, type: :link, target: target).render
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -20,6 +20,14 @@ require 'asciidoctor/extensions'
|
|
20
20
|
# jenkinsdoc:git:hudson.plugins.git.GitSCM[some label]
|
21
21
|
# jenkinsdoc:git:hudson.plugins.git.GitSCM#anchor[]
|
22
22
|
# jenkinsdoc:git:hudson.plugins.git.GitSCM#anchor[some label]
|
23
|
+
#
|
24
|
+
#
|
25
|
+
# For component Javadoc:
|
26
|
+
#
|
27
|
+
# jenkinsdoc:component:remoting:hudson.remoting.Channel[]
|
28
|
+
# jenkinsdoc:component:remoting:hudson.remoting.Channel[some label]
|
29
|
+
# jenkinsdoc:component:remoting:hudson.remoting.Channel#anchor[]
|
30
|
+
# jenkinsdoc:component:remoting:hudson.remoting.Channel#anchor[some label]
|
23
31
|
|
24
32
|
Asciidoctor::Extensions.register do
|
25
33
|
inline_macro do
|
@@ -29,8 +37,13 @@ Asciidoctor::Extensions.register do
|
|
29
37
|
process do |parent, target, attrs|
|
30
38
|
|
31
39
|
if target.include? ":"
|
32
|
-
parts = target.split(':',
|
33
|
-
|
40
|
+
parts = target.split(':', 3)
|
41
|
+
|
42
|
+
if parts.first == "component"
|
43
|
+
component = parts[1]
|
44
|
+
else
|
45
|
+
plugin = parts.first
|
46
|
+
end
|
34
47
|
target = parts.last
|
35
48
|
end
|
36
49
|
classname = label = title = target
|
@@ -43,6 +56,13 @@ Asciidoctor::Extensions.register do
|
|
43
56
|
classname.split('.').each do |part|
|
44
57
|
if is_package && /[[:lower:]]/.match(part[0])
|
45
58
|
package_parts.push(part)
|
59
|
+
elsif match = /(.*)#/.match(part)
|
60
|
+
class_part = match.captures
|
61
|
+
simpleclass_parts.push(class_part)
|
62
|
+
is_package = false
|
63
|
+
|
64
|
+
# escape once fragment has been found, required for complex fragments that contain a '.'
|
65
|
+
break
|
46
66
|
else
|
47
67
|
is_package = false
|
48
68
|
simpleclass_parts.push(part)
|
@@ -52,22 +72,25 @@ Asciidoctor::Extensions.register do
|
|
52
72
|
package = package_parts.join('.')
|
53
73
|
simpleclass = simpleclass_parts.join('.')
|
54
74
|
|
55
|
-
if package.length > 0 || plugin
|
75
|
+
if package.length > 0 || plugin || component
|
56
76
|
classname = classname.gsub(/#.*/, '')
|
57
77
|
classurl = package.gsub(/\./, '/') + '/' + simpleclass + ".html"
|
58
78
|
|
59
|
-
classfrag = (target.include? "#") ? '#' + target.gsub(/.*#/, '') : ''
|
79
|
+
classfrag = (target.include? "#") ? '#' + target.gsub(/.*#/, '').gsub(/\(\)/, '--') : ''
|
60
80
|
|
61
81
|
if plugin
|
62
82
|
label = (attrs.has_key? 'label') ? attrs['label'] : %(#{classname} in #{plugin})
|
63
|
-
target = %(
|
83
|
+
target = %(https://javadoc.jenkins.io/plugin/#{plugin}/#{classurl}#{classfrag})
|
84
|
+
elsif component
|
85
|
+
label = (attrs.has_key? 'label') ? attrs['label'] : %(#{classname} in #{component})
|
86
|
+
target = %(https://javadoc.jenkins.io/component/#{component}/#{classurl}#{classfrag})
|
64
87
|
else
|
65
88
|
label = (attrs.has_key? 'label') ? attrs['label'] : classname
|
66
|
-
target = %(
|
89
|
+
target = %(https://javadoc.jenkins.io/#{classurl}#{classfrag})
|
67
90
|
end
|
68
91
|
else
|
69
92
|
label = (attrs.has_key? 'label') ? attrs['label'] : classname
|
70
|
-
target = %(
|
93
|
+
target = %(https://javadoc.jenkins.io/byShortName/#{classname})
|
71
94
|
end
|
72
95
|
|
73
96
|
title = %(Javadoc for #{classname})
|
@@ -92,8 +115,16 @@ Asciidoctor::Extensions.register do
|
|
92
115
|
is_package = true
|
93
116
|
|
94
117
|
classname.split('.').each do |part|
|
118
|
+
match = /(.*)#/.match(part)
|
95
119
|
if is_package && /[[:lower:]]/.match(part[0])
|
96
120
|
package_parts.push(part)
|
121
|
+
elsif match = /(.*)#/.match(part)
|
122
|
+
class_part = match.captures
|
123
|
+
simpleclass_parts.push(class_part)
|
124
|
+
is_package = false
|
125
|
+
|
126
|
+
# escape once fragment has been found, required for complex fragments that contain a '.'
|
127
|
+
break
|
97
128
|
else
|
98
129
|
is_package = false
|
99
130
|
simpleclass_parts.push(part)
|
@@ -106,9 +137,9 @@ Asciidoctor::Extensions.register do
|
|
106
137
|
classname = target.gsub(/#.*/, '')
|
107
138
|
classurl = package.gsub(/\./, '/') + '/' + simpleclass + ".html"
|
108
139
|
|
109
|
-
classfrag = (target.include? "#") ? '#' + target.gsub(/.*#/, '') : ''
|
140
|
+
classfrag = (target.include? "#") ? '#' + target.gsub(/.*#/, '').gsub(/\(\)/, '--') : ''
|
110
141
|
label = (attrs.has_key? 'label') ? attrs['label'] : classname
|
111
|
-
target = %(
|
142
|
+
target = %(https://stapler.kohsuke.org/apidocs/#{classurl}#{classfrag})
|
112
143
|
|
113
144
|
title = %(Javadoc for #{classname})
|
114
145
|
|
@@ -135,6 +166,13 @@ Asciidoctor::Extensions.register do
|
|
135
166
|
classname.split('.').each do |part|
|
136
167
|
if is_package && /[[:lower:]]/.match(part[0])
|
137
168
|
package_parts.push(part)
|
169
|
+
elsif match = /(.*)#/.match(part)
|
170
|
+
class_part = match.captures
|
171
|
+
simpleclass_parts.push(class_part)
|
172
|
+
is_package = false
|
173
|
+
|
174
|
+
# escape once fragment has been found, required for complex fragments that contain a '.'
|
175
|
+
break
|
138
176
|
else
|
139
177
|
is_package = false
|
140
178
|
simpleclass_parts.push(part)
|
@@ -147,9 +185,9 @@ Asciidoctor::Extensions.register do
|
|
147
185
|
classname = target.gsub(/#.*/, '')
|
148
186
|
classurl = package.gsub(/\./, '/') + '/' + simpleclass + ".html"
|
149
187
|
|
150
|
-
classfrag = (target.include? "#") ? '#' + target.gsub(/.*#/, '') : ''
|
188
|
+
classfrag = (target.include? "#") ? '#' + target.gsub(/.*#/, '').gsub(/\(\)/, '--') : ''
|
151
189
|
label = (attrs.has_key? 'label') ? attrs['label'] : classname
|
152
|
-
target = %(
|
190
|
+
target = %(https://docs.oracle.com/javase/8/docs/api/#{classurl}#{classfrag})
|
153
191
|
|
154
192
|
title = %(Javadoc for #{classname})
|
155
193
|
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'asciidoctor'
|
2
|
+
require 'asciidoctor/extensions'
|
3
|
+
|
4
|
+
#
|
5
|
+
# Usage:
|
6
|
+
# jep:201[Jenkins Configuration as Code]
|
7
|
+
#
|
8
|
+
Asciidoctor::Extensions.register do
|
9
|
+
inline_macro do
|
10
|
+
named :jep
|
11
|
+
name_positional_attributes 'label'
|
12
|
+
|
13
|
+
process do |parent, target, attrs|
|
14
|
+
if attrs['label']
|
15
|
+
label = %(JEP-#{target}: #{attrs['label']})
|
16
|
+
else
|
17
|
+
label = %(JEP-#{target})
|
18
|
+
end
|
19
|
+
target = %(https://github.com/jenkinsci/jep/blob/master/jep/#{target}/README.adoc)
|
20
|
+
(create_anchor parent, label, type: :link, target: target).render
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'asciidoctor'
|
2
|
+
require 'asciidoctor/extensions'
|
3
|
+
|
4
|
+
#
|
5
|
+
# Usage:
|
6
|
+
# jira:JENKINS-12345[Issue description]
|
7
|
+
#
|
8
|
+
Asciidoctor::Extensions.register do
|
9
|
+
inline_macro do
|
10
|
+
named :jira
|
11
|
+
name_positional_attributes 'label'
|
12
|
+
|
13
|
+
process do |parent, target, attrs|
|
14
|
+
if target.include? "-"
|
15
|
+
issueId = target
|
16
|
+
else
|
17
|
+
issueId = %(JENKINS-#{target})
|
18
|
+
end
|
19
|
+
|
20
|
+
if attrs['label']
|
21
|
+
label = %(#{issueId}: #{attrs['label']})
|
22
|
+
else
|
23
|
+
label = issueId
|
24
|
+
end
|
25
|
+
|
26
|
+
target = %(https://issues.jenkins.io/browse/#{issueId})
|
27
|
+
(create_anchor parent, label, type: :link, target: target).render
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'asciidoctor'
|
2
|
+
require 'asciidoctor/extensions'
|
3
|
+
|
4
|
+
#
|
5
|
+
# Usage:
|
6
|
+
# security:12345[Issue description, date]
|
7
|
+
#
|
8
|
+
Asciidoctor::Extensions.register do
|
9
|
+
inline_macro do
|
10
|
+
named :security
|
11
|
+
name_positional_attributes 'label', 'date'
|
12
|
+
|
13
|
+
process do |parent, target, attrs|
|
14
|
+
if target.include? "-"
|
15
|
+
issueId = target
|
16
|
+
else
|
17
|
+
issueId = %(SECURITY-#{target})
|
18
|
+
end
|
19
|
+
|
20
|
+
if attrs['label']
|
21
|
+
label = %(#{issueId}: #{attrs['label']})
|
22
|
+
else
|
23
|
+
label = issueId
|
24
|
+
end
|
25
|
+
|
26
|
+
if attrs['date']
|
27
|
+
target = %(https://jenkins.io/security/advisory/#{attrs['date']}/##{issueId})
|
28
|
+
else
|
29
|
+
# TODO(oleg_nenashev): Change to a security issue redirect service if it gets created
|
30
|
+
target = %(https://jenkins.io/security/advisories/)
|
31
|
+
end
|
32
|
+
|
33
|
+
(create_anchor parent, label, type: :link, target: target).render
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
metadata
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asciidoctor-jenkins-extensions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- R. Tyler Croy
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-11-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 1.5.5
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 1.5.5
|
27
27
|
- !ruby/object:Gem::Dependency
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '2.0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '2.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rake
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -161,9 +161,13 @@ extra_rdoc_files: []
|
|
161
161
|
files:
|
162
162
|
- asciidoctor-jenkins-extensions.gemspec
|
163
163
|
- lib/asciidoctor/jenkins/extensions.rb
|
164
|
+
- lib/asciidoctor/jenkins/extensions/author-link.rb
|
164
165
|
- lib/asciidoctor/jenkins/extensions/javadoc-link.rb
|
166
|
+
- lib/asciidoctor/jenkins/extensions/jep-link.rb
|
167
|
+
- lib/asciidoctor/jenkins/extensions/jira-link.rb
|
165
168
|
- lib/asciidoctor/jenkins/extensions/pipeline-block.rb
|
166
169
|
- lib/asciidoctor/jenkins/extensions/plugin-link.rb
|
170
|
+
- lib/asciidoctor/jenkins/extensions/security-link.rb
|
167
171
|
- lib/asciidoctor/jenkins/extensions/version.rb
|
168
172
|
homepage: https://github.com/jenkins-infra/asciidoctor-jenkins-extensions
|
169
173
|
licenses: []
|
@@ -183,8 +187,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
183
187
|
- !ruby/object:Gem::Version
|
184
188
|
version: '0'
|
185
189
|
requirements: []
|
186
|
-
|
187
|
-
rubygems_version: 2.5.1
|
190
|
+
rubygems_version: 3.1.4
|
188
191
|
signing_key:
|
189
192
|
specification_version: 4
|
190
193
|
summary: a collection of Asciidoctor extensions which enable more advanced formatting
|