metanorma-iso 2.1.1 → 2.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/lib/html2doc/lists.rb +142 -10
  3. data/lib/isodoc/iso/base_convert.rb +10 -0
  4. data/lib/isodoc/iso/html/html_iso_titlepage.html +2 -0
  5. data/lib/isodoc/iso/html/isodoc-dis.css +170 -252
  6. data/lib/isodoc/iso/html/isodoc-dis.scss +170 -245
  7. data/lib/isodoc/iso/html/isodoc.css +38 -13
  8. data/lib/isodoc/iso/html/isodoc.scss +38 -12
  9. data/lib/isodoc/iso/html/style-human.css +14 -1
  10. data/lib/isodoc/iso/html/style-human.scss +10 -1
  11. data/lib/isodoc/iso/html/style-iso.css +35 -23
  12. data/lib/isodoc/iso/html/style-iso.scss +31 -23
  13. data/lib/isodoc/iso/html/word_iso_intro-dis.html +1 -6
  14. data/lib/isodoc/iso/html/word_iso_titlepage-dis.html +24 -13
  15. data/lib/isodoc/iso/html/word_iso_titlepage-prf.html +58 -0
  16. data/lib/isodoc/iso/html/word_iso_titlepage.html +6 -2
  17. data/lib/isodoc/iso/html_convert.rb +5 -0
  18. data/lib/isodoc/iso/i18n-en.yaml +32 -4
  19. data/lib/isodoc/iso/i18n-fr.yaml +29 -3
  20. data/lib/isodoc/iso/i18n-ru.yaml +32 -4
  21. data/lib/isodoc/iso/i18n-zh-Hans.yaml +32 -3
  22. data/lib/isodoc/iso/i18n.rb +1 -1
  23. data/lib/isodoc/iso/iso.amendment.xsl +332 -187
  24. data/lib/isodoc/iso/iso.international-standard.xsl +332 -187
  25. data/lib/isodoc/iso/metadata.rb +63 -63
  26. data/lib/isodoc/iso/presentation_bibdata.rb +74 -0
  27. data/lib/isodoc/iso/presentation_xml_convert.rb +14 -3
  28. data/lib/isodoc/iso/presentation_xref.rb +8 -2
  29. data/lib/isodoc/iso/sections.rb +1 -1
  30. data/lib/isodoc/iso/word_cleanup.rb +3 -0
  31. data/lib/isodoc/iso/word_convert.rb +6 -3
  32. data/lib/isodoc/iso/word_dis_cleanup.rb +235 -0
  33. data/lib/isodoc/iso/word_dis_convert.rb +47 -108
  34. data/lib/isodoc/iso/xref.rb +34 -6
  35. data/lib/metanorma/iso/base.rb +20 -1
  36. data/lib/metanorma/iso/biblio.rng +32 -34
  37. data/lib/metanorma/iso/boilerplate-fr.xml +3 -0
  38. data/lib/metanorma/iso/boilerplate-ru.xml +3 -0
  39. data/lib/metanorma/iso/boilerplate.xml +3 -0
  40. data/lib/metanorma/iso/cleanup.rb +28 -1
  41. data/lib/metanorma/iso/front.rb +31 -6
  42. data/lib/metanorma/iso/front_id.rb +2 -0
  43. data/lib/metanorma/iso/isodoc.rng +9 -0
  44. data/lib/metanorma/iso/isostandard.rng +30 -12
  45. data/lib/metanorma/iso/macros.rb +29 -0
  46. data/lib/metanorma/iso/version.rb +1 -1
  47. data/spec/isodoc/amd_spec.rb +4 -30
  48. data/spec/isodoc/blocks_spec.rb +499 -2
  49. data/spec/isodoc/i18n_spec.rb +145 -80
  50. data/spec/isodoc/iso_spec.rb +50 -169
  51. data/spec/isodoc/metadata_spec.rb +224 -83
  52. data/spec/isodoc/postproc_spec.rb +41 -5
  53. data/spec/isodoc/section_spec.rb +12 -6
  54. data/spec/isodoc/word_dis_spec.rb +1273 -147
  55. data/spec/isodoc/xref_spec.rb +87 -13
  56. data/spec/metanorma/amd_spec.rb +53 -1
  57. data/spec/metanorma/base_spec.rb +185 -10
  58. data/spec/metanorma/blocks_spec.rb +54 -0
  59. data/spec/metanorma/lists_spec.rb +2 -2
  60. data/spec/metanorma/section_spec.rb +2 -2
  61. data/spec/spec_helper.rb +13 -4
  62. data/spec/vcr_cassettes/withdrawn_iso.yml +27 -27
  63. metadata +7 -8
  64. data/docs/asciiiso-syntax.adoc +0 -307
  65. data/docs/guidance.adoc +0 -487
  66. data/docs/navigation.adoc +0 -23
  67. data/docs/quickstart.adoc +0 -179
  68. data/lib/isodoc/iso/presentation_inline.rb +0 -90
