metanorma-standoc 1.1.4 → 1.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c28586f6cbbdce97320f86d86391330303b318424fd94cdedd0a17d239633bd5
4
- data.tar.gz: afcc7583ee3eaf02efa769fb9ff9820a752f48d65b99643d36f83c2c55989233
3
+ metadata.gz: fa63066d27fa7a5628e8f79ea3bfeae64b380c18b3d9612a1cba84c6effb0a89
4
+ data.tar.gz: 60881ce80c1914265eaab8b478a22512c058415ee7f491c14df3aae6bb5b047c
5
5
  SHA512:
6
- metadata.gz: f35a328f0c079cdc665db0ea7c2b8dff76d83ad95db2964cde1a5e6c7d28527ab053a2f0396318edee9f56ef4c4af38c0435b858adb722b594024c6ea5826798
7
- data.tar.gz: 51ae02a66b26288cfd206edac4d123cf1e2052a2e5fef3a966b506804b48ed21a8499eac4fe02be68753c7b160d15f4a6340b53de91738c578ea9a208bf3440b
6
+ metadata.gz: '0888338634c163d1736d76b1c3710554fcef64f653755110b632c4d6c074850f787cf788c106540f827774385a8848dff110bcde888f47440980259585f83fcc'
7
+ data.tar.gz: bb9c4a5fb8534f4ecee4331c2657330cb4ac0670cb1b592b3c731b7eb5fcee44ed02d5339e82ae16a937ae03e2573f4242ab51a18b0918363e9cea3fe2057b58
data/.travis.yml CHANGED
@@ -7,15 +7,8 @@ rvm:
7
7
  - 2.3
8
8
  - ruby-head
9
9
  before_install:
10
- - gem install bundler -v 1.16.1
11
- - unset _JAVA_OPTIONS
12
- - wget "http://downloads.sourceforge.net/project/plantuml/plantuml.jar?r=&ts=1424308684&use_mirror=jaist" -O plantuml.jar
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
10
+ - gem install bundler -v 2.0.1
11
+ - curl -sSL https://raw.githubusercontent.com/metanorma/metanorma-linux-setup/master/ubuntu.sh | sudo bash -s
19
12
  matrix:
20
13
  allow_failures:
21
14
  - rvm: ruby-head
data/Gemfile.lock CHANGED
@@ -1,11 +1,11 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- metanorma-standoc (1.1.4)
4
+ metanorma-standoc (1.1.5)
5
5
  asciidoctor (~> 1.5.7)
6
6
  concurrent-ruby
7
7
  html2doc (~> 0.8.0)
8
- iev (~> 0.2.0)
8
+ iev (~> 0.2.1)
9
9
  isodoc (~> 0.9.0)
10
10
  relaton (~> 0.3.1)
11
11
  ruby-jing
@@ -23,10 +23,10 @@ GEM
23
23
  asciidoctor (1.5.8)
24
24
  asciimath (1.0.8)
25
25
  ast (2.4.0)
26
- byebug (11.0.0)
26
+ byebug (11.0.1)
27
27
  cnccs (0.1.3)
28
28
  coderay (1.1.2)
29
- concurrent-ruby (1.1.4)
29
+ concurrent-ruby (1.1.5)
30
30
  crack (0.4.3)
31
31
  safe_yaml (~> 1.0.0)
32
32
  diff-lcs (1.3)
@@ -71,7 +71,7 @@ GEM
71
71
  iso-bib-item (~> 0.4.2)
72
72
  ietfbib (0.4.5)
73
73
  iso-bib-item (~> 0.4.2)
74
- iev (0.2.0)
74
+ iev (0.2.1)
75
75
  nokogiri
76
76
  image_size (2.0.0)
77
77
  iso-bib-item (0.4.4)
@@ -82,7 +82,7 @@ GEM
82
82
  algoliasearch
83
83
  iecbib (~> 0.2.1)
84
84
  iso-bib-item (~> 0.4.2)
85
- isodoc (0.9.18)
85
+ isodoc (0.9.19)
86
86
  asciimath
87
87
  html2doc (~> 0.8.6)
88
88
  htmlentities (~> 4.3.4)
@@ -97,7 +97,7 @@ GEM
97
97
  uuidtools
98
98
  isoics (0.1.7)
99
99
  json (2.2.0)
100
- liquid (4.0.1)
100
+ liquid (4.0.3)
101
101
  listen (3.1.5)
102
102
  rb-fsevent (~> 0.9, >= 0.9.4)
103
103
  rb-inotify (~> 0.9, >= 0.9.7)
@@ -119,7 +119,7 @@ GEM
119
119
  shellany (~> 0.0)
120
120
  optout (0.0.2)
121
121
  parallel (1.14.0)
122
- parser (2.6.0.0)
122
+ parser (2.6.2.0)
123
123
  ast (~> 2.4.0)
124
124
  powerpack (0.1.2)
125
125
  pry (0.12.2)
@@ -131,7 +131,7 @@ GEM
131
131
  rb-fsevent (0.10.3)
132
132
  rb-inotify (0.10.0)
133
133
  ffi (~> 1.0)
134
- relaton (0.3.1)
134
+ relaton (0.3.2)
135
135
  algoliasearch
136
136
  gbbib (~> 0.4.0)
137
137
  iecbib (~> 0.2.0)
@@ -186,7 +186,7 @@ GEM
186
186
  thread_safe (0.3.6)
187
187
  timecop (0.9.1)
188
188
  unicode-display_width (1.5.0)
189
- unicode2latex (0.0.1)
189
+ unicode2latex (0.0.2)
190
190
  uuidtools (2.1.5)
