avm-eac_asciidoctor_base0 0.15.0 → 0.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/avm/eac_asciidoctor_base0/instances/build/document/{header_macro_value.rb → header_lines.rb} +1 -1
- data/lib/avm/eac_asciidoctor_base0/instances/build/document/media.rb +28 -0
- data/lib/avm/eac_asciidoctor_base0/instances/build/document.rb +18 -13
- data/lib/avm/eac_asciidoctor_base0/sources/base/document/media.rb +30 -0
- data/lib/avm/eac_asciidoctor_base0/sources/base/document.rb +1 -0
- data/lib/avm/eac_asciidoctor_base0/version.rb +1 -1
- data/template/avm/eac_asciidoctor_base0/source_generators/base/content/body.adoc +0 -2
- metadata +9 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46fa936707853578159b6c9c7b1b877ca534305a71fe1b113ff7cad89e879f93
|
4
|
+
data.tar.gz: 5963719ff16c228999a5d080d43ef57464672eaa10c765eb5646af9e23593fb4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b86abd89d760294967e9b58ad07fef5c89a76095a0848c80921dc58d188f2f6275b2684dacf2b1118524bffd15e0cd47638843facabf7d3eea47a6edf107d998
|
7
|
+
data.tar.gz: 3b3678589bf1057056891c368e93a4914b1b654aa409c1ec63f88f827ae7e70f48eb940651565129dd6cb77092f6dd4a9375e22caa3cee40bab9a32614081ea9
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'asciidoctor'
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
5
|
+
|
6
|
+
module Avm
|
7
|
+
module EacAsciidoctorBase0
|
8
|
+
module Instances
|
9
|
+
class Build
|
10
|
+
class Document
|
11
|
+
module Media
|
12
|
+
def copy_media_directory
|
13
|
+
source_document.copy_media_directory_to(media_target_path)
|
14
|
+
end
|
15
|
+
|
16
|
+
# @return [Pathname]
|
17
|
+
def media_target_path
|
18
|
+
build.target_directory.join(
|
19
|
+
parent_document.present? ? source_document.subpath : '',
|
20
|
+
::Avm::EacAsciidoctorBase0::Sources::Base::Document::Media::MEDIA_DIRECTORY_BASENAME
|
21
|
+
)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -8,9 +8,9 @@ module Avm
|
|
8
8
|
module Instances
|
9
9
|
class Build
|
10
10
|
class Document
|
11
|
-
require_sub __FILE__
|
11
|
+
require_sub __FILE__, include_modules: true
|
12
12
|
|
13
|
-
|
13
|
+
BODY_TARGET_BASENAME = 'index.html'
|
14
14
|
|
15
15
|
enable_simple_cache
|
16
16
|
enable_speaker
|
@@ -20,9 +20,16 @@ module Avm
|
|
20
20
|
#
|
21
21
|
# @return [Pathname]
|
22
22
|
def body_target_path
|
23
|
-
build.target_directory.join(
|
24
|
-
|
25
|
-
|
23
|
+
build.target_directory.join(source_document.subpath).join(BODY_TARGET_BASENAME)
|
24
|
+
end
|
25
|
+
|
26
|
+
# @return [Asciidoctor::Document]
|
27
|
+
def build_body
|
28
|
+
::Asciidoctor.convert(
|
29
|
+
pre_processed_body_source_content,
|
30
|
+
base_dir: convert_base_dir,
|
31
|
+
to_file: body_target_path.to_path, safe: :unsafe, mkdirs: true
|
32
|
+
)
|
26
33
|
end
|
27
34
|
|
28
35
|
# @return [Pathname]
|
@@ -37,11 +44,8 @@ module Avm
|
|
37
44
|
|
38
45
|
def perform_self
|
39
46
|
infov 'Building', source_document.subpath
|
40
|
-
|
41
|
-
|
42
|
-
base_dir: convert_base_dir,
|
43
|
-
to_file: body_target_path.to_path, safe: :unsafe, mkdirs: true
|
44
|
-
)
|
47
|
+
build_body
|
48
|
+
copy_media_directory
|
45
49
|
end
|
46
50
|
|
47
51
|
def perform_children
|
@@ -50,9 +54,10 @@ module Avm
|
|
50
54
|
|
51
55
|
# @return [String]
|
52
56
|
def pre_processed_body_source_content
|
53
|
-
|
54
|
-
|
55
|
-
|
57
|
+
(
|
58
|
+
header_lines + [''] + source_document.body_path.read.each_line
|
59
|
+
.flat_map { |line| pre_process_line(line.rstrip) }
|
60
|
+
).map { |line| "#{line.rstrip}\n" }.join
|
56
61
|
end
|
57
62
|
|
58
63
|
def tree_documents_count
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'asciidoctor'
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
5
|
+
|
6
|
+
module Avm
|
7
|
+
module EacAsciidoctorBase0
|
8
|
+
module Sources
|
9
|
+
class Base
|
10
|
+
class Document
|
11
|
+
module Media
|
12
|
+
MEDIA_DIRECTORY_BASENAME = '_media'
|
13
|
+
|
14
|
+
def copy_media_directory_to(target_directory_path)
|
15
|
+
return unless media_directory.directory?
|
16
|
+
|
17
|
+
target_directory_path.parent.mkpath
|
18
|
+
::FileUtils.copy_entry(media_directory, target_directory_path)
|
19
|
+
end
|
20
|
+
|
21
|
+
# @return [Pathname]
|
22
|
+
def media_directory
|
23
|
+
root_path.join(MEDIA_DIRECTORY_BASENAME)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: avm-eac_asciidoctor_base0
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.17.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Put here the authors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-04-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|
@@ -36,40 +36,28 @@ dependencies:
|
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: '0.
|
40
|
-
- - ">="
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
version: 0.13.1
|
39
|
+
version: '0.14'
|
43
40
|
type: :runtime
|
44
41
|
prerelease: false
|
45
42
|
version_requirements: !ruby/object:Gem::Requirement
|
46
43
|
requirements:
|
47
44
|
- - "~>"
|
48
45
|
- !ruby/object:Gem::Version
|
49
|
-
version: '0.
|
50
|
-
- - ">="
|
51
|
-
- !ruby/object:Gem::Version
|
52
|
-
version: 0.13.1
|
46
|
+
version: '0.14'
|
53
47
|
- !ruby/object:Gem::Dependency
|
54
48
|
name: eac_ruby_utils
|
55
49
|
requirement: !ruby/object:Gem::Requirement
|
56
50
|
requirements:
|
57
51
|
- - "~>"
|
58
52
|
- !ruby/object:Gem::Version
|
59
|
-
version: '0.
|
60
|
-
- - ">="
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
version: 0.110.1
|
53
|
+
version: '0.112'
|
63
54
|
type: :runtime
|
64
55
|
prerelease: false
|
65
56
|
version_requirements: !ruby/object:Gem::Requirement
|
66
57
|
requirements:
|
67
58
|
- - "~>"
|
68
59
|
- !ruby/object:Gem::Version
|
69
|
-
version: '0.
|
70
|
-
- - ">="
|
71
|
-
- !ruby/object:Gem::Version
|
72
|
-
version: 0.110.1
|
60
|
+
version: '0.112'
|
73
61
|
- !ruby/object:Gem::Dependency
|
74
62
|
name: os
|
75
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -148,7 +136,8 @@ files:
|
|
148
136
|
- lib/avm/eac_asciidoctor_base0/instances/build.rb
|
149
137
|
- lib/avm/eac_asciidoctor_base0/instances/build/document.rb
|
150
138
|
- lib/avm/eac_asciidoctor_base0/instances/build/document/child_docs_macro_value.rb
|
151
|
-
- lib/avm/eac_asciidoctor_base0/instances/build/document/
|
139
|
+
- lib/avm/eac_asciidoctor_base0/instances/build/document/header_lines.rb
|
140
|
+
- lib/avm/eac_asciidoctor_base0/instances/build/document/media.rb
|
152
141
|
- lib/avm/eac_asciidoctor_base0/instances/build/document/pre_process_line.rb
|
153
142
|
- lib/avm/eac_asciidoctor_base0/instances/deploy.rb
|
154
143
|
- lib/avm/eac_asciidoctor_base0/source_generators.rb
|
@@ -156,6 +145,7 @@ files:
|
|
156
145
|
- lib/avm/eac_asciidoctor_base0/sources.rb
|
157
146
|
- lib/avm/eac_asciidoctor_base0/sources/base.rb
|
158
147
|
- lib/avm/eac_asciidoctor_base0/sources/base/document.rb
|
148
|
+
- lib/avm/eac_asciidoctor_base0/sources/base/document/media.rb
|
159
149
|
- lib/avm/eac_asciidoctor_base0/sources/base/document/title.rb
|
160
150
|
- lib/avm/eac_asciidoctor_base0/sources/base/instance_to_build.rb
|
161
151
|
- lib/avm/eac_asciidoctor_base0/sources/base/theme.rb
|