metanorma-cli 1.4.4 → 1.4.5pre
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/metanorma/cli/site_generator.rb +20 -3
- data/lib/metanorma/cli/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: be9f8d3c8fe6b39720b94f1a66ab0d9ba8819ca8d55a9c35e740d0f5cd15c54a
|
4
|
+
data.tar.gz: e4059fc02804c6dc2c068dcc85216539d366faad7f272e871587a18fbbbfe9e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41044c1c94174a31dd644a1adeb0ac59258b6164226390a72a76beee87e7a0e9957283b0ba55ba5fbfc6158bfac9f0cb7333fed42660d350d0048296d44b57ac
|
7
|
+
data.tar.gz: 6631bd425364be1280a5ec4e14e338b4840ae847e4d77ade51ee018fb97684c9f922900fe487c6db350d866ba8788cd838922a0fde57b20717447c9a17e96977
|
@@ -70,9 +70,11 @@ module Metanorma
|
|
70
70
|
def compile(source)
|
71
71
|
UI.info("Compiling #{source} ...")
|
72
72
|
|
73
|
-
|
73
|
+
options = @compile_options.merge(
|
74
|
+
format: :asciidoc, output_dir: build_asset_output_directory(source)
|
75
|
+
)
|
74
76
|
|
75
|
-
Metanorma::Cli::Compiler.compile(source.to_s,
|
77
|
+
Metanorma::Cli::Compiler.compile(source.to_s, options)
|
76
78
|
end
|
77
79
|
|
78
80
|
def convert_to_html_page(collection, page_name)
|
@@ -127,7 +129,22 @@ module Metanorma
|
|
127
129
|
asset_path = [site_path, asset_folder].join("/")
|
128
130
|
@asset_directory = Pathname.new(Dir.pwd).join(asset_path)
|
129
131
|
|
130
|
-
|
132
|
+
create_directory_if_not_present!(@asset_directory)
|
133
|
+
end
|
134
|
+
|
135
|
+
def create_directory_if_not_present!(directory)
|
136
|
+
FileUtils.mkdir_p(directory) unless directory.exist?
|
137
|
+
end
|
138
|
+
|
139
|
+
def build_asset_output_directory(source)
|
140
|
+
sub_directory = Pathname.new(source.gsub(@source.to_s, "")).dirname.to_s
|
141
|
+
sub_directory.gsub!("/sources", "")
|
142
|
+
sub_directory.slice!(0)
|
143
|
+
|
144
|
+
output_directory = asset_directory.join(sub_directory)
|
145
|
+
create_directory_if_not_present!(output_directory)
|
146
|
+
|
147
|
+
output_directory
|
131
148
|
end
|
132
149
|
end
|
133
150
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.5pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-02-
|
11
|
+
date: 2021-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|
@@ -494,9 +494,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
494
494
|
version: 2.4.0
|
495
495
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
496
496
|
requirements:
|
497
|
-
- - "
|
497
|
+
- - ">"
|
498
498
|
- !ruby/object:Gem::Version
|
499
|
-
version:
|
499
|
+
version: 1.3.1
|
500
500
|
requirements: []
|
501
501
|
rubygems_version: 3.1.4
|
502
502
|
signing_key:
|