191
191
  vcr (4.0.0)
192
192
  webmock (3.5.1)
data/README.adoc CHANGED
@@ -1,18 +1,18 @@
1
1
  = Metanorma-standoc
2
2
 
3
3
  image:https://img.shields.io/gem/v/metanorma-standoc.svg["Gem Version", link="https://rubygems.org/gems/metanorma-standoc"]
4
- image:https://img.shields.io/travis/riboseinc/metanorma-standoc/master.svg["Build Status", link="https://travis-ci.org/riboseinc/metanorma-standoc"]
5
- image:https://codeclimate.com/github/riboseinc/metanorma-standoc/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/riboseinc/metanorma-standoc"]
4
+ image:https://img.shields.io/travis/metanorma/metanorma-standoc/master.svg["Build Status", link="https://travis-ci.org/metanorma/metanorma-standoc"]
5
+ image:https://codeclimate.com/github/metanorma/metanorma-standoc/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/metanorma/metanorma-standoc"]
6
6
 
7
7
  WARNING: This gem is still under development.
8
8
 
9
- Gem for serialising the https://github.com/riboseinc/metanorma-model-standoc[Metanorma Standoc] model.
9
+ Gem for serialising the https://github.com/metanorma/metanorma-model-standoc[Metanorma Standoc] model.
10
10
 
11
11
  == Functionality
12
12
 
13
13
  This gem processes Metanorma documents following a template for generating standards documents, according
14
14
  to a range of standards classes. This gem provides underlying generic functionality; behaviour specific
