neo4j-asciidoctor-extensions 0.3.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +4 -3
- data/.github/workflows/release.yml +4 -3
- data/.rubocop.yml +18 -2
- data/Gemfile.lock +54 -47
- data/lib/neo4j/asciidoctor/extensions/course_document_attributes/extension.rb +8 -10
- data/lib/neo4j/asciidoctor/extensions/document_metadata_generator/extension.rb +16 -18
- data/lib/neo4j/asciidoctor/extensions/inline_highlighter_rouge/extension.rb +1 -1
- data/lib/neo4j/rouge/themes/neo.rb +1 -1
- data/lib/neo4j/rouge/themes/neo_forest.rb +1 -1
- data/neo4j-asciidoctor-extensions.gemspec +3 -4
- data/spec/document_metadata_generator_spec.rb +1 -0
- data/spec/inline_highlighter_rouge_spec.rb +2 -2
- metadata +10 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 824ac06d0958861a7af4f4d2d380145f6db5838d2caa1e7e56006d21ffe92a41
|
4
|
+
data.tar.gz: 9bac6902d01570b08e25e59f173a741c30fa5bd2eaab477da48b2d5ba97b26da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d1ec3064f4a896e8de3758d75670e64ce1af4af0fe6251b2715bfa659d14ecdfe3a6da5e4e53037e89cb42c208edee154e460652fb658cac6e5c638547f7518
|
7
|
+
data.tar.gz: f4f8e16b52dc26d40aa66f63f77c71e0cb869b70d02379aacfabb9fa2ad2019856294be1821a621aefb7ad40ad345e7067d9f2135f3f37e88936b51b5b570fdf
|
data/.github/workflows/ci.yml
CHANGED
@@ -4,9 +4,10 @@ jobs:
|
|
4
4
|
build:
|
5
5
|
runs-on: ubuntu-latest
|
6
6
|
steps:
|
7
|
-
- uses: actions/checkout@
|
8
|
-
- uses:
|
7
|
+
- uses: actions/checkout@v3
|
8
|
+
- uses: ruby/setup-ruby@v1
|
9
9
|
with:
|
10
|
-
ruby-version: '2.
|
10
|
+
ruby-version: '2.7'
|
11
|
+
bundler-cache: true
|
11
12
|
- run: bundle install
|
12
13
|
- run: bundle exec rake
|
@@ -8,10 +8,11 @@ jobs:
|
|
8
8
|
release:
|
9
9
|
runs-on: ubuntu-latest
|
10
10
|
steps:
|
11
|
-
- uses: actions/checkout@
|
12
|
-
- uses:
|
11
|
+
- uses: actions/checkout@v3
|
12
|
+
- uses: ruby/setup-ruby@v1
|
13
13
|
with:
|
14
|
-
ruby-version: '2.
|
14
|
+
ruby-version: '2.7'
|
15
|
+
bundler-cache: true
|
15
16
|
- name: Install and test
|
16
17
|
run: |
|
17
18
|
bundle install
|
data/.rubocop.yml
CHANGED
@@ -1,11 +1,27 @@
|
|
1
|
+
AllCops:
|
2
|
+
NewCops: enable
|
3
|
+
SuggestExtensions: false
|
4
|
+
|
5
|
+
Gemspec/RequireMFA:
|
6
|
+
Enabled: false
|
7
|
+
|
8
|
+
Gemspec/RequiredRubyVersion:
|
9
|
+
Enabled: false
|
10
|
+
|
1
11
|
Style/Encoding:
|
2
12
|
Enabled: false
|
3
13
|
|
4
|
-
|
14
|
+
Layout/LineLength:
|
5
15
|
Max: 160
|
6
16
|
|
7
17
|
Metrics/MethodLength:
|
8
18
|
Max: 25
|
9
19
|
|
20
|
+
Metrics/PerceivedComplexity:
|
21
|
+
Max: 10
|
22
|
+
|
23
|
+
Metrics/CyclomaticComplexity:
|
24
|
+
Max: 10
|
25
|
+
|
10
26
|
Metrics/AbcSize:
|
11
|
-
Max:
|
27
|
+
Max: 25
|
data/Gemfile.lock
CHANGED
@@ -1,70 +1,72 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
neo4j-asciidoctor-extensions (0.
|
4
|
+
neo4j-asciidoctor-extensions (1.0.2)
|
5
5
|
asciidoctor (~> 2.0)
|
6
|
-
asciidoctor-pdf (
|
6
|
+
asciidoctor-pdf (~> 2.3)
|
7
7
|
rouge (~> 3.18)
|
8
8
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
Ascii85 (1.0
|
13
|
-
addressable (2.
|
14
|
-
public_suffix (>= 2.0.2, <
|
12
|
+
Ascii85 (1.1.0)
|
13
|
+
addressable (2.8.1)
|
14
|
+
public_suffix (>= 2.0.2, < 6.0)
|
15
15
|
afm (0.2.2)
|
16
|
-
asciidoctor (2.0.
|
17
|
-
asciidoctor-pdf (
|
18
|
-
asciidoctor (
|
19
|
-
concurrent-ruby (~> 1.1
|
20
|
-
|
21
|
-
prawn
|
22
|
-
prawn-
|
16
|
+
asciidoctor (2.0.18)
|
17
|
+
asciidoctor-pdf (2.3.4)
|
18
|
+
asciidoctor (~> 2.0)
|
19
|
+
concurrent-ruby (~> 1.1)
|
20
|
+
matrix (~> 0.4)
|
21
|
+
prawn (~> 2.4.0)
|
22
|
+
prawn-icon (~> 3.0.0)
|
23
|
+
prawn-svg (~> 0.32.0)
|
23
24
|
prawn-table (~> 0.2.0)
|
24
25
|
prawn-templates (~> 0.1.0)
|
25
|
-
safe_yaml (~> 1.0.0)
|
26
|
-
thread_safe (~> 0.3.0)
|
27
26
|
treetop (~> 1.6.0)
|
28
|
-
|
29
|
-
asciidoctor-revealjs (4.0.1)
|
27
|
+
asciidoctor-revealjs (4.1.0)
|
30
28
|
asciidoctor (>= 2.0.0, < 3.0.0)
|
31
29
|
concurrent-ruby (~> 1.0)
|
32
30
|
thread_safe (~> 0.3.5)
|
33
|
-
ast (2.4.
|
34
|
-
concurrent-ruby (1.
|
35
|
-
css_parser (1.
|
31
|
+
ast (2.4.2)
|
32
|
+
concurrent-ruby (1.2.0)
|
33
|
+
css_parser (1.14.0)
|
36
34
|
addressable
|
37
|
-
diff-lcs (1.
|
35
|
+
diff-lcs (1.5.0)
|
38
36
|
hashery (2.1.2)
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
pdf-
|
45
|
-
|
37
|
+
json (2.6.3)
|
38
|
+
matrix (0.4.2)
|
39
|
+
parallel (1.22.1)
|
40
|
+
parser (3.2.0.0)
|
41
|
+
ast (~> 2.4.1)
|
42
|
+
pdf-core (0.9.0)
|
43
|
+
pdf-reader (2.11.0)
|
44
|
+
Ascii85 (~> 1.0)
|
46
45
|
afm (~> 0.2.1)
|
47
46
|
hashery (~> 2.0)
|
48
47
|
ruby-rc4
|
49
48
|
ttfunk
|
50
49
|
polyglot (0.3.5)
|
51
|
-
prawn (2.
|
52
|
-
pdf-core (~> 0.
|
53
|
-
ttfunk (~> 1.
|
54
|
-
prawn-icon (
|
50
|
+
prawn (2.4.0)
|
51
|
+
pdf-core (~> 0.9.0)
|
52
|
+
ttfunk (~> 1.7)
|
53
|
+
prawn-icon (3.0.0)
|
55
54
|
prawn (>= 1.1.0, < 3.0.0)
|
56
|
-
prawn-svg (0.
|
55
|
+
prawn-svg (0.32.0)
|
57
56
|
css_parser (~> 1.6)
|
58
57
|
prawn (>= 0.11.1, < 3)
|
58
|
+
rexml (~> 3.2)
|
59
59
|
prawn-table (0.2.2)
|
60
60
|
prawn (>= 1.3.0, < 3.0.0)
|
61
61
|
prawn-templates (0.1.2)
|
62
62
|
pdf-reader (~> 2.0)
|
63
63
|
prawn (~> 2.2)
|
64
|
-
public_suffix (
|
65
|
-
rainbow (3.
|
64
|
+
public_suffix (5.0.1)
|
65
|
+
rainbow (3.1.1)
|
66
66
|
rake (12.3.3)
|
67
|
-
|
67
|
+
regexp_parser (2.6.2)
|
68
|
+
rexml (3.2.5)
|
69
|
+
rouge (3.30.0)
|
68
70
|
rspec (3.8.0)
|
69
71
|
rspec-core (~> 3.8.0)
|
70
72
|
rspec-expectations (~> 3.8.0)
|
@@ -78,31 +80,36 @@ GEM
|
|
78
80
|
diff-lcs (>= 1.2.0, < 2.0)
|
79
81
|
rspec-support (~> 3.8.0)
|
80
82
|
rspec-support (3.8.3)
|
81
|
-
rubocop (
|
82
|
-
|
83
|
+
rubocop (1.44.1)
|
84
|
+
json (~> 2.3)
|
83
85
|
parallel (~> 1.10)
|
84
|
-
parser (>= 2.
|
86
|
+
parser (>= 3.2.0.0)
|
85
87
|
rainbow (>= 2.2.2, < 4.0)
|
88
|
+
regexp_parser (>= 1.8, < 3.0)
|
89
|
+
rexml (>= 3.2.5, < 4.0)
|
90
|
+
rubocop-ast (>= 1.24.1, < 2.0)
|
86
91
|
ruby-progressbar (~> 1.7)
|
87
|
-
unicode-display_width (>=
|
88
|
-
|
92
|
+
unicode-display_width (>= 2.4.0, < 3.0)
|
93
|
+
rubocop-ast (1.24.1)
|
94
|
+
parser (>= 3.1.1.0)
|
95
|
+
ruby-progressbar (1.11.0)
|
89
96
|
ruby-rc4 (0.1.5)
|
90
|
-
safe_yaml (1.0.5)
|
91
97
|
thread_safe (0.3.6)
|
92
|
-
treetop (1.6.
|
98
|
+
treetop (1.6.12)
|
93
99
|
polyglot (~> 0.3)
|
94
|
-
ttfunk (1.
|
95
|
-
unicode-display_width (
|
100
|
+
ttfunk (1.7.0)
|
101
|
+
unicode-display_width (2.4.2)
|
96
102
|
|
97
103
|
PLATFORMS
|
98
|
-
|
104
|
+
x86_64-darwin-21
|
105
|
+
x86_64-linux
|
99
106
|
|
100
107
|
DEPENDENCIES
|
101
108
|
asciidoctor-revealjs (~> 4.0)
|
102
109
|
neo4j-asciidoctor-extensions!
|
103
110
|
rake (~> 12.3.2)
|
104
111
|
rspec (~> 3.8.0)
|
105
|
-
rubocop (~>
|
112
|
+
rubocop (~> 1.44.0)
|
106
113
|
|
107
114
|
BUNDLED WITH
|
108
|
-
|
115
|
+
2.4.3
|
@@ -17,17 +17,15 @@ module Neo4j
|
|
17
17
|
TESTING_SLUG_PREFIX = '_testing_'
|
18
18
|
|
19
19
|
def process(document)
|
20
|
-
if (module_descriptor_path = document.attr('module-descriptor-path'))
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
document.set_attr('slug', document_slug)
|
27
|
-
end
|
28
|
-
set_attributes(document, document_slug, module_descriptor)
|
29
|
-
document.set_attribute('module-name', module_descriptor['module_name'])
|
20
|
+
if (module_descriptor_path = document.attr('module-descriptor-path')) && File.exist?(module_descriptor_path)
|
21
|
+
require 'yaml'
|
22
|
+
module_descriptor = YAML.load_file(module_descriptor_path)
|
23
|
+
if (document_slug = document.attr('slug')) && document.attr('stage') != 'production'
|
24
|
+
document_slug = "#{TESTING_SLUG_PREFIX}#{document_slug}"
|
25
|
+
document.set_attr('slug', document_slug)
|
30
26
|
end
|
27
|
+
set_attributes(document, document_slug, module_descriptor)
|
28
|
+
document.set_attribute('module-name', module_descriptor['module_name'])
|
31
29
|
end
|
32
30
|
document
|
33
31
|
end
|
@@ -55,26 +55,24 @@ module Neo4j
|
|
55
55
|
use_dsl
|
56
56
|
|
57
57
|
def process(document, output)
|
58
|
-
if (attrs_include = document.attr 'document-metadata-attrs-include')
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
.reject(&:empty?)
|
58
|
+
if (attrs_include = document.attr 'document-metadata-attrs-include') && (outfile = document.attr 'outfile')
|
59
|
+
require 'yaml'
|
60
|
+
metadata = {}
|
61
|
+
attrs_include = attrs_include
|
62
|
+
.split(',')
|
63
|
+
.map(&:strip)
|
64
|
+
.reject(&:empty?)
|
66
65
|
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
end
|
66
|
+
attrs_include.each do |attr_include|
|
67
|
+
value_type = resolve_value_type(attr_include)
|
68
|
+
attr_name = resolve_attr_name(attr_include)
|
69
|
+
if document.attr? attr_name
|
70
|
+
attr_value = resolve_attribute_value(attr_name, document, value_type)
|
71
|
+
metadata[attr_name.gsub('-', '_')] = attr_value
|
74
72
|
end
|
75
|
-
metadata['title'] = document.doctitle
|
76
|
-
write(metadata, outfile)
|
77
73
|
end
|
74
|
+
metadata['title'] = document.doctitle
|
75
|
+
write(metadata, outfile)
|
78
76
|
end
|
79
77
|
output
|
80
78
|
end
|
@@ -101,7 +99,7 @@ module Neo4j
|
|
101
99
|
def write(metadata, outfile)
|
102
100
|
outputdir = File.dirname(outfile)
|
103
101
|
filename = File.basename(outfile, File.extname(outfile))
|
104
|
-
File.
|
102
|
+
File.write("#{outputdir}/#{filename}.yml", metadata.to_yaml)
|
105
103
|
end
|
106
104
|
|
107
105
|
def resolve_attribute_value(attr_name, document, value_type)
|
@@ -29,7 +29,7 @@ module Neo4j
|
|
29
29
|
class MonospacedTextInlineMacro < Extensions::InlineMacroProcessor
|
30
30
|
use_dsl
|
31
31
|
named :monospaced_highlighter
|
32
|
-
match %r{<code class="src-([a-z]+)">([^<]+)
|
32
|
+
match %r{<code class="src-([a-z]+)">([^<]+)</code>}i
|
33
33
|
positional_attributes :content
|
34
34
|
|
35
35
|
def process(parent, target, attrs)
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = 'neo4j-asciidoctor-extensions'
|
5
|
-
s.version = '0.
|
5
|
+
s.version = '1.0.2'
|
6
6
|
s.summary = 'Asciidoctor extensions by Neo4j.'
|
7
7
|
s.description = 'Asciidoctor extensions by Neo4j.'
|
8
8
|
|
@@ -15,15 +15,14 @@ Gem::Specification.new do |s|
|
|
15
15
|
'source_code_uri' => 'https://github.com/neo4j-contrib/neo4j-asciidoctor-extensions'
|
16
16
|
}
|
17
17
|
s.files = `git ls-files`.split($RS)
|
18
|
-
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
19
18
|
s.require_paths = ['lib']
|
20
19
|
|
21
20
|
s.add_runtime_dependency 'asciidoctor', '~> 2.0'
|
22
|
-
s.add_runtime_dependency 'asciidoctor-pdf', '
|
21
|
+
s.add_runtime_dependency 'asciidoctor-pdf', '~> 2.3'
|
23
22
|
s.add_runtime_dependency 'rouge', '~> 3.18'
|
24
23
|
|
25
24
|
s.add_development_dependency 'asciidoctor-revealjs', '~> 4.0'
|
26
25
|
s.add_development_dependency 'rake', '~> 12.3.2'
|
27
26
|
s.add_development_dependency 'rspec', '~> 3.8.0'
|
28
|
-
s.add_development_dependency 'rubocop', '~>
|
27
|
+
s.add_development_dependency 'rubocop', '~> 1.44.0'
|
29
28
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
require 'asciidoctor'
|
4
4
|
require_relative '../lib/neo4j/asciidoctor/extensions/inline_highlighter_rouge'
|
5
5
|
|
6
|
-
# rubocop:disable
|
6
|
+
# rubocop:disable Layout/LineLength
|
7
7
|
describe Neo4j::AsciidoctorExtensions::InlineHighlighter::MonospacedTextInlineMacro do
|
8
8
|
context 'convert to html5' do
|
9
9
|
it 'should apply syntax highlighting on monospaced text cypher' do
|
@@ -27,4 +27,4 @@ describe Neo4j::AsciidoctorExtensions::InlineHighlighter::SrcInlineMacro do
|
|
27
27
|
end
|
28
28
|
end
|
29
29
|
end
|
30
|
-
# rubocop:enable
|
30
|
+
# rubocop:enable Layout/LineLength
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: neo4j-asciidoctor-extensions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Guillaume Grossetie
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-02-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|
@@ -28,16 +28,16 @@ dependencies:
|
|
28
28
|
name: asciidoctor-pdf
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: '2.3'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: '2.3'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rouge
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -100,14 +100,14 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
103
|
+
version: 1.44.0
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
110
|
+
version: 1.44.0
|
111
111
|
description: Asciidoctor extensions by Neo4j.
|
112
112
|
email:
|
113
113
|
- ggrossetie@yuzutech.fr
|
@@ -175,15 +175,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
175
175
|
- !ruby/object:Gem::Version
|
176
176
|
version: '0'
|
177
177
|
requirements: []
|
178
|
-
rubygems_version: 3.
|
178
|
+
rubygems_version: 3.1.6
|
179
179
|
signing_key:
|
180
180
|
specification_version: 4
|
181
181
|
summary: Asciidoctor extensions by Neo4j.
|
182
|
-
test_files:
|
183
|
-
- spec/.rubocop.yml
|
184
|
-
- spec/cypher_syntax_role_spec.rb
|
185
|
-
- spec/document_metadata_generator_spec.rb
|
186
|
-
- spec/inline_highlighter_rouge_spec.rb
|
187
|
-
- spec/revealjs_linear_navigation_spec.rb
|
188
|
-
- spec/revealjs_speaker_notes_aggregator_spec.rb
|
189
|
-
- spec/stage_slug_spec.rb
|
182
|
+
test_files: []
|