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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 03a8e128511aed4baea69daef29d25282fe0ed17af270c8e4d1feb37bdc5a389
4
- data.tar.gz: 8c37deedbf87a82c09127ebeb567a0b65b621ec99497a441864cb938a0d64423
3
+ metadata.gz: 46fa936707853578159b6c9c7b1b877ca534305a71fe1b113ff7cad89e879f93
4
+ data.tar.gz: 5963719ff16c228999a5d080d43ef57464672eaa10c765eb5646af9e23593fb4
5
5
  SHA512:
6
- metadata.gz: e4c05d9c6a1b657b9f83dad51d72c10830cdb0e28f937c43ab26f3d4845197123388503ee0960ad8568846921661cc308113bf75c332cf4913df6b356b1a5f53
7
- data.tar.gz: b9a9a1f5952c4a97c7e311c0cd1fa86cadf69666c0170fe384ced948598eff86680885d8be3a3f98989c6db482b09d9cc9afb77a2a4b69665347f289e807c594
6
+ metadata.gz: b86abd89d760294967e9b58ad07fef5c89a76095a0848c80921dc58d188f2f6275b2684dacf2b1118524bffd15e0cd47638843facabf7d3eea47a6edf107d998
7
+ data.tar.gz: 3b3678589bf1057056891c368e93a4914b1b654aa409c1ec63f88f827ae7e70f48eb940651565129dd6cb77092f6dd4a9375e22caa3cee40bab9a32614081ea9
@@ -7,7 +7,7 @@ module Avm
7
7
  module Instances
8
8
  class Build
9
9
  class Document
10
- class HeaderMacroValue
10
+ class HeaderLines
11
11
  enable_method_class
12
12
  enable_settings_provider
13
13
  enable_simple_cache
@@ -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
- ROOT_BODY_TARGET_BASENAME = 'index'
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
- parent_document.present? ? source_document.subpath : ROOT_BODY_TARGET_BASENAME
25
- ).basename_sub('.*') { |b| "#{b}.html" }
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
- ::Asciidoctor.convert(
41
- pre_processed_body_source_content,
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
- source_document.body_path.read.each_line
54
- .flat_map { |line| pre_process_line(line.rstrip) }
55
- .map { |line| "#{line.rstrip}\n" }.join
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
@@ -38,6 +38,7 @@ module Avm
38
38
 
39
39
  def children_uncached
40
40
  root_path.children.select(&:directory?)
41
+ .reject { |path| path.basename.to_path == MEDIA_DIRECTORY_BASENAME }
41
42
  .map { |path| self.class.new(source, self, path.basename) }
42
43
  end
43
44
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module EacAsciidoctorBase0
5
- VERSION = '0.15.0'
5
+ VERSION = '0.17.0'
6
6
  end
7
7
  end
@@ -1,5 +1,3 @@
1
- //#header
2
-
3
1
  == Child Documents
4
2
 
5
3
  //#child_docs
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.15.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-01-10 00:00:00.000000000 Z
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.13'
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.13'
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.110'
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.110'
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/header_macro_value.rb
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