metanorma-csd 1.0.11 → 1.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cfa77e6bb51c1c9b88c27780e2c2469d07a8a677dce69b429c90bf5a9e8935ad
4
- data.tar.gz: ac9a4b4d45310c4dc67d5c9f4cf8f5ab16c400557bcc87181d8d373e07faca7b
3
+ metadata.gz: 11d60940512345545644ab6c55d0f71310ca12257b86ab7c9d1ca550d92bd414
4
+ data.tar.gz: 8808b89e1b47ac413aad8ceacc91929d32cad01dafeaddf179f69a846db0039b
5
5
  SHA512:
6
- metadata.gz: 0b53a3f7c310eac3fd0eb622e04f828b54f6be4f92513eb5614eac743007c94479bdfae7fa3d63d62466f56498f3b3c28b2756ab6aebd06542133029d4423635
7
- data.tar.gz: 4c0e567f10f0f0e76a75cd4724908d62be56ae7daf9e8ae4c7f681afa475faed3eb09b668db7e260d49c4e8365c2572c5d77678f4e54079a866af44b1bcaf63f
6
+ metadata.gz: 833eb87552db7ffe68cf48e96e7e6b2469c874efc091e1e311b009ee0cc7afeb988e640b377aef15cb0a4218dc2359eb45366ef8abcde26ac819aa940fbc3ee0
7
+ data.tar.gz: 941ac1ba05c88f284445263acb33b7eb6f499ad6916b7cd35388742d835989a2cffc61a5d0babaf4d42163e02d3542b199cdd12d97fe7c6d420bf0a9294cd207
@@ -0,0 +1,8 @@
1
+ ---
2
+ sections:
3
+ - name: Introduction
4
+ items:
5
+ - quickstart
6
+ ---
7
+
8
+ = Navigation
@@ -0,0 +1,368 @@
1
+ = Quickstart Guide for Metanorma-CSD
2
+
3
+ Start using Metanorma-CSD to author CalConnect docs in these steps:
4
+
5
+ . Get Metanorma running on your machine
6
+ . Fetch and compile an example Metanorma-CSD document
7
+ . Modify the document to fit your goals while keeping it valid AsciiCSD
8
+
9
+ This guide assumes proficiency with the terminal,
10
+ and uses the Docker option of running Metanorma
11
+ (there’re other
12
+ https://www.metanorma.com/overview/getting-started/[options of installing Metanorma],
13
+ too).
14
+
15
+
16
+ == Get Metanorma running on your machine
17
+
18
+ Assuming you have Docker installed, it’s as easy as:
19
+
20
+ [source,console]
21
+ --
22
+ docker pull ribose/metanorma
23
+ --
24
+
25
+
26
+ == Fetch and compile an example Metanorma-CSD document
27
+
28
+ We’re going to use the vCard Format Specification sample document here.
29
+ Clone the Metanorma-CSD repository and change into the directory with the example:
30
+
31
+ [source,console]
32
+ --
33
+ git clone https://github.com/riboseinc/metanorma-csd.git
34
+ cd /spec/examples/
35
+ --
36
+
37
+ To compile the document, run the Docker container as follows:
38
+
39
+ [source,console]
40
+ --
41
+ docker run -v "$(pwd)":/metanorma/ -w /metanorma ribose/metanorma "metanorma -t csd -x xml,html,pdf,doc rfc6350.adoc"
42
+ --
43
+
44
+ NOTE: If you use Metanorma-CLI instead of Docker,
45
+ http://metanorma.com:4001/software/metanorma-cli/docs/usage/[see how to use the metanorma executable to compile documnts].
46
+
47
+
48
+ == Write valid AsciiCSD
49
+
50
+ A Metanorma-CSD is a file in AsciiDoc format with certain extensions
51
+ specific to Metanorma as a whole and Metanorma-CSD in particular.
52
+ (We call the format AsciiCSD for short.)
53
+
54
+
55
+ === AsciiDoc basics
56
+
57
+ NOTE: Skip this section if you’re already familiar with AsciiDoc syntax.
58
+
59
+ ==== Inline formatting
60
+
61
+ [source,asciidoc]
62
+ --
63
+ *bold emphasis*, _italic emphasis_, `monospace / code snippet`
64
+ "`Typographic double quotes`", '`typographic single quotes`'
65
+ Subscript: H~2~O; superscript: E=mc^2^
66
+ --
67
+
68
+ ==== Sections, anchors and references
69
+
70
+ [source,asciidoc]
71
+ --
72
+ == Section 1
73
+
74
+ Content (see <<anchor>>)
75
+
76
+ == Section 2
77
+
78
+ === Section 2.1
79
+
80
+ [[anchor]]
81
+ ==== Section 2.2
82
+
83
+ Content 2.2. http://www.calconnect.org/[CalConnect]
84
+ --
85
+
86
+ ==== Lists and blocks
87
+
88
+ [source,asciidoc]
89
+ --
90
+ * Unordered list item 1
91
+ * Unordered list item 2
92
+
93
+ . Ordered list item 1
94
+ . Ordered list item 2
95
+
96
+ Definition list:
97
+
98
+ stem:[w]:: is the mass fraction of grains with defects in the test sample;
99
+ stem:[m_D]:: is the mass, in grams, of grains with that defect;
100
+ mag:: is the mass, in grams, of the aggregated test sample.
101
+ --
102
+
103
+ ==== Tables, figures, footnotes
104
+
105
+ A rather complex table:
106
+
107
+ [source,adoc]
108
+ ----
109
+ [[tableD-1]]
110
+ [cols="<,^,^,^,^",headerrows=2]
111
+ .Repeatability and reproducibility of husked rice yield
112
+ |===
113
+ .2+| Description 4+| Rice sample
114
+ | Arborio | Drago footnote:[Parboiled rice.] | Balilla | Thaibonnet
115
+
116
+ | Number of laboratories retained after eliminating outliers | 13 | 11 | 13 | 13
117
+ | Mean value, g/100 g | 81,2 | 82,0 | 81,8 | 77,7
118
+ |===
119
+ ----
120
+
121
+ Images (figures) and footnotes:
122
+
123
+ [source,adoc]
124
+ ----
125
+ [[figureC-1]]
126
+ .Typical gelatinization curve
127
+ image::images/rice_image2.png[]
128
+ footnote:[The time stem:[t_90] was estimated to be 18,2 min for this example.]
129
+ ----
130
+
131
+
132
+ ==== Admonition blocks, quotes & code listings
133
+
134
+ Admonitions (notes, warnings, cautions, etc.) and examples:
135
+
136
+ [source,adoc]
137
+ ----
138
+ NOTE: It is unnecessary to compare rice yield across years.
139
+
140
+ [example]
141
+ 5 + 3 = 8
142
+ ----
143
+
144
+ Block quotes:
145
+
146
+ [source,adoc]
147
+ ----
148
+ [quote,ISO,"ISO7301,clause 1"]
149
+ _____
150
+ This Standard gives the minimum specifications for rice (_Oryza sativa_ L.)
151
+ _____
152
+ ----
153
+
154
+ Source code:
155
+
156
+ [source,adoc]
157
+ ----
158
+ [source,some-lang]
159
+ ------
160
+ function () -> {}
161
+ ------
162
+ ----
163
+
164
+
165
+ === Extensions to AsciiDoc
166
+
167
+ ==== Document header & custom AsciiDoc attributes
168
+
169
+ `:docnumber:`: CalConnect document number, as allocated by TCC.
170
+
171
+ `:status:`: The status of the document can be one of:
172
+
173
+ * proposal
174
+ * working-draft
175
+ * committee-draft
176
+ * draft-standard
177
+ * final-draft
178
+ * published
179
+ * withdrawn
180
+
181
+ `:doctype:`: The type of the document can be one of:
182
+
183
+ * standard
184
+ * directive
185
+ * guide
186
+ * specification
187
+ * report
188
+ * amendment
189
+ * technical-corrigendum
190
+
191
+ `:technical-committee:`, `:technical-committee_N:` (where N is a positive integer):
192
+ Technical committee; there can be more than one.
193
+
194
+ `:draft:`: Enables comments in Word and XML.
195
+
196
+ `:local-cache-only:`: Used with Metanorma under Docker to ensure bibliographic entries
197
+ do not get unnecessarily fetched all the time.
198
+
199
+
200
+ ==== Foreword & Introduction
201
+
202
+ Foreword must be put before the first real section/clause (the `==` one).
203
+
204
+ ----
205
+ [[foreword]]
206
+ .Foreword
207
+ The Calendaring and Scheduling Consortium ("`CalConnect`") is global non-profit
208
+ organization with the aim to facilitate interoperability of technologies across
209
+ user-centric systems and applications...
210
+ ----
211
+
212
+ Introduction comes after Foreword and is unnumbered (actually "`0`"):
213
+
214
+ ----
215
+ [[introduction]]
216
+ :sectnums!: <== disables display of section number
217
+ == Introduction
218
+
219
+ <<ISO8601>> has been the international standard for date and time representations
220
+ and is applied widely, including in the <<RFC5545>> and <<RFC6350>> standards
221
+ ...
222
+
223
+ :sectnums: <== re-enables display of section number
224
+ ----
225
+
226
+ NOTE: Some ISO standards display Introduction section numbers (the "`0`") if there are
227
+ too many sub-sections.
228
+
229
+
230
+ ==== Normative references & bibliography
231
+
232
+ What is a normative vs informative reference?
233
+
234
+ * A change to a normative reference requires updating of the document;
235
+ * A change to an informative reference should not trigger a change in the document.
236
+
237
+
238
+ Clause 2 must be this:
239
+
240
+ ----
241
+ [bibliography]
242
+ == Normative references
243
+
244
+ * [[[ISO3696,ISO 3696]]], _Water for analytical laboratory use -- Test methods_
245
+ ----
246
+
247
+ Last section must be this:
248
+
249
+ ----
250
+ [bibliography]
251
+ == Bibliography
252
+
253
+ * [[[ISO5609,ISO 5609]]], _Soil for laboratory analysis -- Test methods_
254
+ ----
255
+
256
+ NOTE: the Bibliography is identical in usage with the IETF RFC section "`Informative references`".
257
+
258
+
259
+ ==== Citations
260
+
261
+ In a CSD you often want to cite external or internal references.
262
+
263
+ Internal:
264
+ [source,adoc]
265
+ ----
266
+ [[dog-food]]
267
+ == Dog food
268
+
269
+ Dogs love food, not only bones. Mine especially loves eating Oreo's.
270
+
271
+ == Living with your dog
272
+
273
+ My dog, Cookie, loves to eat cookies (see <<dog-food>>).
274
+
275
+ ----
276
+
277
+
278
+ External (remember to add the reference!):
279
+
280
+ [source,adoc]
281
+ ----
282
+ The quality requirements on wheat are described in <<ISO7301>>.
283
+
284
+ In particular, those for bread wheat (T. aestivum) are given in
285
+ <<ISO7301,clause=5.6>>.
286
+ ----
287
+
288
+
289
+ ==== Terms and definitions
290
+
291
+ This must be clause 3.
292
+
293
+ [source,adoc]
294
+ ----
295
+ [[tda]] <= anchor if you want it
296
+ [source=ISO8601-1] <= allows inheriting terms and definitions from
297
+ another document
298
+ == Terms, definitions, symbols and abbreviations <= can combine T&D and S&A
299
+
300
+ === Terms and definitions <= the real T&D clause
301
+
302
+ [[term-explicit]] <= anchor if you want it
303
+ ==== explicit form <= term item
304
+
305
+ date and time representation that uses designator symbols to delimit
306
+ time scale components
307
+ ----
308
+
309
+
310
+ ==== Term entry in T&D
311
+
312
+ The structure is strict; the following illustrates the complete structure of a term entry.
313
+
314
+ In the term source (`[.source]`), all content after the reference and the "`comma`" is about "`modifications`" to the original definition.
315
+
316
+ [source,adoc]
317
+ ----
318
+ [[paddy]] <= anchor
319
+ === paddy <= term
320
+ alt:[paddy rice] <= alternative term
321
+ alt:[rough rice] <= second alternative
322
+ deprecated:[cargo rice] <= deprecated term
323
+ domain:[rice] <= domain
324
+
325
+ rice retaining its husk after threshing <= definition
326
+
327
+ [example] <= example
328
+ Foreign seeds, husks, bran, sand, dust.
329
+
330
+ NOTE: The starch of waxy rice consists almost entirely of amylopectin. <= note
331
+
332
+ [.source]
333
+ <<ISO7301,section 3.2>>, The term "cargo rice" is shown as deprecated, <= source
334
+ and Note 1 to entry is not included here.
335
+ ----
336
+
337
+
338
+ ==== Term entry sourced from IEC Electropedia (IEV)
339
+
340
+ In the `[.source]`, a termbase such as the IEC Electropedia ("`IEV`") can be used, such as:
341
+
342
+ [source,adoc]
343
+ ----
344
+ [.source]
345
+ <<IEV,clause "113-01-01">>, the term "space-time" is further explained
346
+ in a new Note 2 to entry.
347
+ ----
348
+
349
+ References to the specific IEC 60500 documents (where IEV terms came
350
+ from) are automatically added to the Bibliography.
351
+
352
+
353
+ ==== Annex
354
+
355
+ Annexes have to be placed before the "`Bibliography`".
356
+
357
+ [source,adoc]
358
+ ----
359
+ [[AnnexA]]
360
+ [appendix,subtype=informative]
361
+ == Example date and time expressions, and representations
362
+ ...
363
+ ----
364
+
365
+
366
+ == Where next?
367
+
368
+ * https://www.metanorma.com/overview/[Learn more about Metanorma]
@@ -56,15 +56,6 @@ module Asciidoctor
56
56
  File.join(File.dirname(__FILE__), "csd.rng"))
