avm-eac_asciidoctor_base0 0.22.1 → 0.23.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: d6745f7f5eff86a2f74fd7d6d777ab5f476206537190a08b270a31d82328338f
4
- data.tar.gz: 857ca6e7ccd6e55f9e5e5f82f7d0036dd194ddf7afd1c2998c73926f2224f0e3
3
+ metadata.gz: 7d37d94b86819700eaf7184b375ae1b20ba6fbc20c27d4aa24f743044b5190c8
4
+ data.tar.gz: 280366443594dd47f048d68f0a45e363a1440bad489f0b508ec74b6cc6b56d3a
5
5
  SHA512:
6
- metadata.gz: 9a2120098e809b1ee1e512ba591179bd436ab9e4658954efcd01e91804ec04245214238c539d52416983b69c859d821b9ca0ab209ac926bec012ae5aa9f72b85
7
- data.tar.gz: 884f24cb149209e5a2b5e825e76e0c862387e49fb0d18fb0f10f2d9ae49a1fe776ff412a902c39e1a050d9c8b552b885029b85fc0c422c86c98585e06826d3e3
6
+ metadata.gz: 551f9f89e27dfbdcab4007aeff84b575048c4daed2f5deb4f536f1e9bd6af263604ce4bdbd19303363eb95152b79e9b2f837cdbe3e68dd508d9a44768fb6766d
7
+ data.tar.gz: da779b1d473fec706a2661597515115848901ed132b8e93d4da2c0a409ee4b13c1f197a3109874401bbd22ad3c9c6d1ab005302da5ccc6d434e7adbe7a8b42c1
@@ -56,17 +56,17 @@ module Avm
56
56
  breadcrumbs_lines
57
57
  end
58
58
 
59
+ # @return [Pathname]
60
+ def relative_path_to_stylesheet
61
+ build.theme.target_stylesheet_path
62
+ .relative_path_from(document.body_target_path.dirname)
63
+ end
64
+
59
65
  # @return [String]
60
66
  def stylesheet_line
61
67
  attribute_line('stylesheet', stylesheet_path)
62
68
  end
63
69
 
64
- # @return [Pathname]
65
- def stylesheet_path
66
- source_document.source.theme_stylesheet_path
67
- .relative_path_from(document.convert_base_dir)
68
- end
69
-
70
70
  # @return [String]
71
71
  def title_line
72
72
  "= #{source_document.title}"
@@ -75,6 +75,15 @@ module Avm
75
75
  def website
76
76
  instance.web_url
77
77
  end
78
+
79
+ protected
80
+
81
+ # @return [Pathname]
82
+ def stylesheet_path_uncached
83
+ temp = ::EacRubyUtils::Fs::Temp.file
84
+ temp.write("@import '#{relative_path_to_stylesheet}'\n")
85
+ temp.to_pathname
86
+ end
78
87
  end
79
88
  end
80
89
  end
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/eac_asciidoctor_base0/instances/macros'
4
+ require 'eac_ruby_utils/core_ext'
5
+
6
+ module Avm
7
+ module EacAsciidoctorBase0
8
+ module Instances
9
+ class Build
10
+ class Theme
11
+ TARGET_SUBPATH = '_theme'
12
+
13
+ common_constructor :build
14
+
15
+ # @return [void]
16
+ def perform
17
+ copy_theme_to_target
18
+ end
19
+
20
+ # @return [Pathname]
21
+ def target_path
22
+ build.target_directory.join(TARGET_SUBPATH)
23
+ end
24
+
25
+ # @return [Pathname]
26
+ def target_stylesheet_path
27
+ target_path
28
+ .join(Avm::EacAsciidoctorBase0::Sources::Base::Theme::THEME_STYLESHEET_BASENAME)
29
+ end
30
+
31
+ protected
32
+
33
+ # @return [void]
34
+ def copy_theme_to_target
35
+ build.source.copy_theme_directory_to(target_path)
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
@@ -23,6 +23,7 @@ module Avm
23
23
  def perform
24
24
  infov 'Documents to build', root_document.tree_documents_count
25
25
  target_directory.clear
26
+ theme.perform
26
27
  root_document.perform
27
28
  end
28
29
 
@@ -45,6 +46,13 @@ module Avm
45
46
  options[OPTION_TARGET_DIRECTORY] || default_target_directory
46
47
  )
47
48
  end
49
+
50
+ private
51
+
52
+ # @return [Avm::EacAsciidoctorBase0::Instances::Build::Theme]
53
+ def theme_uncached
54
+ ::Avm::EacAsciidoctorBase0::Instances::Build::Theme.new(self)
55
+ end
48
56
  end
49
57
  end
50
58
  end
@@ -12,6 +12,12 @@ module Avm
12
12
  DEFAULT_THEME_DIRECTORY_SUBPATH = 'theme'
13
13
  THEME_STYLESHEET_BASENAME = 'main.css'
14
14
 
15
+ # @param target_directory_path [Pathname]
16
+ def copy_theme_directory_to(target_directory_path)
17
+ target_directory_path.parent.mkpath
18
+ ::FileUtils.copy_entry(theme_directory, target_directory_path)
19
+ end
20
+
15
21
  # @return [Pathname]
16
22
  def default_theme_directory
17
23
  path.join(DEFAULT_THEME_DIRECTORY_SUBPATH)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module EacAsciidoctorBase0
5
- VERSION = '0.22.1'
5
+ VERSION = '0.23.0'
6
6
  end
7
7
  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.22.1
4
+ version: 0.23.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: 2024-04-03 00:00:00.000000000 Z
11
+ date: 2024-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor
@@ -36,20 +36,14 @@ dependencies:
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '0.18'
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- version: 0.18.4
39
+ version: '0.19'
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.18'
50
- - - ">="
51
- - !ruby/object:Gem::Version
52
- version: 0.18.4
46
+ version: '0.19'
53
47
  - !ruby/object:Gem::Dependency
54
48
  name: eac_ruby_utils
55
49
  requirement: !ruby/object:Gem::Requirement
@@ -146,6 +140,7 @@ files:
146
140
  - lib/avm/eac_asciidoctor_base0/instances/build/document/header_lines.rb
147
141
  - lib/avm/eac_asciidoctor_base0/instances/build/document/media.rb
148
142
  - lib/avm/eac_asciidoctor_base0/instances/build/document/pre_process_line.rb
143
+ - lib/avm/eac_asciidoctor_base0/instances/build/theme.rb
149
144
  - lib/avm/eac_asciidoctor_base0/instances/deploy.rb
150
145
  - lib/avm/eac_asciidoctor_base0/instances/macros.rb
151
146
  - lib/avm/eac_asciidoctor_base0/instances/macros/base.rb