metanorma-iso 1.1.3 → 1.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -8
- data/README.adoc +8 -177
- data/appveyor.yml +30 -0
- data/docs/adopting-spec.adoc +5 -5
- data/docs/adopting-toolchain.adoc +3 -3
- data/docs/asciiiso-syntax.adoc +2 -2
- data/docs/guidance.adoc +7 -7
- data/docs/htmloutput.adoc +4 -4
- data/docs/outputs.adoc +1 -1
- data/docs/quickstart.adoc +19 -19
- data/docs/styling-output-html.adoc +1 -1
- data/docs/styling-output-msword.adoc +3 -3
- data/lib/asciidoctor/iso/biblio.rng +38 -34
- data/lib/asciidoctor/iso/isodoc.rng +1 -0
- data/lib/asciidoctor/iso/reqt.rng +157 -0
- data/lib/asciidoctor/iso/validate_requirements.rb +6 -6
- data/lib/asciidoctor/iso/validate_style.rb +2 -2
- data/lib/isodoc/iso/html/html_iso_titlepage.html +14 -2
- data/lib/isodoc/iso/html/isodoc.scss +1 -1
- data/lib/isodoc/iso/html/style-iso.scss +11 -3
- data/lib/isodoc/iso/html/word_iso_titlepage.html +23 -3
- data/lib/isodoc/iso/metadata.rb +9 -2
- data/lib/metanorma/iso/version.rb +1 -1
- data/metanorma-iso.gemspec +1 -1
- data/spec/assets/iso.doc +20 -15
- data/spec/assets/iso.html +11 -3
- data/spec/isodoc/metadata_spec.rb +2 -2
- data/spec/isodoc/postproc_spec.rb +7 -6
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f22c94d1c862cca77258350af0650f8b736410dc43faa81491fb81e4d5c1181
|
4
|
+
data.tar.gz: f63dbc9d704fb62c6dce58a35c415342c3b706c5fd808c8523f6092215e90c99
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7829b974b2acc494439813ea14e184f7b1c0bdda2d8f6c2aefb7154963a64d0371fb0cdf93908a50e78bc7cb5fa958226ca6d2fe44da3088fefe6ecd287fc877
|
7
|
+
data.tar.gz: bb8bab6f488ca2d35314567a483c69f08ec4500c633d2a8b0d32ca2e869a453d8485ac2bd25beeabb7a904547e27a5df0d615995f16f2457d74e20010ca589f5
|
data/.travis.yml
CHANGED
@@ -8,14 +8,8 @@ rvm:
|
|
8
8
|
- ruby-head
|
9
9
|
before_install:
|
10
10
|
- gem install bundler -v 2.0.1
|
11
|
-
-
|
12
|
-
-
|
13
|
-
- sudo mkdir -p /opt/plantuml
|
14
|
-
- sudo cp plantuml.jar /opt/plantuml
|
15
|
-
- echo "#! /bin/sh" > plantuml.sh
|
16
|
-
- echo 'exec java -jar /opt/plantuml/plantuml.jar "$@"' >> plantuml.sh
|
17
|
-
- sudo install -m 755 -D plantuml.sh /usr/bin/plantuml
|
18
|
-
- plantuml -version
|
11
|
+
- travis_retry sudo apt-get update
|
12
|
+
- sudo bash -c "curl -L https://raw.githubusercontent.com/metanorma/plantuml-install/master/ubuntu.sh | bash"
|
19
13
|
matrix:
|
20
14
|
allow_failures:
|
21
15
|
- rvm: ruby-head
|
data/README.adoc
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
= Metanorma-ISO: Metanorma processor for ISO standards
|
2
2
|
|
3
3
|
image:https://img.shields.io/gem/v/metanorma-iso.svg["Gem Version", link="https://rubygems.org/gems/metanorma-iso"]
|
4
|
-
image:https://img.shields.io/travis/
|
5
|
-
image:https://
|
4
|
+
image:https://img.shields.io/travis/metanorma/metanorma-iso/master.svg["Build Status", link="https://travis-ci.org/metanorma/metanorma-iso"]
|
5
|
+
image:https://ci.appveyor.com/api/projects/status/hnc1wnc8i9nquqqb?svg=true["Appveyor Build Status", link="https://ci.appveyor.com/project/ribose/metanorma-iso"]
|
6
|
+
image:https://codeclimate.com/github/metanorma/metanorma-iso/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/metanorma/metanorma-iso"]
|
6
7
|
|
7
8
|
WARNING: This gem is still under development.
|
8
9
|
|
@@ -10,7 +11,7 @@ _Formerly known as_ `asciidoctor-iso`.
|
|
10
11
|
|
11
12
|
== Functionality and Approach
|
12
13
|
|
13
|
-
For the conceptual underpinnings of this gem, and the other gems in the Metanorma suite, see the https://github.com/
|
14
|
+
For the conceptual underpinnings of this gem, and the other gems in the Metanorma suite, see the https://github.com/metanorma/metanorma-model-standoc/blob/master/README.adoc[metanorma-standoc README].
|
14
15
|
|
15
16
|
== Outputs
|
16
17
|
|
@@ -54,13 +55,13 @@ The gem then converts the XML into HTML and DOC.
|
|
54
55
|
|
55
56
|
=== Installation
|
56
57
|
|
57
|
-
If you are using a Mac, the https://github.com/
|
58
|
+
If you are using a Mac, the https://github.com/metanorma/metanorma-macos-setup
|
58
59
|
repository has instructions on setting up your machine to run Metanorma
|
59
60
|
scripts such as this one. You need only run the following in a Terminal console:
|
60
61
|
|
61
62
|
[source,console]
|
62
63
|
----
|
63
|
-
$ bash <(curl -s https://raw.githubusercontent.com/
|
64
|
+
$ bash <(curl -s https://raw.githubusercontent.com/metanorma/metanorma-macos-setup/master/metanorma-setup)
|
64
65
|
$ gem install metanorma-iso
|
65
66
|
$ gem install metanorma-cli
|
66
67
|
----
|
@@ -68,177 +69,7 @@ $ gem install metanorma-cli
|
|
68
69
|
The metanorma-cli gem is the command-line interface for the Metanorma tool suite
|
69
70
|
(incorporating the `metanorma` executable seen above).
|
70
71
|
|
71
|
-
|
72
|
+
== Documentation
|
72
73
|
|
73
|
-
The
|
74
|
-
checks as prescribed in ISO/IEC DIR 2:2018, and warns the user about them in the
|
75
|
-
console:
|
76
|
-
|
77
|
-
* Numbers with what looks like dots instead of commas for decimal points.
|
78
|
-
|
79
|
-
* Groups of numbers without spacing for every three digits. (The gem attempts
|
80
|
-
to ignore ISO references.)
|
81
|
-
|
82
|
-
* No space before percent sign.
|
83
|
-
|
84
|
-
* No bracketing of tolerance in percentage (e.g. `15 ± 7 % .`)
|
85
|
-
|
86
|
-
* No recommendations, permissions or requirements (detected by keyword) in:
|
87
|
-
foreword, scope, introduction, term examples and examples, notes, footnotes.
|
88
|
-
|
89
|
-
* No subclauses that are the only child of a clause. (In clauses, annexes, or
|
90
|
-
scopes.)
|
91
|
-
|
92
|
-
* 5 levels of subclause nesting. (Never actuated, AsciiDoc only permits 4
|
93
|
-
levels of subsections.)
|
94
|
-
|
95
|
-
* Non-ISO/IEC reference turning up as normative.
|
96
|
-
|
97
|
-
* Term definition starts with an article, or ends with a period.
|
98
|
-
|
99
|
-
* Title intro or title part appears in only one of French or English.
|
100
|
-
|
101
|
-
In addition, the gem checks all terms cited from the IEV Electropedia against
|
102
|
-
the online IEV Electropedia entry, and issues a warning if the term is different.
|
103
|
-
|
104
|
-
The document model for ISO Standards contains all the structures described
|
105
|
-
in http://www.iec.ch/members_experts/refdocs/iec/isoiecdir-2%7Bed7.0%7Den.pdf[ISO/IEC DIR 2 "Principles and rules for the structure and drafting of ISO and IEC documents"].
|
106
|
-
It is expressed as a
|
107
|
-
link:lib/metanorma/iso/isostandard.rnc[Relax NG Compact schema]; actual
|
108
|
-
validation occurs against its link:lib/metanorma/iso/isostandard.rng[full Relax
|
109
|
-
NG counterpart].
|
110
|
-
|
111
|
-
[[model_additions]]
|
112
|
-
== Asciidoctor model additions
|
113
|
-
|
114
|
-
Refer also to https://github.com/riboseinc/metanorma-standoc/blob/master/README.adoc; this section lists additions specific only to metanorma-iso
|
115
|
-
|
116
|
-
=== Additional warning types
|
117
|
-
|
118
|
-
Asciidoctor natively supports the ISO admonitions "Caution", "Warning", and "Important"
|
119
|
-
through its admonition syntax:
|
120
|
-
|
121
|
-
[source,asciidoctor]
|
122
|
-
--
|
123
|
-
CAUTION: This is a single-block caution
|
124
|
-
|
125
|
-
[WARNING]
|
126
|
-
====
|
127
|
-
This is a
|
128
|
-
|
129
|
-
multiple-block warning
|
130
|
-
====
|
131
|
-
--
|
132
|
-
|
133
|
-
If the admonitions "Danger" and "Safety Precaution" are needed, they should be indicated
|
134
|
-
through a `type` attribute, which will override the admonition type appearing in the Asciidoc:
|
135
|
-
|
136
|
-
[source,asciidoctor]
|
137
|
-
--
|
138
|
-
[type=Danger]
|
139
|
-
CAUTION: This is a single-block caution
|
140
|
-
|
141
|
-
[WARNING,type=Safety Precaution]
|
142
|
-
====
|
143
|
-
This is a
|
144
|
-
|
145
|
-
multiple-block warning
|
146
|
-
====
|
147
|
-
--
|
148
|
-
|
149
|
-
=== Bibliography
|
150
|
-
|
151
|
-
ISO treats dated and undated references as separate (an undated reference is taken to
|
152
|
-
refer to the latest published edition of that reference.) if reference is to be made to
|
153
|
-
both an undated and a dated version of an ISO reference, these need to be explicitly listed as
|
154
|
-
separate references.
|
155
|
-
|
156
|
-
For automated bibliography integration, see the https://github.com/riboseinc/metanorma-model-standoc/blob/master/README.adoc[metanorma-standoc README].
|
157
|
-
|
158
|
-
[[document-attributes]]
|
159
|
-
== Document Attributes
|
160
|
-
|
161
|
-
The gem uses the document attributes defined for metanorma-standoc (see
|
162
|
-
the https://github.com/riboseinc/metanorma-model-standoc/blob/master/README.adoc[metanorma-standoc README]).
|
163
|
-
|
164
|
-
The following document attributes are specific to ISO:
|
165
|
-
|
166
|
-
`:tc-docnumber:`:: The document number assigned by the Technical committee
|
167
|
-
|
168
|
-
`:partnumber:`:: The ISO document part number. (This can be "part-subpart" if this is an IEC document.)
|
169
|
-
|
170
|
-
`:title-intro-en:`:: The introductory component of the English title of the
|
171
|
-
document. This and the other `:title-*` document attributes are used instead
|
172
|
-
of the metanorma-standoc `:title:` attribute and the default Asciidoctor title
|
173
|
-
(the first line of the document header, prefixed with `=`).
|
174
|
-
|
175
|
-
`:title-main-en:`:: The main component of the English title of the document
|
176
|
-
(mandatory).
|
177
|
-
|
178
|
-
`:title-part-en:`:: The English title of the document part
|
179
|
-
|
180
|
-
`:title-intro-fr:`:: The introductory component of the French title of the
|
181
|
-
document. (This document template presupposes authoring in English; a different
|
182
|
-
template will be needed for French, including French titles of document
|
183
|
-
components such as annexes.)
|
184
|
-
|
185
|
-
`:title-main-fr:`:: The main component of the French title of the document
|
186
|
-
(mandatory).
|
187
|
-
|
188
|
-
`:title-part-fr:`:: The French title of the document part
|
189
|
-
|
190
|
-
`:doctype:`:: Has its possible values defined by
|
191
|
-
https://www.iso.org/deliverables-all.html[ISO deliverables: The different types of ISO publications]
|
192
|
-
(mandatory). The permitted types are:
|
193
|
-
`international-standard, technical-specification, technical-report,
|
194
|
-
publicly-available-specification, international-workshop-agreement, guide`.
|
195
|
-
|
196
|
-
`:docstage:`:: The stage code for the document status (see
|
197
|
-
https://www.iso.org/stage-codes.html[International harmonized stage codes]).
|
198
|
-
This attribute and `:docsubstage:` replace the `:status:` attribute of
|
199
|
-
metanorma-standoc.
|
200
|
-
|
201
|
-
`:docsubstage:`:: The substage code for the document status (see
|
202
|
-
https://www.iso.org/stage-codes.html[International harmonized stage codes])
|
203
|
-
|
204
|
-
`:iteration:`:: The iteration of a stage, in case there have been multiple drafts
|
205
|
-
(e.g. `2` on a `CD`: this is the second iteration through the `CD` stage).
|
206
|
-
|
207
|
-
`:secretariat:`:: The national body acting as the secretariat for the document
|
208
|
-
in the deafting stage
|
209
|
-
|
210
|
-
`:technical-committee-number:`:: The number of the relevant ISO technical
|
211
|
-
committee (also `:technical-committee-number_2:`, `:technical-committee-number_3:`...;
|
212
|
-
the same applies for all technical-committee, subcommittee and workgroup attributes)
|
213
|
-
|
214
|
-
`:technical-committee-type:``:: The type of the relevant technical committee. Defaults
|
215
|
-
to `TC` if not supplied. Values: `TC1, `PC`, `JTC`, `JPC`.
|
216
|
-
|
217
|
-
`:technical-committee:`:: The name of the relevant ISO technical committee
|
218
|
-
(mandatory)
|
219
|
-
|
220
|
-
`:subcommittee-number:`:: The number of the relevant ISO subcommittee
|
221
|
-
|
222
|
-
`:subcommittee-type:`:: The type of the relevant ISO subcommittee. Defaults to
|
223
|
-
`SC` if not supplied. Values: `SC`, `JSC`.
|
224
|
-
|
225
|
-
`:subcommittee:`:: The name of the relevant ISO subcommittee
|
226
|
-
|
227
|
-
`:workgroup-number:`:: The number of the relevant ISO workgroup
|
228
|
-
|
229
|
-
`:workgroup-type:`:: The type of the relevant ISO workgroup. Defaults to `WG` if
|
230
|
-
not supplied. Example values: `JWG`, `JAG`, `AG` (advisory group), `AHG`, `SWG`,
|
231
|
-
`SG`, `MA` (maintenance agency), `CORG`, `JCG`, `CAG`
|
232
|
-
|
233
|
-
`:workgroup:`:: The name of the relevant ISO workgroup
|
234
|
-
|
235
|
-
== Examples
|
236
|
-
|
237
|
-
The gem has been tested to date against the
|
238
|
-
https://www.iso.org/publication/PUB100407.html["Rice document"], the ISO's
|
239
|
-
model document of an international standard. Sample representation of the Rice document
|
240
|
-
in Asciidoctor, and output formats, are included in the https://github.com/riboseinc/isodoc-rice
|
241
|
-
repository.
|
242
|
-
|
243
|
-
See also `link:spec/metanorma-iso[]` for individual features.
|
74
|
+
See https://www.metanorma.com/author/iso/[The ISO flavor of Metanorma].
|
244
75
|
|
data/appveyor.yml
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
version: '{build}'
|
2
|
+
|
3
|
+
environment:
|
4
|
+
matrix:
|
5
|
+
- RUBY_VERSION: 25
|
6
|
+
- RUBY_VERSION: 24
|
7
|
+
- RUBY_VERSION: 23
|
8
|
+
- RUBY_VERSION: _trunk
|
9
|
+
|
10
|
+
matrix:
|
11
|
+
allow_failures:
|
12
|
+
- RUBY_VERSION: _trunk
|
13
|
+
|
14
|
+
install:
|
15
|
+
- ps: . { iwr -useb https://raw.githubusercontent.com/metanorma/metanorma-build-scripts/master/appveyor.ps1 } | iex
|
16
|
+
- refreshenv
|
17
|
+
|
18
|
+
build_script:
|
19
|
+
- set PATH=C:\Ruby%RUBY_VERSION%\bin;%PATH%
|
20
|
+
- bundle update
|
21
|
+
- bundle install
|
22
|
+
|
23
|
+
before_test:
|
24
|
+
- ruby -v
|
25
|
+
- gem -v
|
26
|
+
- bundle -v
|
27
|
+
|
28
|
+
test_script:
|
29
|
+
- bundle exec rake
|
30
|
+
|
data/docs/adopting-spec.adoc
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
= How can I adopt the StanDoc specification for my own publications?
|
2
2
|
|
3
|
-
TIP: Copy the RSD schema from https://github.com/
|
3
|
+
TIP: Copy the RSD schema from https://github.com/metanorma/metanorma-model-iso/blob/master/grammars/rsd.rng. You may need to adapt some of the enums in the model, or in the ISO Standards model that it inherits; but in the first instance, you can just ignore the differences—and ignore the validation feedback that the toolset gives.
|
4
4
|
|
5
5
|
The Standoc specification is expressed in http://www.relaxng.org[RelaxNG schema for XML], and is intended to be customisable for different types of publication. The customisation of Standoc relies on inheritance, with the following schemas embedded hierarchically:
|
6
6
|
|
7
|
-
* https://github.com/
|
8
|
-
* https://github.com/
|
9
|
-
* https://github.com/
|
7
|
+
* https://github.com/metanorma/relaton-models[Relaton]: bibliography
|
8
|
+
* https://github.com/metanorma/basicdoc-models[BasicDoc]: block-level and inline formatting
|
9
|
+
* https://github.com/metanorma/metanorma-standoc[StanDoc]: organisation of sections for a generic standards document
|
10
10
|
* Models specific to standards
|
11
11
|
|
12
12
|
Specialisation of a model consists of:
|
@@ -19,7 +19,7 @@ To adapt the schema for your publication set,
|
|
19
19
|
|
20
20
|
* Get familiar with the Standoc set of models, and identify any elements that you would want to represent differently for your documents (different types, different enums), or enhance for your documents (additional element attributes, additional elements)
|
21
21
|
* Create a grammar inheriting from StanDoc or from a specific standard, which expresses what is distinctive about your grammar.
|
22
|
-
** We recommend starting your modelling in UML, as an effective communication tool; compare the UML models for Standoc standards at https://github.com/
|
22
|
+
** We recommend starting your modelling in UML, as an effective communication tool; compare the UML models for Standoc standards at https://github.com/metanorma/metanorma-model-iso
|
23
23
|
** The tool suite expects to validate against a set of schemas expressed in RelaxNG. We have been authoring grammars in RelaxNG Compact, as a more human-readable format, then compiling those grammars to RelaxNG using https://github.com/relaxng/jing-trang[jing-trang]. You can choose to use a different schema language, but you will need to customise the tool chain to validate against that form of schema instead.
|
24
24
|
** In order to make schema inheritance easier, we have avoided using namespaces for the individual schemas; a namespace is added to the standards-specific schema at the very end of the inheritance chain.
|
25
25
|
|
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
[TIP]
|
4
4
|
====
|
5
|
-
The easiest way to adopt StanDoc is to use the metanorma-acme gem: https://github.com/
|
5
|
+
The easiest way to adopt StanDoc is to use the metanorma-acme gem: https://github.com/metanorma/metanorma-acme, supplying your own stylesheets and HTML files for styling.
|
6
6
|
|
7
7
|
If you wish to create a custom gem, in order to customise behaviour further:
|
8
8
|
|
9
|
-
* Clone the metanorma-sample gem: https://github.com/
|
9
|
+
* Clone the metanorma-sample gem: https://github.com/metanorma/metanorma-sample.
|
10
10
|
* Change the namespace for RSD documents (`RSD_NAMESPACE = "https://open.ribose.com/standards/rsd"`) to a namespace specific to your organisation's document standard.
|
11
11
|
* Change any references to `sample` or `Sample` in the gem to your organisation's document standard.
|
12
12
|
* Change the styling of the document outputs (`.../lib/isodoc/XXX/html`).
|
@@ -26,7 +26,7 @@ The customisations needed for `Isodoc::Sample` are more extensive. Three base cl
|
|
26
26
|
|
27
27
|
* `Isodoc::Metadata` processes the metadata about the document stored in `//bibdata`. This information typically ends up in the document title page, as opposed to the document body. For that reason, metadata is extracted into a hash, which is passed to document output (title page, Word header) via the https://shopify.github.io/liquid/[Liquid template language].
|
28
28
|
* `Isodoc::HtmlConvert` converts Standoc XML to HTML.
|
29
|
-
* `Isodoc::WordConvert` converts Standoc XML to Word HTML; the https://github.com/
|
29
|
+
* `Isodoc::WordConvert` converts Standoc XML to Word HTML; the https://github.com/metanorma/html2doc[html2doc] gem then converts this to a .doc document.
|
30
30
|
|
31
31
|
The `Isodoc::HtmlConvert` and `Isodoc::WordConvert` overlap substantially, as both use variants of HTML. However there is no reason not to make substantially different rendering choices in the HTML and Word branches of the code.
|
32
32
|
|
data/docs/asciiiso-syntax.adoc
CHANGED
@@ -4,7 +4,7 @@ AsciiISO is syntax based on AsciiDoc, with some extensions specific to authoring
|
|
4
4
|
|
5
5
|
== ISO specific syntax
|
6
6
|
|
7
|
-
TIP: Full details of Asciidoctor-ISO–specific markup and conventions is given in the https://github.com/
|
7
|
+
TIP: Full details of Asciidoctor-ISO–specific markup and conventions is given in the https://github.com/metanorma/metanorma-iso/blob/master/README.adoc[Asciidoctor-ISO Readme] and the https://github.com/metanorma/metanorma-iso/wiki/Guidance-for-authoring[Guidance for authoring].
|
8
8
|
|
9
9
|
The sections that have a fixed position according to ISO/IEC DIR 2 (Introduction, Scope, Normative References, Terms and Definitions, Symbols and Abbreviations, Bibliography) need to be titled as such, as first-level headings.
|
10
10
|
|
@@ -16,7 +16,7 @@ Syntax includes the following; the links are to the Asciidoctor User Manual. All
|
|
16
16
|
|
17
17
|
=== https://asciidoctor.org/docs/user-manual/#doc-header[Document header]
|
18
18
|
|
19
|
-
Attributes of the document, which typically appear in the coverpage (if at all), rather than in the document proper. The permitted attributes for all Metanorma documents, and their expected values, are documented in the https://github.com/
|
19
|
+
Attributes of the document, which typically appear in the coverpage (if at all), rather than in the document proper. The permitted attributes for all Metanorma documents, and their expected values, are documented in the https://github.com/metanorma/metanorma-standoc#document-attributes[metanorma-standoc Readme]; each standards-specific gem adds documentation of its own specific attributes (e.g. https://github.com/metanorma/metanorma-iso#document-attributes).
|
20
20
|
|
21
21
|
Note that the initial title line and author line expected in Asciidoctor are ignored in favour of specific document attributes, although they still need to be supplied for the document to be valid.
|
22
22
|
|
data/docs/guidance.adoc
CHANGED
@@ -8,16 +8,16 @@ The documents you will be authoring will be in the http://asciidoctor.org[Asciid
|
|
8
8
|
|
9
9
|
* http://asciidoctor.org/docs/user-manual/[Asciidoctor User Manual] will be your companion.
|
10
10
|
* https://www.metanorma.com/software/metanorma-iso/docs/asciiiso-syntax/[AsciiISO syntax] provides a quick reference for both standard Asciidoctor markup and custom ISO-related features.
|
11
|
-
* See also https://github.com/
|
11
|
+
* See also https://github.com/metanorma/metanorma-iso#asciidoctor-model-additions[Additions to markup made for ISO standards] in README Metanorma-ISO.
|
12
12
|
|
13
|
-
We have tried to make things easier for you by preparing an https://github.com/
|
13
|
+
We have tried to make things easier for you by preparing an https://github.com/metanorma/metanorma-iso/blob/master/spec/examples/rice.adoc[AsciiDoc version] of the ISO Standard exemplar, the https://www.iso.org/publication/PUB100407.html["Rice document"].
|
14
14
|
If you use this document as a template for your own ISO standard document, you will find most of the formatting you need illustrated there.
|
15
15
|
|
16
16
|
== Output in different languages
|
17
17
|
|
18
18
|
Metanorma allows generation of standards in different languages; the language of the document is specified in the `:language:` document attribute (and `:script:`, for languages with more than one script).
|
19
19
|
|
20
|
-
For each language, language-specific templated text is specified for the boilerplate, labels and cross-references that are included in document output. Metanorma has predefined templates for English, Chinese (Simplified) and French. You can specify your own language by providing your own http://www.yaml.org/spec/1.2/spec.html[YAML] template file, and linking to it with the `:i18nyaml` document attribute. The YAML template you provide needs to match https://github.com/
|
20
|
+
For each language, language-specific templated text is specified for the boilerplate, labels and cross-references that are included in document output. Metanorma has predefined templates for English, Chinese (Simplified) and French. You can specify your own language by providing your own http://www.yaml.org/spec/1.2/spec.html[YAML] template file, and linking to it with the `:i18nyaml` document attribute. The YAML template you provide needs to match https://github.com/metanorma/isodoc/blob/master/lib/isodoc/i18n-en.yaml, substituting translations for each of the fields given.
|
21
21
|
|
22
22
|
The Chinese (Simplified) template also localises punctuation and spacing, mapping them away from the default Latin punctuation used elsewhere in the gem.
|
23
23
|
|
@@ -56,7 +56,7 @@ The tool also validates terms cited from the Internatinal Electrotechnical Vocab
|
|
56
56
|
|
57
57
|
== Document header
|
58
58
|
|
59
|
-
The core metadata about the standard comes from the Asciidoctor document header (the list of colon-delimited attributes at the start of the document). The https://github.com/
|
59
|
+
The core metadata about the standard comes from the Asciidoctor document header (the list of colon-delimited attributes at the start of the document). The https://github.com/metanorma/metanorma-standoc#document-attributes[metanorma-standoc README] and the README of each standard-specific gem documents what those fields should be. Use the Rice document as a template, and be careful about sticking to the guidelines on populating them.
|
60
60
|
|
61
61
|
You will need to use the `:stem:` document attribute in if you have any AsciiMath or MathML to include in the document; otherwise they will not be detected.
|
62
62
|
|
@@ -142,7 +142,7 @@ The bracketed reference numbers are expected to be correct and in order: they ar
|
|
142
142
|
|
143
143
|
==== Relaton Reference Fetching
|
144
144
|
|
145
|
-
The https://github.com/
|
145
|
+
The https://github.com/metanorma/relaton[`relaton`] can fetch bibliographic entries for any standards known to have online bibliographic databases (ISO, IEC, IETF, GB). Any bibliographic entry recognised through its document identifier prefix will by default have its bibliographic entry fetched by that gem. The fetched data overrides any content about the item provided in the document, since the online bibliography is treated as the source of truth for that standards document.
|
146
146
|
|
147
147
|
==== Cross-References
|
148
148
|
|
@@ -168,7 +168,7 @@ TIP: ISO clause references in particular will suppress the word "Clause" before
|
|
168
168
|
|
169
169
|
=== Terms and Definitions
|
170
170
|
|
171
|
-
// TODO: This paragraph will be removed when https://github.com/
|
171
|
+
// TODO: This paragraph will be removed when https://github.com/metanorma/metanorma-iso/issues/222 is implemented
|
172
172
|
|
173
173
|
The title of a top-level Terms and Definitions clause is populated automatically, overriding the title provided by the user: if it contains a Symbols and Abbreviated Terms subclause, it is titled _Terms, definitions, symbols and abbreviated terms_, otherwise it is titled _Terms and definitions_. A Terms and Definitions clause will be recognised if either title is given, regardless of case. Symbols and Abbreviated Terms subclauses are also automatically titled; other subclauses of Terms and Definitions clauses are not.
|
174
174
|
|
@@ -418,7 +418,7 @@ Notes that are not at the end of a clause are folded into the preceding block, i
|
|
418
418
|
|
419
419
|
=== Reviewer Notes
|
420
420
|
|
421
|
-
We have introduced a mechanism in the gem to annotate arbitrary blocks of text, using Asciidoctor sidebars and anchors for the beginning and end of the annotation; see https://github.com/
|
421
|
+
We have introduced a mechanism in the gem to annotate arbitrary blocks of text, using Asciidoctor sidebars and anchors for the beginning and end of the annotation; see https://github.com/metanorma/metanorma-standoc#reviewer-notes[discussion in the metanorma-standoc README].
|
422
422
|
|
423
423
|
== Cross-references
|
424
424
|
|
data/docs/htmloutput.adoc
CHANGED
@@ -22,7 +22,7 @@ The `body` of the HTML document is divided into the following parts:
|
|
22
22
|
|
23
23
|
=== Body markup
|
24
24
|
|
25
|
-
Within the body of the document, different blocks and inline spans of the Metanorma document model (https://github.com/
|
25
|
+
Within the body of the document, different blocks and inline spans of the Metanorma document model (https://github.com/metanorma/metanorma-model-standoc[Standoc XML], https://github.com/metanorma/basicdoc-models[BasicDoc XML]) are represented by different CSS classes, as follows:
|
26
26
|
|
27
27
|
==== Sections
|
28
28
|
|
@@ -86,11 +86,11 @@ All images for an HTML document `{filename}.html` are moved to the folder `{file
|
|
86
86
|
|
87
87
|
=== Word HTML and Word HTML CSS
|
88
88
|
|
89
|
-
The Word HTML documented here is what is used by the gems to generate DOC output. For more on why Word HTML is used, instead of OOXML or HTML 5 embedded into DOCX, see https://github.com/
|
89
|
+
The Word HTML documented here is what is used by the gems to generate DOC output. For more on why Word HTML is used, instead of OOXML or HTML 5 embedded into DOCX, see https://github.com/metanorma/html2doc/wiki/Why-not-docx%3F
|
90
90
|
|
91
91
|
Word HTML, and the Word HTML version of CSS, are restricted compared to the HTML and CSS you are likely familiar with. Word HTML is a subset of HTML 4; Word HTML CSS has a weakened set of selectors, and a range of Microsoft-specific extensions (prefixed with `@` or `mso-`). The weakened set of selectors means you cannot assume that classes are inherited by their children; normal CSS would apply formatting on a `div` class to its child paragraphs, but Word HTML would expect you to repeat that class definition for `p`.
|
92
92
|
|
93
|
-
Some of the necessary caveats are listed in https://github.com/
|
93
|
+
Some of the necessary caveats are listed in https://github.com/metanorma/html2doc/blob/master/README.adoc. The styling of lists in particular is quite different to normal CSS, and requires a Word-specific selector to define list styles (the `:ulstyle ` and `:olstyle ` parameter of `WordConvert.new()`).
|
94
94
|
|
95
95
|
Word HTML and CSS is not well-documented (even though there is a 1500 page manual from Microsoft); fortunately saving Word documents to HTML will reveal the Word HTML and Word HTML CSS that can be used to generate the same formatting. The stylesheets need to follow the conventions of Word HTML, and should be formulated by saving Word documents as HTML, and extracting their CSS stylesheets. Note that the CSS is prefixed with a set of font definitions; these too should be obtained by saving Word documents as HTML.
|
96
96
|
|
@@ -100,7 +100,7 @@ The headers and footers of a Word document are defined in Word HTML in a separat
|
|
100
100
|
|
101
101
|
The `head` of the Word HTML document contains two stylesheets (the `:wordstylesheet` and `:standardsheet` parameter of `WordConvert.new()`). The `:wordstylesheet` is intended as generic Word markup, while `:standardsheet` is intended to contain styling specific to the standard. No scripts are supported in Word HTML.
|
102
102
|
|
103
|
-
The other elements of the Word HTML head are populated by the https://github.com/
|
103
|
+
The other elements of the Word HTML head are populated by the https://github.com/metanorma/html2doc[html2doc gem]: a reference to a manifest of included files (specifically images and the header file), and settings to open the document in Print View at 100% magnification.
|
104
104
|
|
105
105
|
The `body` of the Word HTML document is divided into the following parts:
|
106
106
|
|
data/docs/outputs.adoc
CHANGED
@@ -30,7 +30,7 @@ when you save a Word document as HTML.)
|
|
30
30
|
Using DOC HTML makes it much easier to generate documents with
|
31
31
|
the advanced formatting requirements of Metanorma (including complex tables, formulas, footnotes, headers and footers,
|
32
32
|
nested list numbering and crossreferences) than generating either native DOCX (in OOXML), or the DOCX flavour of MHT. For more
|
33
|
-
on the choice to use DOC, see https://github.com/
|
33
|
+
on the choice to use DOC, see https://github.com/metanorma/html2doc/wiki/Why-not-docx%3F
|
34
34
|
|
35
35
|
The constraint on using DOC, however, imposes some constraints.
|
36
36
|
|
data/docs/quickstart.adoc
CHANGED
@@ -8,18 +8,18 @@ Metanorma takes text in the _Asciidoctor markup language_ as input (consult the
|
|
8
8
|
Metanorma makes some adjustments to the text format for its requirements;
|
9
9
|
these adjustments (which we refer to as _Metanorma Asciidoctor_, or AsciiISO) are documented in relevant sections of this documentation.
|
10
10
|
Metanorma uses Asciidoctor to generate _Metanorma XML_, as an intermediate, semantic representation of standards content.
|
11
|
-
Metanorma XML in turn is processed by the https://github.com/
|
11
|
+
Metanorma XML in turn is processed by the https://github.com/metanorma/isodoc[isodoc] gem to generate output in Microsoft Word (`.doc`) and HTML (`.html`).
|
12
12
|
|
13
13
|
== Even quicker summary
|
14
14
|
|
15
15
|
In order to start a new Metanorma document, or migrate your document from Word:
|
16
16
|
|
17
17
|
. Install <<installation>> (for your specific Metanorma standards class)
|
18
|
-
. Clone the https://github.com/
|
18
|
+
. Clone the https://github.com/metanorma/isodoc-rice/[AsciiISO Rice]
|
19
19
|
|
20
20
|
To migrate:
|
21
21
|
|
22
|
-
. Use our https://github.com/
|
22
|
+
. Use our https://github.com/metanorma/reverse_asciidoctor[reverse_asciidoctor] gem to help you convert a Word document into Asciidoctor. Be warned that the conversion will not be 100% clean, and you will have to manually fix some syntax (especially if your Word document contains an index, stray anchors, and equations).
|
23
23
|
. Move the content back to the cloned isodoc-rice.
|
24
24
|
. The isodoc-rice repository is set up for the ISO standards class; if you are not working with ISO, change its makefile to refer to the correct standards class (e.g. from `bundle exec metanorma -t iso -x doc,xml,html $^` to `bundle exec metanorma -t rsd -x doc,xml,html $^`
|
25
25
|
|
@@ -29,15 +29,15 @@ To migrate:
|
|
29
29
|
|
30
30
|
As of this writing, Metanorma supports the following standards classes:
|
31
31
|
|
32
|
-
* https://github.com/
|
33
|
-
* https://github.com/
|
34
|
-
* https://github.com/
|
35
|
-
* https://github.com/
|
36
|
-
* https://github.com/
|
37
|
-
* https://github.com/
|
38
|
-
* https://github.com/
|
39
|
-
* https://github.com/
|
40
|
-
* https://github.com/
|
32
|
+
* https://github.com/metanorma/metanorma-iso[ISO and IEC] (`iso`)
|
33
|
+
* https://github.com/metanorma/metanorma-gb[Chinese National standards] (`gb`)
|
34
|
+
* https://github.com/metanorma/metanorma-csd[Calconnect] (`csd`)
|
35
|
+
* https://github.com/metanorma/metanorma-csand[Cloud Security Alliance] (`csand`)
|
36
|
+
* https://github.com/metanorma/metanorma-m3d[Messaging, Malware and Mobile Anti-Abuse Working Group (M^3^AAWG)] (`m3d`)
|
37
|
+
* https://github.com/metanorma/metanorma-rsd[Ribose] (`rsd`)
|
38
|
+
* https://github.com/metanorma/metanorma-acme[Acme (shell for user-customised standards)] (`acme`)
|
39
|
+
* https://github.com/metanorma/metanorma-mpfd[Mandatory Provident Fund Schemes Authority, Hong Kong (MPFA)] (`mpfd`)
|
40
|
+
* https://github.com/metanorma/metanorma-unece[United Nations Economic Commission for Europe] (`unece`)
|
41
41
|
|
42
42
|
== Installing on Linux and macOS
|
43
43
|
|
@@ -56,7 +56,7 @@ you can install it from Github:
|
|
56
56
|
|
57
57
|
[source,console]
|
58
58
|
--
|
59
|
-
git clone https://github.com/
|
59
|
+
git clone https://github.com/metanorma/metanorma-cli.git
|
60
60
|
cd metanorma-cli
|
61
61
|
gem build *.gemspec
|
62
62
|
gem install *.gem
|
@@ -107,7 +107,7 @@ This will generate two files from the `new_standard.adoc` document (provided it
|
|
107
107
|
* `new_standard.doc`, a Word document
|
108
108
|
(currently in the pre-2007 `.doc` format, but Microsoft Word will open it fine).
|
109
109
|
|
110
|
-
Both these files are generated via an intermediate XML file, `new_standard.xml`, which represents the structure of the document as it is formally defined by the standards body, and captured in the https://github.com/
|
110
|
+
Both these files are generated via an intermediate XML file, `new_standard.xml`, which represents the structure of the document as it is formally defined by the standards body, and captured in the https://github.com/metanorma/metanorma-model-iso[Metanorma XML schema].
|
111
111
|
|
112
112
|
Even if there are no errors in the Asciidoctor syntax, the document may still raise warnings to the console as it is being validated. The validation comes from the formal definition of the standard class (e.g. ISO/IEC DIR 2 in the case of ISO and IEC), and consists of two parts: warnings about document content (e.g., for ISO, requiring space before a percentage sign; requiring that the scope not contain text that looks like a recommendation); and warnings about document structure. The latter are generated by running the generated XML against the ISOXML schema, and report the line numbers of the XML document where issues are observed.
|
113
113
|
|
@@ -132,7 +132,7 @@ and edit it, observing how it approaches various formatting tasks.
|
|
132
132
|
The https://www.iso.org/publication/PUB100407.html["Rice document"]
|
133
133
|
is the ISO's model document of an international standard.
|
134
134
|
An Metanorma-ISO version of the document is available
|
135
|
-
at https://github.com/
|
135
|
+
at https://github.com/metanorma/isodoc-rice/.
|
136
136
|
We suggest downloading the site, and editing it.
|
137
137
|
|
138
138
|
The `iso-rice-en.adoc` document consists of a document header,
|
@@ -149,11 +149,11 @@ as well as _the syntax extensions and conventions_ that are specific to Metanorm
|
|
149
149
|
|
150
150
|
- See also https://asciidoctor.org/docs/user-manual/[Asciidoctor User Manual]
|
151
151
|
documenting Asciidoctor itself
|
152
|
-
and https://github.com/
|
152
|
+
and https://github.com/metanorma/metanorma-iso/blob/master/README.adoc[Metanorma-ISO README].
|
153
153
|
|
154
154
|
== Migrating existing documents from Microsoft Word
|
155
155
|
|
156
|
-
. Use our https://github.com/
|
156
|
+
. Use our https://github.com/metanorma/reverse_asciidoctor[reverse_asciidoctor]
|
157
157
|
gem to help you convert a Word document into AsciiISO.
|
158
158
|
+
|
159
159
|
You will likely have to manually clean up some syntax
|
@@ -165,11 +165,11 @@ don’t rely on the automatic conversion to be 100% correct.
|
|
165
165
|
|
166
166
|
- See also https://asciidoctor.org/docs/user-manual/[Asciidoctor User Manual]
|
167
167
|
documenting Asciidoctor itself
|
168
|
-
and https://github.com/
|
168
|
+
and https://github.com/metanorma/metanorma-iso/blob/master/README.adoc[Metanorma-ISO README].
|
169
169
|
|
170
170
|
== Migrating existing documents from Microsoft Word:
|
171
171
|
|
172
|
-
. Use our https://github.com/
|
172
|
+
. Use our https://github.com/metanorma/reverse_asciidoctor[reverse_asciidoctor]
|
173
173
|
gem to help you convert a Word document into AsciiISO.
|
174
174
|
|
175
175
|
You will likely have to manually clean up some syntax
|