57
57
  end
58
58
 
59
- def literal(node)
60
- noko do |xml|
61
- xml.figure **id_attr(node) do |f|
62
- figure_title(node, f)
63
- f.pre node.lines.join("\n")
64
- end
65
- end
66
- end
67
-
68
59
  def sections_cleanup(x)
69
60
  super
70
61
  x.xpath("//*[@inline-header]").each do |h|
@@ -87,30 +78,6 @@ module Asciidoctor
87
78
  def word_converter(node)
88
79
  IsoDoc::Csd::WordConvert.new(doc_extract_attributes(node))
89
80
  end
90
-
91
- def inline_quoted(node)
92
- noko do |xml|
93
- case node.type
94
- when :emphasis then xml.em node.text
95
- when :strong then xml.strong node.text
96
- when :monospaced then xml.tt node.text
97
- when :double then xml << "\"#{node.text}\""
98
- when :single then xml << "'#{node.text}'"
99
- when :superscript then xml.sup node.text
100
- when :subscript then xml.sub node.text
101
- when :asciimath then stem_parse(node.text, xml)
102
- else
103
- case node.role
104
- when "strike" then xml.strike node.text
105
- when "smallcap" then xml.smallcap node.text
106
- when "keyword" then xml.keyword node.text
107
- else
108
- xml << node.text
109
- end
110
- end
111
- end.join
112
- end
113
-
114
81
  end
