metanorma-cli 1.2.1 → 1.2.2
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.lock +3 -3
- data/appveyor.yml +1 -0
- data/exe/metanorma +13 -144
- data/lib/metanorma/cli/git_template.rb +1 -0
- data/lib/metanorma/cli/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2410a33ad2bacfb66c4f7e6ee2c3ffb1d6c13bfb1ed65b6772c884c55ce4a663
|
4
|
+
data.tar.gz: 2fa231a58594b34711ff9b674a613e51ec6727f0639dedfcd2ed871f92b3fed5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7afdd97819fec7df7ba1d056066ca658c6b4a33af191f40d88fa067fd27dafe2a37ca5ecb672465ee5d3f2904a1a86404bcf4d54d9682a1c2c55951b7ebc2f36
|
7
|
+
data.tar.gz: 1ab470e100859fae5746aa7a7fda60dbbf4cb783b23647ba6f9d1c4ef036a630d6d86cb9ee42bdf49a6aab4db695f54936b489079fbb80729e92930eae9a57e6
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
metanorma-cli (1.2.
|
4
|
+
metanorma-cli (1.2.2)
|
5
5
|
git (~> 1.5)
|
6
6
|
isodoc (~> 0.10.0)
|
7
7
|
metanorma (~> 0.3.9)
|
@@ -69,7 +69,7 @@ GEM
|
|
69
69
|
isoics (0.1.7)
|
70
70
|
json (2.2.0)
|
71
71
|
liquid (4.0.3)
|
72
|
-
metanorma (0.3.
|
72
|
+
metanorma (0.3.14)
|
73
73
|
asciidoctor
|
74
74
|
htmlentities
|
75
75
|
metanorma-acme (1.2.1)
|
@@ -242,7 +242,7 @@ GEM
|
|
242
242
|
tzinfo
|
243
243
|
tzinfo (2.0.0)
|
244
244
|
concurrent-ruby (~> 1.0)
|
245
|
-
tzinfo-data (1.2019.
|
245
|
+
tzinfo-data (1.2019.2)
|
246
246
|
tzinfo (>= 1.0.0)
|
247
247
|
unicode2latex (0.0.2)
|
248
248
|
uuidtools (2.1.5)
|
data/appveyor.yml
CHANGED
data/exe/metanorma
CHANGED
@@ -1,151 +1,20 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# encoding: UTF-8
|
2
3
|
|
3
|
-
#
|
4
|
-
|
5
|
-
|
6
|
-
# to test it out we adding this environment variable. When the
|
7
|
-
# `METANORMA_DEV_MODE` set to `true` then it will revert to the
|
8
|
-
# old version of the CLI.
|
9
|
-
#
|
10
|
-
unless ENV.fetch("METANORMA_DEV_MODE", false) == "true"
|
11
|
-
require "bundler/setup"
|
12
|
-
require "metanorma/cli"
|
4
|
+
# resolve bin path, ignoring symlinks
|
5
|
+
require "pathname"
|
6
|
+
bin_file = Pathname.new(__FILE__).realpath
|
13
7
|
|
14
|
-
|
15
|
-
|
16
|
-
end
|
17
|
-
|
18
|
-
require "optparse"
|
19
|
-
require "metanorma"
|
20
|
-
require "fileutils"
|
21
|
-
require "nokogiri"
|
22
|
-
require "metanorma-cli"
|
23
|
-
|
24
|
-
registry = Metanorma::Registry.instance
|
25
|
-
Metanorma::Cli.load_flavors
|
26
|
-
|
27
|
-
options = {
|
28
|
-
format: :asciidoc
|
29
|
-
}
|
30
|
-
opt_parser = OptionParser.new do |opts|
|
31
|
-
opts.banner += " <file>"
|
32
|
-
opts.on(
|
33
|
-
'-t',
|
34
|
-
'--type TYPE',
|
35
|
-
String,
|
36
|
-
"Type of standard to generate",
|
37
|
-
"#{registry.supported_backends}"
|
38
|
-
) { |v| options[:type] = v.to_sym }
|
39
|
-
|
40
|
-
output_formats = registry.output_formats.inject([]) do |acc, (processor, formats)|
|
41
|
-
str = "* #{processor.to_s}: "
|
42
|
-
|
43
|
-
formats.each_pair do |type, ext|
|
44
|
-
str << "['#{type.to_s}': #{ext.to_s}] "
|
45
|
-
end
|
46
|
-
|
47
|
-
acc << str
|
48
|
-
end
|
49
|
-
|
50
|
-
opts.on(
|
51
|
-
'-x',
|
52
|
-
"--extensions all | EXT,...",
|
53
|
-
Array,
|
54
|
-
"Document extensions available per type (type, ['filetype': ext])",
|
55
|
-
*output_formats
|
56
|
-
) { |v| options[:extension_keys] = v.map(&:to_sym) }
|
57
|
-
|
58
|
-
input_formats = [:asciidoc]
|
59
|
-
opts.on(
|
60
|
-
'-f',
|
61
|
-
'--format FORMAT',
|
62
|
-
String,
|
63
|
-
'Format of source file',
|
64
|
-
"#{input_formats}",
|
65
|
-
) { |v| options[:format] = v.to_sym }
|
66
|
-
|
67
|
-
opts.on(
|
68
|
-
'-r',
|
69
|
-
'--require LIBRARY',
|
70
|
-
'Require LIBRARY prior to execution'
|
71
|
-
) { |v|
|
72
|
-
options[:require] ||= []
|
73
|
-
options[:require] << v
|
74
|
-
}
|
75
|
-
|
76
|
-
opts.on(
|
77
|
-
'-v',
|
78
|
-
'--version',
|
79
|
-
"Print version of code (accompanied with -t)",
|
80
|
-
) { options[:version] = true }
|
81
|
-
|
82
|
-
opts.on(
|
83
|
-
'-w',
|
84
|
-
'--wrapper',
|
85
|
-
'Create wrapper folder for HTML output'
|
86
|
-
) { options[:wrapper] = true }
|
87
|
-
|
88
|
-
opts.on(
|
89
|
-
'-a',
|
90
|
-
'--asciimath',
|
91
|
-
'Keep Asciimath in XML output instead of converting it to MathML'
|
92
|
-
) { options[:asciimath] = true }
|
93
|
-
|
94
|
-
opts.on(
|
95
|
-
'-d',
|
96
|
-
'--data-uri-image',
|
97
|
-
'Encode HTML output images as data URIs'
|
98
|
-
) { options[:datauriimage] = true }
|
99
|
-
|
100
|
-
opts.on(
|
101
|
-
'-R',
|
102
|
-
'--relaton FILENAME',
|
103
|
-
'Export Relaton XML for document to nominated filename'
|
104
|
-
) { |v| options[:relaton] = v }
|
105
|
-
|
106
|
-
opts.on(
|
107
|
-
'-e',
|
108
|
-
'--extract DIR(,ASSET1,ASSET2...)',
|
109
|
-
Array,
|
110
|
-
'Export sourcecode fragments from this document to nominated directory. If ASSET1,ASSET2 are named, only those types of asset are extracted'
|
111
|
-
) do |v|
|
112
|
-
options[:extract] = v[0]
|
113
|
-
options[:extract_type] = []
|
114
|
-
v.size > 1 and options[:extract_type] = v[1..-1].map(&:to_sym)
|
115
|
-
end
|
116
|
-
|
117
|
-
opts.on_tail("-h", "--help", "Show this message") do
|
118
|
-
puts opts
|
119
|
-
exit
|
120
|
-
end
|
121
|
-
|
122
|
-
end
|
123
|
-
|
124
|
-
opt_parser.parse!(ARGV)
|
125
|
-
|
126
|
-
=begin
|
127
|
-
if options[:require]
|
128
|
-
options[:require].each do |r|
|
129
|
-
require r
|
130
|
-
end
|
131
|
-
end
|
132
|
-
=end
|
133
|
-
|
134
|
-
if options[:version]
|
135
|
-
case options[:format]
|
136
|
-
when :asciidoc
|
137
|
-
processor = registry.find_processor(options[:type].to_sym)
|
138
|
-
puts processor.version
|
139
|
-
exit
|
140
|
-
end
|
141
|
-
end
|
8
|
+
# add self to libpath
|
9
|
+
$:.unshift File.expand_path("../../lib", bin_file)
|
142
10
|
|
143
|
-
|
11
|
+
# Fixes https://github.com/rubygems/rubygems/issues/1420
|
12
|
+
require "rubygems/specification"
|
144
13
|
|
145
|
-
|
146
|
-
|
147
|
-
exit 0
|
14
|
+
class Gem::Specification
|
15
|
+
def this; self; end
|
148
16
|
end
|
149
17
|
|
150
|
-
|
151
|
-
|
18
|
+
# start up the CLI
|
19
|
+
require "metanorma/cli"
|
20
|
+
Metanorma::Cli.start(ARGV)
|
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.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|