15
- to each standards class is refined in the gem specific to that standards class (e.g. https://github.com/riboseinc/metanorma-iso).
15
+ to each standards class is refined in the gem specific to that standards class (e.g. https://github.com/metanorma/metanorma-iso).
16
16
  The following outputs are generated.
17
17
 
18
18
  * Metanorma XML representation of the document, intended as a document model for
@@ -27,8 +27,8 @@ The following input formats are supported:
27
27
  * http://asciidoctor.org/[Asciidoctor]
28
28
 
29
29
  This README provides an overview of the functionality of the gem; see also
30
- https://github.com/riboseinc/metanorma-iso/blob/master/docs/guidance.adoc[Guidance for authoring].
31
- https://github.com/riboseinc/metanorma-iso/blob/master/docs/quickstart.adoc[Quickstart guide]
30
+ https://github.com/metanorma/metanorma-iso/blob/master/docs/guidance.adoc[Guidance for authoring].
31
+ https://github.com/metanorma/metanorma-iso/blob/master/docs/quickstart.adoc[Quickstart guide]
32
32
  gives a summary overview.
33
33
 
34
34
  NOTE: http://asciimath.org[AsciiMathML] is used for mathematical formatting.
@@ -39,13 +39,13 @@ expressions.
39
39
 
40
40
  === Installation
41
41
 
42
- If you are using a Mac, the https://github.com/riboseinc/metanorma-macos-setup
42
+ If you are using a Mac, the https://github.com/metanorma/metanorma-macos-setup
43
43
  repository has instructions on setting up your machine to run Metanorma
44
44
  scripts such as this one. You need only run the following in a Terminal console:
45
45
 
46
46
  [source,console]
47
47
  ----
48
- $ bash <(curl -s https://raw.githubusercontent.com/riboseinc/metanorma-macos-setup/master/metanorma-setup)
48
+ $ bash <(curl -s https://raw.githubusercontent.com/metanorma/metanorma-macos-setup/master/metanorma-setup)
49
49
  $ gem install metanorma-standoc
50
50
  $ gem install metanorma-cli
51
51
  ----
@@ -53,812 +53,8 @@ $ gem install metanorma-cli
53
53
  The metanorma-cli gem is the command-line interface for the Metanorma tool suite
54
54
  (incorporating the `metanorma` executable seen above).
55
55
 
56
- == Approach
57
- === Document model
56
+ == Documentation
58
57
 
59
- The https://github.com/riboseinc/metanorma-model-iso[Metanorma document model] used in document generation
60
- intends to introduce rigour into the standards authoring process; existing
61
- document templates do not support such rigour down to the element level. It also introduces
62
- flexibility by decoupling the document structure from its presentation.
63
-
64
- Formal definitions of standards prescribe the contents of standards to a level
65
- amenable to an explicit document model. The ISO International Standard format,
66
- ss prescribed in
67
- 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"],
68
- is one of the more detailed such prescriptions available. A formal document
69
- model would allow checking for consistency in format and content, and expedite
70
- authoring and quality control of ISO standards. Authoring standards through a
71
- more abstract formal model also permit enhanced functionality such as
72
- cross-reference link checking and auto-numbering of sections, figures, tables and formulas.
73
- Outputting a document in different languages also becomes straightforward.
74
-
75
- === Asciidoctor
76
-
77
- Asciidoctor has been selected as the authoring tool to generate the document
78
- model representation of standards. It is a document formatting tool like
79
- Markdown and DocBook, which combines the relative ease of use of the former
80
- (using relatively lightweight markup), and the rigour and expressively of the
81
- latter (it has a well-defined syntax, and was in fact initially developed as a
82
- DocBook document authoring tool). Asciidoctor has built-in capability to output
83
- Text and HTML; so it can be used to preview the file as it is being
84
- authored. However the gem natively outputs HTML and Word output, so there should
85
- not be much need for this.
86
-
87
- Asciidoctor has some formatting constraints because of its own document model,
88
- that users need to be aware. For example, Asciidoc has a strict division between
89
- inline and block elements, which disallows certain kinds of nesting; so a list
90
- cannot be embedded within a paragraph, it can only constitute its own paragraph
91
- (though lists themselves can be nested within each other). Asciidoctor also disallows
92
- multiple paragraphs in footnotes,
93
- http://discuss.asciidoctor.org/footnotes-with-paragraph-breaks-td4130.html[by design].
94
- (The document model does not impose this constraint, so you could edit the generated
95
- XML to break up paragraphs within a footnote.)
96
-
97
- == Different behaviour from native Asciidoctor
98
-
99
- === Autonumbering
100
-
101
- Autonumbering in Metanorma extends to formulas (which are encoded as "stem" blocks) and notes.
102
- Autonumbering is applied in the conversion from Metanorma XML to output formats (`isodoc`);
103
- by default it restarts for each annex, but is continuous for the main body of text.
104
-
105
- === Unsupported blocks
106
-
107
- Sidebars (`aside`) are not supported, and have been repurposed for reviewer comments.
108
- Page breaks (`thematic break`) are not supported; ASCII art/preformatted text (`literal`)
109
- are not supported in most standards classes.
110
-
111
- === Footnotes
112
-
113
- Table and figure footnotes are treated diffferently from all other footnotes: they are
114
- rendered at the bottom of the table or figure, and they are numbered separately.
115
-
116
- === References
117
-
118
- References to well-defined standards codes use the document identifiers for citations
119
- (e.g. `ISO 20483:2013`); generic references in bibliographies use bracketed numbers `[1]`.
120
-
121
- [[model_additions]]
122
- == Asciidoctor model additions
123
-
124
- === Section titles
125
- Metanorma standards has special section types: "Scope", "Normative References", "Terms and Definitions", "Symbols and Abbreviated Terms", "Bibliography". By default, these are identified in Asciidoc by using those titles. The gem allows you to override the title by using a `heading` attribute on the node, so that the actual title in your Asciidoc can be something different; that is useful, for example, if you are translating the document into different languages. So:
126
-
127
- [source,asciidoctor]
128
- --
129
- [heading=scope]
130
- == 范围
131
- --
132
-
133
- Note that both the XML population, and the isodoc gem will overwrite any supplied title. If you are translating Metanorma documents into other languages, you will still need access to versions of the metanorma-standoc and isodoc gems in those languages.
134
-
135
- === Obligation
136
- The obligation of sections (whether they are normative or informative) is indicated
137
- with the attribute "obligation". For most sections, this is fixed; for annexes and clauses, the
138
- default value of the obligation is "normative", and users need to set the obligation
139
- to "informative" as a section attribute.
140
-
141
- [source,asciidoctor]
142
- --
143
- [[AnnexA]]
144
- [appendix,obligation=informative]
145
- == Determination of defects
146
- --
147
-
148
- === Term markup
149
-
150
- To ensure the structure of Terms and Definitions is captured accurately, the following
151
- macros are defined, and must be used to mark up their respective content:
152
-
153
- `alt:[TERM]`:: for alternative terms
154
- `deprecated:[TERM]`:: for deprecated terms
155
- `domain:[TERM]`:: for term domains
156
-
157
- The macro contents can contain their own markup.
158
-
159
- [source,asciidoctor]
160
- --
161
- === paddy
162
- alt:[_paddy_ rice]
163
- deprecated:[#[smallcap]#cargo# rice]
164
- domain:[rice]
165
-
166
- _paddy_ (<<paddy>>) from which the husk only has been removed
167
- --
168
-
169
- === Terms and Definitions markup
170
-
171
- If the Terms and Definitions of a standard are partly or fully sourced from
172
- another standard, that standard is cited in a `source` attribute to the section,
173
- which is set to the reference anchor of the standard (given under the Normative
174
- Referencecs).
175
- Any boilerplate of the Terms and Definitions section is adjusted accordingly.
176
-
177
- [source,asciidoctor]
178
- --
179
- [source=ISO712]
180
- == Terms and Definitions
181
- --
182
-
183
- Multiple sources are allowed, and need to be quoted and comma-delimited:
184
-
185
- [source,asciidoctor]
186
- --
187
- [source="ISO712,ISO24333"]
188
- == Terms and Definitions
189
- --
190
-
191
-
192
- === Paragraph alignment
193
-
194
- Alignment is defined as an attribute for paragraphs:
195
-
196
- [source,asciidoctor]
197
- --
198
- [align=left]
199
- This paragraph is aligned left
200
-
201
- [align=right]
202
- This paragraph is aligned right
203
-
204
- [align=center]
205
- This paragraph is aligned center
206
-
207
- [align=justified]
208
- This paragraph is justified, which is the default
209
- --
210
-
211
- === Reviewer notes
212
-
213
- Reviewer notes are encoded as sidebars, and can be separated at a distance from the
214
- text they are annotating; the text they are annotating is indicated through anchors.
215
- Reviewer notes are only rendered if the document has a `:draft:` attribute.
216
-
217
- The following attributes on reviewer notes are mandatory:
218
-
219
- * `reviewer` attribute (naming the reviewer)
220
- * the starting target anchor of the note (`from` attribute)
221
-
222
- The following attributes are optional:
223
-
224
- * `date` attribute, optionally including the time (as xs:date or xs:datetime)
225
- * the ending target anchor of the note (`to` attribute)
226
-
227
- The span of text covered by the reviewer note is from the start of the
228
- text encompassed by the `from` element, to the end of the text encompassed
229
- by the `to` element. If only the `from` element supplied, the reviewer note
230
- covers the `from` element. The `from` and `to` elements can be bookmarks,
231
- which cover no space.
232
-
233
- [source,asciidoctor]
234
- --
235
- [[clause_address_profile_definition]]
236
- === Address Profile Definition (AddressProfileDescription)
237
-
238
- [[para1]]
239
- This is a clause address [[A]]profile[[B]] definition
240
-
241
- [reviewer="Nick Nicholas",date=20180125T0121,from=clause_address_profile_definition,to=para1]
242
- ****
243
- I do not agree with this statement.
244
- ****
245
-
246
- [reviewer="Nick Nicholas",date=20180125T0121,from=A,to=B]
247
- ****
248
- Profile?!
249
- ****
250
- --
251
-
252
- === Strikethrough and Small Caps
253
-
254
- The following formatting macros are used for strikethrough and small caps text:
255
-
256
- [source,asciidoctor]
257
- --
258
- [strike]#strike through text#
259
- [smallcap]#small caps text#
260
- --
261
-
262
- === Count of table header and footer rows
263
-
264
- In Asciidoc, a table can have at most one header row or footer row. In Metanorma,
265
- a nominal single header row is routinely broken up into multiple rows in order
266
- to accommodate units or symbols, that line up against each other, though
267
- they are displayed as merged cells with no grid between them. To address this,
268
- tables can be marked up with an optional `headerrows` attribute:
269
-
270
- [source,asciidoctor]
271
- --
272
- [headerrows=2]
273
- |===
274
- .2+|Defect 4+^| Maximum permissible mass fraction of defects in husked rice +
275
- stem:[w_max]
276
- | in husked rice | in milled rice (non-glutinous) | in husked parboiled rice | in milled parboiled rice
277
-
278
- | Extraneous matter: organic footnote:[Organic extraneous matter includes foreign seeds, husks, bran, parts of straw, etc.] | 1,0 | 0,5 | 1,0 | 0,5
279
- |===
280
- --
281
-
282
- === Inline clause numbers
283
-
284
- For some clauses (notably test methods), the clause heading appears inline with the clause, instead of being separated on a different line. This is indicated in Asciidoc by the option
285
- attribute `inline-header`:
286
-
287
- [source,asciidoctor]
288
- --
289
- [%inline-header]
290
- [[AnnexA-2-1]]
291
- ==== Sample divider,
292
-
293
- consisting of a conical sample divider
294
- --
295
-
296
- === Bibliographic details
297
-
298
- Citations can include details of where in the document the citation is located; these
299
- are entered by suffixing the type of locality, then an equals sign, then the reference.
300
- The word "whole" on its own is also treated as a locality. Multiple
301
- instances of locality and reference can be provided, delimited by comma or colon. Any trailing
302
- text after the sequence of locality=reference (or locality, space, reference) are treated
303
- as substitute text, as would occur normally in an Asciidoctor crossreference. For
304
- example:
305
-
306
- [source,asciidoctor]
307
- --
308
- <<ISO712,the foregoing reference>> # renders as: the foregoing reference
309
- <<ISO712,section=5, page 8-10>> # renders as: ISO 712, Section 5, Page 8-10
310
- <<ISO712,section=5, page=8-10: 5:8-10>> # renders as ISO 712, 5:8-10 ("5:8-10" treated as replacement text for all the foregoing)
311
- <<ISO712,whole>> # renders as: ISO 712, Whole of text
312
- --
313
-
314
- The references cannot contain spaces. Any text following the sequence of localities
315
- will be displayed instead of the localities.
316
-
317
- A custom locality can be entered by prefixing it with `locality:`:
318
-
319
- [source,asciidoctor]
320
- --
321
- <<ISO712,locality:frontispiece=5, page=8-10>> # renders as: ISO 712, Frontispiece 5, Page 8-10
322
- --
323
-
324
- Custom localities may not contain commas, colons, or space. Localities with the `locality:`
325
- prefix are recognised in internationalisation configuration files.
326
-
327
- === Block Quotes
328
-
329
- As in normal Asciidoctor, block quotes are preceded with an author and a citation;
330
- but the citation is expected to be in the same format as all other citations,
331
- a cross-reference optionally followed by text, which may include the bibliographic
332
- sections referenced:
333
-
334
- [source,asciidoctor]
335
- --
336
- [quote, ISO, "ISO7301,section 1"]
337
- _____
338
- This International Standard gives the minimum specifications for rice (_Oryza sativa_ L.)
339
- which is subject to international trade. It is applicable to the following types: husked rice
340
- and milled rice, parboiled or not, intended for direct human consumption. It is neither
341
- applicable to other products derived from rice, nor to waxy rice (glutinous rice).
342
- _____
343
- --
344
-
345
- === Image size
346
-
347
- The value `auto` is accepted for image width and height attributes. It is only passed on
348
- to HTML output; if the output is to Word, both the width and height attributes are stripped
349
- from the image.
350
-
351
- [source,asciidoctor]
352
- --
353
- [height=90,width=auto]
354
- image::logo.jpg
355
- --
356
-
357
- === Subclauses in Terms & Definitions sections
358
-
359
- Normally any terminal subclause in a Terms & Definitions section is treated as a term
360
- definition. Exceptionally, an introductory section can be tagged to be treated as a clause,
361
- instead of a term, by prefixing it with the style attribute `[.nonterm]`.
362
-
363
- [source,asciidoctor]
364
- --
365
- == Terms and definitions
366
-
367
- [.nonterm]
368
- === Introduction
369
- The following terms have non-normative effect, and should be ignored by the ametrical.
370
-
371
- === Anapaest
372
-
373
- metrical foot consisting of a short, a long, and a short
374
- --
375
-
376
- Any clause within a Terms & Definitions section which is a nonterminal subclause (has
377
- child nodes) is automatically itself a terms (or definitions) section. On the other hand,
378
- any descendant of a nonterm clause is also a nonterm clause.
379
-
380
- === Cross-references to external documents
381
-
382
- Metanorma Asciidoctor, like normal Asciidoctor, will process cross-references to
383
- anchors within external documents. So `<<document1.adoc#b>>` will be processed as a link
384
- to anchor `#b` in document `document1.adoc`. The `.adoc` suffix is presupposed for
385
- Asciidoctor documents (as in normal Asciidoctor): it is stripped in Metanorma XML,
386
- and substituted with the extension of the current document type when rendered. So
387
- `<<document1.adoc#b>>` is rendered in Metanorma XML as `<xref target="document1#b">`,
388
- in HTML as `<a href="document1.html#b">`, and in PDF as `<a href="document1.pdf#b">`.
389
-
390
- === Sections embedded more than 5 levels
391
-
392
- Asciidoctor permits only 5 levels of section embedding (not counting the document title).
393
- Standards do contain more levels of embedding; ISO/IEC DIR 2 only considers it a problem
394
- if there are more than 7 levels of embedding. To realise higher levels of embedding,
395
- prefix a 5-level section title with the attribute `level=`:
396
-
397
- [source,asciidoctor]
398
- --
399
- ====== Clause 5
400
-
401
- [level=6]
402
- ===== Clause 6
403
-
404
- [level=7]
405
- ====== Clause 7A
406
-
407
- [level=7]
408
- ====== Clause 7B
409
-
410
- [level=6]
411
- ====== Clause 6B
412
-
413
- ====== Clause 5B
414
- --
415
-
416
- This generates the following ISO XML:
417
-
418
- [source,xml]
419
- --
420
- <clause id="_" inline-header="false" obligation="normative">
421
- <title>
422
- Clause 5
423
- </title>
424
- <clause id="_" inline-header="false" obligation="normative">
425
- <title>
426
- Clause 6
427
- </title>
428
- <clause id="_" inline-header="false" obligation="normative">
429
- <title>
430
- Clause 7A
431
- </title>
432
- </clause>
433
- <clause id="_" inline-header="false" obligation="normative">
434
- <title>
435
- Clause 7B
436
- </title>
437
- </clause>
438
- </clause>
439
- <clause id="_" inline-header="false" obligation="normative">
440
- <title>
441
- Clause 6B
442
- </title>
443
- </clause>
444
- </clause>
445
- <clause id="_" inline-header="false" obligation="normative">
446
- <title>
447
- Clause 5B
448
- </title>
449
- </clause>
450
- --
451
-
452
- === Requirements, Recommendations, and Permissions
453
-
454
- Requirements, Recommendations, and Permissions are encoded as Asciidoctor examples,
455
- with the style attribute value indicating that it is a Requirement, Recommendation, or Permission:
456
-
457
- [source,asciidoctor]
458
- --
459
- [permission]
460
- ====
461
- I recommend this
462
- ====
463
- --
464
-
465
- (In the following, "requirement" shall be used as the cover-all term.)
466
-
467
- The named attributes `subject` and `label` may be used to indicate the subject of the
468
- requirement, and the conventional label assigned to the requirement. The named attribute
469
- `classification` may be used to give an arbitrary number of key-value pairs of tags describing
470
- the requirement; key-value pairs are delimited by semicolon, key and value are delimited by
471
- colon, multiple values are delimited by comma,
472
- and key and value are both intended to be tokens (containing no punctuation). The `obligation`
473
- attribute can contain one or more of "requirement", "permission", "recommendation", comma-delimited:
474
- it can be used to override the obligation in the tag name. The `inherit`
475
- attribute may be used to reference the label of a requirement that is imported or
476
- presupposed by this requirement:
477
-
478
- [source,asciidoctor]
479
- --
480
- [recommendation,label="/ogc/recommendation/wfs/2",subject="user",inherit="/ss/584/2015/level/1",classification="control-class:Technical;priority:P0;family:System and Communications Protection,System and Communications Protocols",obligation="permission,recommendation"]
481
- ====
482
- I recommend this
483
- ====
484
- --
485
-
486
- Requirements can be nested, as is the case with any delimited block in Asciidoctor,
487
- by adding one more delimiter symbol than its containing block:
488
-
489
- [source,asciidoctor]
490
- --
491
- [permission]
492
- ====
493
- I permit this
494
- =====
495
- Example 2
496
- =====
497
- [permission]
498
- =====
499
- I also permit this
500
- =====
501
- ====
502
- --
503
-
504
- The internal structure of a requirement can also be marked up to make it machine-readable,
505
- although this is not expected to be reflected in rendering.
506
-
507
- Any text not wrapped in a named open block is considered to be part of a description.
508
- Any text in a named open block allowed under Metanorma is considered to be a separate
509
- subpart of the requirement: that includes the measurement target (for quantitative requirements),
510
- the verification steps, imports (code stubs), and specifications (which may be considered
511
- the object of the requirement). These blocks can have types, referring to the conventions
512
- or computer frameworks that they follow.
513
-
514
- Text in a named open block may be include or consist of machine readable code; any such
515
- code needs to be wrapped in turn in a source code element, which is expected to
516
- contain an attribute giving the computer language the block is expressed in.
517
- (The notion of "language" may be expanded to include a particular computer framework
518
- that the code is to be run under.)
519
- `[sourcecode,text]` is taken as meaning that the block is still human readable.
520
- The language of a source code block is likely to be distinct from the type of named block
521
- it is contained in.
522
-
523
- By default, both named blocks and descriptions will be included in the document output.
524
- Often, though not always, the named blocks contain machine-readable code which is not
525
- intended to be included in the document output, but is supplemental to the human-readable
526
- description. That is signalled through the options attribute `exclude` on the named block.
527
-
528
- The label attribute is always rendered if present. The subject attribute is never rendered.
529
-
530
- [source,asciidoctor]
531
- --
532
- [recommendation,label="/ogc/recommendation/wfs/2",subject="user"]
533
- ====
534
- I recommend _this_.
535
- [specification,type="tabular"]
536
- ---
537
- This is the object of the recommendation:
538
- |===
539
- |Object |Value
540
- |Mission | Accomplished
541
- |===
542
- ---
543
- As for the measurement targets,
544
- [measurement-target]
545
- ---
546
- The measurement target shall be measured as:
547
- [stem]
548
- ++++
549
- r/1 = 0
550
- ++++
551
- ---
552
- [verification,type="comprehensive"]
553
- ---
554
- The following code will be run for verification:
555
- [source,CoreRoot]
556
- ----
557
- CoreRoot(success): HttpResponse
558
- if (success)
559
- recommendation(label: success-response)
560
- end
561
- ----
562
- ---
563
-
564
- [import%exclude]
565
- ---
566
- [source,CoreRoot]
567
- ----
568
- success-response()
569
- ----
570
- ---
571
- ====
572
- --
573
-
574
- === STEM expressions
575
-
576
- Like Asciidoctor proper, Metanorma Asciidoctor accepts mathematical input
577
- in either LaTeX or AsciiMath, following the conventions of Asciidoctor:
578
-
579
- * The document attribute `:stem:` means any markup tagged as `[stem]`
580
- (`stem:[...]`, or `[stem]` before a block delimited with `++++`)
581
- is interpreted as AsciiMath.
582
- * The document attribute `:stem: latexmath` means any markup tagged as `[stem]`
583
- (`stem:[...]`, or `[stem]` before a block delimited with `++++`)
584
- is interpreted as LaTeX.
585
- * Any markup tagged as `[asciimath]`
586
- (`asciimath:[...]`, or `[asciimath]` before a block delimited with `++++`)
587
- is interpreted as AsciiMath.
588
- * Any markup tagged as `[latexmath]`
589
- (`latexmath:[...]`, or `[latexmath]` before a block delimited with `++++`)
590
- is interpreted as LaTeX.
591
-
592
- In addition, stem markup that contains MathML markup (as detected by an initial
593
- `<math ... >`) is interpreted as MathML.
594
-
595
- MathML is used as the internal representation of STEM expressions in Metanorma:
596
- AsciiMath and LaTeX in Metanorma Asciidoctor are converted into MathML,
597
- using the https://github.com/asciidoctor/asciimath[asciimath] gem and the
598
- https://dlmf.nist.gov/LaTeXML/manual/commands/latexmlmath.html[latexmath]
599
- processor of LaTeXML, respectively.
600
-
601
- NOTE: latexmath is much slower than other available LaTeX to MathML converters,
602
- but is also more accurate.
603
-
604
- === PlantUML
605
-
606
- The http://plantuml.com[PlantUML] diagramming tool is integrated with Asciidoctor
607
- in this gem, as a literal block with the style attribute `plantuml`:
608
-
609
- [source,asciidoctor]
610
- --
611
- [plantuml]
612
- ....
613
- @startuml
614
- Alice -> Bob: Authentication Request
615
- Bob --> Alice: Authentication Response
616
-
617
- Alice -> Bob: Another authentication Request
618
- Alice <-- Bob: another authentication Response
619
- @enduml
620
- ....
621
- --
622
-
623
- The integration runs PlantUML for each such block, generating a PNG image.
624
- The images are stored in the `plantuml` directory, and linked into the output
625
- document in place of the PlantUML.
626
-
627
- PlantUML needs to be installed by users separately, and accesssible from the
628
- command line:
629
-
630
- * `brew install plantuml` on MacOS.
631
- * For Linux, link the PlantUML jar file into a command line executable; see
632
- `.travis.yml` for an example.
633
-
634
- If PlantUML is not installed locally, the source PlantUML is incorporated into
635
- the output document as sourcecode.
636
-
637
- == Bibliography integration
638
-
639
- Bibliographic entries for standards are expected to use the standard document
640
- identifier as the item label; e.g.
641
-
642
- [source,asciidoctor]
643
- --
644
- * [[[ref1,ISO 712]]], _Cereals and cereal products -- Determination of moisture content -- Reference method_
645
- --
646
-
647
- By default, the https://github.com/riboseinc/relaton[`relaton`] gem is used to look up the reference details for
648
- standards known to have online bibliographies. For bibliographic standards to be looked up via relaton,
649
- the standard document identifier needs to be encoded in a format recognised by relaton as a key:
650
-
651
- * For ISO: `ISO(identifier)`, or any identifier prefixed with `ISO`
652
- * For IEC: `IEC(identifier)`, or any identifier prefixed with `IEC`
653
- * For IETF: `IETF(identifier)` (e.g. `IETF(I-D.-burger-xcon-mmodels)`), or any identifier prefixed with `RFC`
654
- * For GB: `CN(identifier)` (e.g. `CN(JB/T 13368-2018)`)
655
-
656
- The full bibliographic details of the item are screenscraped from the online bibliography and inserted into the XML file
657
- (although only the title of the reference is used in rendering).
658
-
659
- In addition, if any entries in Terms and Definitions cite the International Electrotechnical Vocabulary (IEV),
660
- the http://www.electropedia.org[IEV Electropedia] termbank is queried during validation, to confirm
661
- that the cited entries are the same as what is cited online; those queries are routed through the `iev` gem
662
-
663
- [[cache]]
664
- The results of all `relaton` searches done to date, across all documents,
665
- are cached in the global cache file `~/.relaton/cache`,
666
- so they do not need to be re-fetched each time a document is processed.
667
- (The web query takes a few seconds per reference.)
668
-
669
- The results of all `relaton` searches done to date in a given directory
670
- are stored in the same directory as the current document,
671
- by default to the file `relaton/cache`. (The filename can be overriden in
672
- document attributes.) The local cache overrides entries in
673
- the global cache, and can be manually edited. The local cache is only used
674
- if the `:local-cache:` or `:local-cache-only:` document attribute is set.
675
-
676
- If the document attribute `:no-isobib:` is set, the reference details for
677
- items are not looked up via `isobib`, and the `isobib` caches are not used.
678
- If the document attribute `:no-isobib-cache:` is set, the reference details for
679
- items are still looked up via `isobib`, but the `isobib` caches are not used.
680
-
681
- Any entry in the cache that corresponds to an undated ISO reference fetches its details
682
- from the latest available entry on the ISO web site. If the entry is more than 60
683
- days old, it is refetched.
684
-
685
- The results of all `iev` searches done to date across all documents are cached
686
- in the global cache fule `~/iev.pstore`, and the results of all `iev` searches
687
- done to date for the current document are stored in the same directory as the
688
- current document, in the file `(filename).iev.pstore`.
689
-
690
- [[docattributes]]
691
- == Document Attributes
692
-
693
- The gem relies on Asciidoctor document attributes to provide necessary
694
- metadata about the document. These include:
695
-
696
- `:nodoc:`:: Do not generate Word and HTML output, only generate XML output.
697
- Can be used as a command-line option (like all other document attributes):
698
- `asciidoctor -a nodoc -b iso -r "metanorma-iso" a.adoc`
699
-
700
- `:novalid:`:: Suppress validation.
701
-
702
- `:flush-caches:`:: If set, delete and reinitialise the <<cache,cache>> of `relaton` searches.
703
-
704
- `:no-isobib:`:: If set, do not use the `relaton` or `iev` gem functionality to look up
705
- ISO and IEV references online, nor the <<cache,cache>> of `relaton` and `iev` searches.
706
-
707
- `:no-isobib-cache:`:: If set, use the `relaton` and `iev` gem functionality to look up
708
- ISO and IEV references online, but do not use the <<cache,cache>> of `relaton` and `iev` searches.
709
-
710
- `:local-cache:`:: Use the local relaton and iev search caches to override the global `relaton` and `iev` search
711
- caches. If a directory name is given for the attribute, that name overrides `relaton` as the
712
- cache name.
713
-
714
- `:local-cache-only:`:: Use the local relaton and iev search caches to the exclusion of the global `relaton` and `iev` search
715
- caches. If a directory name is given for the attribute, that name overrides `relaton` as the
716
- cache name.
717
-
718
- `:i18nyaml:`:: Name of YAML file of internationalisation text, to use instead
719
- of the built-in English, French or Chinese text used to label parts of the document
720
- (e.g. "Table", "Foreword", boilerplate text for Normative References, etc.)
721
- Use if you wish to output an standard in a language other than those three.
722
- A sample YAML file for English, with "Foreword" replaced with "Frontispiece",
723
- is available at https://github.com/riboseinc/metanorma-iso/blob/master/spec/examples/english.yaml[]
724
-
725
- `:docnumber:`:: The numeric component of the document identifier (mandatory). The full identifier is formed by prefixing and suffixing this element with other strings derived from metadata.
726
-
727
- `:edition:`:: The document edition
728
-
729
- `:revdate:`:: The date the document was last updated
730
-
731
- `:copyright-year:`:: The year which will be claimed as when the copyright for
732
- the document was issued
733
-
734
- `:library-ics:` :: The ICS (International Categorization for Standards) number for the standard. There may be more than one ICS for a document; if so, they should be comma-delimited. (The ics identifier is added to the document metadata, but is not output to the current document templates.)
735
-
736
- `:title:` :: The title of the document. If not supplied, the built-in Asciidoctor title (first line of document header) is used instead.
737
- `:title-XX:` :: The title of the document in the language `XX` (presumed to be a ISO 639-1 code).
738
-
739
- `:doctype:`:: The document type; e.g. "standard", "guide", "report".
740
-
741
- `:status:` :: The status of the document; e.g. "draft", "published".
742
-
743
- `:technical-committee:`:: The name of the relevant technical committee
744
-
745
- `:fullname{_i}:`:: The full name of a person who is a contributor to the document.
746
- A second person is indicated by using a numeric suffix: `:fullname:`, `:fullname_2:`, `fullname_3:`, &c.
747
- (This and the other personal name attributes are not displayed in all standards.)
748
-
749
- `:surname{_i}:`:: The surname of a person who is a contributor to the document.
750
- `:givenname{_i}:`:: The given name(s) of a person who is a contributor to the document.
751
- `:initials{_i}:`:: The initials(s) of a person who is a contributor to the document.
752
- `:role{_i}:`:: The role of a a person who is a contributor to the document. By default,
753
- they are coded as an `editor`; they can also be represented as an `author`.
754
- `:affiliation{_i}:`:: The organisational affiliation of a person who is a contributor to the document.
755
- `:address{_i}:`:: The organisational address of a person who is a contributor to the document.
756
- `:contributor-uri{_i}:`:: The URI of a person who is a contributor to the document.
757
- `:email{_i}:`:: The email of a person who is a contributor to the document.
758
-
759
-
760
- `:draft:`:: The document draft (used in addition to document stage, for multiple iterations: expected format _X.Y_)
761
-
762
- `:issued-date:`::
763
- The date on which the standard was issued (authorised for publication by the issuing authority).
764
-
765
- `:published-date:`::
766
- The date on which the standard was published (distributed by the publisher).
767
-
768
- `:implemented-date:`::
769
- The date on which the standard became active.
770
-
771
- `:created-date:`::
772
- The date on which the first version of the standard was created.
773
-
774
- `:updated-date:`::
775
- The date on which the current version of the standard was updated.
776
-
777
- `:obsoleted-date:`::
778
- The date on which the standard was obsoleted/revoked.
779
-
780
- `:confirmed-date:`::
781
- The date on which the standard was reviewed and approved by the issuing authority.
782
-
783
- `:unchanged-date:`::
784
- The date on which the standard was last renewed without any changes in content.
785
-
786
- `:circulated-date:`::
787
- The date on which the unpublished standard was last circulated officially as a preprint. For standards, this is associated with the latest transition to a formally defined preparation stage, such as Working Draft or Committee Draft.
788
-
789
- `:date:`::
790
- An arbitrary date in the production of the standard. Content of the attribute should be a token, giving the type of date, then space, then the date itself. Multiple dates can be added as `:date_2:`, `date_3`, etc.
791
-
792
- `:uri:`:: The URI to which this standard is published.
793
- `:xml-uri:`:: The URI to which the (Metanorma) XML representation of this standard is published.
794
- `:html-uri:`:: The URI to which the HTML representation of this standard is published.
795
- `:pdf-uri:`:: The URI to which the PDF representation of this standard is published.
796
- `:doc-uri:`:: The URI to which the DOC representation of this standard is published.
797
- `:relaton-uri:`:: The URI to which the Relaton XML representation of this standard is published.
798
-
799
- `:language:` :: The language of the document (`en` or `fr`). Defaults to `en`.
800
-
801
- `:script:` :: The script of the document (defaults to `Latn`). Must be supplied as
802
- `Hans` for Simplified Chinese.
803
-
804
- `:publisher:`:: The standards agency publishing the standard; can be multiple
805
- (comma-delimited). Defaults to `ISO`.
806
-
807
- `:body-font:`:: Font for body text; will be inserted into CSS. Defaults to
808
- Cambria for Latin script, SimSun for Simplified Chinese.
809
-
810
- `:header-font:`:: Font for headers; will be inserted into CSS. Defaults to
811
- Cambria for Latin script, SimHei for Simplified Chinese.
812
-
813
- `:monospace-font`:: Font for monospace; will be inserted into CSS. Defaults to
814
- Courier New.
815
-
816
- `:htmlstylesheet`:: SCSS stylesheet to use for HTML output. Defaults to built in stylesheet,
817
- which adheres with ISO formatting requirements. Recommend against overriding this.
818
-
819
- `:htmlcoverpage`:: HTML template for cover page. Defaults to built in template. Recommend against overriding this.
820
-
821
- `:htmlintropage`:: HTML template for introductory section. Defaults to built in template. Recommend against overriding this.
822
-
823
- `:scripts`:: Javascript scripts for HTML output. Defaults to built in scripts. Recommend against overriding this.
824
- `:scripts-pdf`:: Javascript scripts for HTML > PDF output. Defaults to built in scripts. Recommend against overriding this.
825
-
826
- `:wordstylesheet`:: Primary SCSS stylesheet to use for Word output. Defaults to built in stylesheet,
827
- which adheres with ISO formatting requirements. Recommend against overriding this.
828
-
829
- `:standardstylesheet`:: Secondary SCSS stylesheet use for Word output. Defaults to built in stylesheet,
830
- which adheres with ISO formatting requirements. Recommend against overriding this.
831
-
832
- `:header`:: Header and footer file for Word output. Defaults to built in template. Recommend against overriding this.
833
-
834
- `:wordcoverpage`:: Word template for cover page. Defaults to built in template. Recommend against overriding this.
835
-
836
- `:wordintropage`:: Word template for introductory section. Defaults to built in template. Recommend against overriding this.
837
-
838
- `:ulstyle`:: Word CSS selector for unordered lists in supplied stylesheets. Defaults to value for built in stylesheet. Recommend against overriding this.
839
-
840
- `:olstyle`:: Word CSS selector for ordered lists in supplied stylesheets. Defaults to value for built in stylesheet. Recommend against overriding this.
841
-
842
- `:data-uri-image`:: Encode all images in HTML output as inline data-URIs. Defaults to true.
843
-
844
- `:smartquotes`:: Apply smartquotes and other autoformatting to the XML output (and hence the downstream outputs)
845
- (default true). The rules for
846
- smart formatting follow the https://github.com/pbhogan/sterile[sterile] gem, and are given in
847
- https://github.com/pbhogan/sterile/blob/master/lib/sterile/data/smart_format_rules.rb. If `:smartquotes:`
848
- is set to `false`, then the Asciidoctor default is used to generate smart quotes: `"&#x060; &#x060;"`, `'&#x060; &#x060;'`.
849
-
850
-
851
- The attribute `:draft:`, if present, includes review notes in the XML output;
852
- these are otherwise suppressed.
853
-
854
- The document proper can reference the values of document attributes, which is convenient
855
- for reusability. For example,
856
-
857
- [source,asciidoc]
858
- --
859
- This document was prepared by Technical Committee ISO/TC {technical-committee-number}, _{technical-committee}_, Subcommittee SC {subcommittee-number}, _{subcommittee}_.
860
- --
861
-
862
- If the corresponding document attributes are not populated in the header, then the references
863
- themselves will not be populated.
58
+ See http://metanorma.com[]
864
59
 
60
+ bump