115
82
  end
116
83
  end
@@ -74,28 +74,6 @@
74
74
  </choice>
75
75
  </element>
76
76
  </define>
77
- <!-- TextElement |= keyword -->
78
- <define name="TextElement">
79
- <choice>
80
- <text/>
81
- <ref name="em"/>
82
- <ref name="eref"/>
83
- <ref name="strong"/>
84
- <ref name="stem"/>
85
- <ref name="sub"/>
86
- <ref name="sup"/>
87
- <ref name="tt"/>
88
- <ref name="strike"/>
89
- <ref name="smallcap"/>
90
- <ref name="xref"/>
91
- <ref name="br"/>
92
- <ref name="hyperlink"/>
93
- <ref name="hr"/>
94
- <ref name="pagebreak"/>
95
- <ref name="bookmark"/>
96
- <ref name="keyword"/>
97
- </choice>
98
- </define>
99
77
  <define name="BibItemType">
100
78
  <choice>
101
79
  <value>directive</value>
@@ -288,16 +266,6 @@
288
266
  </element>
289
267
  </define>
290
268
  </include>
291
- <define name="pre">
292
- <element name="pre">
293
- <text/>
294
- </element>
295
- </define>
296
- <define name="keyword">
297
- <element name="keyword">
298
- <text/>
299
- </element>
300
- </define>
301
269
  <define name="csd-standard">
