metanorma-cli 1.12.3 → 1.12.4
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/collection.rb +1 -0
- data/lib/metanorma/cli/site_generator.rb +37 -5
- data/lib/metanorma/cli/version.rb +1 -1
- data/metanorma-cli.gemspec +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 83127d9943ff11c57968eba5da57a1506bab8cdbe1e035e055c382b5a70ba8d9
|
4
|
+
data.tar.gz: 76a08db2cd6f26d9f82a795fd2075eabe1f4ec7b1789bb56d6fccd49deaf188d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e43bd5b2d5a3cb5bea64d82109963de633ab0c3e139ae36283cf4cbc0756a54e7952157c37e20c2bf0ee1c6edb09245671b77a5b1054a5073d13794063557e0
|
7
|
+
data.tar.gz: ac22976c0ee80b29e48ba6559230c742f97d86bbc2243cd51a4657833dc54ffb6b60b5a9919c8bbfc6be7404e9d6c4593fe8e5028ceb8cd45213d64b6b6f6ed9
|
@@ -34,6 +34,17 @@ module Metanorma
|
|
34
34
|
template_data("output_filename"),
|
35
35
|
)
|
36
36
|
|
37
|
+
# Determine base path for template files
|
38
|
+
# If template_dir is not absolute, then it is relative to the manifest
|
39
|
+
# file.
|
40
|
+
# If manifest file is not provided, then it is relative to the current
|
41
|
+
# directory.
|
42
|
+
@base_path = if manifest_file.nil?
|
43
|
+
Pathname.pwd
|
44
|
+
else
|
45
|
+
Pathname.new(manifest_file).parent
|
46
|
+
end
|
47
|
+
|
37
48
|
@compile_options = compile_options
|
38
49
|
end
|
39
50
|
# rubocop:enable Metrics/AbcSize
|
@@ -47,7 +58,8 @@ module Metanorma
|
|
47
58
|
|
48
59
|
compile_files!(select_source_files)
|
49
60
|
|
50
|
-
site_directory = asset_directory.
|
61
|
+
site_directory = asset_directory.parent
|
62
|
+
|
51
63
|
Dir.chdir(site_directory) do
|
52
64
|
build_collection_file!(relaton_collection_index)
|
53
65
|
convert_to_html_page!(relaton_collection_index, DEFAULT_SITE_INDEX)
|
@@ -61,7 +73,8 @@ module Metanorma
|
|
61
73
|
attr_reader :source, :asset_folder, :asset_directory, :site_path,
|
62
74
|
:manifest_file, :relaton_collection_index, :stylesheet,
|
63
75
|
:template_dir,
|
64
|
-
:output_filename_template
|
76
|
+
:output_filename_template,
|
77
|
+
:base_path
|
65
78
|
|
66
79
|
def find_realpath(source_path)
|
67
80
|
Pathname.new(source_path.to_s).realpath if source_path
|
@@ -128,14 +141,32 @@ module Metanorma
|
|
128
141
|
raise Errors::FatalCompilationError, fatals unless fatals.empty?
|
129
142
|
end
|
130
143
|
|
131
|
-
|
144
|
+
# Given a path, return the full path if it is not nil.
|
145
|
+
# If the path is absolute, return the path as is.
|
146
|
+
# If the path is relative, return the path relative to the base path.
|
147
|
+
# @param some_path [String, nil] the path to be converted to full path
|
148
|
+
# @return [String, nil] the full path
|
149
|
+
def full_path_for(some_path)
|
150
|
+
if some_path.nil?
|
151
|
+
nil
|
152
|
+
elsif Pathname.new(some_path).absolute?
|
153
|
+
some_path
|
154
|
+
elsif !base_path.nil?
|
155
|
+
base_path.join(some_path)
|
156
|
+
end
|
157
|
+
end
|
158
|
+
|
159
|
+
def convert_to_html_page!(
|
160
|
+
relaton_index_filename, page_name
|
161
|
+
)
|
132
162
|
UI.info("Generating html site in #{site_path} ...")
|
133
163
|
|
134
164
|
Relaton::Cli::XMLConvertor.to_html(
|
135
165
|
relaton_index_filename,
|
136
|
-
stylesheet,
|
137
|
-
template_dir,
|
166
|
+
full_path_for(stylesheet),
|
167
|
+
full_path_for(template_dir),
|
138
168
|
)
|
169
|
+
|
139
170
|
File.rename(
|
140
171
|
Pathname.new(relaton_index_filename).sub_ext(".html").to_s,
|
141
172
|
page_name,
|
@@ -230,6 +261,7 @@ module Metanorma
|
|
230
261
|
job,
|
231
262
|
compile: @compile_options,
|
232
263
|
output_dir: @asset_directory.join(".."),
|
264
|
+
site_generate: true,
|
233
265
|
)
|
234
266
|
end
|
235
267
|
end
|
data/metanorma-cli.gemspec
CHANGED
@@ -39,7 +39,7 @@ Gem::Specification.new do |spec|
|
|
39
39
|
spec.add_dependency "metanorma-standoc", "~> 3.0.0"
|
40
40
|
# spec.add_dependency 'metanorma-mpfa', "~> 0.9.0"
|
41
41
|
spec.add_dependency "git", "~> 1.5"
|
42
|
-
spec.add_dependency "lutaml-model"
|
42
|
+
spec.add_dependency "lutaml-model"
|
43
43
|
spec.add_dependency "metanorma", "~> 2.1.0"
|
44
44
|
spec.add_dependency "metanorma-iho", "~> 1.1.0"
|
45
45
|
spec.add_dependency "metanorma-itu", "~> 2.6.0"
|
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.12.
|
4
|
+
version: 1.12.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-04-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: metanorma-ietf
|
@@ -154,16 +154,16 @@ dependencies:
|
|
154
154
|
name: lutaml-model
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
|
-
- - "
|
157
|
+
- - ">="
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: 0
|
159
|
+
version: '0'
|
160
160
|
type: :runtime
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
|
-
- - "
|
164
|
+
- - ">="
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version: 0
|
166
|
+
version: '0'
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
168
|
name: metanorma
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|