metanorma-cli 1.5.16 → 1.5.18.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.adoc +3 -299
- data/docs/installation.adoc +1 -185
- data/docs/usage.adoc +1 -103
- data/lib/metanorma/cli/version.rb +1 -1
- data/lib/metanorma/flavor.rb +7 -10
- data/metanorma-cli.gemspec +5 -2
- metadata +19 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1601f0ff711fb22530caaa98747d61eacadec8e9669fc5833e4c9e1dea41b34
|
4
|
+
data.tar.gz: 14dd8d4490dc2584192a9a75faa5be0bb1f8828ada59cfbe813134a4118cff9b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f5b2d2acbba3ce893d8ff70e97e76368364acd08556d3bba8b45e190ed79dccb3b5a4238739e03266561755f95d0eb4c9f58c99831cfa685dc7c259ad6db880d
|
7
|
+
data.tar.gz: cf3eaba88d21e0b079b8ad0a3915d574ec31386f97adf84a505bdd70d0079f01ebe160f6687611095cd10dc229d187e2faa83171f722d284ec953b34a28c5550
|
data/README.adoc
CHANGED
@@ -33,42 +33,10 @@ Generally, we recommend you to follow steps given at
|
|
33
33
|
https://www.metanorma.com/author/topics/install/[Metanorma Installation].
|
34
34
|
|
35
35
|
But if you aren't afraid of tinkering deeply, please see the
|
36
|
-
|
36
|
+
https://www.metanorma.com/install/manual-installation/[Developer Installation Notes]
|
37
37
|
for advanced details regarding dependencies and Windows installation notes.
|
38
38
|
|
39
39
|
|
40
|
-
== Usage
|
41
|
-
|
42
|
-
=== Setting up
|
43
|
-
|
44
|
-
Metanorma CLI helps you install necessary fonts used by particular flavors,
|
45
|
-
as long as those fonts have a license that allow you to install them.
|
46
|
-
|
47
|
-
For example, ISO relies on Cambria while ITU relies on Arial, which are both not
|
48
|
-
supplied by default on Linux. Due to licensing terms, you are allowed to
|
49
|
-
install them yourself.
|
50
|
-
|
51
|
-
By running the `metanorma setup` command, Metanorma will identify fonts not
|
52
|
-
available on your system, and helps you install them once you agree to
|
53
|
-
the license terms presented by those fonts.
|
54
|
-
|
55
|
-
Typically run the command below.
|
56
|
-
|
57
|
-
[source, sh]
|
58
|
-
----
|
59
|
-
metanorma setup
|
60
|
-
----
|
61
|
-
|
62
|
-
If you are sure you want to agree with all the font licensing terms,
|
63
|
-
such as during non-interactive runs for continuous integration,
|
64
|
-
you can explicitly agree to all terms using the `--agree-to-terms`
|
65
|
-
option.
|
66
|
-
|
67
|
-
[source, sh]
|
68
|
-
----
|
69
|
-
metanorma setup --agree-to-terms
|
70
|
-
----
|
71
|
-
|
72
40
|
=== External dependencies
|
73
41
|
|
74
42
|
The Metanorma toolchain supports certain features when optional dependencies
|
@@ -105,273 +73,9 @@ are installed. Please refer to the following table for them.
|
|
105
73
|
|===
|
106
74
|
|
107
75
|
|
108
|
-
|
109
|
-
|
110
|
-
Metanorma CLI allows you to create a new document using an official
|
111
|
-
template, or a user-specified custom template.
|
112
|
-
|
113
|
-
To see what options are available under the `new` command,
|
114
|
-
run `metanorma help new`.
|
115
|
-
|
116
|
-
==== Generate a new document from an official Metanorma template (from an official Metanorma template repository)
|
117
|
-
|
118
|
-
The `metanorma new` command allows you to create a document by running a
|
119
|
-
single command.
|
120
|
-
|
121
|
-
To create a new document using an official template you simply
|
122
|
-
invoke the command with the mandatory options `type` and `doctype`,
|
123
|
-
then Metanorma will find and load the official template to
|
124
|
-
create your document.
|
125
|
-
|
126
|
-
For example, if you want to create a new CSD document (`type`: `csd`) called
|
127
|
-
`csd-foo-standard`, using the `standard` template type,
|
128
|
-
run the following command:
|
129
|
-
|
130
|
-
[source, sh]
|
131
|
-
----
|
132
|
-
metanorma new -d standard -t csd csd-foo-standard
|
133
|
-
----
|
134
|
-
|
135
|
-
This will create your barebones document and will also print out
|
136
|
-
all files created during generation.
|
137
|
-
|
138
|
-
Currently, the supported Metanorma template types are `csd`, `ogc` and `iso`.
|
139
|
-
|
140
|
-
|
141
|
-
==== Generate a new document from a custom Metanorma template repository
|
142
|
-
|
143
|
-
The CLI allows using custom or unofficial template repositories, meaning you
|
144
|
-
could also generate a new document using your own custom template.
|
145
|
-
|
146
|
-
Metanorma supports two types of template repositories:
|
147
|
-
|
148
|
-
* Git: a Git repository (local or remote, public or private)
|
149
|
-
* Local: a directory
|
150
|
-
|
151
|
-
Once a template repository and a template within is specified, Metanorma will
|
152
|
-
automatically download and generate the new document using your custom template.
|
153
|
-
|
154
|
-
For example, if you want to create a new CSD document with the
|
155
|
-
following parameters:
|
156
|
-
|
157
|
-
* Document name: `my-custom-csd-document`
|
158
|
-
* Flavor: `csd`
|
159
|
-
* Doctype: `standard`
|
160
|
-
* Template: `https://gitfoo.com/foobar/mn-templates-foobar` (fictitious example)
|
161
|
-
|
162
|
-
You could execute the following command to do so:
|
163
|
-
|
164
|
-
[source,sh]
|
165
|
-
----
|
166
|
-
metanorma new -d standard -t csd \
|
167
|
-
-l https://gitfoo.com/foobar/mn-templates-foobar my-custom-csd-document
|
168
|
-
----
|
169
|
-
|
170
|
-
Here's an example of using a local directory:
|
171
|
-
|
172
|
-
[source,sh]
|
173
|
-
----
|
174
|
-
metanorma new -d standard -t csd \
|
175
|
-
-l ~/shared/mn-templates my-custom-csd-document
|
176
|
-
----
|
177
|
-
|
178
|
-
|
179
|
-
=== Compile a document (`metanorma compile` or just `metanorma`)
|
180
|
-
|
181
|
-
The key functionality of this CLI is to allow compilation of a Metanorma document.
|
182
|
-
The command `metanorma help compile` will display all usage instructions of
|
183
|
-
the `compile` command shown with available options.
|
184
|
-
|
185
|
-
[source]
|
186
|
-
----
|
187
|
-
Usage:
|
188
|
-
metanorma compile FILENAME [..options]
|
189
|
-
|
190
|
-
Options:
|
191
|
-
-t, [--type=TYPE] # Type of standard to generate
|
192
|
-
-x, [--extensions=EXTENSIONS] # Type of extension to generate per type
|
193
|
-
-f, [--format=FORMAT] # Format of source file: eg. asciidoc
|
194
|
-
# Default: asciidoc
|
195
|
-
|
196
|
-
-r, [--require=one two three] # Require LIBRARY prior to execution
|
197
|
-
-w, [--wrapper], [--no-wrapper] # Create wrapper folder for HTML output
|
198
|
-
-a, [--asciimath], [--no-asciimath] # Keep Asciimath in XML output instead of converting it to MathM
|
199
|
-
-R, [--relaton=RELATON] # Export Relaton XML for document to nominated filename
|
200
|
-
-e, [--extract=EXTRACT] # Export sourcecode fragments from this document to nominated directory
|
201
|
-
-v, [--version=VERSION] # Print version of code (accompanied with -t)
|
202
|
-
----
|
203
|
-
|
204
|
-
So, let's put this in use. For example we have a document `my-iso-document.adoc`
|
205
|
-
and we want to compile this using `iso` and `html` as extension, then we can use
|
206
|
-
the following command.
|
207
|
-
|
208
|
-
[source, sh]
|
209
|
-
----
|
210
|
-
metanorma compile --type iso -x html my-iso-document.adoc
|
211
|
-
# or just
|
212
|
-
metanorma --type iso -x html my-iso-document.adoc
|
213
|
-
----
|
214
|
-
|
215
|
-
This should compile any valid document, but if there are some issues then it
|
216
|
-
will also print those out in the terminal. Currently, the supported flavors
|
217
|
-
are `ietf`, `iso`, `gb`, `csd`, `csand`, `m3d` and `rsd`.
|
218
|
-
|
219
|
-
=== Compile a document collection (`metanorma collection`)
|
220
|
-
|
221
|
-
This functionality compiles collections of Metanorma documents. It compiles
|
222
|
-
the individual documents comprising the collection; then it compiles a document
|
223
|
-
acting as a container for those collections. See
|
224
|
-
https://github.com/metanorma/metanorma/wiki/Metanorma-collections[],
|
225
|
-
https://github.com/metanorma/metanorma-cli/blob/master/spec/fixtures/collection1.yml[]
|
226
|
-
|
227
|
-
The file argument to the collection command is a Metanorma Collections YAML file,
|
228
|
-
which contains:
|
229
|
-
|
230
|
-
* Directives on how the collection should be generated
|
231
|
-
* Metadata about the collection
|
232
|
-
* A manifest listing the documents contained in the collection, in nested hierarchy
|
233
|
-
* Content to put at the beginning of the collection container
|
234
|
-
* Content to put at the ending of the collection container
|
235
|
-
|
236
|
-
Documents within a collection
|
237
|
-
may cross-reference each other using the syntax
|
238
|
-
`* [[[myanchor,repo:(current-metanorma-collection/mydoc)]]]`,
|
239
|
-
as proposed in https://github.com/metanorma/metanorma/issues/57, where
|
240
|
-
`mydoc` is be the value of docref/identifier corresponding to the target document,
|
241
|
-
as set in the YAML manifest.
|
242
|
-
|
243
|
-
The output directory will contain:
|
244
|
-
|
245
|
-
* The documents referenced in the manifest, with any citations of other documents in the collection
|
246
|
-
resolved, in the output formats requested
|
247
|
-
* If `xml` or `presentation` are requested as formats, a concatenated `collection.xml` and/or
|
248
|
-
`collection.presentation.xml` file, containing all the documents in the collection.
|
249
|
-
* If `html` is requested as a format, an `index.html` HTML page, populated from a provided
|
250
|
-
Liquid template coverpage, and linking to all the documents in the manifest.
|
251
|
-
|
252
|
-
|
253
|
-
[source]
|
254
|
-
----
|
255
|
-
Usage:
|
256
|
-
metanorma collection FILENAME [..options]
|
257
|
-
|
258
|
-
Options:
|
259
|
-
-x, [--extensions=EXTENSIONS] # Type of extension to generate
|
260
|
-
-w, [--output-folder=FOLDER] # Folder to generate collection in
|
261
|
-
-c, [--coverpage=COVERPAGE] # Cover page as Liquid template for collection (currently HTML only)
|
262
|
-
----
|
263
|
-
|
264
|
-
=== List supported doctypes (`metanorma list-doctypes`)
|
265
|
-
|
266
|
-
You want to know what are the supported doctypes and what do they support for
|
267
|
-
input and output format? Well, the `metanorma list-doctypes` can help.
|
268
|
-
|
269
|
-
|
270
|
-
[source,sh]
|
271
|
-
----
|
272
|
-
metanorma list-doctypes
|
273
|
-
----
|
274
|
-
|
275
|
-
|
276
|
-
To list out the details for a specific flavor run the following command:
|
277
|
-
|
278
|
-
[source,sh]
|
279
|
-
----
|
280
|
-
metanorma list-doctypes <flavor>
|
281
|
-
----
|
282
|
-
|
283
|
-
e.g.,
|
284
|
-
|
285
|
-
[source,sh]
|
286
|
-
----
|
287
|
-
metanorma list-doctypes iso
|
288
|
-
----
|
289
|
-
|
290
|
-
=== List supported output formats (`metanorma list-extensions`)
|
291
|
-
|
292
|
-
Need to know what output formats are supported for a given flavor?
|
293
|
-
We've got you covered.
|
294
|
-
|
295
|
-
To list out the output formats supported by every single flavor type,
|
296
|
-
run the following command:
|
297
|
-
|
298
|
-
[source,sh]
|
299
|
-
|
300
|
-
----
|
301
|
-
metanorma list-extensions
|
302
|
-
----
|
303
|
-
|
304
|
-
|
305
|
-
To list out the output formats supported by a particular flavor type,
|
306
|
-
run the following command:
|
307
|
-
|
308
|
-
[source,sh]
|
309
|
-
----
|
310
|
-
metanorma list-extensions <flavor>
|
311
|
-
----
|
312
|
-
|
313
|
-
e.g.,
|
314
|
-
|
315
|
-
[source,sh]
|
316
|
-
----
|
317
|
-
metanorma list-extensions iso
|
318
|
-
----
|
319
|
-
|
320
|
-
|
321
|
-
=== Show processor version (`metanorma version`)
|
322
|
-
|
323
|
-
The `version` command returns the version of the Metanorma processor for
|
324
|
-
a specific flavor.
|
325
|
-
|
326
|
-
e.g., to know the currently running version for `iso`, then we
|
327
|
-
can use the following command and this will show the current version that we are
|
328
|
-
using for that specific processor.
|
329
|
-
|
330
|
-
[source, sh]
|
331
|
-
----
|
332
|
-
metanorma version --type iso
|
333
|
-
----
|
334
|
-
|
335
|
-
=== Add new template repository (`metanorma template-repo add`)
|
336
|
-
|
337
|
-
The `template-repo add` interface allows you to add your custom template
|
338
|
-
repository to metanorma, so next time when you need to generate a new document
|
339
|
-
then you can directly use that name to use your custom template from that
|
340
|
-
repository.
|
341
|
-
|
342
|
-
[source, sh]
|
343
|
-
----
|
344
|
-
metanorma template-repo add my-iso https://github.com/you/my-iso-template
|
345
|
-
----
|
346
|
-
|
347
|
-
=== Generate metanorma minisite
|
348
|
-
|
349
|
-
The `site` interface allows you to manage mini site generation using the CLI.
|
350
|
-
To generate a mini site you need to provide the `SOURCE_PATH` and the CLI will
|
351
|
-
take care of compiling each of those files and generate deployable site in the
|
352
|
-
provided output directory.
|
353
|
-
|
354
|
-
This interface also supports a YAML manifest file that can be used to customize
|
355
|
-
the site generation process. You can check more details here: link:./spec/fixtures/metanorma.yml[metanorma.yml]
|
356
|
-
|
357
|
-
[source, sh]
|
358
|
-
----
|
359
|
-
metanorma site generate SOURCE_PATH -o OUTPUT_PATH -c metanorma.yml
|
360
|
-
----
|
361
|
-
|
362
|
-
=== Using with proxy
|
363
|
-
|
364
|
-
The `metanorma` command can read proxy settings from the following
|
365
|
-
environment variables:
|
366
|
-
|
367
|
-
* `HTTP_PROXY` for HTTPS and HTTP proxies
|
368
|
-
* `SOCKS_PROXY` for SOCKS proxies
|
369
|
-
|
370
|
-
Please refer to our https://www.metanorma.org/blog/2021-07-20/metanorma-with-proxies/[announcement on proxy support] for details.
|
76
|
+
== Usage
|
371
77
|
|
372
|
-
|
373
|
-
Git must also be configured to use proxies. Please refer to
|
374
|
-
https://gist.github.com/evantoli/f8c23a37eb3558ab8765[this Gist by evantoli] for details.
|
78
|
+
Refer to https://www.metanorma.org/install/usage[Metanorma CLI usage].
|
375
79
|
|
376
80
|
|
377
81
|
== Credits
|
data/docs/installation.adoc
CHANGED
@@ -1,187 +1,3 @@
|
|
1
1
|
= Installation
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
[IMPORTANT]
|
6
|
-
====
|
7
|
-
Users of the Metanorma suite should install Metanorma according to the steps at the https://www.metanorma.org/author/topics/install/[Metanorma installation guide].
|
8
|
-
|
9
|
-
The instructions provided here are intended for Metanorma developers, since
|
10
|
-
a number of third-party dependencies will also need to be installed manually.
|
11
|
-
====
|
12
|
-
|
13
|
-
== Install Ruby
|
14
|
-
|
15
|
-
== macOS
|
16
|
-
|
17
|
-
While macOS provides a default installation of Ruby, it is restricted in a number of ways.
|
18
|
-
|
19
|
-
We strongly recommend installing a Ruby outside of the system Ruby using `rbenv`.
|
20
|
-
|
21
|
-
[source,console]
|
22
|
-
----
|
23
|
-
# Install Xcode and associated development tools
|
24
|
-
$ xcode-select --install
|
25
|
-
|
26
|
-
# Install GCC and development tools
|
27
|
-
$ brew install autoconf gcc make
|
28
|
-
|
29
|
-
# Install rbenv to manage Ruby versions
|
30
|
-
# Remember to follow the setup steps by running `rbenv init`!
|
31
|
-
$ curl -fsSL https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-installer | bash
|
32
|
-
|
33
|
-
# Install Ruby 2.7.4 through rbenv
|
34
|
-
$ rbenv install 2.7.4
|
35
|
-
|
36
|
-
# Set Ruby 2.7.4 as your global version
|
37
|
-
$ rbenv global 2.7.4
|
38
|
-
|
39
|
-
# Then restart Terminal.app
|
40
|
-
----
|
41
|
-
|
42
|
-
|
43
|
-
== Linux
|
44
|
-
|
45
|
-
Ruby is sometimes included with Linux. To see if you already have it (and check the version):
|
46
|
-
|
47
|
-
1. Open a console/terminal
|
48
|
-
2. Type `ruby -v`
|
49
|
-
|
50
|
-
If Ruby is installed, you'll see something like the following
|
51
|
-
[source, console]
|
52
|
-
----
|
53
|
-
ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [x86_64-linux]
|
54
|
-
----
|
55
|
-
|
56
|
-
If not, follow the official
|
57
|
-
https://www.ruby-lang.org/en/documentation/installation[Ruby installation guide].
|
58
|
-
|
59
|
-
== Windows
|
60
|
-
|
61
|
-
Ruby is not pre-installed on Windows. There are several ways to install it:
|
62
|
-
|
63
|
-
. For an *easy* experience, use `RubyInstaller`, via the official https://www.ruby-lang.org/en/documentation/installation[Ruby installation guide])
|
64
|
-
. For a more *developer-friendly* experience, install Ruby via a Linux distribution (like Ubuntu) hosted in the [Windows Subsystem for Linux (WSL)](https://docs.microsoft.com/en-us/windows/wsl/). [Install WSL2]((https://docs.microsoft.com/en-us/windows/wsl/install), and then [Install Ruby](https://gorails.com/setup/ubuntu/21.04).
|
65
|
-
. For a *simpler command-line* experience, first install the [Chocolatey](https://chocolatey.org/install) package manager, then add Ruby packaged with [the MSYS2 build tools](https://www.msys2.org/). This process is explained below:
|
66
|
-
|
67
|
-
|
68
|
-
.. Open a command prompt (`cmd.exe`) or *PowerShell* console.
|
69
|
-
.. Type `choco install -y msys2 ruby`. (If you have a firewall, you may be prompted to allow *dirmngr.exe* and *pacman.exe*. These are part of Ruby and are safe).
|
70
|
-
.. When the installation completes, type `refreshenv` to make Ruby available to you.
|
71
|
-
.. Type `ridk install 3` to complete the installation of Ruby version 3. This make take a while.
|
72
|
-
|
73
|
-
== Other Ruby Resources
|
74
|
-
|
75
|
-
Further details (or FAQ) on Ruby installation please visit the official
|
76
|
-
https://www.ruby-lang.org/en/documentation/installation[Ruby installation guide].
|
77
|
-
|
78
|
-
== Installing the Metanorma CLI gem
|
79
|
-
|
80
|
-
Once Ruby is installed, you can install `metanorma-cli` as a gem:
|
81
|
-
|
82
|
-
[source,console]
|
83
|
-
----
|
84
|
-
gem install metanorma-cli
|
85
|
-
----
|
86
|
-
|
87
|
-
Installing the gem will also install all officially supported Metanorma flavors
|
88
|
-
(such as ISO, CalConnect, IETF, etc).
|
89
|
-
|
90
|
-
|
91
|
-
== Dependencies
|
92
|
-
|
93
|
-
=== Java
|
94
|
-
|
95
|
-
You will have to have a Java runtime installed.
|
96
|
-
|
97
|
-
Use the following commands on various platforms:
|
98
|
-
|
99
|
-
macOS:: Run `brew cask install java`
|
100
|
-
|
101
|
-
Linux:: Follow https://www.java.com/en/download/help/linux_install.html[official instructions]
|
102
|
-
|
103
|
-
Windows:: Run `choco install -y javaruntime`
|
104
|
-
|
105
|
-
=== PlantUML
|
106
|
-
|
107
|
-
*If your documents include link:/author/topics/document-format/diagrams/[PlantUML diagrams]*,
|
108
|
-
PlantUML will have to be installed.
|
109
|
-
|
110
|
-
macOS:: Run `brew install plantuml`.
|
111
|
-
|
112
|
-
Linux:: Link the PlantUML jar file into a command line executable; see
|
113
|
-
`.travis.yml` for an example.
|
114
|
-
|
115
|
-
Windows:: Run `choco install -y plantuml`.
|
116
|
-
|
117
|
-
If PlantUML diagrams used within a document but there PlantUML is not installed,
|
118
|
-
the PlantUML diagram source will be incorporated into the output document as
|
119
|
-
source code (i.e. `[source]` style).
|
120
|
-
|
121
|
-
=== Graphviz
|
122
|
-
|
123
|
-
Graphviz is required by LutaML (and PlantUML) to draw diagrams.
|
124
|
-
|
125
|
-
macOS:: Run `brew install graphviz`.
|
126
|
-
|
127
|
-
Linux:: Install the appropriate
|
128
|
-
https://graphviz.org/download/#linux[available packages] (`apt` or `yum`)
|
129
|
-
|
130
|
-
Windows:: Run `choco install -y graphviz`
|
131
|
-
|
132
|
-
|
133
|
-
=== xml2rfc
|
134
|
-
|
135
|
-
Metanorma IETF requires usage of the `xml2rfc` Python package.
|
136
|
-
|
137
|
-
To install Python:
|
138
|
-
|
139
|
-
macOS:: `brew install python3`
|
140
|
-
|
141
|
-
Windows:: `choco install -y python`
|
142
|
-
|
143
|
-
Then install `xml2rfc` with:
|
144
|
-
|
145
|
-
[source,console]
|
146
|
-
----
|
147
|
-
pip3 install xml2rfc
|
148
|
-
----
|
149
|
-
|
150
|
-
|
151
|
-
=== Inkscape
|
152
|
-
|
153
|
-
Optional dependency. Inkscape is needed for SVG-to-EMF conversion functionality.
|
154
|
-
|
155
|
-
macOS:: Run `brew install inkscape`
|
156
|
-
|
157
|
-
Linux:: See Linux instructions https://inkscape.org/release/[here]
|
158
|
-
|
159
|
-
Windows:: Run `choco install -y inkscape`
|
160
|
-
|
161
|
-
|
162
|
-
=== LaTeXML
|
163
|
-
|
164
|
-
Optional dependency. `LaTeXML` is needed for Metanorma for LaTeX functionality.
|
165
|
-
|
166
|
-
Most of the packages from various package manager listed on
|
167
|
-
https://dlmf.nist.gov/LaTeXML/get.html are outdated.
|
168
|
-
|
169
|
-
Since `LaTeXML` is a `perl` module, a reliable way to install it is with the
|
170
|
-
https://metacpan.org/dist/App-cpanminus/view/bin/cpanm[`cpanm` package manager]
|
171
|
-
|
172
|
-
[source,console]
|
173
|
-
----
|
174
|
-
curl -L https://cpanmin.us | perl - --sudo App::cpanminus
|
175
|
-
cpanm --notest LaTeXML
|
176
|
-
# or
|
177
|
-
cpanm --notest git://github.com/brucemiller/LaTeXML.git@9a0e7dc5
|
178
|
-
----
|
179
|
-
|
180
|
-
Alternative, it also can be installed in the following ways (always check the
|
181
|
-
version, because the packages may be outdated):
|
182
|
-
|
183
|
-
macOS:: Run `brew install latexml`
|
184
|
-
|
185
|
-
Linux (with Snap installed):: Run `snap install latexml`
|
186
|
-
|
187
|
-
Windows:: `choco install -y latexml`
|
3
|
+
Refer to https://metanorma.org/install/manual-installation/[Metanorma Manual Installation]
|
data/docs/usage.adoc
CHANGED
@@ -1,105 +1,3 @@
|
|
1
1
|
= Using the Metanorma CLI
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
For a single document:
|
6
|
-
[source,sh]
|
7
|
-
----
|
8
|
-
$ metanorma iso-my-standard-document.adoc
|
9
|
-
----
|
10
|
-
|
11
|
-
or
|
12
|
-
|
13
|
-
[source,sh]
|
14
|
-
----
|
15
|
-
$ metanorma --type iso -x html iso-my-standard-document.adoc
|
16
|
-
----
|
17
|
-
|
18
|
-
if type and extensions are not defined in adoc header
|
19
|
-
|
20
|
-
== Full syntax & options
|
21
|
-
|
22
|
-
General help message can be shown by `metanorma help`
|
23
|
-
|
24
|
-
[source,sh]
|
25
|
-
----
|
26
|
-
Commands:
|
27
|
-
metanorma collection FILENAME -w, --output-folder=OUTPUT_FOLDER # Render HTML pages from XML/YAML colection
|
28
|
-
metanorma compile FILENAME # Compile to a metanorma document
|
29
|
-
metanorma config # Manage configuration file
|
30
|
-
metanorma help [COMMAND] # Describe available commands or one specific command
|
31
|
-
metanorma list-doctypes # List supported doctypes
|
32
|
-
metanorma list-extensions # List supported extensions
|
33
|
-
metanorma new NAME -d, --doctype=DOCTYPE -t, --type=TYPE # Create new Metanorma document
|
34
|
-
metanorma site # Manage site for metanorma collections
|
35
|
-
metanorma template-repo # Manage metanorma templates repository
|
36
|
-
metanorma version # Version of the code
|
37
|
-
|
38
|
-
Options:
|
39
|
-
-s, [--no-progress], [--no-no-progress] # Don't show progress for long running tasks (like download)
|
40
|
-
# Default: true
|
41
|
-
----
|
42
|
-
|
43
|
-
Also you can get a help message for a specific command for example `metanorma help compile`:
|
44
|
-
|
45
|
-
[source,sh]
|
46
|
-
----
|
47
|
-
Usage:
|
48
|
-
metanorma compile FILENAME
|
49
|
-
|
50
|
-
Options:
|
51
|
-
-t, [--type=TYPE] # Type of standard to generate
|
52
|
-
-x, [--extensions=EXTENSIONS] # Type of extension to generate per type
|
53
|
-
-f, [--format=FORMAT] # Format of source file: eg. asciidoc
|
54
|
-
# Default: asciidoc
|
55
|
-
-r, [--require=REQUIRE] # Require LIBRARY prior to execution
|
56
|
-
-w, [--wrapper], [--no-wrapper] # Create wrapper folder for HTML output
|
57
|
-
-a, [--asciimath], [--no-asciimath] # Keep Asciimath in XML output instead of converting it to MathM
|
58
|
-
-d, [--datauriimage], [--no-datauriimage] # Encode HTML output images as data URIs
|
59
|
-
-R, [--relaton=RELATON] # Export Relaton XML for document to nominated filename
|
60
|
-
-e, [--extract=EXTRACT] # Export sourcecode fragments from this document to nominated directory
|
61
|
-
-v, [--version=VERSION] # Print version of code (accompanied with -t)
|
62
|
-
-o, [--output-dir=OUTPUT_DIR] # Directory to save compiled files
|
63
|
-
[--agree-to-terms], [--no-agree-to-terms] # Agree / Disagree with all third-party licensing terms presented (WARNING: do know what you are agreeing with!)
|
64
|
-
[--no-install-fonts], [--no-no-install-fonts] # Skip the font installation process
|
65
|
-
[--continue-without-fonts], [--no-continue-without-fonts] # Continue processing even when fonts are missing
|
66
|
-
-s, [--no-progress], [--no-no-progress] # Don't show progress for long running tasks (like download)
|
67
|
-
# Default: true
|
68
|
-
|
69
|
-
Compile to a metanorma document
|
70
|
-
----
|
71
|
-
|
72
|
-
A bit more details on options:
|
73
|
-
|
74
|
-
`type`:: (mandatory, specified via `--type` or `-t`) takes one of the following types:
|
75
|
-
`rfc2`, `rfc3`, `iso`, `gb`, `csd`, `csand`, `m3d`, `rsd`. Each of these corresponds to a
|
76
|
-
standards class and a Metanorma gem; the list of standards classes supported by the script
|
77
|
-
by default will grow (see also `require`).
|
78
|
-
|
79
|
-
`extension`:: (optional) specifies the output formats to be generated. If not specified,
|
80
|
-
all possible output formats are generated. The output formats generated are constrained by
|
81
|
-
what has been defined for each standard type. All standards can generate Metanorma XML (`xml`),
|
82
|
-
and at least one of HTML (`html`), DOC (`doc`), PDF (`pdf`). Some standards generate alternative
|
83
|
-
HTML renderings (e.g. `html_alt` for ISO).
|
84
|
-
|
85
|
-
Actual list of supported `types` and `extension`s you can get with `metanorma list-doctypes`
|
86
|
-
|
87
|
-
`wrapper`:: create a separate folder for each instance of HTML output generated; the folder is named
|
88
|
-
the same as the output file, without the `.html` suffix. Used to make distribution of HTML outputs
|
89
|
-
more straightforward.
|
90
|
-
|
91
|
-
`format`:: (optional, defaults to `asciidoc`, specified via `--format` or `-f`) only accepts `asciidoc` for now
|
92
|
-
|
93
|
-
`require`:: If you wish to use metanorma with a document class which has not been included in the types recognised
|
94
|
-
by the metanorma script, you will need to name the corresponding Metnorma gem explicitly with the `-r`
|
95
|
-
option. For example:
|
96
|
-
|
97
|
-
[source,sh]
|
98
|
-
----
|
99
|
-
$ metanorma -t mpfd mpfd-bpn.adoc
|
100
|
-
|
101
|
-
[metanorma] Error: mpfd is not a supported standard type.
|
102
|
-
|
103
|
-
$ metanorma -t mpfd -r metanorma-mpfd mpfd-bpn.adoc
|
104
|
-
----
|
105
|
-
|
3
|
+
Refer to https://www.metanorma.org/install/man[Metanorma CLI Manual] and https://www.metanorma.org/install/usage[Metanorma CLI usage]
|
data/lib/metanorma/flavor.rb
CHANGED
@@ -7,6 +7,7 @@ module Metanorma
|
|
7
7
|
SUPPORTED_GEMS = [
|
8
8
|
"metanorma-iso",
|
9
9
|
"metanorma-iec",
|
10
|
+
"metanorma-ieee",
|
10
11
|
"metanorma-ietf",
|
11
12
|
"metanorma-bipm",
|
12
13
|
"metanorma-cc",
|
@@ -36,21 +37,17 @@ module Metanorma
|
|
36
37
|
|
37
38
|
def activate
|
38
39
|
flavors.each do |flavor_name|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
Metanorma::Cli::UI.debug("#{flavor_name} is not present!")
|
43
|
-
end
|
40
|
+
gem(flavor_name)
|
41
|
+
rescue LoadError, MissingSpecError => _e
|
42
|
+
Metanorma::Cli::UI.debug("#{flavor_name} is not present!")
|
44
43
|
end
|
45
44
|
end
|
46
45
|
|
47
46
|
def load_flavors
|
48
47
|
flavors.each do |flavor_name|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
gem_loading_error(flavor_name)
|
53
|
-
end
|
48
|
+
require(flavor_name)
|
49
|
+
rescue LoadError => _e
|
50
|
+
gem_loading_error(flavor_name)
|
54
51
|
end
|
55
52
|
end
|
56
53
|
|
data/metanorma-cli.gemspec
CHANGED
@@ -34,7 +34,7 @@ Gem::Specification.new do |spec|
|
|
34
34
|
# need for dev because locally compiled metanorma-iso does not have css
|
35
35
|
spec.add_development_dependency "rubocop", "~> 1.5.2"
|
36
36
|
spec.add_development_dependency "sassc"
|
37
|
-
#spec.add_runtime_dependency "metanorma-nist", "~> 2.1.0"
|
37
|
+
# spec.add_runtime_dependency "metanorma-nist", "~> 2.1.0"
|
38
38
|
|
39
39
|
spec.add_runtime_dependency "metanorma-ietf", "~> 3.0.0"
|
40
40
|
spec.add_runtime_dependency "metanorma-iso", "~> 2.1.0"
|
@@ -56,10 +56,13 @@ Gem::Specification.new do |spec|
|
|
56
56
|
spec.add_runtime_dependency "metanorma-iho", "~> 0.6.0"
|
57
57
|
spec.add_runtime_dependency "metanorma-itu", "~> 2.1.0"
|
58
58
|
# spec.add_runtime_dependency "metanorma-nist", "~> 2.1.0"
|
59
|
+
spec.add_runtime_dependency "metanorma-ieee", "~> 0.0.1"
|
59
60
|
spec.add_runtime_dependency "metanorma-ogc", "~> 2.1.0"
|
60
61
|
spec.add_runtime_dependency "metanorma-un", "~> 0.9.0"
|
61
62
|
spec.add_runtime_dependency "relaton-cli", ">= 0.8.2"
|
62
63
|
|
63
64
|
spec.add_runtime_dependency "socksify"
|
64
|
-
#spec.metadata["rubygems_mfa_required"] = "true"
|
65
|
+
# spec.metadata["rubygems_mfa_required"] = "true"
|
66
|
+
# spec.metadata["rubygems_mfa_required"] = "true"
|
67
|
+
# NOBODY UNCOMMENTS THIS WITHOUT EXPLAINING TO ME HOW TO USE MFA
|
65
68
|
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.5.
|
4
|
+
version: 1.5.18.pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: debug
|
@@ -374,6 +374,20 @@ dependencies:
|
|
374
374
|
- - "~>"
|
375
375
|
- !ruby/object:Gem::Version
|
376
376
|
version: 2.1.0
|
377
|
+
- !ruby/object:Gem::Dependency
|
378
|
+
name: metanorma-ieee
|
379
|
+
requirement: !ruby/object:Gem::Requirement
|
380
|
+
requirements:
|
381
|
+
- - "~>"
|
382
|
+
- !ruby/object:Gem::Version
|
383
|
+
version: 0.0.1
|
384
|
+
type: :runtime
|
385
|
+
prerelease: false
|
386
|
+
version_requirements: !ruby/object:Gem::Requirement
|
387
|
+
requirements:
|
388
|
+
- - "~>"
|
389
|
+
- !ruby/object:Gem::Version
|
390
|
+
version: 0.0.1
|
377
391
|
- !ruby/object:Gem::Dependency
|
378
392
|
name: metanorma-ogc
|
379
393
|
requirement: !ruby/object:Gem::Requirement
|
@@ -508,11 +522,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
508
522
|
version: 2.5.0
|
509
523
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
510
524
|
requirements:
|
511
|
-
- - "
|
525
|
+
- - ">"
|
512
526
|
- !ruby/object:Gem::Version
|
513
|
-
version:
|
527
|
+
version: 1.3.1
|
514
528
|
requirements: []
|
515
|
-
rubygems_version: 3.3.
|
529
|
+
rubygems_version: 3.3.16
|
516
530
|
signing_key:
|
517
531
|
specification_version: 4
|
518
532
|
summary: Metanorma is the standard of standards; the metanorma gem allows you to create
|