302
270
  <element name="csd-standard">
303
271
  <ref name="bibdata"/>
@@ -384,6 +384,7 @@
384
384
  <ref name="sourcecode"/>
385
385
  <ref name="example"/>
386
386
  <ref name="review"/>
387
+ <ref name="pre"/>
387
388
  </choice>
388
389
  </define>
389
390
  <define name="paragraph">
@@ -540,6 +541,20 @@
540
541
  </zeroOrMore>
541
542
  </element>
542
543
  </define>
544
+ <define name="pre">
545
+ <element name="pre">
546
+ <attribute name="id">
547
+ <data type="ID"/>
548
+ </attribute>
549
+ <optional>
550
+ <ref name="tname"/>
551
+ </optional>
552
+ <text/>
553
+ <zeroOrMore>
554
+ <ref name="note"/>
555
+ </zeroOrMore>
556
+ </element>
557
+ </define>
543
558
  <define name="table">
544
559
  <element name="table">
545
560
  <attribute name="id">
@@ -710,6 +725,7 @@
710
725
  </optional>
711
726
  <choice>
712
727
  <ref name="image"/>
728
+ <ref name="pre"/>
713
729
  <zeroOrMore>
714
730
  <ref name="figure"/>
715
731
  </zeroOrMore>
@@ -735,6 +751,7 @@
735
751
  <ref name="sub"/>
