metanorma-cli 1.3.2 → 1.3.6
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/.github/workflows/dependent_repos.env +3 -0
- data/.github/workflows/macos.yml +38 -0
- data/.github/workflows/ubuntu.yml +72 -0
- data/.github/workflows/windows.yml +40 -0
- data/.gitignore +21 -0
- data/.hound.yml +3 -0
- data/.rspec +2 -0
- data/.rubocop.yml +515 -0
- data/docs/installation.adoc +61 -0
- data/docs/navigation.adoc +7 -0
- data/docs/usage.adoc +74 -0
- data/lib/metanorma/cli/command.rb +16 -2
- data/lib/metanorma/cli/setup.rb +9 -25
- data/lib/metanorma/cli/version.rb +1 -1
- data/metanorma-cli.gemspec +24 -18
- data/templates/base/.github/workflows/docker.yml +74 -0
- data/templates/base/.github/workflows/macos.yml +50 -0
- data/templates/base/.github/workflows/ubuntu.yml +55 -0
- data/templates/base/.github/workflows/windows.yml +42 -0
- data/templates/base/.gitlab-ci.yml +34 -4
- data/templates/base/Makefile +111 -59
- data/templates/base/Makefile.win +136 -36
- data/templates/base/metanorma.yml +1 -1
- metadata +49 -69
- data/05-020r26.rxl +0 -75
- data/05-020r26.xml.zip +0 -0
- data/Gemfile.lock +0 -337
- data/a +0 -5
- data/a.json +0 -33
- data/a.rb +0 -13
- data/a.rxl +0 -45
- data/b +0 -85
- data/csd-tofix 2.zip +0 -0
- data/csd-tofix.zip +0 -0
- data/exe/metanorma.old +0 -178
- data/extract/sourcecode/sourcecode-0000.txt +0 -5
- data/files.zip +0 -0
- data/relaton/cache/version +0 -1
- data/rice.rxl +0 -51
- data/sourcecode/0 +0 -5
- data/templates/base/.travis.yml +0 -30
- data/templates/base/appveyor.yml +0 -29
- data/test.rxl +0 -52
- data/tmp/my-custom-csd/Gemfile +0 -4
- data/tmp/my-custom-csd/Makefile +0 -144
- data/tmp/my-custom-csd/Makefile.win +0 -116
- data/tmp/my-custom-csd/appveyor.yml +0 -29
- data/tmp/my-custom-csd/metanorma.yml +0 -4
- data/tmp/my-document/Gemfile +0 -4
- data/tmp/my-document/Makefile +0 -144
- data/tmp/my-document/Makefile.win +0 -116
- data/tmp/my-document/appveyor.yml +0 -29
- data/tmp/my-document/metanorma.yml +0 -4
- data/tmp/my-local-document/Gemfile +0 -4
- data/tmp/my-local-document/Makefile +0 -144
- data/tmp/my-local-document/Makefile.win +0 -116
- data/tmp/my-local-document/appveyor.yml +0 -29
- data/tmp/my-local-document/metanorma.yml +0 -4
data/a
DELETED
data/a.json
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"id": "<GUID>",
|
3
|
-
"actor": {
|
4
|
-
"name": "<Student Name>",
|
5
|
-
"mbox": "<Student Email Address>",
|
6
|
-
"objectType": "Person"
|
7
|
-
},
|
8
|
-
"verb": {
|
9
|
-
"id": "http://adlnet.gov/expapi/verbs/completed",
|
10
|
-
"display": {
|
11
|
-
"en-US": "completed"
|
12
|
-
}
|
13
|
-
},
|
14
|
-
"object": {
|
15
|
-
"id": "<Activity URL>",
|
16
|
-
"definition": {
|
17
|
-
"name": {
|
18
|
-
"en-US": "<Activity name>"
|
19
|
-
},
|
20
|
-
"description": {
|
21
|
-
"en-US": "<Activity description>"
|
22
|
-
},
|
23
|
-
"type": "http://id.tincanapi.com/activitytype/resource"
|
24
|
-
},
|
25
|
-
"objectType": "Activity"
|
26
|
-
},
|
27
|
-
"result": {
|
28
|
-
"completion": "<Boolean>",
|
29
|
-
"duration": "<Cumulative ISO 8601 Duration>"
|
30
|
-
},
|
31
|
-
"timestamp": "<Start, ISO 8601 DATE>"
|
32
|
-
}
|
33
|
-
|
data/a.rb
DELETED
data/a.rxl
DELETED
@@ -1,45 +0,0 @@
|
|
1
|
-
<bibdata type="standard">
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
<contributor>
|
8
|
-
<role type="author"/>
|
9
|
-
<organization>
|
10
|
-
<name>International Organization for Standardization</name>
|
11
|
-
<abbreviation>ISO</abbreviation>
|
12
|
-
</organization>
|
13
|
-
</contributor>
|
14
|
-
<contributor>
|
15
|
-
<role type="publisher"/>
|
16
|
-
<organization>
|
17
|
-
<name>International Organization for Standardization</name>
|
18
|
-
<abbreviation>ISO</abbreviation>
|
19
|
-
</organization>
|
20
|
-
</contributor>
|
21
|
-
|
22
|
-
<language>en</language>
|
23
|
-
<script>Latn</script>
|
24
|
-
<status>
|
25
|
-
<stage>60</stage>
|
26
|
-
<substage>60</substage>
|
27
|
-
</status>
|
28
|
-
<copyright>
|
29
|
-
<from>2020</from>
|
30
|
-
<owner>
|
31
|
-
<organization>
|
32
|
-
<name>International Organization for Standardization</name>
|
33
|
-
<abbreviation>ISO</abbreviation>
|
34
|
-
</organization>
|
35
|
-
</owner>
|
36
|
-
</copyright>
|
37
|
-
<ext>
|
38
|
-
<doctype>article</doctype>
|
39
|
-
<editorialgroup>
|
40
|
-
<technical-committee/>
|
41
|
-
<subcommittee/>
|
42
|
-
<workgroup/>
|
43
|
-
</editorialgroup>
|
44
|
-
</ext>
|
45
|
-
</bibdata>
|
data/b
DELETED
@@ -1,85 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<gb-standard xmlns="http://riboseinc.com/gbstandard">
|
3
|
-
<bibdata type="standard">
|
4
|
-
<title>
|
5
|
-
|
6
|
-
</title>
|
7
|
-
<title>
|
8
|
-
|
9
|
-
</title>
|
10
|
-
<docidentifier type="gb">T/AAA 123</docidentifier>
|
11
|
-
<docidentifier type="gb-structured">
|
12
|
-
<project-number>T/AAA 123</project-number>
|
13
|
-
</docidentifier>
|
14
|
-
<docnumber>123</docnumber>
|
15
|
-
<contributor>
|
16
|
-
<role type="author"/>
|
17
|
-
<person>
|
18
|
-
<name>
|
19
|
-
<surname>Author</surname>
|
20
|
-
</name>
|
21
|
-
</person>
|
22
|
-
</contributor>
|
23
|
-
<contributor>
|
24
|
-
<role type="author"/>
|
25
|
-
<organization>
|
26
|
-
<name>GB</name>
|
27
|
-
</organization>
|
28
|
-
</contributor>
|
29
|
-
<contributor>
|
30
|
-
<role type="publisher"/>
|
31
|
-
<organization>
|
32
|
-
<name>GB</name>
|
33
|
-
</organization>
|
34
|
-
</contributor>
|
35
|
-
<contributor>
|
36
|
-
<role type="authority"/>
|
37
|
-
<organization>
|
38
|
-
<name>GB</name>
|
39
|
-
</organization>
|
40
|
-
</contributor>
|
41
|
-
<contributor>
|
42
|
-
<role type="proposer"/>
|
43
|
-
<organization>
|
44
|
-
<name>GB</name>
|
45
|
-
</organization>
|
46
|
-
</contributor>
|
47
|
-
<contributor>
|
48
|
-
<role type="issuer"/>
|
49
|
-
<organization>
|
50
|
-
<name>GB</name>
|
51
|
-
</organization>
|
52
|
-
</contributor>
|
53
|
-
|
54
|
-
<language>en</language>
|
55
|
-
<script>Latn</script>
|
56
|
-
<status>
|
57
|
-
<stage>60</stage>
|
58
|
-
<substage>60</substage>
|
59
|
-
</status>
|
60
|
-
<copyright>
|
61
|
-
<from>2019</from>
|
62
|
-
<owner>
|
63
|
-
<organization>
|
64
|
-
<name>GB</name>
|
65
|
-
</organization>
|
66
|
-
</owner>
|
67
|
-
</copyright>
|
68
|
-
<relation type="nonequivalent">
|
69
|
-
<bibitem>
|
70
|
-
<title> Televisual Frequencies</title>
|
71
|
-
<docidentifier>ISO 1012</docidentifier>
|
72
|
-
</bibitem>
|
73
|
-
</relation>
|
74
|
-
<ext>
|
75
|
-
<doctype>recommendation</doctype>
|
76
|
-
<gbtype>
|
77
|
-
<gbscope>social-group</gbscope>
|
78
|
-
<gbprefix>AAA</gbprefix>
|
79
|
-
<gbmandate>recommendation</gbmandate>
|
80
|
-
<gbtopic>basic</gbtopic>
|
81
|
-
</gbtype>
|
82
|
-
</ext>
|
83
|
-
</bibdata>
|
84
|
-
<sections/>
|
85
|
-
</gb-standard
|
data/csd-tofix 2.zip
DELETED
Binary file
|
data/csd-tofix.zip
DELETED
Binary file
|
data/exe/metanorma.old
DELETED
@@ -1,178 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require "optparse"
|
4
|
-
require "metanorma"
|
5
|
-
require "fileutils"
|
6
|
-
require "nokogiri"
|
7
|
-
|
8
|
-
registry = Metanorma::Registry.instance
|
9
|
-
|
10
|
-
supported_gem_paths = [
|
11
|
-
"asciidoctor-rfc",
|
12
|
-
"metanorma-iso",
|
13
|
-
"metanorma-gb",
|
14
|
-
"metanorma-csd",
|
15
|
-
"metanorma-csand",
|
16
|
-
"metanorma-m3d",
|
17
|
-
"metanorma-rsd",
|
18
|
-
"metanorma-acme",
|
19
|
-
"metanorma-standoc",
|
20
|
-
]
|
21
|
-
|
22
|
-
puts "[metanorma] detecting backends:"
|
23
|
-
supported_gem_paths.each do |backend|
|
24
|
-
begin
|
25
|
-
puts backend
|
26
|
-
require backend
|
27
|
-
rescue LoadError
|
28
|
-
puts "[metanorma] backend #{backend} not present"
|
29
|
-
end
|
30
|
-
end
|
31
|
-
puts
|
32
|
-
|
33
|
-
options = {
|
34
|
-
format: :asciidoc
|
35
|
-
}
|
36
|
-
opt_parser = OptionParser.new do |opts|
|
37
|
-
opts.banner += " <file>"
|
38
|
-
opts.on(
|
39
|
-
'-t',
|
40
|
-
'--type TYPE',
|
41
|
-
"Type of standard to generate: #{registry.supported_backends.join(", ")}"
|
42
|
-
) { |v| options[:type] = v.to_sym }
|
43
|
-
|
44
|
-
opts.on(
|
45
|
-
'-x',
|
46
|
-
'--extensions EXT1,EXT2,... | all',
|
47
|
-
Array,
|
48
|
-
"Type of extension to generate per type: #{registry.output_formats}\n"
|
49
|
-
) { |v| options[:extension_keys] = v.map(&:to_sym) }
|
50
|
-
|
51
|
-
opts.on(
|
52
|
-
'-f',
|
53
|
-
'--format FORMAT',
|
54
|
-
'Format of source file: asciidoc (current default, only format supported)'
|
55
|
-
) { |v| options[:format] = v.to_sym }
|
56
|
-
|
57
|
-
opts.on(
|
58
|
-
'-r',
|
59
|
-
'--require LIBRARY',
|
60
|
-
'Require LIBRARY prior to execution'
|
61
|
-
) { |v|
|
62
|
-
options[:require] ||= []
|
63
|
-
options[:require] << v
|
64
|
-
}
|
65
|
-
|
66
|
-
opts.on(
|
67
|
-
'-v',
|
68
|
-
'--version',
|
69
|
-
"Print version of code (accompanied with -t)",
|
70
|
-
) { options[:version] = true }
|
71
|
-
|
72
|
-
opts.on(
|
73
|
-
'-w',
|
74
|
-
'--wrapper',
|
75
|
-
'Create wrapper folder for HTML output'
|
76
|
-
) { options[:wrapper] = true }
|
77
|
-
|
78
|
-
opts.on(
|
79
|
-
'-d',
|
80
|
-
'--data-uri-image',
|
81
|
-
'Encode HTML output images as data URIs'
|
82
|
-
) { options[:datauriimage] = true }
|
83
|
-
|
84
|
-
opts.on(
|
85
|
-
'-R',
|
86
|
-
'--relaton FILENAME',
|
87
|
-
'Export Relaton XML for document to nominated filename'
|
88
|
-
) { |v| options[:relaton] = v }
|
89
|
-
|
90
|
-
opts.on_tail("-h", "--help", "Show this message") do
|
91
|
-
puts opts
|
92
|
-
exit
|
93
|
-
end
|
94
|
-
|
95
|
-
end
|
96
|
-
|
97
|
-
opt_parser.parse!(ARGV)
|
98
|
-
|
99
|
-
if options[:require]
|
100
|
-
options[:require].each do |r|
|
101
|
-
require r
|
102
|
-
end
|
103
|
-
end
|
104
|
-
|
105
|
-
if options[:version]
|
106
|
-
case options[:format]
|
107
|
-
when :asciidoc
|
108
|
-
processor = registry.find_processor(options[:type].to_sym)
|
109
|
-
puts processor.version
|
110
|
-
exit
|
111
|
-
end
|
112
|
-
end
|
113
|
-
|
114
|
-
options[:filename] = ARGV.pop
|
115
|
-
|
116
|
-
unless options[:type]
|
117
|
-
puts "[metanorma] Error: Please specify a standard type."
|
118
|
-
puts opt_parser.help
|
119
|
-
exit 0
|
120
|
-
end
|
121
|
-
|
122
|
-
unless registry.supported_backends.include? options[:type]
|
123
|
-
puts "[metanorma] Error: #{options[:type]} is not a supported standard type."
|
124
|
-
exit 0
|
125
|
-
end
|
126
|
-
|
127
|
-
unless options[:format] == :asciidoc
|
128
|
-
puts "[metanorma] Error: Only source file format currently supported is 'asciidoc'."
|
129
|
-
exit 0
|
130
|
-
end
|
131
|
-
|
132
|
-
unless options[:filename]
|
133
|
-
puts "[metanorma] Error: Need to specify a file to process."
|
134
|
-
exit 0
|
135
|
-
end
|
136
|
-
|
137
|
-
options[:extension_keys] = nil if options[:extension_keys] == [:all]
|
138
|
-
|
139
|
-
case options[:format]
|
140
|
-
when :asciidoc
|
141
|
-
processor = registry.find_processor(options[:type].to_sym)
|
142
|
-
options[:extension_keys] ||= processor.output_formats.inject([]) do |memo, (k, _)|
|
143
|
-
memo << k; memo
|
144
|
-
end
|
145
|
-
extensions = options[:extension_keys].inject([]) do |memo, e|
|
146
|
-
if processor.output_formats[e]
|
147
|
-
memo << e
|
148
|
-
else
|
149
|
-
warn "[metanorma] Error: #{e} format is not supported for this standard"
|
150
|
-
end
|
151
|
-
memo
|
152
|
-
end
|
153
|
-
exit 0 if extensions.empty?
|
154
|
-
|
155
|
-
file = File.read(options[:filename], encoding: "utf-8")
|
156
|
-
isodoc = processor.input_to_isodoc(file)
|
157
|
-
if options[:relaton]
|
158
|
-
xml = Nokogiri::XML(isodoc)
|
159
|
-
bibdata = xml.at("//xmlns:bibdata")
|
160
|
-
#docid = bibdata&.at("./xmlns:docidentifier")&.text || options[:filename]
|
161
|
-
#outname = docid.sub(/^\s+/, "").sub(/\s+$/, "").gsub(/\s+/, "-") + ".xml"
|
162
|
-
File.open(options[:relaton], "w:UTF-8") { |f| f.write bibdata.to_xml }
|
163
|
-
end
|
164
|
-
isodoc_options = processor.extract_options(file)
|
165
|
-
isodoc_options[:datauriimage] = true if options[:datauriimage]
|
166
|
-
extensions.each do |ext|
|
167
|
-
file_extension = processor.output_formats[ext]
|
168
|
-
outfilename = options[:filename].sub(/\.[^.]+$/, ".#{file_extension}")
|
169
|
-
processor.output(isodoc, outfilename, ext, isodoc_options)
|
170
|
-
if options[:wrapper] and /html$/.match file_extension
|
171
|
-
outfilename = outfilename.sub(/\.html$/, "")
|
172
|
-
FileUtils.mkdir_p outfilename
|
173
|
-
FileUtils.mv "#{outfilename}.html", outfilename
|
174
|
-
FileUtils.mv "#{outfilename}_images", outfilename
|
175
|
-
end
|
176
|
-
end
|
177
|
-
end
|
178
|
-
|
data/files.zip
DELETED
Binary file
|
data/relaton/cache/version
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
0.5.0
|
data/rice.rxl
DELETED
@@ -1,51 +0,0 @@
|
|
1
|
-
<bibdata type="standard">
|
2
|
-
<title language="en" format="text/plain">Rice model</title>
|
3
|
-
<title language="intro-en" format="text/plain">Cereals and pulses</title>
|
4
|
-
<title language="main-en" format="text/plain">Specifications and test methods</title>
|
5
|
-
<title language="part-en" format="text/plain">Rice</title>
|
6
|
-
<title language="intro-fr" format="text/plain">Céréales et légumineuses</title>
|
7
|
-
<title language="main-fr" format="text/plain">Spécification et méthodes d'essai</title>
|
8
|
-
<title language="part-fr" format="text/plain">Riz</title>
|
9
|
-
<docidentifier type="m3d">17301:2016</docidentifier>
|
10
|
-
<docnumber>17301</docnumber>
|
11
|
-
<contributor>
|
12
|
-
<role type="author"/>
|
13
|
-
<organization>
|
14
|
-
<name>Messaging Malware and Mobile Anti-Abuse Working Group</name>
|
15
|
-
<abbreviation>M3AAWG</abbreviation>
|
16
|
-
</organization>
|
17
|
-
</contributor>
|
18
|
-
<contributor>
|
19
|
-
<role type="publisher"/>
|
20
|
-
<organization>
|
21
|
-
<name>Messaging Malware and Mobile Anti-Abuse Working Group</name>
|
22
|
-
<abbreviation>M3AAWG</abbreviation>
|
23
|
-
</organization>
|
24
|
-
</contributor>
|
25
|
-
<edition>2</edition>
|
26
|
-
<version>
|
27
|
-
<revision-date>2016-05-01</revision-date>
|
28
|
-
|
29
|
-
</version>
|
30
|
-
<language>en</language>
|
31
|
-
<script>Latn</script>
|
32
|
-
<status>
|
33
|
-
<stage>30</stage>
|
34
|
-
<substage>92</substage>
|
35
|
-
</status>
|
36
|
-
<copyright>
|
37
|
-
<from>2016</from>
|
38
|
-
<owner>
|
39
|
-
<organization>
|
40
|
-
<name>Messaging Malware and Mobile Anti-Abuse Working Group</name>
|
41
|
-
<abbreviation>M3AAWG</abbreviation>
|
42
|
-
</organization>
|
43
|
-
</owner>
|
44
|
-
</copyright>
|
45
|
-
<ext>
|
46
|
-
<doctype>report</doctype>
|
47
|
-
<editorialgroup>
|
48
|
-
<committee>Food products</committee>
|
49
|
-
</editorialgroup>
|
50
|
-
</ext>
|
51
|
-
</bibdata>
|
data/sourcecode/0
DELETED
data/templates/base/.travis.yml
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
dist: xenial
|
3
|
-
env:
|
4
|
-
global:
|
5
|
-
- COMMIT_AUTHOR_EMAIL="$(yq r metanorma.yml metanorma.deploy.email)"
|
6
|
-
addons:
|
7
|
-
apt:
|
8
|
-
update: true
|
9
|
-
snaps:
|
10
|
-
- jq
|
11
|
-
- yq
|
12
|
-
- name: node
|
13
|
-
confinement: classic # or devmode
|
14
|
-
channel: 10/stable
|
15
|
-
rvm:
|
16
|
-
- 2.6
|
17
|
-
cache: bundler
|
18
|
-
before_install:
|
19
|
-
- gem update --system
|
20
|
-
- gem install bundler
|
21
|
-
- npm install -g puppeteer
|
22
|
-
- sudo bash -c "curl -L https://raw.githubusercontent.com/metanorma/metanorma-linux-setup/master/ubuntu.sh | bash"
|
23
|
-
script:
|
24
|
-
- make clean all publish
|
25
|
-
deploy:
|
26
|
-
skip_cleanup: true
|
27
|
-
provider: script
|
28
|
-
script: bash -c "curl -L https://raw.githubusercontent.com/metanorma/metanorma-build-scripts/master/deploy-to-gh-pages.sh | bash"
|
29
|
-
on:
|
30
|
-
branch: master
|