neo4j-asciidoctor-extensions 0.2.0 → 0.3.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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ed2835da9be7c20ddf83b173cd740644a00986b0216e1d77d30ca65b359296a
|
4
|
+
data.tar.gz: 0b2d0ef0ec3f5d5c05910d8768e836d9147c045a4cd017f326fa1c261d2212bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5edbf5d0eb1e83d2d82dcbd3e9515f645b48b56d246bb30e9caa005079c7742967bac7bbffc3d73d415c3b968fa8346f3e8116557475e2c8a573e8155902461f
|
7
|
+
data.tar.gz: 83660797c903651ebcabbc8c167faaa19ac42685ad866641f4fb411f70c62a8512bfb986ceb1653a5c73c96753d2aee1a9fa2de08c2b0718fb1f5c97e33fad0d
|
data/Gemfile.lock
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
neo4j-asciidoctor-extensions (0.
|
5
|
-
asciidoctor (~> 2.0
|
4
|
+
neo4j-asciidoctor-extensions (0.3.0)
|
5
|
+
asciidoctor (~> 2.0)
|
6
6
|
asciidoctor-pdf (= 1.5.3)
|
7
|
-
rouge (~> 3.18
|
7
|
+
rouge (~> 3.18)
|
8
8
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
@@ -17,18 +17,16 @@ module Neo4j
|
|
17
17
|
TESTING_SLUG_PREFIX = '_testing_'
|
18
18
|
|
19
19
|
def process(document)
|
20
|
-
if (
|
21
|
-
|
22
|
-
path = File.expand_path('../build/online/asciidoctor-module-descriptor.yml', docdir)
|
23
|
-
if File.exist?(path)
|
20
|
+
if (module_descriptor_path = document.attr('module-descriptor-path'))
|
21
|
+
if File.exist?(module_descriptor_path)
|
24
22
|
require 'yaml'
|
25
|
-
module_descriptor = YAML.load_file(
|
26
|
-
if (document_slug = document.attr
|
23
|
+
module_descriptor = YAML.load_file(module_descriptor_path)
|
24
|
+
if (document_slug = document.attr('slug')) && document.attr('stage') != 'production'
|
27
25
|
document_slug = "#{TESTING_SLUG_PREFIX}#{document_slug}"
|
28
|
-
document.set_attr
|
26
|
+
document.set_attr('slug', document_slug)
|
29
27
|
end
|
30
28
|
set_attributes(document, document_slug, module_descriptor)
|
31
|
-
document.set_attribute
|
29
|
+
document.set_attribute('module-name', module_descriptor['module_name'])
|
32
30
|
end
|
33
31
|
end
|
34
32
|
document
|
@@ -38,17 +36,17 @@ module Neo4j
|
|
38
36
|
|
39
37
|
def set_attributes(document, document_slug, module_descriptor)
|
40
38
|
module_descriptor['pages'].each_with_index do |page, index|
|
41
|
-
document.set_attribute
|
42
|
-
document.set_attribute
|
39
|
+
document.set_attribute("module-toc-link-#{index}", page['url'])
|
40
|
+
document.set_attribute("module-toc-title-#{index}", page['title'])
|
43
41
|
page_slug = page['slug']
|
44
42
|
page_slug = "#{TESTING_SLUG_PREFIX}#{page_slug}" unless document.attr('stage') == 'production'
|
45
|
-
document.set_attribute
|
46
|
-
document.set_attribute
|
43
|
+
document.set_attribute("module-toc-slug-#{index}", page_slug)
|
44
|
+
document.set_attribute("module-quiz-#{index}", page['quiz'])
|
47
45
|
next unless document_slug == page_slug
|
48
46
|
|
49
47
|
set_next_attributes(document, page)
|
50
|
-
document.set_attribute
|
51
|
-
document.set_attribute
|
48
|
+
document.set_attribute('module-quiz', page['quiz'])
|
49
|
+
document.set_attribute('module-certificate', page['certificate'])
|
52
50
|
end
|
53
51
|
end
|
54
52
|
|
@@ -57,8 +55,8 @@ module Neo4j
|
|
57
55
|
|
58
56
|
next_page_slug = page['next']['slug']
|
59
57
|
next_page_slug = "#{TESTING_SLUG_PREFIX}#{next_page_slug}" unless document.attr('stage') == 'production'
|
60
|
-
document.set_attr
|
61
|
-
document.set_attr
|
58
|
+
document.set_attr('module-next-slug', next_page_slug, false)
|
59
|
+
document.set_attr('module-next-title', page['next']['title'], false)
|
62
60
|
end
|
63
61
|
end
|
64
62
|
end
|
@@ -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 = '0.3.0'
|
6
6
|
s.summary = 'Asciidoctor extensions by Neo4j.'
|
7
7
|
s.description = 'Asciidoctor extensions by Neo4j.'
|
8
8
|
|
@@ -18,9 +18,9 @@ Gem::Specification.new do |s|
|
|
18
18
|
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
19
19
|
s.require_paths = ['lib']
|
20
20
|
|
21
|
-
s.add_runtime_dependency 'asciidoctor', '~> 2.0
|
21
|
+
s.add_runtime_dependency 'asciidoctor', '~> 2.0'
|
22
22
|
s.add_runtime_dependency 'asciidoctor-pdf', '1.5.3'
|
23
|
-
s.add_runtime_dependency 'rouge', '~> 3.18
|
23
|
+
s.add_runtime_dependency 'rouge', '~> 3.18'
|
24
24
|
|
25
25
|
s.add_development_dependency 'asciidoctor-revealjs', '~> 4.0'
|
26
26
|
s.add_development_dependency 'rake', '~> 12.3.2'
|
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: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Guillaume Grossetie
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.0
|
19
|
+
version: '2.0'
|
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
|
-
version: 2.0
|
26
|
+
version: '2.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: asciidoctor-pdf
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 3.18
|
47
|
+
version: '3.18'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 3.18
|
54
|
+
version: '3.18'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: asciidoctor-revealjs
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|