736
752
  <ref name="sup"/>
737
753
  <ref name="tt"/>
754
+ <ref name="keyword"/>
738
755
  <ref name="strike"/>
739
756
  <ref name="smallcap"/>
740
757
  <ref name="xref"/>
@@ -765,6 +782,11 @@
765
782
  <text/>
766
783
  </element>
767
784
  </define>
785
+ <define name="keyword">
786
+ <element name="keyword">
787
+ <text/>
788
+ </element>
789
+ </define>
768
790
  <define name="sub">
769
791
  <element name="sub">
770
792
  <text/>
@@ -37,12 +37,12 @@
37
37
  <span>TC {{ tc }}</span>
38
38
  </div>
39
39
 
40
- {% if editors %}
40
+ {% if editors.size > 0 %}
41
41
  <div class="coverpage-tc-name">
42
42
  <span>Editors: {{ editors | join: ", " }}</span>
43
43
  </div>
44
44
  {% endif %}
45
- {% if authors %}
45
+ {% if authors.size > 0 %}
46
46
  <div class="coverpage-tc-name">
47
47
  <span>Authors: {{ authors | join: ", " }}</span>
48
48
  </div>
@@ -42,10 +42,6 @@ module IsoDoc
42
42
  end
43
43
  end
44
44
 
45
- def pre_parse(node, out)
46
- out.pre node.text # content.gsub(/</, "&lt;").gsub(/>/, "&gt;")
47
- end
48
-
49
45
  def term_defs_boilerplate(div, source, term, preface)
50
46
  if source.empty? && term.nil?
51
47
  div << @no_terms_boilerplate
@@ -59,18 +55,6 @@ module IsoDoc
59
55
  @annex_lbl = "Appendix"
60
56
  end
61
57
 
62
- def error_parse(node, out)
63
- # catch elements not defined in ISO
64
- case node.name
65
- when "pre"
66
- pre_parse(node, out)
67
- when "keyword"
68
- out.span node.text, **{ class: "keyword" }
69
- else
70
- super
71
- end
72
- end
73
-
74
58
  def html_head()
