metanorma-cli 1.12.1 → 1.12.3
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/Gemfile +22 -1
- data/bin/font-test +45 -43
- data/bin/rspec +3 -3
- data/exe/metanorma-manifest +12 -13
- data/lib/metanorma/cli/collection.rb +1 -1
- data/lib/metanorma/cli/command.rb +28 -12
- data/lib/metanorma/cli/commands/config.rb +25 -13
- data/lib/metanorma/cli/commands/site.rb +44 -21
- data/lib/metanorma/cli/commands/template_repo.rb +3 -2
- data/lib/metanorma/cli/compiler.rb +8 -5
- data/lib/metanorma/cli/site_generator.rb +96 -56
- data/lib/metanorma/cli/template_repo.rb +5 -4
- data/lib/metanorma/cli/version.rb +1 -1
- data/lib/metanorma/cli.rb +5 -4
- data/lib/metanorma/flavor.rb +6 -2
- data/lib/metanorma/site_manifest.rb +32 -0
- data/metanorma-cli.gemspec +26 -38
- metadata +33 -172
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90f685d6b13137d25912d7129caa1a487daf72b3c901cb886f70dc81b1db0379
|
4
|
+
data.tar.gz: 45b57be8c9ac1906e772d064502326d17ecb9537f313da2556cd855bdeb6dd1a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 159cd71befca37dacc12caafd5bc1e9da5f3d729630de5afd43a02f58c5a2089a9e1e6557dffaea4a915bd957ea9fa69c0ff9d7d82211896214b28c3970b1921
|
7
|
+
data.tar.gz: 15a912993f92551525183ab983a5de78d29407b45def67fb96046e6e5da3e43ff3b8cb988901cbb7fd4b1ba82c542148b444fce0b7e686caf56737952519fcce
|
data/Gemfile
CHANGED
@@ -10,4 +10,25 @@ end
|
|
10
10
|
|
11
11
|
gemspec
|
12
12
|
|
13
|
-
|
13
|
+
group :development do
|
14
|
+
gem "debug"
|
15
|
+
gem "pry"
|
16
|
+
gem "rake", "~> 13.0"
|
17
|
+
gem "rspec", "~> 3.0"
|
18
|
+
gem "rspec-command", "~> 1.0.3"
|
19
|
+
gem "rspec-core", "~> 3.4"
|
20
|
+
gem "rubocop", "~> 1"
|
21
|
+
gem "rubocop-performance"
|
22
|
+
# need for dev because locally compiled metanorma-iso does not have css
|
23
|
+
gem "sassc-embedded"
|
24
|
+
gem "simplecov", "~> 0.15"
|
25
|
+
gem "vcr", "~> 6.1.0"
|
26
|
+
gem "webmock"
|
27
|
+
gem "xml-c14n"
|
28
|
+
end
|
29
|
+
|
30
|
+
begin
|
31
|
+
eval_gemfile("Gemfile.devel")
|
32
|
+
rescue StandardError
|
33
|
+
nil
|
34
|
+
end
|
data/bin/font-test
CHANGED
@@ -1,56 +1,58 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# frozen_string_literal: true
|
3
|
+
|
3
4
|
require "fontist"
|
4
5
|
require "rubygems"
|
5
6
|
require "yaml"
|
6
7
|
|
7
8
|
flavors = ARGV
|
8
9
|
|
10
|
+
def die(message)
|
11
|
+
warn message
|
12
|
+
warn "Aborting..."
|
13
|
+
exit(1)
|
14
|
+
end
|
15
|
+
|
9
16
|
Fontist::Formula.update_formulas_repo
|
10
17
|
|
11
18
|
flavors.each do |flavor|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
STDERR.puts "Fontist failed with: #{e.message}"
|
51
|
-
else
|
52
|
-
STDERR.puts "Unknown error: #{e.message}"
|
53
|
-
end
|
54
|
-
exit(1)
|
19
|
+
gem_name = "metanorma-#{flavor}"
|
20
|
+
require gem_name
|
21
|
+
|
22
|
+
submodule = case flavor
|
23
|
+
when "jcgm"
|
24
|
+
"Bipm"
|
25
|
+
else
|
26
|
+
flavor.capitalize
|
27
|
+
end
|
28
|
+
processor_class = "Metanorma::#{submodule}::Processor"
|
29
|
+
|
30
|
+
processor = Object
|
31
|
+
.const_get(processor_class)
|
32
|
+
.new
|
33
|
+
|
34
|
+
unless processor.respond_to?(:fonts_manifest)
|
35
|
+
puts "#{flavor} does not require any fonts. Skipping."
|
36
|
+
exit(0)
|
37
|
+
end
|
38
|
+
|
39
|
+
manifest = processor.fonts_manifest
|
40
|
+
|
41
|
+
Fontist::Manifest::Install.from_hash(
|
42
|
+
manifest,
|
43
|
+
confirmation: "yes",
|
44
|
+
)
|
45
|
+
|
46
|
+
puts "#{flavor}-related fonts:"
|
47
|
+
puts Fontist::Manifest::Locations.from_hash(manifest).to_yaml
|
48
|
+
rescue LoadError => e
|
49
|
+
die "Could not load gem '#{gem_name}': #{e.message}"
|
50
|
+
rescue NameError => e
|
51
|
+
die "Could not find class '#{processor_class}': #{e.message}"
|
52
|
+
rescue StandardError => e
|
53
|
+
if e.class.to_s.start_with?("Fontist::Errors::")
|
54
|
+
die "Fontist failed with: #{e.message}"
|
55
|
+
else
|
56
|
+
die "Unknown error: #{e.message}"
|
55
57
|
end
|
56
58
|
end
|
data/bin/rspec
CHANGED
@@ -10,12 +10,12 @@
|
|
10
10
|
|
11
11
|
require "pathname"
|
12
12
|
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
13
|
-
|
13
|
+
Pathname.new(__FILE__).realpath)
|
14
14
|
|
15
|
-
bundle_binstub = File.expand_path("
|
15
|
+
bundle_binstub = File.expand_path("bundle", __dir__)
|
16
16
|
|
17
17
|
if File.file?(bundle_binstub)
|
18
|
-
if
|
18
|
+
if /This file was generated by Bundler/.match?(File.read(bundle_binstub, 300))
|
19
19
|
load(bundle_binstub)
|
20
20
|
else
|
21
21
|
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
data/exe/metanorma-manifest
CHANGED
@@ -92,7 +92,8 @@ opt_parser = OptionParser.new do |opts|
|
|
92
92
|
opts.on(
|
93
93
|
"-R dir",
|
94
94
|
"--relaton",
|
95
|
-
"Insert links to relaton XML, generated by relaton-server-csd,
|
95
|
+
"Insert links to relaton XML, generated by relaton-server-csd," \
|
96
|
+
" with root directory dir (/id/xxxx is supplied)",
|
96
97
|
) { |v| options[:relaton] = v }
|
97
98
|
|
98
99
|
opts.on_tail("-h", "--help", "Show this message") do
|
@@ -103,10 +104,8 @@ end
|
|
103
104
|
opt_parser.parse!(ARGV)
|
104
105
|
options[:filename] = ARGV.pop
|
105
106
|
|
106
|
-
|
107
|
-
|
108
|
-
require r
|
109
|
-
end
|
107
|
+
options[:require]&.each do |r|
|
108
|
+
require r
|
110
109
|
end
|
111
110
|
|
112
111
|
manifest = YAML.load_file(options[:filename])
|
@@ -115,16 +114,16 @@ documents = extract_documents(manifest)
|
|
115
114
|
|
116
115
|
# TODO real lookup of namespaces and root elements
|
117
116
|
|
118
|
-
out = <<~
|
117
|
+
out = <<~EOXML
|
119
118
|
<#{options[:type]}-standard xmlns="http://riboseinc.com/isoxml">
|
120
119
|
<bibdata type="standard">
|
121
120
|
<title>#{manifest['title']}</title>
|
122
|
-
|
121
|
+
EOXML
|
123
122
|
|
124
123
|
# TODO leave in anchor references?
|
125
124
|
#
|
126
125
|
documents.each do |d|
|
127
|
-
out += <<~
|
126
|
+
out += <<~EOXML
|
128
127
|
<relation type="partOf">
|
129
128
|
<bibdata type="standard">
|
130
129
|
<title>#{d['title']}</title>
|
@@ -132,20 +131,20 @@ documents.each do |d|
|
|
132
131
|
<abstract>#{d['description']}</abstract>
|
133
132
|
</bibdata>
|
134
133
|
</relation>
|
135
|
-
|
134
|
+
EOXML
|
136
135
|
end
|
137
136
|
|
138
|
-
out += <<~
|
137
|
+
out += <<~EOXML
|
139
138
|
</bibdata>
|
140
139
|
<sections>
|
141
|
-
|
140
|
+
EOXML
|
142
141
|
|
143
142
|
out += iterate(manifest["sections"], options)
|
144
143
|
|
145
|
-
out += <<~
|
144
|
+
out += <<~EOXML
|
146
145
|
</sections>
|
147
146
|
<#{options[:type]}-standard>
|
148
|
-
|
147
|
+
EOXML
|
149
148
|
outfilename = options[:filename].sub(/\.[^.]+$/, ".xml")
|
150
149
|
File.open(outfilename, "w") { |f| f.write out }
|
151
150
|
|
@@ -73,7 +73,7 @@ module Metanorma
|
|
73
73
|
end
|
74
74
|
|
75
75
|
def xml_extract_options_from_file
|
76
|
-
xml = Nokogiri::XML File.read(@file.to_s, encoding: "UTF-8"
|
76
|
+
xml = Nokogiri::XML File.read(@file.to_s, encoding: "UTF-8", &:huge)
|
77
77
|
{ "coverpage" => xml.at("//coverpage"),
|
78
78
|
"format" => xml.at("//format"),
|
79
79
|
"output_folder" => xml.at("//output_folder") }.compact
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "metanorma/cli/compiler"
|
2
4
|
require "metanorma/cli/generator"
|
3
5
|
require "metanorma/cli/collection"
|
@@ -12,7 +14,8 @@ module Metanorma
|
|
12
14
|
module Cli
|
13
15
|
class Command < ThorWithConfig
|
14
16
|
class_option :progress, aliases: "-s", type: :boolean, default: false,
|
15
|
-
desc: "Show progress for long running tasks
|
17
|
+
desc: "Show progress for long running tasks" \
|
18
|
+
" (like download)"
|
16
19
|
|
17
20
|
desc "new NAME", "Create new Metanorma document"
|
18
21
|
option :type, aliases: "-t", required: true, desc: "Document type"
|
@@ -36,26 +39,34 @@ module Metanorma
|
|
36
39
|
option :wrapper, aliases: "-w", type: :boolean,
|
37
40
|
desc: "Create wrapper folder for HTML output"
|
38
41
|
option :asciimath, aliases: "-a", type: :boolean,
|
39
|
-
desc: "Keep Asciimath in XML output instead of
|
42
|
+
desc: "Keep Asciimath in XML output instead of" \
|
43
|
+
" converting it to MathM"
|
40
44
|
option :datauriimage, aliases: "-d", type: :boolean,
|
41
45
|
desc: "Encode HTML output images as data URIs"
|
42
46
|
option :relaton, aliases: "-R",
|
43
|
-
desc: "Export Relaton XML for document to nominated
|
47
|
+
desc: "Export Relaton XML for document to nominated" \
|
48
|
+
" filename"
|
44
49
|
option :extract, aliases: "-e",
|
45
|
-
desc: "Export sourcecode fragments from this document
|
50
|
+
desc: "Export sourcecode fragments from this document" \
|
51
|
+
" to nominated directory"
|
46
52
|
option :version, aliases: "-v",
|
47
53
|
desc: "Print version of code (accompanied with -t)"
|
48
54
|
option :output_dir, aliases: "-o",
|
49
55
|
desc: "Directory to save compiled files"
|
50
56
|
option :strict, aliases: "-S", type: :boolean,
|
51
57
|
desc: "Strict compilation: abort if there are any errors"
|
52
|
-
option :agree_to_terms,
|
53
|
-
|
58
|
+
option :agree_to_terms,
|
59
|
+
type: :boolean,
|
60
|
+
desc: "Agree / Disagree with all third-party licensing terms "\
|
61
|
+
"presented (WARNING: do know what you are agreeing with!)"
|
54
62
|
option :install_fonts, type: :boolean, default: true,
|
55
63
|
desc: "Install required fonts"
|
56
|
-
option :continue_without_fonts,
|
57
|
-
|
64
|
+
option :continue_without_fonts,
|
65
|
+
type: :boolean,
|
66
|
+
desc: "Continue processing even when fonts are missing"
|
58
67
|
|
68
|
+
# rubocop:disable Metrics/PerceivedComplexity
|
69
|
+
# rubocop:disable Metrics/AbcSize
|
59
70
|
def compile(file_name = nil)
|
60
71
|
if file_name && !options[:version]
|
61
72
|
documents = select_wildcard_documents(file_name) || [file_name]
|
@@ -71,18 +82,23 @@ module Metanorma
|
|
71
82
|
invoke :help
|
72
83
|
end
|
73
84
|
end
|
85
|
+
# rubocop:enable Metrics/AbcSize
|
86
|
+
# rubocop:enable Metrics/PerceivedComplexity
|
74
87
|
|
75
88
|
desc "collection FILENAME", "Render HTML pages from XML/YAML colection"
|
76
89
|
option :format, aliases: "-x", type: :string, desc: "Formats to generate"
|
77
90
|
option :output_folder, aliases: "-w",
|
78
91
|
desc: "Directory to save compiled files"
|
79
92
|
option :coverpage, aliases: "-c", desc: "Liquid template"
|
80
|
-
option :agree_to_terms,
|
81
|
-
|
93
|
+
option :agree_to_terms,
|
94
|
+
type: :boolean,
|
95
|
+
desc: "Agree / Disagree with all third-party licensing terms "\
|
96
|
+
"presented (WARNING: do know what you are agreeing with!)"
|
82
97
|
option :install_fonts, type: :boolean, default: true,
|
83
98
|
desc: "Install required fonts"
|
84
|
-
option :continue_without_fonts,
|
85
|
-
|
99
|
+
option :continue_without_fonts,
|
100
|
+
type: :boolean,
|
101
|
+
desc: "Continue processing even when fonts are missing"
|
86
102
|
option :strict, aliases: "-S", type: :boolean, \
|
87
103
|
desc: "Strict compilation: abort if there are any errors"
|
88
104
|
|
@@ -1,20 +1,22 @@
|
|
1
1
|
require "pathname"
|
2
2
|
require "metanorma-utils"
|
3
3
|
|
4
|
-
#require "metanorma/cli/stringify_all_keys"
|
4
|
+
# require "metanorma/cli/stringify_all_keys"
|
5
5
|
|
6
6
|
module Metanorma
|
7
7
|
module Cli
|
8
8
|
module Commands
|
9
9
|
class Config < Thor
|
10
|
-
|
11
|
-
|
10
|
+
Hash.include Metanorma::Utils::Hash
|
11
|
+
Array.include Metanorma::Utils::Array
|
12
12
|
|
13
|
-
class_option :global, aliases: "-g", type: :boolean, default: false,
|
13
|
+
class_option :global, aliases: "-g", type: :boolean, default: false,
|
14
|
+
desc: "Use global config"
|
14
15
|
|
15
16
|
desc "get NAME", "Get config value"
|
16
17
|
def get(name = nil)
|
17
|
-
config, config_path = load_config(options[:global],
|
18
|
+
config, config_path = load_config(options[:global],
|
19
|
+
create_default_config: false)
|
18
20
|
|
19
21
|
if name.nil? && File.exist?(config_path)
|
20
22
|
UI.say File.read(config_path, encoding: "utf-8")
|
@@ -47,16 +49,25 @@ module Metanorma
|
|
47
49
|
def self.exit_on_failure?() true end
|
48
50
|
|
49
51
|
# priority:
|
50
|
-
# IDEAL:
|
51
|
-
#
|
52
|
-
#
|
52
|
+
# IDEAL:
|
53
|
+
# thor defaults -> global conf -> local conf
|
54
|
+
# -> env vars -> passed arguments
|
55
|
+
#
|
56
|
+
# ACTUAL:
|
57
|
+
# all arguments -> global conf -> local conf
|
58
|
+
#
|
59
|
+
# - thor doesn't provide to differentiate default values against passed
|
60
|
+
# args
|
53
61
|
# - thor doesn't allow to get all args available for current command
|
54
|
-
def self.load_configs(options, configs = [
|
62
|
+
def self.load_configs(options, configs = [
|
63
|
+
Metanorma::Cli.global_config_path, Metanorma::Cli.local_config_path
|
64
|
+
])
|
55
65
|
result = options.dup
|
56
66
|
configs.each do |config_path|
|
57
67
|
next unless File.exist?(config_path)
|
58
68
|
|
59
|
-
config_values = ::YAML::load_file(config_path)
|
69
|
+
config_values = ::YAML::load_file(config_path)
|
70
|
+
.symbolize_all_keys[:cli] || {}
|
60
71
|
result.merge!(config_values)
|
61
72
|
end
|
62
73
|
|
@@ -80,15 +91,16 @@ module Metanorma
|
|
80
91
|
end
|
81
92
|
|
82
93
|
def load_config(global_config, create_default_config: true)
|
83
|
-
config_path = Metanorma::Cli.config_path(global_config)
|
94
|
+
config_path = Metanorma::Cli.config_path(global: global_config)
|
84
95
|
|
85
96
|
unless File.exist?(config_path) || create_default_config
|
86
|
-
config_path = Metanorma::Cli.config_path(true)
|
97
|
+
config_path = Metanorma::Cli.config_path(global: true)
|
87
98
|
end
|
88
99
|
|
89
100
|
save_default_config(config_path)
|
90
101
|
|
91
|
-
[::YAML::load_file(config_path).symbolize_all_keys || {},
|
102
|
+
[::YAML::load_file(config_path).symbolize_all_keys || {},
|
103
|
+
config_path]
|
92
104
|
end
|
93
105
|
|
94
106
|
def dig_path(str)
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "pathname"
|
2
4
|
require "metanorma/cli/site_generator"
|
3
5
|
require "metanorma/cli/thor_with_config"
|
@@ -6,31 +8,52 @@ module Metanorma
|
|
6
8
|
module Cli
|
7
9
|
module Commands
|
8
10
|
class Site < ThorWithConfig
|
9
|
-
SITE_OUTPUT_DIRNAME = "_site"
|
11
|
+
SITE_OUTPUT_DIRNAME = "_site"
|
10
12
|
|
11
13
|
desc "generate [SOURCE_PATH]", "Generate site from collection"
|
12
|
-
option :config,
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
option :
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
14
|
+
option :config,
|
15
|
+
aliases: "-c",
|
16
|
+
desc: "Metanorma configuration file"
|
17
|
+
|
18
|
+
option :output_dir,
|
19
|
+
aliases: "-o",
|
20
|
+
default: Pathname.new(Dir.pwd).join(SITE_OUTPUT_DIRNAME).to_s,
|
21
|
+
desc: "Output directory for generated site"
|
22
|
+
|
23
|
+
option :output_filename_template,
|
24
|
+
default: nil,
|
25
|
+
desc: "Liquid template to generate output filenames" \
|
26
|
+
" (using Relaton model)"
|
27
|
+
|
28
|
+
option :agree_to_terms,
|
29
|
+
type: :boolean,
|
30
|
+
desc: "Agree / Disagree with all third-party licensing" \
|
31
|
+
" terms presented (WARNING: do know what you are" \
|
32
|
+
" agreeing with!)"
|
33
|
+
option :install_fonts,
|
34
|
+
type: :boolean,
|
35
|
+
default: true,
|
36
|
+
desc: "Install required fonts"
|
37
|
+
|
38
|
+
option :continue_without_fonts,
|
39
|
+
type: :boolean,
|
40
|
+
desc: "Continue processing even when fonts are missing"
|
41
|
+
|
42
|
+
option :stylesheet,
|
43
|
+
aliases: "-s",
|
44
|
+
desc: "Stylesheet file path for rendering HTML page"
|
45
|
+
|
46
|
+
option :template_dir,
|
47
|
+
aliases: "-t",
|
48
|
+
desc: "Liquid template directory to render site design"
|
49
|
+
|
50
|
+
option :strict,
|
51
|
+
aliases: "-S",
|
52
|
+
type: :boolean,
|
53
|
+
desc: "Strict compilation: abort if there are any errors"
|
31
54
|
|
32
55
|
def generate(source_path = Dir.pwd)
|
33
|
-
Cli::SiteGenerator.generate(
|
56
|
+
Cli::SiteGenerator.generate!(
|
34
57
|
source_path,
|
35
58
|
options,
|
36
59
|
filter_compile_options(options),
|
@@ -6,12 +6,13 @@ module Metanorma
|
|
6
6
|
module Commands
|
7
7
|
class TemplateRepo < ThorWithConfig
|
8
8
|
desc "add NAME SOURCE", "Add new metanorma templates repository"
|
9
|
-
option :overwrite, aliases: "-y",
|
9
|
+
option :overwrite, aliases: "-y",
|
10
|
+
type: :boolean,
|
11
|
+
desc: "Overwrite existing template"
|
10
12
|
|
11
13
|
def add(name, source)
|
12
14
|
Metanorma::Cli::TemplateRepo.add(name, source, options)
|
13
15
|
UI.say("Template repo: #{name} has been added successfully")
|
14
|
-
|
15
16
|
rescue Errors::DuplicateTemplateError
|
16
17
|
UI.error("Duplicate metanorma template")
|
17
18
|
end
|
@@ -4,7 +4,6 @@ require "metanorma/cli/errors"
|
|
4
4
|
module Metanorma
|
5
5
|
module Cli
|
6
6
|
class Compiler
|
7
|
-
|
8
7
|
def initialize(file, options)
|
9
8
|
validate_file_path(file)
|
10
9
|
@file = file
|
@@ -16,12 +15,16 @@ module Metanorma
|
|
16
15
|
path = Pathname.new(file)
|
17
16
|
# Check if provided file path exists
|
18
17
|
unless path.exist?
|
19
|
-
raise ::Metanorma::Cli::Errors::FileNotFoundError.new(
|
18
|
+
raise ::Metanorma::Cli::Errors::FileNotFoundError.new(
|
19
|
+
"Specified input file '#{file}' does not exist",
|
20
|
+
)
|
20
21
|
end
|
21
22
|
|
22
23
|
# Check if provided file is really a file
|
23
24
|
unless path.file?
|
24
|
-
raise ::Metanorma::Cli::Errors::FileNotFoundError.new(
|
25
|
+
raise ::Metanorma::Cli::Errors::FileNotFoundError.new(
|
26
|
+
"Specified input file '#{file}' is not a file",
|
27
|
+
)
|
25
28
|
end
|
26
29
|
end
|
27
30
|
|
@@ -58,12 +61,12 @@ module Metanorma
|
|
58
61
|
Hash.new.tap do |hash|
|
59
62
|
hash[:extract] = extract[0]
|
60
63
|
hash[:extract_type] =
|
61
|
-
extract.
|
64
|
+
extract.empty? ? [] : extract.map(&:to_sym)
|
62
65
|
end
|
63
66
|
end
|
64
67
|
|
65
68
|
def extension_option
|
66
|
-
|
69
|
+
extensions.empty? ? {} : { extension_keys: extensions.map(&:to_sym) }
|
67
70
|
end
|
68
71
|
|
69
72
|
def serialize(options)
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "yaml"
|
2
4
|
require "pathname"
|
3
5
|
require "fileutils"
|
@@ -5,48 +7,61 @@ require "fileutils"
|
|
5
7
|
module Metanorma
|
6
8
|
module Cli
|
7
9
|
class SiteGenerator
|
10
|
+
DEFAULT_RELATON_COLLECTION_INDEX = "documents.xml"
|
11
|
+
DEFAULT_ASSET_FOLDER = "documents"
|
12
|
+
DEFAULT_SITE_INDEX = "index.html"
|
13
|
+
DEFAULT_CONFIG_FILE = "metanorma.yml"
|
14
|
+
|
15
|
+
# rubocop:disable Metrics/AbcSize
|
8
16
|
def initialize(source, options = {}, compile_options = {})
|
9
17
|
@collection_queue = []
|
10
18
|
@source = find_realpath(source)
|
11
19
|
@site_path = options.fetch(
|
12
20
|
:output_dir, Commands::Site::SITE_OUTPUT_DIRNAME
|
13
21
|
).to_s
|
14
|
-
|
15
|
-
@
|
22
|
+
|
23
|
+
@asset_folder = options.fetch(:asset_folder, DEFAULT_ASSET_FOLDER).to_s
|
24
|
+
@relaton_collection_index = options.fetch(
|
25
|
+
:collection_name,
|
26
|
+
DEFAULT_RELATON_COLLECTION_INDEX,
|
27
|
+
)
|
16
28
|
|
17
29
|
@manifest_file = find_realpath(options.fetch(:config, default_config))
|
18
30
|
@template_dir = options.fetch(:template_dir, template_data("path"))
|
19
31
|
@stylesheet = options.fetch(:stylesheet, template_data("stylesheet"))
|
32
|
+
@output_filename_template = options.fetch(
|
33
|
+
:output_filename_template,
|
34
|
+
template_data("output_filename"),
|
35
|
+
)
|
20
36
|
|
21
37
|
@compile_options = compile_options
|
22
|
-
ensure_site_asset_directory!
|
23
38
|
end
|
39
|
+
# rubocop:enable Metrics/AbcSize
|
24
40
|
|
25
|
-
def self.generate(source, options = {}, compile_options = {})
|
26
|
-
new(source, options, compile_options).generate
|
41
|
+
def self.generate!(source, options = {}, compile_options = {})
|
42
|
+
new(source, options, compile_options).generate!
|
27
43
|
end
|
28
44
|
|
29
|
-
def generate
|
30
|
-
|
31
|
-
|
32
|
-
fatals = select_source_files.map { |source| compile(source) }
|
33
|
-
.flatten
|
34
|
-
.compact
|
45
|
+
def generate!
|
46
|
+
ensure_site_asset_directory!
|
35
47
|
|
36
|
-
|
48
|
+
compile_files!(select_source_files)
|
37
49
|
|
50
|
+
site_directory = asset_directory.join("..")
|
38
51
|
Dir.chdir(site_directory) do
|
39
|
-
build_collection_file(
|
40
|
-
convert_to_html_page(
|
52
|
+
build_collection_file!(relaton_collection_index)
|
53
|
+
convert_to_html_page!(relaton_collection_index, DEFAULT_SITE_INDEX)
|
41
54
|
end
|
42
55
|
|
43
|
-
dequeue_jobs
|
56
|
+
dequeue_jobs!
|
44
57
|
end
|
45
58
|
|
46
59
|
private
|
47
60
|
|
48
|
-
attr_reader :source, :asset_folder, :asset_directory, :site_path
|
49
|
-
|
61
|
+
attr_reader :source, :asset_folder, :asset_directory, :site_path,
|
62
|
+
:manifest_file, :relaton_collection_index, :stylesheet,
|
63
|
+
:template_dir,
|
64
|
+
:output_filename_template
|
50
65
|
|
51
66
|
def find_realpath(source_path)
|
52
67
|
Pathname.new(source_path.to_s).realpath if source_path
|
@@ -55,7 +70,7 @@ module Metanorma
|
|
55
70
|
end
|
56
71
|
|
57
72
|
def default_config
|
58
|
-
default_file = Pathname.new(Dir.pwd).join(
|
73
|
+
default_file = Pathname.new(Dir.pwd).join(DEFAULT_CONFIG_FILE)
|
59
74
|
default_file if File.exist?(default_file)
|
60
75
|
end
|
61
76
|
|
@@ -66,90 +81,115 @@ module Metanorma
|
|
66
81
|
files = Dir[File.join(source, "**", "*.adoc")]
|
67
82
|
end
|
68
83
|
|
69
|
-
files.flatten
|
84
|
+
result = files.flatten
|
85
|
+
result.uniq!
|
86
|
+
result.reject! { |file| File.directory?(file) }
|
87
|
+
result
|
70
88
|
end
|
71
89
|
|
72
|
-
def build_collection_file(
|
73
|
-
collection_path = [site_path,
|
90
|
+
def build_collection_file!(relaton_collection_index_filename)
|
91
|
+
collection_path = [site_path,
|
92
|
+
relaton_collection_index_filename].join("/")
|
74
93
|
UI.info("Building collection file: #{collection_path} ...")
|
75
94
|
|
76
95
|
Relaton::Cli::RelatonFile.concatenate(
|
77
96
|
asset_folder,
|
78
|
-
|
97
|
+
relaton_collection_index_filename,
|
79
98
|
title: manifest[:collection_name],
|
80
99
|
organization: manifest[:collection_organization],
|
81
100
|
)
|
82
101
|
end
|
83
102
|
|
84
|
-
def
|
103
|
+
def compile_file!(source)
|
85
104
|
if collection_file?(source)
|
86
105
|
return
|
87
106
|
end
|
88
107
|
|
89
108
|
UI.info("Compiling #{source} ...")
|
90
109
|
|
110
|
+
# Incorporate output_filename_template so the output file
|
111
|
+
# can be named as desired, using liquid template and Relaton LiquidDrop
|
91
112
|
options = @compile_options.merge(
|
92
|
-
|
93
|
-
|
113
|
+
output_filename_template: output_filename_template,
|
114
|
+
format: :asciidoc,
|
115
|
+
output_dir: build_asset_output_directory!(source),
|
116
|
+
site_generate: true,
|
94
117
|
)
|
95
118
|
|
96
119
|
options[:baseassetpath] = Pathname.new(source.to_s).dirname.to_s
|
97
120
|
Metanorma::Cli::Compiler.compile(source.to_s, options)
|
98
121
|
end
|
99
122
|
|
100
|
-
def
|
123
|
+
def compile_files!(files)
|
124
|
+
fatals = files.map { |source| compile_file!(source) }
|
125
|
+
fatals.flatten!
|
126
|
+
fatals.compact!
|
127
|
+
|
128
|
+
raise Errors::FatalCompilationError, fatals unless fatals.empty?
|
129
|
+
end
|
130
|
+
|
131
|
+
def convert_to_html_page!(relaton_index_filename, page_name)
|
101
132
|
UI.info("Generating html site in #{site_path} ...")
|
102
133
|
|
103
|
-
Relaton::Cli::XMLConvertor.to_html(
|
104
|
-
|
134
|
+
Relaton::Cli::XMLConvertor.to_html(
|
135
|
+
relaton_index_filename,
|
136
|
+
stylesheet,
|
137
|
+
template_dir,
|
138
|
+
)
|
139
|
+
File.rename(
|
140
|
+
Pathname.new(relaton_index_filename).sub_ext(".html").to_s,
|
141
|
+
page_name,
|
142
|
+
)
|
105
143
|
end
|
106
144
|
|
107
145
|
def template_data(node)
|
108
|
-
|
109
|
-
template_node&.fetch(node.to_s, nil)
|
146
|
+
manifest[:template]&.public_send(node.to_s)
|
110
147
|
end
|
111
148
|
|
112
149
|
def manifest
|
113
150
|
@manifest ||= config_from_manifest || {
|
114
|
-
files: [],
|
151
|
+
files: [],
|
152
|
+
collection_name: "",
|
153
|
+
collection_organization: "",
|
115
154
|
}
|
116
155
|
end
|
117
156
|
|
118
157
|
def config_from_manifest
|
119
158
|
if manifest_file
|
120
|
-
manifest_config(
|
159
|
+
manifest_config(
|
160
|
+
Metanorma::SiteManifest::Base.from_yaml(
|
161
|
+
File.read(manifest_file.to_s),
|
162
|
+
),
|
163
|
+
)
|
121
164
|
end
|
122
165
|
end
|
123
166
|
|
124
|
-
def manifest_config(
|
167
|
+
def manifest_config(manifest_model)
|
125
168
|
{
|
126
|
-
files:
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
),
|
137
|
-
|
138
|
-
template: extract_config_data(manifest["metanorma"], "template"),
|
169
|
+
files: manifest_model&.metanorma&.source&.files || [],
|
170
|
+
template: manifest_model&.metanorma&.template,
|
171
|
+
collection_name: manifest_model
|
172
|
+
.metanorma
|
173
|
+
.collection
|
174
|
+
.name,
|
175
|
+
collection_organization: manifest_model
|
176
|
+
.metanorma
|
177
|
+
.collection
|
178
|
+
.organization,
|
139
179
|
}
|
140
180
|
rescue NoMethodError
|
141
181
|
raise Errors::InvalidManifestFileError.new("Invalid manifest file")
|
142
182
|
end
|
143
183
|
|
144
|
-
def extract_config_data(node, key)
|
145
|
-
node ? node[key] : nil
|
146
|
-
end
|
147
|
-
|
148
184
|
def source_from_manifest
|
149
|
-
@source_from_manifest ||=
|
150
|
-
|
151
|
-
|
152
|
-
|
185
|
+
@source_from_manifest ||= begin
|
186
|
+
result = manifest[:files].map do |source_file|
|
187
|
+
file_path = source.join(source_file).to_s
|
188
|
+
file_path.include?("*") ? Dir.glob(file_path) : file_path
|
189
|
+
end
|
190
|
+
result.flatten!
|
191
|
+
result
|
192
|
+
end
|
153
193
|
end
|
154
194
|
|
155
195
|
def ensure_site_asset_directory!
|
@@ -163,7 +203,7 @@ module Metanorma
|
|
163
203
|
FileUtils.mkdir_p(directory) unless directory.exist?
|
164
204
|
end
|
165
205
|
|
166
|
-
def build_asset_output_directory(source)
|
206
|
+
def build_asset_output_directory!(source)
|
167
207
|
sub_directory = Pathname.new(source.gsub(@source.to_s, "")).dirname.to_s
|
168
208
|
sub_directory.gsub!("/sources", "")
|
169
209
|
sub_directory.slice!(0)
|
@@ -182,7 +222,7 @@ module Metanorma
|
|
182
222
|
end
|
183
223
|
end
|
184
224
|
|
185
|
-
def dequeue_jobs
|
225
|
+
def dequeue_jobs!
|
186
226
|
job = @collection_queue.pop
|
187
227
|
|
188
228
|
if job
|
@@ -1,12 +1,11 @@
|
|
1
1
|
require "yaml"
|
2
2
|
require "metanorma-utils"
|
3
3
|
|
4
|
-
#require "metanorma/cli/stringify_all_keys"
|
4
|
+
# require "metanorma/cli/stringify_all_keys"
|
5
5
|
|
6
6
|
module Metanorma
|
7
7
|
module Cli
|
8
8
|
class TemplateRepo
|
9
|
-
|
10
9
|
Hash.include Metanorma::Utils::Hash
|
11
10
|
Array.include Metanorma::Utils::Array
|
12
11
|
|
@@ -38,7 +37,7 @@ module Metanorma
|
|
38
37
|
end
|
39
38
|
|
40
39
|
def template_config_file
|
41
|
-
@template_config_file ||= Cli.config_path(true)
|
40
|
+
@template_config_file ||= Cli.config_path(global: true)
|
42
41
|
end
|
43
42
|
|
44
43
|
def create_template_config
|
@@ -60,7 +59,9 @@ module Metanorma
|
|
60
59
|
names = templates[:templates].map { |template| template[:name].to_s }
|
61
60
|
|
62
61
|
if names.include?(name.to_s) && overwrite == false
|
63
|
-
raise Errors::DuplicateTemplateError.new(
|
62
|
+
raise Errors::DuplicateTemplateError.new(
|
63
|
+
"Duplicate metanorma template",
|
64
|
+
)
|
64
65
|
end
|
65
66
|
|
66
67
|
templates[:templates].push({ name: name, source: source, type: type })
|
data/lib/metanorma/cli.rb
CHANGED
@@ -3,13 +3,14 @@
|
|
3
3
|
require "metanorma"
|
4
4
|
require "metanorma/flavor"
|
5
5
|
|
6
|
+
require "metanorma/site_manifest"
|
7
|
+
|
6
8
|
require "metanorma/cli/version"
|
7
9
|
require "metanorma/cli/errors"
|
8
10
|
require "metanorma/cli/command"
|
9
11
|
|
10
12
|
module Metanorma
|
11
13
|
module Cli
|
12
|
-
|
13
14
|
CONFIG_DIRNAME = ".metanorma"
|
14
15
|
CONFIG_FILENAME = "config.yml"
|
15
16
|
|
@@ -32,7 +33,7 @@ module Metanorma
|
|
32
33
|
end
|
33
34
|
|
34
35
|
Metanorma::Cli::Command.start(arguments)
|
35
|
-
rescue Interrupt
|
36
|
+
rescue SignalException # `Interrupt` inherits from this
|
36
37
|
UI.say("Process cancelled, exiting.")
|
37
38
|
rescue Errors::FileNotFoundError => e
|
38
39
|
UI.say("Error: #{e}. \nNot sure what to run? try: metanorma help")
|
@@ -65,7 +66,7 @@ module Metanorma
|
|
65
66
|
Pathname.new(Dir.pwd).join(CONFIG_DIRNAME, CONFIG_FILENAME)
|
66
67
|
end
|
67
68
|
|
68
|
-
def self.config_path(global
|
69
|
+
def self.config_path(global: false)
|
69
70
|
return global_config_path if global
|
70
71
|
|
71
72
|
local_config_path
|
@@ -91,7 +92,7 @@ module Metanorma
|
|
91
92
|
|
92
93
|
def self.find_command(arguments)
|
93
94
|
commands = Metanorma::Cli::Command.all_commands.keys
|
94
|
-
commands.select { |cmd| arguments.include?(cmd.
|
95
|
+
commands.select { |cmd| arguments.include?(cmd.tr("_", "-")) == true }
|
95
96
|
end
|
96
97
|
|
97
98
|
def self.print_fatal_summary(error)
|
data/lib/metanorma/flavor.rb
CHANGED
@@ -14,7 +14,7 @@ module Metanorma
|
|
14
14
|
"metanorma-csa",
|
15
15
|
"metanorma-iho",
|
16
16
|
"metanorma-jis",
|
17
|
-
# "metanorma-m3aawg",
|
17
|
+
# "metanorma-m3aawg",
|
18
18
|
"metanorma-generic",
|
19
19
|
"metanorma-standoc",
|
20
20
|
# "metanorma-un",
|
@@ -56,7 +56,11 @@ module Metanorma
|
|
56
56
|
private
|
57
57
|
|
58
58
|
def flavors
|
59
|
-
@flavors ||=
|
59
|
+
@flavors ||= begin
|
60
|
+
result = [SUPPORTED_GEMS + PRIVATE_SUPPORTED_GEMS].flatten
|
61
|
+
result.uniq!
|
62
|
+
result
|
63
|
+
end
|
60
64
|
end
|
61
65
|
|
62
66
|
def gem_loading_error(flavor_name)
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "lutaml/model"
|
4
|
+
|
5
|
+
module Metanorma
|
6
|
+
module SiteManifest
|
7
|
+
class SourceEntries < Lutaml::Model::Serializable
|
8
|
+
attribute :files, :string, collection: true
|
9
|
+
end
|
10
|
+
|
11
|
+
class SiteMetadata < Lutaml::Model::Serializable
|
12
|
+
attribute :organization, :string
|
13
|
+
attribute :name, :string
|
14
|
+
end
|
15
|
+
|
16
|
+
class SiteTemplate < Lutaml::Model::Serializable
|
17
|
+
attribute :path, :string
|
18
|
+
attribute :stylesheet, :string
|
19
|
+
attribute :output_filename, :string
|
20
|
+
end
|
21
|
+
|
22
|
+
class Manifest < Lutaml::Model::Serializable
|
23
|
+
attribute :source, SourceEntries
|
24
|
+
attribute :collection, SiteMetadata
|
25
|
+
attribute :template, SiteTemplate
|
26
|
+
end
|
27
|
+
|
28
|
+
class Base < Lutaml::Model::Serializable
|
29
|
+
attribute :metanorma, Manifest
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
data/metanorma-cli.gemspec
CHANGED
@@ -25,45 +25,33 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.require_paths = ["lib"]
|
26
26
|
spec.required_ruby_version = ">= 3.1.0"
|
27
27
|
|
28
|
-
spec.
|
29
|
-
spec.
|
30
|
-
spec.
|
31
|
-
spec.
|
32
|
-
spec.
|
33
|
-
spec.
|
34
|
-
spec.
|
35
|
-
spec.
|
36
|
-
#
|
37
|
-
spec.
|
38
|
-
spec.
|
39
|
-
spec.
|
40
|
-
spec.
|
28
|
+
spec.add_dependency "metanorma-ietf", "~> 3.5.0"
|
29
|
+
spec.add_dependency "metanorma-iso", "~> 3.0.0"
|
30
|
+
spec.add_dependency "mnconvert"
|
31
|
+
# spec.add_dependency "thor", "~> 1.0" # inherited from vectory
|
32
|
+
# spec.add_dependency "metanorma-gb", "~> 1.5.0"
|
33
|
+
spec.add_dependency "metanorma-cc", "~> 2.6.0"
|
34
|
+
spec.add_dependency "metanorma-csa", "~> 2.6.0"
|
35
|
+
spec.add_dependency "metanorma-iec", "~> 2.6.0"
|
36
|
+
# spec.add_dependency 'metanorma-ribose', "~> 2.3.0"
|
37
|
+
spec.add_dependency "metanorma-bipm", "~> 2.6.0"
|
38
|
+
spec.add_dependency "metanorma-generic", "~> 3.0.0"
|
39
|
+
spec.add_dependency "metanorma-standoc", "~> 3.0.0"
|
40
|
+
# spec.add_dependency 'metanorma-mpfa', "~> 0.9.0"
|
41
|
+
spec.add_dependency "git", "~> 1.5"
|
42
|
+
spec.add_dependency "lutaml-model", "~> 0.6.7"
|
43
|
+
spec.add_dependency "metanorma", "~> 2.1.0"
|
44
|
+
spec.add_dependency "metanorma-iho", "~> 1.1.0"
|
45
|
+
spec.add_dependency "metanorma-itu", "~> 2.6.0"
|
46
|
+
# spec.add_dependency "metanorma-nist", "~> 2.6.0"
|
47
|
+
spec.add_dependency "liquid", "~> 5"
|
48
|
+
spec.add_dependency "metanorma-ieee", "~> 1.4.0"
|
49
|
+
spec.add_dependency "metanorma-jis", "~> 0.5.0"
|
50
|
+
spec.add_dependency "metanorma-ogc", "~> 2.7.0"
|
51
|
+
spec.add_dependency "metanorma-plateau", "~> 1.0.0"
|
52
|
+
spec.add_dependency "relaton-cli", ">= 0.8.2"
|
41
53
|
|
42
|
-
spec.
|
43
|
-
spec.add_runtime_dependency "metanorma-iso", "~> 3.0.0"
|
44
|
-
spec.add_runtime_dependency "mnconvert"
|
45
|
-
# spec.add_runtime_dependency "thor", "~> 1.0" # inherited from vectory
|
46
|
-
# spec.add_runtime_dependency "metanorma-gb", "~> 1.5.0"
|
47
|
-
spec.add_runtime_dependency "metanorma-cc", "~> 2.6.0"
|
48
|
-
spec.add_runtime_dependency "metanorma-csa", "~> 2.6.0"
|
49
|
-
spec.add_runtime_dependency "metanorma-iec", "~> 2.6.0"
|
50
|
-
# spec.add_runtime_dependency 'metanorma-ribose', "~> 2.3.0"
|
51
|
-
spec.add_runtime_dependency "metanorma-bipm", "~> 2.6.0"
|
52
|
-
spec.add_runtime_dependency "metanorma-generic", "~> 3.0.0"
|
53
|
-
spec.add_runtime_dependency "metanorma-standoc", "~> 3.0.0"
|
54
|
-
# spec.add_runtime_dependency 'metanorma-mpfa', "~> 0.9.0"
|
55
|
-
spec.add_runtime_dependency "git", "~> 1.5"
|
56
|
-
spec.add_runtime_dependency "metanorma", "~> 2.1.0"
|
57
|
-
spec.add_runtime_dependency "metanorma-iho", "~> 1.1.0"
|
58
|
-
spec.add_runtime_dependency "metanorma-itu", "~> 2.6.0"
|
59
|
-
# spec.add_runtime_dependency "metanorma-nist", "~> 2.6.0"
|
60
|
-
spec.add_runtime_dependency "metanorma-ieee", "~> 1.4.0"
|
61
|
-
spec.add_runtime_dependency "metanorma-jis", "~> 0.5.0"
|
62
|
-
spec.add_runtime_dependency "metanorma-ogc", "~> 2.7.0"
|
63
|
-
spec.add_runtime_dependency "metanorma-plateau", "~> 0.2.0"
|
64
|
-
spec.add_runtime_dependency "relaton-cli", ">= 0.8.2"
|
65
|
-
|
66
|
-
spec.add_runtime_dependency "socksify"
|
54
|
+
spec.add_dependency "socksify"
|
67
55
|
# spec.metadata["rubygems_mfa_required"] = "true"
|
68
56
|
# NOBODY UNCOMMENTS THIS WITHOUT EXPLAINING TO ME HOW TO USE MFA
|
69
57
|
end
|
metadata
CHANGED
@@ -1,183 +1,15 @@
|
|
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.3
|
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-03-
|
11
|
+
date: 2025-03-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: debug
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rake
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '13.0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '13.0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: rspec
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '3.0'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '3.0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rspec-command
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: 1.0.3
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: 1.0.3
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: rspec-core
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - "~>"
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '3.4'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - "~>"
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '3.4'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: simplecov
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - "~>"
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0.15'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - "~>"
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '0.15'
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: vcr
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - "~>"
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: 6.1.0
|
104
|
-
type: :development
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - "~>"
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: 6.1.0
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: webmock
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - ">="
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '0'
|
118
|
-
type: :development
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - ">="
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: '0'
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
|
-
name: rubocop
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
128
|
-
requirements:
|
129
|
-
- - "~>"
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: '1'
|
132
|
-
type: :development
|
133
|
-
prerelease: false
|
134
|
-
version_requirements: !ruby/object:Gem::Requirement
|
135
|
-
requirements:
|
136
|
-
- - "~>"
|
137
|
-
- !ruby/object:Gem::Version
|
138
|
-
version: '1'
|
139
|
-
- !ruby/object:Gem::Dependency
|
140
|
-
name: rubocop-performance
|
141
|
-
requirement: !ruby/object:Gem::Requirement
|
142
|
-
requirements:
|
143
|
-
- - ">="
|
144
|
-
- !ruby/object:Gem::Version
|
145
|
-
version: '0'
|
146
|
-
type: :development
|
147
|
-
prerelease: false
|
148
|
-
version_requirements: !ruby/object:Gem::Requirement
|
149
|
-
requirements:
|
150
|
-
- - ">="
|
151
|
-
- !ruby/object:Gem::Version
|
152
|
-
version: '0'
|
153
|
-
- !ruby/object:Gem::Dependency
|
154
|
-
name: sassc-embedded
|
155
|
-
requirement: !ruby/object:Gem::Requirement
|
156
|
-
requirements:
|
157
|
-
- - ">="
|
158
|
-
- !ruby/object:Gem::Version
|
159
|
-
version: '0'
|
160
|
-
type: :development
|
161
|
-
prerelease: false
|
162
|
-
version_requirements: !ruby/object:Gem::Requirement
|
163
|
-
requirements:
|
164
|
-
- - ">="
|
165
|
-
- !ruby/object:Gem::Version
|
166
|
-
version: '0'
|
167
|
-
- !ruby/object:Gem::Dependency
|
168
|
-
name: xml-c14n
|
169
|
-
requirement: !ruby/object:Gem::Requirement
|
170
|
-
requirements:
|
171
|
-
- - ">="
|
172
|
-
- !ruby/object:Gem::Version
|
173
|
-
version: '0'
|
174
|
-
type: :development
|
175
|
-
prerelease: false
|
176
|
-
version_requirements: !ruby/object:Gem::Requirement
|
177
|
-
requirements:
|
178
|
-
- - ">="
|
179
|
-
- !ruby/object:Gem::Version
|
180
|
-
version: '0'
|
181
13
|
- !ruby/object:Gem::Dependency
|
182
14
|
name: metanorma-ietf
|
183
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -318,6 +150,20 @@ dependencies:
|
|
318
150
|
- - "~>"
|
319
151
|
- !ruby/object:Gem::Version
|
320
152
|
version: '1.5'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: lutaml-model
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - "~>"
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: 0.6.7
|
160
|
+
type: :runtime
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - "~>"
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: 0.6.7
|
321
167
|
- !ruby/object:Gem::Dependency
|
322
168
|
name: metanorma
|
323
169
|
requirement: !ruby/object:Gem::Requirement
|
@@ -360,6 +206,20 @@ dependencies:
|
|
360
206
|
- - "~>"
|
361
207
|
- !ruby/object:Gem::Version
|
362
208
|
version: 2.6.0
|
209
|
+
- !ruby/object:Gem::Dependency
|
210
|
+
name: liquid
|
211
|
+
requirement: !ruby/object:Gem::Requirement
|
212
|
+
requirements:
|
213
|
+
- - "~>"
|
214
|
+
- !ruby/object:Gem::Version
|
215
|
+
version: '5'
|
216
|
+
type: :runtime
|
217
|
+
prerelease: false
|
218
|
+
version_requirements: !ruby/object:Gem::Requirement
|
219
|
+
requirements:
|
220
|
+
- - "~>"
|
221
|
+
- !ruby/object:Gem::Version
|
222
|
+
version: '5'
|
363
223
|
- !ruby/object:Gem::Dependency
|
364
224
|
name: metanorma-ieee
|
365
225
|
requirement: !ruby/object:Gem::Requirement
|
@@ -408,14 +268,14 @@ dependencies:
|
|
408
268
|
requirements:
|
409
269
|
- - "~>"
|
410
270
|
- !ruby/object:Gem::Version
|
411
|
-
version: 0.
|
271
|
+
version: 1.0.0
|
412
272
|
type: :runtime
|
413
273
|
prerelease: false
|
414
274
|
version_requirements: !ruby/object:Gem::Requirement
|
415
275
|
requirements:
|
416
276
|
- - "~>"
|
417
277
|
- !ruby/object:Gem::Version
|
418
|
-
version: 0.
|
278
|
+
version: 1.0.0
|
419
279
|
- !ruby/object:Gem::Dependency
|
420
280
|
name: relaton-cli
|
421
281
|
requirement: !ruby/object:Gem::Requirement
|
@@ -489,6 +349,7 @@ files:
|
|
489
349
|
- lib/metanorma/cli/ui.rb
|
490
350
|
- lib/metanorma/cli/version.rb
|
491
351
|
- lib/metanorma/flavor.rb
|
352
|
+
- lib/metanorma/site_manifest.rb
|
492
353
|
- metanorma-cli.gemspec
|
493
354
|
- templates/base/Gemfile
|
494
355
|
- templates/base/metanorma.yml
|