data/docs/guidance.adoc DELETED
@@ -1,487 +0,0 @@
1
- = Guidance for Authoring
2
-
3
- TIP: This guide has been authored for ISO standards, but most of it applies to all Metanorma standards. We indicate where guidance differs for different standards classes.
4
-
5
- The Asciidoctor approach to authoring ISO standards (and other related standards under Metanorma) is not https://en.wikipedia.org/wiki/WYSIWYG[WYSIWYG]: you are dealing with a text editor and a console rather than a Word document, and you are authoring something that looks more like HTML than the final product. On the other hand, editing documents with a markup system like Asciidoctor makes it much easier to automate key validation and formatting processes, such as checking for missing document components, autonumbering, and generating output in multiple formats.
6
-
7
- The documents you will be authoring will be in the http://asciidoctor.org[Asciidoc] formatting language, so you need to be familiar with that language's markup conventions.
8
-
9
- * http://asciidoctor.org/docs/user-manual/[Asciidoctor User Manual] will be your companion.
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/metanorma/metanorma-iso#asciidoctor-model-additions[Additions to markup made for ISO standards] in README Metanorma-ISO.
12
-
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
- 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
-
16
- == Output in different languages
17
-
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
-
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
-
22
- The Chinese (Simplified) template also localises punctuation and spacing, mapping them away from the default Latin punctuation used elsewhere in the gem.
23
-
24
- == Validation
25
-
26
- All Metanorma XML documents that are generated by the Metanorma tool are validated against a formal schema for the document structure, as well as style rules around content. The gem will generate a sequence of warnings; you should pay attention to them.
27
-
28
- The content warnings come first, and are prefixed with `ISO Style`. They try to impose rules on content taken from http://www.iec.ch/members_experts/refdocs/iec/isoiecdir-2%7Bed7.0%7Den.pdf[ISO/IEC DIR 2], including restrictions on where requirements may be stated, usage of decimal points, hanging clauses, and subclauses that are the only child of their parent clause. While the error detection is not infallible, they should be reviewed at least once. Where possible, the gem will give the ID or section heading associated with the error. For example:
29
-
30
- [source,console]
31
- --
32
- ISO style: WARNING (Section: ): Footnote may contain requirement: The maximum permissible mass fraction of defects shall be determined with respect to the mass fraction obtained after milling.
33
- ISO style: WARNING (Section: Wire sieve,): possible decimal point: 0.02
34
- ISO style: invalid technical committee type XYZ
35
- ISO style: AnnexA-4-1:Preparation of test sample: subsection is only child
36
- --
37
-
38
- TIP: Style rules around content are currently only applied to ISO standards. Within ISO, style rules are currently specific to content in English.
39
-
40
- The syntax errors come afterwards, and they report the line number and line position of the syntax error in the Metanorma XML document generated by the gem. (For example, the Asciidoctor document `rice.adoc` generates the Metanorma XML file `rice.xml`.) These errors deal with restrictions on what kinds of text can appear where, pointers within the document that are orphaned, and elements that appear in the wrong sequence. Deciphering what has gone wrong with them may take more effort, but the errors they point to are more serious than the style errors, and need to be resolved for the document to be well-formed. The gem will usually (but not always!) generate HTML and Word output despite the presence of those errors.
41
-
42
- For example:
43
-
44
- [source,console]
45
- --
46
- value of attribute "date" is invalid; must be an ISO date @ 454:183
47
- element "review" missing required attribute "from" @ 454:183
48
- element "subsection" not allowed here; expected the element end-tag or element "admonition", "dl", "example", "figure", "formula", "note", "ol", "p", "quote", "review", "sourcecode", "table" or "ul" @ 467:52
49
- value of attribute "date" is invalid; must be an ISO date @ 476:233
50
- IDREF "Annex-A-2" without matching ID @ 315:50
51
- IDREF "last_conformance_class" without matching ID @ 649:236
52
- IDREF "Annex-A" without matching ID @ 308:141
53
- --
54
-
55
- The tool also validates terms cited from the Internatinal Electrotechnical Vocabulary (IEV) against the online http://www.electropedia.org[IEV Electropedia] entries: if the preferred term does not match the form given in the IEV for that entry, it will issue a warning.
56
-
57
- == Document header
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/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
-
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
-
63
- The document header, unlike the document proper, cannot deal with HTML entities. If you need to enter non-Ascii characters for a title, or dashes for compound titles, you will need to enter them directly as Unicode (even if your console text editor doesn't like it): e.g. `:title-main-fr: Spécification et méthodes d'essai`, not `:title-main-fr: Sp\écification et m\éthodes d'essai`; `:title-part-en:Information Technology—Security`, not `:title-part-en:Information Technology\—Security`.
64
-
65
- == Document sections
66
-
67
- Sections are marked off in Asciidoc with titles prefixed by double equal signs, `==`. The gem depends on the titles given to identify the different kinds of sections in the document. As a result, you cannot choose to modify the titles of sections; the `Abstract`, `Introduction`, `Scope`, `Normative References`, `Terms and Definitions`, `Symbols and Abbreviations`, and `Bibliography` need to be titled as such. As an alternative (if the document deviates from that naming structure, or is in a language other than English), the section can be prefixed with a `heading=` attribute, giving the English canonical form of the section name.
68
-
69
- [source,asciidoc]
70
- --
71
- == Normative References
72
-
73
- [heading=terms and definitions]
74
- == Terms, definitions and abbreviations
75
- --
76
-
77
- The Foreword of a standard is detected as any text between the document header and the first section header (the "document preamble" in Asciidoctor). The Rice document gives the `.Foreword` title to the preamble, but the gem will supply the "Foreword" title regardless of what title is present.
78
-
79
-
80
- === Bibliographies
81
-
82
- The Normative References and the Bibliography must be preceded by the style attribute `[bibliography]`, so that the references they contain may be recognised as such.
83
-
84
- All bibliographic entries must be given as unordered lists.
85
-
86
- Currently the gem only supports formatted citations, which are given as such in the Asciidoc source. In the future, we expect to integrate the documents with rendering of Relaton-model bibliographies.
87
-
88
- ==== References to standards
89
-
90
- For references to standards with a document identifier, the entry must be preceded by a bibliographic anchor, in triple brackets: this consists of an arbitrary internal identifier (used in citations), followed by the canonical document identifier for the reference as its label. All references under Normative References are expected to have such an identifier. For example:
91
-
92
- [source,asciidoc]
93
- --
94
- * [[[ricepotentialmilling,ISO 6646]]], _Rice -- Determination of the potential milling yield from paddy and from husked rice_
95
- * [[[ISOGuide73, ISO Guide 73:2009]]], _Risk management -- Vocabulary_
96
- --
97
-
98
- [subs="quotes"]
99
- ISO 6646 in this example would be cited from elsewhere in the document through crossreferences to the `ricepotentialmilling` identifier; e.g. `<< ricepotentialmilling>>` (which will be rendered as `ISO 6646`), `<<``ricepotentialmilling, section 5``>>` (which will be rendered as `ISO 6646, Section 5`), `<<``ricepotentialmilling,section 5: the foregoing discussion``>>` (which will be tagged in the XML representation as Section 5 of ISO 6646, but will be displayed as `the foregoing discussion`.)
100
-
101
- [TIP]
102
- ====
103
- If an ISO reference is in preparation, ISO/IEC DIR 2 dictates that details of the reference status be given as a footnote. In Asciidoc, this is done by giving the date as a double dash, and following the bibliographic anchor with a footnote macro:
104
-
105
- [source,asciidoc]
106
- --
107
- * [[[ISO16634,ISO 16634:--]]] footnote:[Under preparation. (Stage at the time of publication ISO/DIS 16634)], _Cereals, pulses, milled cereal products, oilseeds and animal feeding stuffs -- Determination of the total nitrogen content by combustion according to the Dumas principle and calculation of the crude protein content_
108
- --
109
-
110
- If an ISO reference includes all parts of the standard, that is indicated by appending `(all parts)` after the reference anchor:
111
-
112
- [source,asciidoc]
113
- --
114
- * [[[ISO16634,ISO 16634 (all parts)]]] _Cereals, pulses, milled cereal products, oilseeds and animal feeding stuffs -- Determination of the total nitrogen content by combustion according to the Dumas principle and calculation of the crude protein content_
115
- --
116
- ====
117
-
118
- In informative references, references to standards documents are still given with the same format of bibliographic anchor, and they are cited by their document identifier -- although they are displayed with an incrementing reference number in brackets, for consistency with any bibliographic entries that are not standards documents. (This convention is taken from ISO.) So
119
-
120
- [source,asciidoc]
121
- --
122
- [bibliography]
123
- == Bibliography
124
-
125
- * [[[ISO3696,ISO 3696]]], _Water for analytical laboratory use -- Specification and test methods_
126
- ...
127
- * [[[ref11,11]]] Nitrogen-ammonia-protein modified Kjeldahl method -- Titanium oxide and copper sulfate catalyst. _Official Methods and Recommended Practices of the AOCS_ (ed. Firestone, D.E.), AOCS Official Method Ba Ai 4-91, 1997, AOCS Press, Champaign, IL
128
- --
129
-
130
- is displayed as:
131
-
132
- [quote]
133
- ____
134
- *Bibliography*
135
-
136
- [1] ISO 3696, _Water for analytical laboratory use -- Specification and test methods_
137
- ...
138
- [11] Nitrogen-ammonia-protein modified Kjeldahl method -- Titanium oxide and copper sulfate catalyst. _Official Methods and Recommended Practices of the AOCS_ (ed. Firestone, D.E.), AOCS Official Method Ba Ai 4-91, 1997, AOCS Press, Champaign, IL
139
- ____
140
-
141
- The bracketed reference numbers are expected to be correct and in order: they are not overriden in rendering.
142
-
143
- ==== Relaton Reference Fetching
144
-
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
-
147
- ==== Cross-References
148
-
149
- Normally in Asciidoctor, any text in a cross-reference that follows a comma constitutes custom text for the cross-reference. So a cross-reference `<<ISO7301,the foregoing reference>>` will be rendered as "the foregoing reference", and hyperlinked to the ISO7301 reference.
150
-
151
- In Metanorma Asciidoctor cross-references, bibliographic localities (e.g. page numbers, clause numbers) can be added directly after the comma, as part of the cross-reference text: this overrides the normal Asciidoctor treatment of custom text. Bibliographic localities are expressed as a sequence of lowercase locality type, then an equal sign, then the locality value or range of values. The locality can appear in quotations, if it contains special characters (like dashes or commas).
152
-
153
- [source,asciidoc]
154
- --
155
- <<ISO7301,clause=3.1-3.4>>
156
-
157
- NOTE: This table is based on <<ISO7301,table=1>>.
158
-
159
- Sampling shall be carried out in accordance with <<xxx,section="5-3-1,bis">>
160
- --
161
-
162
- Any text after the bibliographic localities is still treated as custom cross-reference text; e.g. `<<ISO7301,clause=5,table=1,the foregoing reference>>`.
163
-
164
- TIP: Custom cross-references should not be used in ISO standards, either for an external reference, or for a section of the current document: ISO/IEC DIR 2 requires any cross-references to be transparent in text. For example, a cross-reference to the anchor `[[tabular]]` on clause 5 should be given as just `<<tabular>>`, without any custom text: it will be automatically rendered as `Clause 5` by the gem.
165
-
166
- TIP: ISO clause references in particular will suppress the word "Clause" before a subclause reference, following ISO/IEC DIR 2: `<``<ISO24333,clause=5>``>` will be rendered as _ISO 24333, Clause 5_, but `<``<ISO7301,clause=3.1>``>` will be rendered as _ISO 7301, 3.1_.
167
-
168
-
169
- === Terms and Definitions
170
-
171
- // TODO: This paragraph will be removed when https://github.com/metanorma/metanorma-iso/issues/222 is implemented
172
-
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
-
175
- If the Terms and Definitions are partly or fully sourced from another standard, that document is named as a `[source=REFERENCE]` attribute to the section. (The attribute needs to be applied to the top-level clause, if there are subclauses.) If there are no terms and definitions defined in this standards document, no terms should be included in the section body (it should be blank). The boilerplate at the start of the section is adjusted to reflect both possibilities; any paragraphs or lists in the Asciidoctor input (which can replicate the expected boilerplate) is stripped in the intermediate XML format.
176
-
177
- Terms and Definitions sections follow a strict grammar, which is reflected in their Asciidoctor markup:
178
-
179
- * The term is given as a subheading at the appropriate level (three equal signs, unless there are subsections in the Terms and Definition section). The term may be crossreferenced from other terms, in which case it should have an anchor.
180
- * The term is optionally followed by alternative/admitted terms, which must be marked up in an `+alt:[...]+` macro; deprecated terms, which must be marked up in a `+deprecated:[...]+` macro; and a term domain, which must be marked up in a `+domain:[...]+` macro.
181
- * The definition of the term is given in a separate paragraph.
182
- * The definition is optionally followed by examples (paragraphs with an `[example]` style attribute).
183
- * The definition is then optionally followed by notes (denoted with a `NOTE:` prefix).
184
- * The definition is then followed by a citation for the term, marked with a `[.source]` role attribute).
185
- * The citation is a cross-reference to a normative reference, optionally followed by a comma and a modification if applicable.
186
-
187
- For example,
188
-
189
- [source,asciidoc]
190
- --
191
- [[paddy]]
192
- === paddy
193
- alt:[paddy rice]
194
- alt:[rough rice]
195
- deprecated:[cargo rice]
196
- domain:[rice]
197
-
198
- rice retaining its husk after threshing
199
-
200
- [example]
201
- Foreign seeds, husks, bran, sand, dust.
202
-
203
- NOTE: The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.
204
-
205
- [.source]
206
- <<ISO7301,section 3.2>>, The term "cargo rice" is shown as deprecated,
207
- and Note 1 to entry is not included here
208
- --
209
-
210
- The requirement that the source of a term be given in a citation also applies when the source is a term bank, such as the http://www.electropedia.org[International Electrotechnical Vocabulary (IEV)]. Formally, IEV references should be cited as `IEC 60050-nnn:20xx`, where `n` is the top-level clause, and `20xx` is the year when that particular specification was published; e.g. `IEC 60050-113:2011, 113-01-07`. For convenience, this gem requires all IEV references to be to a single reference, named `IEV` in the normative references. In rendering the Asciidoctor into Metanorma XML, this reference will be replaced by the various required IEC 60050-nnn:20xx references. (That means that you should not insert your own instances of IEC 60050 references for IEV citations: they will be duplicated by the automatically generated references.)
211
-
212
- [source,asciidoc]
213
- --
214
- [.source]
215
- <<ievtermbank,clause="103-01-02">>
216
-
217
- ...
218
-
219
- [bibliography]
220
- * [[[ievtermbank,IEV]]], _IEV: Electropedia_
221
- // will be excluded from HTML and Word output. Will be replaced by a canonical reference in XML output.
222
- --
223
-
224
- Note that, for IEV entries to be validated, the IEV reference must be given as a Clause, and in quotes (otherwise the locality syntax would be interpreted as a range); so `<<ievtermbank,clause="103-01-02">>` for IEV 103-01-02.
225
-
226
- Asciidoctor does not permit macros to be nested inside other macros; so the following markup, introducing a stem expression as an admitted term, is illegal. (The use of stem expressions as preferred terms is not a problem, because the macro appears as a header.)
227
-
228
- [source,asciidoc]
229
- --
230
- === stem:[t_90]
231
- alt:[stem:[t_A]]
232
-
233
- Time to launch.
234
- --
235
-
236
- However, the gem will treat any standalone paragraph in a term section, consisting of just a stem macro, as an admitted term:
237
-
238
- [source,asciidoc]
239
- --
240
- === stem:[t_90]
241
-
242
- stem:[t_A]
243
-
244
- Time to launch.
245
- --
246
-
247
- As defined above, all terminal subclauses of a term section are treated as term definitions. Exceptionally, an introductory section can be treated as a subclause instead of a term, by prefixing it with the style attribute `[.nonterm]`:
248
-
249
- [source,asciidoc]
250
- --
251
- == Terms and definitions
252
-
253
- [.nonterm]
254
- === Introduction
255
- The following terms have non-normative effect, and should be ignored by the ametrical.
256
-
257
- === Anapaest
258
-
259
- metrical foot consisting of a short, a long, and a short
260
- --
261
-
262
- === Symbols and Abbreviations
263
-
264
- Symbols and Abbreviations sections are expected to be simple definition lists (http://asciidoctor.org/docs/user-manual/#labeled-list["labelled lists"] in Asciidoctor nomenclature). The gem takes care of sorting the symbol entries in the order prescribed by ISO/IEC DIR 2, provided the symbols are in AsciiMath; sorting MathML entries is not currently supported.
265
-
266
- === Clauses
267
-
268
- Blank subclause headings can be given as `=== {blank}`. These are used when you want to give a subclause number for a new subclause, but without an associated header text. So e.g. in the Rice Model document,
269
-
270
- [source,asciidoc]
271
- --
272
- === Physical and chemical characteristics
273
-
274
- ==== {blank}
275
-
276
- The mass fraction of moisture, determined in accordance with...
277
- --
278
-
279
- renders as
280
-
281
- ____
282
- *4.2. Physical and chemical characteristics*
283
-
284
- *4.2.1.* The mass fraction of moisture, determined in accordance with...
285
- ____
286
-
287
- TIP: This notation should not be used to implement paragraph numbering, as required for UNECE: the UNECE gem automatically treats each paragraph as a distinct clause, and automatically numbers it.
288
-
289
- Inline subclause headings (e.g. for test methods) are indicated by preceding the heading with the `[%inline-header]` option attribute. So in the Rice Model document,
290
-
291
- [source,asciidoc]
292
- --
293
- [%inline-header]
294
- ==== Sieve,
295
-
296
- with round perforations of diameter 1,4 mm.
297
- --
298
-
299
- renders as
300
-
301
- ____
302
- *A.2.1.1. Sieve,* with round perforations of diameter 1,4 mm.
303
- ____
304
-
305
-
306
- Informative clauses are indicated with the attribute `[obligation=informative]`; clauses are normative by default.
307
-
308
- === Annexes
309
-
310
- All annexes must be preceded by the style attribute `[appendix]`, in order to be recognised correctly. Like all clauses, annexes are normative by default, an informative annex is indicated with `[appendix,obligation=informative]`.
311
-
312
- [TIP]
313
- ====
314
- In ISO, Appendixes to annexes can occur, although they are not mentioned in ISO/IEC DIR 2; ISO/IEC DIR 1 features them. They are marked up as immediate subsections of annexes, and must be tagged with an option attribute of "appendix":
315
-
316
- [source,asciidoc]
317
- --
318
- [appendix]
319
- == Annex A
320
- Text
321
-
322
- [%appendix]
323
- === Appendix 1
324
- Text
325
- --
326
- ====
327
-
328
- The numbering of annexes and appendices is automatic: do not insert "Annex A" or "Appendix 1" as part of the title. Annex and Appendix titles can be left blank, as with Clauses.
329
-
330
- == Text markup
331
-
332
- === Mathematical formatting
333
-
334
- Mathematical formatting is done using the `[stem]` macro. Asciidoctor supports http://asciimath.org[AsciiMath] and LaTeX natively (AsciiMath by default); as of this writing Metanorma only supports AsciiMath. AsciiMath is converted to Microsoft Word's OOXML via MathML, using the https://github.com/asciidoctor/asciimath[AsciiMath] Ruby gem; the syntax of the Ruby gem may be at odds with the usual MathJax processor of AsciiMath. (We have found that the Ruby gem insists on numerators being bracketed.)
335
-
336
- === Formulae
337
-
338
- Formulae are marked up as `[stem]` blocks. Any explanation of symbols in the formula is given as a "where" paragraph, followed by a definition list. For example:
339
-
340
- [source,asciidoc]
341
- --
342
- [[formulaA-1]]
343
- [stem]
344
- ++++
345
- w = (m_D) / (m_s)
346
- ++++
347
-
348
- where
349
-
350
- stem:[w]:: is the mass fraction of grains with a particular defect in the test sample;
351
- stem:[m_D]:: is the mass, in grams, of grains with that defect;
352
- stem:[m_S]:: is the mass, in grams, of the test sample.
353
- --
354
-
355
- === Figures
356
-
357
- Like formulae, figures can be followed by a definition list for the variables used in the figure; the definition list is preceded by `+*Key*+`. For example:
358
-
359
- [source,asciidoc]
360
- --
361
- [[figureC-1]]
362
- .Typical gelatinization curve
363
- image::rice_images/rice_image2.png[]
364
- footnote:[The time stem:[t_90] was estimated to be 18,2 min for this example.]
365
-
366
- *Key*
367
-
368
- stem:[w]:: mass fraction of gelatinized kernels, expressed in per cent
369
- stem:[t]:: cooking time, expressed in minutes
370
- stem:[t_90]:: time required to gelatinize 90 % of the kernels
371
- P:: point of the curve corresponding to a cooking time of stem:[t_90]
372
-
373
- NOTE: These results are based on a study carried out on three different types of kernel.
374
- --
375
-
376
- Subfigures (which appear in ISO) are entered by including images in an Asciidoc example:
377
-
378
- [source,asciidoc]
379
- --
380
- [[figureC-2]]
381
- .Stages of gelatinization
382
- ====
383
- .Initial stages: No grains are fully gelatinized (ungelatinized starch granules are visible inside the kernels)
384
- image::rice_images/rice_image3_1.png[]
385
-
386
- .Intermediate stages: Some fully gelatinized kernels are visible
387
- image::rice_images/rice_image3_2.png[]
388
-
389
- .Final stages: All kernels are fully gelatinized
390
- image::rice_images/rice_image3_3.png[]
391
-
392
- ====
393
- --
394
-
395
- === Tables
396
-
397
- While Asciidoctor tables are quite powerful for a non-XML markup language, they still have not dealt with the full range of complexity required in Metanorma. Metanorma adds the option of multiple header rows (attribute `headerrows=n`), to deal with the complexity of ISO tables requiring labels, variables, and units to lining up in the header.
398
-
399
- Asciidoc allows table cells to have footnotes (which the gem renders inside the table), and notes following the table (which the gem moves inside the table footer.) Table 1 in the Rice document illustrates a large range of table formatting options.
400
-
401
- === Lists
402
-
403
- Ordered lists in both HTML and Word have their labels pre-configured, to align with ISO/IEC DIR 2: _a), b), c)_ for the first level, then _1), 2), 3)_ for the second level, then _i), ii), iii)_, then _A), B), C)_, then _I), II), III)_. The `type` attribute for ordered lists in Asciidoctor, which allows the user to specify the label of an ordered list, is ignored.
404
-
405
- TIP: The stylesheets for ISO render unordered lists with em-dashes instead of bullets, as preferred by ISO. Ordered lists in Word are rendered with their labels bracketed. (_a)_, _1)_, etc.)
406
-
407
- TIP: Asciidoctor and HTML support multiple paragraphs within a single list item (through https://asciidoctor.org/docs/user-manual/#list-continuation[list continuation]); in HTML output, all the paragraphs within a list item will be aligned. The software attempts to do so with Word output as well, by using custom list continuation styles (`ListContLevel1` etc.); but you should check the output, and may need to manually intervene.
408
-
409
- In Word, each list entry must be a single paragraph; if the Asciidoctor contains more than one paragraph for a list item, the subsequent paragraphs will not be preceded by a bullet in Word, but they will also not be indented under the first paragraph of the list item.
410
-
411
- === Footnotes
412
-
413
- Asciidoctor supports only single-paragraph footnotes through its footnote macro (which can only contain a single line of text); this reflects a stylistic bias against digressive text by the Asciidoc creator, and will not change. It can be worked around by introducing line breaks into the macro (see https://github.com/asciidoctor/asciidoctor.org/issues/599, http://discuss.asciidoctor.org/footnotes-with-paragraph-breaks-td4130.html).
414
-
415
- === Notes
416
-
417
- Notes that are not at the end of a clause are folded into the preceding block, if that block is not delimited (so that the user could not choose to include or exclude a note): that is, notes are folded into a preceding paragraph, list, formula, or figure.
418
-
419
- === Reviewer Notes
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/metanorma/metanorma-standoc#reviewer-notes[discussion in the metanorma-standoc README].
422
-
423
- == Cross-references
424
-
425
- The guidance given in ISO/IEC DIR 2 for internal cross-references guarantees unambiguous referencing, and it is followed rigorously by Metanorma. In particular, if a formula, example, figure, list, list item or table is cross-referenced outside its (sub)clause, the clause containing the item is always given in the cross-reference, unless the item is being referenced in the same clause. In the case of notes, the containing clause is extended to containing example, figure or table.
426
-
427
- So for example, in the Rice model document, formula B.1 is defined in Annex B.6, and is referenced in B.6 and B.7. In the Rice model document published by ISO, both instances are cited as "Formula (B.1)"; but the gem follows ISO/IEC DIR 2 in citing the former as "Formula (B.1)", but the latter as "B.6, Formula (B.1)". (Metanorma in general is "more royalist than the king" in applying formatting rules and validation—which is what you would want of a computer-based tool.)
428
-
429
- The label of the item cross-referenced, the use of brackets, and the containing reference are all taken care of by the gem; the document author needs only give the item identifier in the Asciidocto source (e.g. `<<``formulaB-1``>>` generates either "Formula (B.1)" or "B.6, Formula (B.1)", depending on where in the document it occurs.)
430
-
431
- List items can be cross-referenced by inserting a bookmark at the very start of the list item:
432
-
433
- [source,asciidoc]
434
- --
435
- . Ordered list
436
- .. [[id]] This is the first list item
437
- ... [[id]] This is a list sub-item
438
- --
439
-
440
- == Asciidoctor Tips
441
-
442
- As noted, the http://asciidoctor.org/docs/user-manual/[Asciidoctor User Manual] should be your companion when authoring any Asciidoc documents, including Asciidoc documents under Metanorma. There are some more specialised aspects of Asciidoctor markup, which you might need to dig deeper to find in the manual; we list some of them here.
443
-
444
- * A note or admonition can be made to span multiple paragraphs (including lists and tables), by making it a https://asciidoctor.org/docs/user-manual/#delimited-blocks[delimited block]:
445
-
446
- [source,asciidoc]
447
- --
448
- [NOTE]
449
- ====
450
- This is a multi-paragraph note.
451
-
452
- It includes:
453
-
454
- * A list
455
-
456
- |===
457
- | And
458
-
459
- | a table
460
- |===
461
- ====
462
- --
463
-
464
- * https://asciidoctor.org/docs/user-manual/#using-attributes-set-assign-and-reference[Attribute references] can be used as template variables in a document: if your document contains the text `{foo}`, you can assign the value to be populated in `{foo}` by setting it as a document attribute in the Asciidoctor header: `:foo: this is the text to replace "foo"`. In the Rice Model document example, document attributes are used to provide the Subcommittee and Technical Committee names, which are populated as template entries in the document foreword.
465
-
466
- * List items can contain other blocks in Asciidoctor, through concatenating blocks; e.g.
467
- +
468
- [source.asciidoc]
469
- --
470
- * List
471
- +
472
- |===
473
- | Contains | A table
474
-
475
- |===
476
- --
477
- +
478
- However, downstream renderers may not be able to cope with embedding blocks within list items. In particular, Word will force a carriage return between a list item, and a list or table contained in the item. So output like the following, with the list number flush with the embedded block, is not possible in Word (though it is in HTML):
479
-
480
- ....
481
- a) 1. Text
482
- b) |-------|------ |
483
- | table | table |
484
- |---------------|
485
- c) Definition Term Definition
486
- Definition Term Definition
487
- ....
data/docs/navigation.adoc DELETED
@@ -1,23 +0,0 @@
1
- ---
2
- items:
3
- - title: Introduction
4
- items:
5
- - { title: Quickstart, path: quickstart/ }
6
- - title: Using Metanorma-ISO
7
- items:
8
- - { title: Authoring guidance, path: guidance/ }
9
- - { title: Output formats, path: outputs/ }
10
- - { title: HTML output, path: htmloutput/ }
11
- - { title: Customisation, path: customisation/ }
12
- - { title: AsciiISO syntax, path: asciiiso-syntax/ }
13
- - title: "Adopting Metanorma: FAQ"
14
- items:
15
- - { title: How to adopt StanDoc in your own specs, path: adopting-spec/ }
16
- - { title: How to use StanDoc toolchain for your specs, path: adopting-toolchain/ }
17
- - { title: How to style HTML output, path: styling-output-html/ }
18
- - { title: How to style MS Word output, path: styling-output-msword/ }
19
- - { title: How to localize the output, path: localizing-output/ }
20
- - { title: How to bypass AsciiDoc, path: replacing-asciidoc/ }
21
- ---
22
-
23
- = Navigation