75
59
  <<~HEAD.freeze
76
60
  <title>{{ doctitle }}</title>
@@ -42,10 +42,6 @@ module IsoDoc
42
42
  end
43
43
  end
44
44
 
45
- def pre_parse(node, out)
46
- out.pre node.text # content.gsub(/</, "&lt;").gsub(/>/, "&gt;")
47
- end
48
-
49
45
  def term_defs_boilerplate(div, source, term, preface)
50
46
  if source.empty? && term.nil?
51
47
  div << @no_terms_boilerplate
@@ -59,18 +55,6 @@ module IsoDoc
59
55
  @annex_lbl = "Appendix"
60
56
  end
61
57
 
62
- def error_parse(node, out)
63
- # catch elements not defined in ISO
64
- case node.name
65
- when "pre"
66
- pre_parse(node, out)
67
- when "keyword"
68
- out.span node.text, **{ class: "keyword" }
69
- else
70
- super
71
- end
72
- end
73
-
74
58
  def html_head()
75
59
  <<~HEAD.freeze
76
60
  <title>{{ doctitle }}</title>
@@ -45,10 +45,6 @@ module IsoDoc
45
45
  end
46
46
  end
47
47
 
48
- def pre_parse(node, out)
49
- out.pre node.text # content.gsub(/</, "&lt;").gsub(/>/, "&gt;")
50
- end
51
-
52
48
  def term_defs_boilerplate(div, source, term, preface)
53
49
  if source.empty? && term.nil?
54
50
  div << @no_terms_boilerplate
@@ -62,18 +58,6 @@ module IsoDoc
62
58
  @annex_lbl = "Appendix"
63
59
  end
64
60
 
65
- def error_parse(node, out)
66
- # catch elements not defined in ISO
67
- case node.name
68
- when "pre"
69
- pre_parse(node, out)
70
- when "keyword"
71
- out.span node.text, **{ class: "keyword" }
72
- else
73
- super
74
- end
75
- end
76
-
77
61
  def cleanup(docxml)
78
62
  super
79
63
  term_cleanup(docxml)
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Csd
3
- VERSION = "1.0.11"
3
+ VERSION = "1.0.12"
4
4
  end
5
5
  end
@@ -37,7 +37,7 @@ Gem::Specification.new do |spec|
37
37
  spec.add_development_dependency "guard-rspec", "~> 4.7"
38
38
  spec.add_development_dependency "rake", "~> 12.0"
39
39
  spec.add_development_dependency "rspec", "~> 3.6"
40
- spec.add_development_dependency "rubocop", "~> 0.50"
40
+ spec.add_development_dependency "rubocop", "= 0.54.0"
41
41
  spec.add_development_dependency "simplecov", "~> 0.15"
42
42
  spec.add_development_dependency "timecop", "~> 0.9"
43
43
  spec.add_development_dependency "metanorma", "~> 0.3.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-csd
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.11
4
+ version: 1.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-11-27 00:00:00.000000000 Z
11
+ date: 2018-12-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-standoc
@@ -140,16 +140,16 @@ dependencies:
140
140
  name: rubocop
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - "~>"
143
+ - - '='
144
144
  - !ruby/object:Gem::Version
145
- version: '0.50'
145
+ version: 0.54.0
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - "~>"
150
+ - - '='
151
151
  - !ruby/object:Gem::Version
152
- version: '0.50'
152
+ version: 0.54.0
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: simplecov
155
155
  requirement: !ruby/object:Gem::Requirement
@@ -217,6 +217,8 @@ files:
217
217
  - bin/console
218
218
  - bin/rspec
219
219
  - bin/setup
220
+ - docs/navigation.adoc
221
+ - docs/quickstart.adoc
220
222
  - lib/asciidoctor/csd.rb
221
223
  - lib/asciidoctor/csd/biblio.rng
222
224
  - lib/asciidoctor/csd/converter.rb