metanorma-nist 0.0.3 → 0.0.4

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: 479ffc86d11ce177921f465e151fb8fa57f20e946234b079879523f2de275e68
4
- data.tar.gz: 681de2826b7931bab707e701dc85fc6ed090c860c3c20e5105c86fbe57c837f0
3
+ metadata.gz: 30193344892f68ba4a979316250fe4e6268cdbbe1ae476b48169f34d5ebcfcf6
4
+ data.tar.gz: 5a2165e97b94d197e9e5247b7fdb21bdc33c38041da812824f5298452f6a0512
5
5
  SHA512:
6
- metadata.gz: 9cd443581973f965269c74a3b4b185014513cda9733135a117db5e3775b201d5ccaa146c587ff7694166f9bc09f2af59b833f650bb0d8019e9950eff84384d72
7
- data.tar.gz: 73566c4935a4778599499eec7f88bf2d82ca4317420f6e8dc5a6b8594cd9b9103ed52bf8f1f9f75f2c25cba9438cf4d55384fe151b4bbad2b3a5330801e4d8b7
6
+ metadata.gz: 1fb5c7754d436c24af54b760c3cbb9b8561ada612d8aa022c709b651eb8bf8f16fc43d4f2fc7efb65de9743c0167a85f86fc58816f9b3b8b250da380e4f98fd4
7
+ data.tar.gz: d0ed65e3f7cb8cf0abd6e9235522faaf2e4fc14d2d0d77b8b51a678719d081caa02403de3b9b7b37f52e1f33f1395440006fe14b33278900bf8311f2e1d0079d
data/README.adoc CHANGED
@@ -124,13 +124,13 @@ Where these preexisting metanorma attributes correspond to attributes already us
124
124
  by NIST in their Asciidoctor template, they are treated as synonyms of the Metanorma
125
125
  attributes.
126
126
 
127
- The attributes relevant to OGC documents include:
127
+ The attributes relevant to NIST documents include:
128
128
 
129
129
  `:edition:`:: The document version; e.g. `2.0`.
130
130
 
131
131
  `:revdate:`:: The date the document was last updated.
132
132
 
133
- `:copyright-year:`: The year which will be claimed as when the copyright for
133
+ `:copyright-year:`:: The year which will be claimed as when the copyright for
134
134
  the document was issued.
135
135
 
136
136
  `:title:`:: The main component of the English title of the document
@@ -203,6 +203,15 @@ The following document attributes are specific to this document class:
203
203
 
204
204
  `:doc-email:`:: Email contact for document
205
205
 
206
+ `:call-for-patent-claims:`:: Include the Call for Patent Claims in document drafts,
207
+ and the Patent Disclosure Notice in finalised documents.
208
+
209
+ `:commitment-to-licence:`:: Indicate in the Patent Disclosure Notice that
210
+ notice and commitment to license have been received.
211
+
212
+ `:patent-contact:`:: Contact for the Call for Patent Claims or Patent Disclosure Notice.
213
+ If not supplied, `:doc-email:` is used.
214
+
206
215
  == Asciidoctor features specific to NIST
207
216
 
208
217
  The https://github.com/riboseinc/metanorma-standoc[metanorma-standoc]
@@ -18,6 +18,21 @@
18
18
  of this.
19
19
  -->
20
20
  <grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
21
+ <!--
22
+ https://www.myintervals.com/blog/2009/05/20/iso-8601-date-validation-that-doesnt-suck/
23
+ iso8601date = xsd:string { pattern = "([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24\:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?" }
24
+ Somewhat dumbed down for XSD regex:
25
+ -->
26
+ <define name="ISO8601DateTime">
27
+ <data type="string">
28
+ <param name="pattern">([\+\-]?\d{4})((-?)((0[1-9]|1[0-2])((-?)([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([\.,]\d+)?)?((:?)[0-5]\d([.,]\d+)?)?([zZ]|([\+\-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?</param>
29
+ </data>
30
+ </define>
31
+ <define name="ISO8601Date">
32
+ <data type="string">
33
+ <param name="pattern">([\+\-]?\d{4})((-?)((0[1-9]|1[0-2])((-?)([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6]))))?</param>
34
+ </data>
35
+ </define>
21
36
  <define name="status">
22
37
  <element name="status">
23
38
  <ref name="LocalizedString"/>
@@ -375,10 +390,7 @@
375
390
  </define>
376
391
  <define name="date">
377
392
  <element name="date">
378
- <choice>
379
- <data type="gYear"/>
380
- <data type="date"/>
381
- </choice>
393
+ <ref name="ISO8601Date"/>
382
394
  </element>
383
395
  </define>
384
396
  <define name="locality">
@@ -561,10 +573,7 @@
561
573
  </define>
562
574
  <define name="fetched">
563
575
  <element name="fetched">
564
- <choice>
565
- <data type="dateTime"/>
566
- <data type="date"/>
567
- </choice>
576
+ <ref name="ISO8601DateTime"/>
568
577
  </element>
569
578
  </define>
570
579
  <define name="validity">
@@ -582,26 +591,17 @@
582
591
  </define>
583
592
  <define name="validityBegins">
584
593
  <element name="validityBegins">
585
- <choice>
586
- <data type="dateTime"/>
587
- <data type="date"/>
588
- </choice>
594
+ <ref name="ISO8601DateTime"/>
589
595
  </element>
590
596
  </define>
591
597
  <define name="validityEnds">
592
598
  <element name="validityEnds">
593
- <choice>
594
- <data type="dateTime"/>
595
- <data type="date"/>
596
- </choice>
599
+ <ref name="ISO8601DateTime"/>
597
600
  </element>
598
601
  </define>
599
602
  <define name="validityRevision">
600
603
  <element name="revision">
601
- <choice>
602
- <data type="dateTime"/>
603
- <data type="date"/>
604
- </choice>
604
+ <ref name="ISO8601DateTime"/>
605
605
  </element>
606
606
  </define>
607
607
  <define name="TypedTitleString">
@@ -632,10 +632,7 @@
632
632
  <attribute name="text"/>
633
633
  </optional>
634
634
  <optional>
635
- <choice>
636
- <data type="gYear"/>
637
- <data type="date"/>
638
- </choice>
635
+ <ref name="ISO8601Date"/>
639
636
  </optional>
640
637
  </define>
641
638
  <define name="bdate">
@@ -660,25 +657,16 @@
660
657
  <choice>
661
658
  <group>
662
659
  <element name="from">
663
- <choice>
664
- <data type="gYear"/>
665
- <data type="date"/>
666
- </choice>
660
+ <ref name="ISO8601Date"/>
667
661
  </element>
668
662
  <optional>
669
663
  <element name="to">
670
- <choice>
671
- <data type="gYear"/>
672
- <data type="date"/>
673
- </choice>
664
+ <ref name="ISO8601Date"/>
674
665
  </element>
675
666
  </optional>
676
667
  </group>
677
668
  <element name="on">
678
- <choice>
679
- <data type="gYear"/>
680
- <data type="date"/>
681
- </choice>
669
+ <ref name="ISO8601Date"/>
682
670
  </element>
683
671
  </choice>
684
672
  </element>
@@ -791,20 +779,12 @@
791
779
  </define>
792
780
  <define name="seriesfrom">
793
781
  <element name="from">
794
- <choice>
795
- <data type="dateTime"/>
796
- <data type="date"/>
797
- <data type="gYear"/>
798
- </choice>
782
+ <ref name="ISO8601Date"/>
799
783
  </element>
800
784
  </define>
801
785
  <define name="seriesto">
802
786
  <element name="to">
803
- <choice>
804
- <data type="dateTime"/>
805
- <data type="date"/>
806
- <data type="gYear"/>
807
- </choice>
787
+ <ref name="ISO8601Date"/>
808
788
  </element>
809
789
  </define>
810
790
  <define name="seriesnumber">
@@ -899,7 +879,7 @@
899
879
  </define>
900
880
  <define name="revision-date">
901
881
  <element name="revision-date">
902
- <data type="date"/>
882
+ <ref name="ISO8601Date"/>
903
883
  </element>
904
884
  </define>
905
885
  <define name="draft">
@@ -922,10 +902,12 @@
922
902
  <define name="AnyElement">
923
903
  <element>
924
904
  <anyName/>
925
- <choice>
926
- <text/>
927
- <ref name="AnyElement"/>
928
- </choice>
905
+ <oneOrMore>
906
+ <choice>
907
+ <text/>
908
+ <ref name="AnyElement"/>
909
+ </choice>
910
+ </oneOrMore>
929
911
  </element>
930
912
  </define>
931
913
  </grammar>
@@ -27,8 +27,8 @@ module Asciidoctor
27
27
  def pseudocode_example(node)
28
28
  noko do |xml|
29
29
  xml.figure **{id: Asciidoctor::Standoc::Utils::anchor_or_uuid(node),
30
- type: "pseudocode"} do |ex|
31
- figure_title(node, ex)
30
+ type: "pseudocode"} do |ex|
31
+ figure_title(node, ex)
32
32
  wrap_in_para(node, ex)
33
33
  end
34
34
  end.join("\n")
@@ -88,15 +88,15 @@ module Asciidoctor
88
88
  end
89
89
  end
90
90
 
91
- def dlist(node)
92
- return glossary(node) if node.attr("style") == "glossary"
93
- super
94
- end
91
+ def dlist(node)
92
+ return glossary(node) if node.attr("style") == "glossary"
93
+ super
94
+ end
95
95
 
96
- def glossary(node)
96
+ def glossary(node)
97
97
  noko do |xml|
98
98
  xml.dl **{id: Asciidoctor::Standoc::Utils::anchor_or_uuid(node),
99
- type: "glossary"} do |xml_dl|
99
+ type: "glossary"} do |xml_dl|
100
100
  node.items.each do |terms, dd|
101
101
  dt(terms, xml_dl)
102
102
  dd(dd, xml_dl)
@@ -156,6 +156,13 @@ module Asciidoctor
156
156
  d
157
157
  end
158
158
 
159
+ def init(node)
160
+ @callforpatentclaims = node.attr("call-for-patent-claims")
161
+ @commitmenttolicence = node.attr("commitment-to-licence")
162
+ @patentcontact = node.attr("patent-contact")
163
+ super
164
+ end
165
+
159
166
  def document(node)
160
167
  init(node)
161
168
  ret1 = makexml(node)
@@ -198,10 +205,74 @@ module Asciidoctor
198
205
  c.name = "executivesummary" if c&.at("./title")&.text.downcase == "executive summary"
199
206
  preface.add_child c.remove
200
207
  end
208
+ callforpatentclaims(x, preface)
209
+ end
210
+
211
+ CALL_FOR_PATENT_CLAIMS = <<~END.freeze
212
+ <clause><title>Call for Patent Claims</title>
213
+ <p>This public review includes a call for information on essential patent claims (claims whose use would be required for compliance with the guidance or requirements in this Information Technology Laboratory (ITL) draft publication). Such guidance and/or requirements may be directly stated in this ITL Publication or by reference to another publication. This call also includes disclosure, where known, of the existence of pending U.S. or foreign patent applications relating to this ITL draft publication and of any relevant unexpired U.S. or foreign patents.</p>
214
+
215
+ <p>ITL may require from the patent holder, or a party authorized to make assurances on its behalf, in written or electronic form, either:</p>
216
+
217
+ <ol><li><p>assurance in the form of a general disclaimer to the effect that such party does not hold and does not currently intend holding any essential patent claim(s); or</p></li>
218
+
219
+ <li><p>assurance that a license to such essential patent claim(s) will be made available to applicants desiring to utilize the license for the purpose of complying with the guidance or requirements in this ITL draft publication either:</p>
220
+
221
+ <ol><li><p>under reasonable terms and conditions that are demonstrably free of any unfair discrimination; or</p></li>
222
+
223
+ <li><p>without compensation and under reasonable terms and conditions that are demonstrably free of any unfair discrimination.</p></li></ol>
224
+ </li></ol>
225
+
226
+ <p>Such assurance shall indicate that the patent holder (or third party authorized to make assurances on its behalf) will include in any documents transferring ownership of patents subject to the assurance, provisions sufficient to ensure that the commitments in the assurance are binding on the transferee, and that the transferee will similarly include appropriate provisions in the event of future transfers with the goal of binding each successor-in-interest.</p>
227
+
228
+ <p>The assurance shall also indicate that it is intended to be binding on successors-in-interest regardless of whether such provisions are included in the relevant transfer documents.</p>
229
+
230
+ <p>Such statements should be addressed to: ITL-POINT-OF_CONTACT.</p>
231
+ </clause>
232
+ END
233
+
234
+ PATENT_DISCLOSURE_NOTICE1 = <<~END.freeze
235
+ <clause><title>Patent Disclosure Notice</title>
236
+ <p>NOTICE: The Information Technology Laboratory (ITL) has requested that holders of patent claims whose use may be required for compliance with the guidance or requirements of this publication disclose such patent claims to ITL. However, holders of patents are not obligated to respond to ITL calls for patents and ITL has not undertaken a patent search in order to identify which, if any, patents may apply to this publication. </p>
237
+ <p>Following the ITL call for the identification of patent claims whose use may be required for compliance with the guidance or requirements of this publication, notice of one or more such claims has been received. </p>
238
+ <p>By publication, no position is taken by ITL with respect to the validity or scope of any patent claim or of any rights in connection therewith. The known patent holder(s) has (have), however, provided to NIST a letter of assurance stating either (1) a general disclaimer to the effect that it does (they do) not hold and does (do) not currently intend holding any essential patent claim(s), or (2) that it (they) will negotiate royalty-free or royalty-bearing licenses with other parties on a demonstrably nondiscriminatory basis with reasonable terms and conditions. </p>
239
+ <p>Details may be obtained from ITL-POINT-OF_CONTACT. </p>
240
+ <p>No representation is made or implied that this is the only license that may be required to avoid patent infringement in the use of this publication. </p>
241
+ </clause>
242
+ END
243
+
244
+ PATENT_DISCLOSURE_NOTICE2 = <<~END.freeze
245
+ <clause><title>Patent Disclosure Notice</title>
246
+ <p>NOTICE: ITL has requested that holders of patent claims whose use may be required for compliance with the guidance or requirements of this publication disclose such patent claims to ITL. However, holders of patents are not obligated to respond to ITL calls for patents and ITL has not undertaken a patent search in order to identify which, if any, patents may apply to this publication.</p>
247
+ <p>As of the date of publication and following call(s) for the identification of patent claims whose use may be required for compliance with the guidance or requirements of this publication, no such patent claims have been identified to ITL.</p>
248
+ <p>No representation is made or implied by ITL that licenses are not required to avoid patent infringement in the use of this publication.</p>
249
+ </clause>
250
+ END
251
+
252
+ def callforpatentclaims(x, preface)
253
+ if @callforpatentclaims
254
+ docemail = x&.at("//uri[@type = 'email']")&.text || "???"
255
+ docnumber = x&.at("//docnumber")&.text || "???"
256
+ status = x&.at("//bibdata/status")&.text
257
+ published = status.nil? || status == "published"
258
+ preface.add_child patent_text(published, docemail, docnumber)
259
+ end
260
+ end
261
+
262
+ def patent_text(published, docemail, docnumber)
263
+ patent = (!published ? CALL_FOR_PATENT_CLAIMS :
264
+ (@commitmenttolicence ? PATENT_DISCLOSURE_NOTICE1 :
265
+ PATENT_DISCLOSURE_NOTICE2)).clone
266
+ patent.gsub(/ITL-POINT-OF_CONTACT/, published ?
267
+ (@patentcontact || docemail) :
268
+ (@patentcontact ||
269
+ "#{docemail}, with the Subject: #{docnumber} "\
270
+ "Call for Patent Claims"))
201
271
  end
202
272
 
203
273
  def make_preface(x, s)
204
- if x.at("//foreword | //introduction | //abstract | //preface")
274
+ if x.at("//foreword | //introduction | //abstract | //preface") ||
275
+ @callforpatentclaims
205
276
  preface = s.add_previous_sibling("<preface/>").first
206
277
  move_sections_into_preface(x, preface)
207
278
  summ = x.at("//executivesummary") and preface.add_child summ.remove
@@ -243,7 +314,7 @@ module Asciidoctor
243
314
  else
244
315
  if @term_def then term_def_subclause_parse(a, xml, node)
245
316
  elsif @biblio then bibliography_parse(a, xml, node)
246
- elsif node.attr("style") == "bibliography" && node.level == 1
317
+ elsif node.attr("style") == "bibliography"
247
318
  bibliography_parse(a, xml, node)
248
319
  elsif node.attr("style") == "abstract"
249
320
  abstract_parse(a, xml, node)
@@ -255,6 +326,18 @@ module Asciidoctor
255
326
  end
256
327
  end.join("\n")
257
328
  end
329
+
330
+ def section_validate(doc)
331
+ super
332
+ f = doc.xpath("//references[not(parent::clause)]/title | //clause[descendant::references][not(parent::clause)]/title")
333
+ names = f.map { |s| s&.text }
334
+ return if names.empty?
335
+ return if names == ["References"]
336
+ return if names == ["Bibliography"]
337
+ return if names == ["References", "Bibliography"]
338
+ warn "Reference clauses #{names.join(', ')} do not follow expected pattern in NIST"
339
+ end
340
+
258
341
  def html_converter(node)
259
342
  IsoDoc::NIST::HtmlConvert.new(html_extract_attributes(node))
260
343
  end
@@ -62,7 +62,8 @@ module Asciidoctor
62
62
  end
63
63
 
64
64
  def metadata_copyright(node, xml)
65
- from = node.attr("copyright-year") || node.attr("copyrightyear") || Date.today.year
65
+ from = node.attr("copyright-year") || node.attr("copyrightyear") ||
66
+ Date.today.year
66
67
  xml.copyright do |c|
67
68
  c.from from
68
69
  c.owner do |owner|
@@ -927,7 +927,12 @@
927
927
  <value>AsciiMath</value>
928
928
  </choice>
929
929
  </attribute>
930
- <text/>
930
+ <oneOrMore>
931
+ <choice>
932
+ <text/>
933
+ <ref name="AnyElement"/>
934
+ </choice>
935
+ </oneOrMore>
931
936
  </element>
932
937
  </define>
933
938
  <define name="annotation">
@@ -250,24 +250,17 @@
250
250
  <choice>
251
251
  <group>
252
252
  <element name="from">
253
- <choice>
254
- <data type="gYear"/>
255
- <data type="date"/>
256
- </choice>
253
+ <ref name="ISO8601Date"/>
257
254
  </element>
258
255
  <optional>
259
256
  <element name="to">
260
- <choice>
261
- <data type="gYear"/>
262
- <data type="date"/>
263
- </choice>
257
+ <ref name="ISO8601Date"/>
264
258
  </element>
265
259
  </optional>
266
260
  </group>
267
261
  <element name="on">
268
262
  <choice>
269
- <data type="gYear"/>
270
- <data type="date"/>
263
+ <ref name="ISO8601Date"/>
271
264
  <value>--</value>
272
265
  </choice>
273
266
  </element>
@@ -1,142 +1,142 @@
1
1
  <div class="document-stage-band" id='{{ status | downcase | replace: " ", "-" }}-band'>
2
- <p class="document-stage">{{ status }}</p>
2
+ <p class="document-stage">{{ status }}</p>
3
3
  </div>
4
4
 
5
5
  <div class="document-type-band" id='{{ doctype | downcase | replace: " ", "-" }}-band'>
6
- <p class="document-type">NIST {{ doctype }}</p>
6
+ <p class="document-type">NIST {{ doctype }}</p>
7
7
  </div>
8
8
 
9
9
 
10
10
 
11
- <div id='toggle'> <span>&#x2022;</span> </div>
11
+ <div id='toggle'> <span>&#x2022;</span> </div>
12
12
 
13
- <header>
13
+ <header>
14
14
 
15
- <!--<div class="WordSection1">-->
15
+ <!--<div class="WordSection1">-->
16
16
  <div class="coverpage">
17
17
  <div class="wrapper-top">
18
18
 
19
- <div class="rule-2"></div>
19
+ <div class="rule-2"></div>
20
20
 
21
- <div class="coverpage-doc-identity">
22
- <div class="doc-number">
23
- <div>{{ docnumber }}</div>
24
- {% if edition %} <div> Revision {{ edition }}</div> {% endif %}
25
- <div> {{ draftinfo }}</div>
26
- </div>
21
+ <div class="coverpage-doc-identity">
22
+ <div class="doc-number">
23
+ <div>{{ docnumber }}</div>
24
+ {% if edition %} <div> Revision {{ edition }}</div> {% endif %}
25
+ <div> {{ draftinfo }}</div>
26
+ </div>
27
27
 
28
- <div class="coverpage-title">
29
- <span class="title-first">{{ doctitle }}</span>
30
- {% if docsubtitle %}
31
- <br/><span class="title-second">{{ docsubtitle }}</span>
32
- {% endif %}
33
- </div>
34
- </div>
28
+ <div class="coverpage-title">
29
+ <span class="title-first">{{ doctitle }}</span>
30
+ {% if docsubtitle %}
31
+ <br/><span class="title-second">{{ docsubtitle }}</span>
32
+ {% endif %}
33
+ </div>
34
+ </div>
35
35
 
36
- <div class="coverpage-logo">
37
- <span>National Institute of Standards and Technology {{ docyear }}</span>
38
- </div>
36
+ <div class="coverpage-logo">
37
+ <span>National Institute of Standards and Technology {{ docyear }}</span>
38
+ </div>
39
39
 
40
- <div class="coverpage-tc-name">
41
- <span>{{ tc }}</span>
42
- </div>
40
+ <div class="coverpage-tc-name">
41
+ <span>{{ tc }}</span>
42
+ </div>
43
43
 
44
- <div class="rule-thick"></div>
44
+ <div class="rule-thick"></div>
45
45
 
46
- <div class="authors-container">
47
- {% for affiliation in authors_affiliations %}
48
- {% for author in affiliation[1] %}
49
- <div class="author">{{ author }}</div>
50
- {% endfor %}
51
- <div class="affiliation">{{affiliation[0]}}</div>
52
- {% endfor %}
53
- </div>
46
+ <div class="authors-container">
47
+ {% for affiliation in authors_affiliations %}
48
+ {% for author in affiliation[1] %}
49
+ <div class="author">{{ author }}</div>
50
+ {% endfor %}
51
+ <div class="affiliation">{{affiliation[0]}}</div>
52
+ {% endfor %}
53
+ </div>
54
54
 
55
- <div class="download-info">
55
+ <div class="download-info">
56
56
 
57
- This publication is available free of charge from: <br>
58
- <a href="{{url}}">{{ url }}</a>
57
+ This publication is available free of charge from: <br>
58
+ <a href="{{url}}">{{ url }}</a>
59
59
 
60
- <div class="category">{{ tc }}</div>
60
+ <div class="category">{{ tc }}</div>
61
61
 
62
- </div>
62
+ </div>
63
63
 
64
- </div>
64
+ </div>
65
65
  </div>
66
66
 
67
- <div class="logo-wrapper">
67
+ <div class="logo-wrapper">
68
68
 
69
69
  <img id="NIST-logo" src="logo.png">
70
70
  <img id="commerce-logo" src="commerce-logo-color.png">
71
71
  </div>
72
72
 
73
73
  <div class="logo-info">
74
- <p>U.S. Department of Commerce</p>
75
- <p><i>Wilbur L. Ross, Jr., Secretary</i></p>
74
+ <p>U.S. Department of Commerce</p>
75
+ <p><i>Wilbur L. Ross, Jr., Secretary</i></p>
76
76
  </div>
77
77
 
78
78
  <div class="logo-info">
79
- <p>National Institute of Standards and Technology</p>
80
- <p><i>Walter Copan, NIST Director and Under Secretary of Commerce for Standards and Technology </i></p>
79
+ <p>National Institute of Standards and Technology</p>
80
+ <p><i>Walter Copan, NIST Director and Under Secretary of Commerce for Standards and Technology </i></p>
81
81
  </div>
82
82
 
83
83
  <div class="WordSection11">
84
- <div class="coverpage-stage-block">
85
- <span class="coverpage-stage" id="{{ doctype | downcase | replace: ' ', '-' }}">{{ doctype }}</span>
86
- </div>
87
-
88
- <div class="coverpage-stage-block">
89
- <span class="coverpage-maturity" id="{{ status }}">{{ status }}</span>
90
-
91
- </div>
92
-
84
+ <div class="coverpage-stage-block">
85
+ <span class="coverpage-stage" id="{{ doctype | downcase | replace: ' ', '-' }}">{{ doctype }}</span>
86
+ </div>
93
87
 
94
- {% if unpublished %}
95
- <div class="coverpage-warning">
96
- <span class="title">Warning for Drafts</span>
88
+ <div class="coverpage-stage-block">
89
+ <span class="coverpage-maturity" id="{{ status }}">{{ status }}</span>
97
90
 
98
- <p class="content">
99
- This document is not a NIST Standard. It is distributed for review and
100
- comment, and is subject to change without notice and may not be referred to as
101
- a Standard. Recipients of this draft are invited to submit, with their
102
- comments, notification of any relevant patent rights of which they are aware
103
- and to provide supporting documentation.
104
- </p>
105
- </div>
106
- {% endif %}
107
-
108
- <div class="info-section">
109
- <div class="copyright">
110
-
111
- <p class="year">
112
- &copy; {{ docyear }} NIST.
113
- </p>
114
-
115
- <p class="message">
116
- All rights reserved. Unless otherwise specified, no part of this
117
- publication may be reproduced or utilized otherwise in any form or by any
118
- means, electronic or mechanical, including photocopying, or posting on the
119
- internet or an intranet, without prior written permission. Permission can
120
- be requested from the address below.
121
- </p>
122
-
123
- <div class="contact-info">
124
- <p class="name">National Institute of Standards and Technology</p>
125
- <p class="address">
126
- Attn: Computer Security Division, Information Technology Laboratory<br/>
127
- 100 Bureau Drive (Mail Stop 8930) Gaithersburg, MD 20899-8930<br/>
128
- United States of America<br/>
129
- <br />
130
- <a href="mailto:{{ email }}">{{ email }}</a><br />
131
- <a href="www.nist.gov">www.nist.gov</a>
132
- </p>
133
- </div>
91
+ </div>
134
92
 
135
93
 
136
- </div>
94
+ {% if unpublished %}
95
+ <div class="coverpage-warning">
96
+ <span class="title">Warning for Drafts</span>
137
97
 
138
- <div class="rule"></div>
139
- </div>
98
+ <p class="content">
99
+ This document is not a NIST Standard. It is distributed for review and
100
+ comment, and is subject to change without notice and may not be referred to as
101
+ a Standard. Recipients of this draft are invited to submit, with their
102
+ comments, notification of any relevant patent rights of which they are aware
103
+ and to provide supporting documentation.
104
+ </p>
105
+ </div>
106
+ {% endif %}
107
+
108
+ <div class="info-section">
109
+ <div class="copyright">
110
+
111
+ <p class="year">
112
+ &copy; {{ docyear }} NIST.
113
+ </p>
114
+
115
+ <p class="message">
116
+ All rights reserved. Unless otherwise specified, no part of this
117
+ publication may be reproduced or utilized otherwise in any form or by any
118
+ means, electronic or mechanical, including photocopying, or posting on the
119
+ internet or an intranet, without prior written permission. Permission can
120
+ be requested from the address below.
121
+ </p>
122
+
123
+ <div class="contact-info">
124
+ <p class="name">National Institute of Standards and Technology</p>
125
+ <p class="address">
126
+ Attn: Computer Security Division, Information Technology Laboratory<br/>
127
+ 100 Bureau Drive (Mail Stop 8930) Gaithersburg, MD 20899-8930<br/>
128
+ United States of America<br/>
129
+ <br />
130
+ <a href="mailto:{{ email }}">{{ email }}</a><br />
131
+ <a href="www.nist.gov">www.nist.gov</a>
132
+ </p>
133
+ </div>
134
+
135
+
136
+ </div>
137
+
138
+ <div class="rule"></div>
139
+ </div>
140
140
  </div>
141
141
 
142
142
 
@@ -632,7 +632,7 @@ p.Biblio, p.NormRef {
632
632
  overflow: auto;
633
633
  }
634
634
 
635
- .FigureTitle {
635
+ .FigureTitle, .SourceTitle, .AdmonitionTitle {
636
636
  font-weight: 700;
637
637
  font-size: 1em;
638
638
  text-align: center;
@@ -888,10 +888,10 @@ h2 p {
888
888
 
889
889
  .coverpage-title {
890
890
 
891
- font-family: 'Libre Baskerville', serif; }
891
+ font-family: $headerfont; }
892
892
 
893
893
  .coverpage-title span {
894
- font-family: 'Libre Baskerville', serif;
894
+ font-family: $headerfont;
895
895
  font-size: 1.1em;
896
896
  line-height: 1;
897
897
  }
@@ -157,6 +157,44 @@ p.FigureTitle
157
157
  mso-fareast-font-family:$bodyfont;
158
158
  mso-bidi-font-family:$bodyfont;
159
159
  mso-ansi-language:EN-GB;}
160
+ p.SourceTitle
161
+ {mso-style-unhide:no;
162
+ mso-style-qformat:yes;
163
+ mso-style-parent:"";
164
+ margin-top:0cm;
165
+ margin-right:0cm;
166
+ margin-bottom:6.0pt;
167
+ margin-left:0cm;
168
+ text-align:center;
169
+ line-height:12.0pt;
170
+ page-break-before:avoid;
171
+ mso-pagination:widow-orphan;
172
+ tab-stops:20.15pt;
173
+ font-size:11.0pt;
174
+ font-weight:bold;
175
+ font-family:$bodyfont;
176
+ mso-fareast-font-family:$bodyfont;
177
+ mso-bidi-font-family:$bodyfont;
178
+ mso-ansi-language:EN-GB;}
179
+ p.AdmonitionTitle
180
+ {mso-style-unhide:no;
181
+ mso-style-qformat:yes;
182
+ mso-style-parent:"";
183
+ margin-top:0cm;
184
+ margin-right:0cm;
185
+ margin-bottom:6.0pt;
186
+ margin-left:0cm;
187
+ text-align:center;
188
+ line-height:12.0pt;
189
+ page-break-after:avoid;
190
+ mso-pagination:widow-orphan;
191
+ tab-stops:20.15pt;
192
+ font-size:11.0pt;
193
+ font-weight:bold;
194
+ font-family:$bodyfont;
195
+ mso-fareast-font-family:$bodyfont;
196
+ mso-bidi-font-family:$bodyfont;
197
+ mso-ansi-language:EN-GB;}
160
198
  p.TableTitle
161
199
  {mso-style-unhide:no;
162
200
  mso-style-qformat:yes;
@@ -527,33 +565,51 @@ p.QuoteAttribution
527
565
  mso-bidi-font-family:$bodyfont;
528
566
  mso-ansi-language:EN-GB;
529
567
  }
530
- p.Admonition, li.Admonition, div.Admonition
568
+ div.Admonition {
569
+ mso-style-priority:99;
570
+ mso-pagination:widow-orphan;
571
+ padding:18.0pt 12.0pt 18.0pt 12.0pt;
572
+ margin-left:14.2pt;
573
+ margin-right:14.2pt;
574
+ border:none;
575
+ mso-element:para-border-div;
576
+ border:solid windowtext 1.0pt;
577
+ mso-border-alt:solid windowtext .5pt;
578
+ mso-padding-alt:7.0pt 4.0pt 7.0pt 4.0pt;
579
+ font-size:11.0pt;
580
+ font-family:$headerfont;
581
+ background-color: #dddddd;
582
+ mso-ascii-font-family:$headerfont;
583
+ mso-ascii-theme-font:minor-latin;
584
+ mso-fareast-font-family:$headerfont;
585
+ mso-fareast-theme-font:minor-fareast;
586
+ mso-hansi-font-family:$headerfont;
587
+ mso-hansi-theme-font:minor-latin;
588
+ mso-bidi-font-family:$headerfont;
589
+ mso-bidi-theme-font:minor-bidi;
590
+ mso-ansi-language:EN-AU;
591
+ }
592
+ p.Admonition, li.Admonition
531
593
  {mso-style-priority:99;
532
- margin-top:0cm;
533
- margin-right:57.6pt;
534
- margin-bottom:0cm;
535
- margin-left:57.6pt;
536
- margin-bottom:.0001pt;
537
594
  mso-pagination:widow-orphan;
595
+ padding:0cm;
596
+ padding:18.0pt 12.0pt 18.0pt 12.0pt;
538
597
  border:none;
539
- mso-border-alt:solid #4472C4 .25pt;
540
- mso-border-themecolor:accent1;
541
- padding:0cm;
542
- mso-padding-alt:10.0pt 10.0pt 10.0pt 10.0pt;
543
- font-size:12.0pt;
544
- font-family:$bodyfont;
545
- mso-ascii-font-family:$bodyfont;
598
+ mso-border-alt:solid .25pt;
599
+ mso-padding-alt:7.0pt 4.0pt 7.0pt 4.0pt;
600
+ font-size:11.0pt;
601
+ font-family:$headerfont;
602
+ background-color: #dddddd;
603
+ mso-ascii-font-family:$headerfont;
546
604
  mso-ascii-theme-font:minor-latin;
547
- mso-fareast-font-family:$bodyfont;
605
+ mso-fareast-font-family:$headerfont;
548
606
  mso-fareast-theme-font:minor-fareast;
549
- mso-hansi-font-family:$bodyfont;
607
+ mso-hansi-font-family:$headerfont;
550
608
  mso-hansi-theme-font:minor-latin;
551
- mso-bidi-font-family:$bodyfont;
609
+ mso-bidi-font-family:$headerfont;
552
610
  mso-bidi-theme-font:minor-bidi;
553
- color:#4472C4;
554
- mso-themecolor:accent1;
555
611
  mso-ansi-language:EN-AU;
556
- font-style:italic;}
612
+ }
557
613
  p.Code, li.Code, div.Code
558
614
  {mso-style-name:Code;
559
615
  mso-style-priority:16;
@@ -709,6 +709,7 @@ p.TOCTitle, li.TOCTitle, div.TOCTitle
709
709
  margin-bottom:12.0pt;
710
710
  margin-left:0in;
711
711
  text-align:center;
712
+ page-break-after:avoid;
712
713
  mso-pagination:none;
713
714
  mso-hyphenate:none;
714
715
  mso-layout-grid-align:none;
@@ -91,7 +91,7 @@ module IsoDoc
91
91
  end
92
92
  end
93
93
 
94
- def bibliography(isoxml, out)
94
+ def bibliography(isoxml, out)
95
95
  f = isoxml.at(ns("//bibliography/clause | //bibliography/references")) || return
96
96
  page_break(out)
97
97
  isoxml.xpath(ns("//bibliography/clause | //bibliography/references")).each do |f|
@@ -314,8 +314,8 @@ module IsoDoc
314
314
  def middle(isoxml, out)
315
315
  middle_title(out)
316
316
  clause isoxml, out
317
- annex isoxml, out
318
317
  bibliography isoxml, out
318
+ annex isoxml, out
319
319
  end
320
320
 
321
321
  def info(isoxml, out)
@@ -352,6 +352,7 @@ module IsoDoc
352
352
  end
353
353
  end
354
354
 
355
+ =begin
355
356
  def prefaceprefix(nodes)
356
357
  i = 0
357
358
  nodes.each do |n|
@@ -375,6 +376,42 @@ module IsoDoc
375
376
  hierarchical_asset_names(s, @anchors[s["id"]][:label])
376
377
  end
377
378
  end
379
+ =end
380
+
381
+ def middle_section_asset_names(d)
382
+ middle_sections =
383
+ "//xmlns:preface/child::* | //xmlns:sections/child::*"
384
+ sequential_asset_names(d.xpath(middle_sections))
385
+ end
386
+
387
+ def sequential_asset_names(clause)
388
+ super
389
+ sequential_permission_names(clause)
390
+ sequential_requirement_names(clause)
391
+ sequential_recommendation_names(clause)
392
+ end
393
+
394
+ def sequential_permission_names(clause)
395
+ clause.xpath(ns(".//permission")).each_with_index do |t, i|
396
+ next if t["id"].nil? || t["id"].empty?
397
+ @anchors[t["id"]] = anchor_struct(i + 1, t, "Permission", "permission")
398
+ end
399
+ end
400
+
401
+ def sequential_requirement_names(clause)
402
+ clause.xpath(ns(".//requirement")).each_with_index do |t, i|
403
+ next if t["id"].nil? || t["id"].empty?
404
+ @anchors[t["id"]] = anchor_struct(i + 1, t, "Requirement", "requirement")
405
+ end
406
+ end
407
+
408
+ def sequential_recommendation_names(clause)
409
+ clause.xpath(ns(".//recommendation")).each_with_index do |t, i|
410
+ next if t["id"].nil? || t["id"].empty?
411
+ @anchors[t["id"]] = anchor_struct(i + 1, t, "Recommendation", "recommendation")
412
+ end
413
+ end
414
+
378
415
 
379
416
  def hierarchical_asset_names(clause, num)
380
417
  super
@@ -12,10 +12,10 @@ module IsoDoc
12
12
  super
13
13
  end
14
14
  def convert1(docxml, filename, dir)
15
- FileUtils.cp html_doc_path('logo.png'), "logo.png"
16
- FileUtils.cp html_doc_path('commerce-logo-color.png'), "commerce-logo-color.png"
17
- @files_to_delete << "logo.png"
18
- @files_to_delete << "commerce-logo-color.png"
15
+ FileUtils.cp html_doc_path('logo.png'), File.join(@localdir, "logo.png")
16
+ FileUtils.cp html_doc_path('commerce-logo-color.png'), File.join(@localdir, "commerce-logo-color.png")
17
+ @files_to_delete << File.join(@localdir, "logo.png")
18
+ @files_to_delete << File.join(@localdir, "commerce-logo-color.png")
19
19
  super
20
20
  end
21
21
 
@@ -295,8 +295,8 @@ module IsoDoc
295
295
  def middle(isoxml, out)
296
296
  middle_title(out)
297
297
  clause isoxml, out
298
- annex isoxml, out
299
298
  bibliography isoxml, out
299
+ annex isoxml, out
300
300
  end
301
301
 
302
302
  def bibliography(isoxml, out)
@@ -349,28 +349,37 @@ module IsoDoc
349
349
  end
350
350
  end
351
351
 
352
+ def middle_section_asset_names(d)
353
+ middle_sections =
354
+ "//xmlns:preface/child::* | //xmlns:sections/child::*"
355
+ sequential_asset_names(d.xpath(middle_sections))
356
+ end
352
357
 
353
- def prefaceprefix(nodes)
354
- i = 0
355
- nodes.each do |n|
356
- case n.name
357
- when "executivesummary" then @anchors[n["id"]][:prefix] = "ES"
358
- when "abstract" then @anchors[n["id"]][:prefix] = "ABS"
359
- when "reviewernote" then @anchors[n["id"]][:prefix] = "NTR"
360
- else
361
- @anchors[n["id"]][:prefix] = "PR" + i.to_s
362
- i += 1
363
- end
358
+ def sequential_asset_names(clause)
359
+ super
360
+ sequential_permission_names(clause)
361
+ sequential_requirement_names(clause)
362
+ sequential_recommendation_names(clause)
363
+ end
364
+
365
+ def sequential_permission_names(clause)
366
+ clause.xpath(ns(".//permission")).each_with_index do |t, i|
367
+ next if t["id"].nil? || t["id"].empty?
368
+ @anchors[t["id"]] = anchor_struct(i + 1, t, "Permission", "permission")
364
369
  end
365
370
  end
366
371
 
367
- def middle_section_asset_names(d)
368
- prefaceprefix(d.xpath("//xmlns:preface/child::*"))
369
- d.xpath("//xmlns:preface/child::*").each do |s|
370
- hierarchical_asset_names(s, @anchors[s["id"]][:prefix])
372
+ def sequential_requirement_names(clause)
373
+ clause.xpath(ns(".//requirement")).each_with_index do |t, i|
374
+ next if t["id"].nil? || t["id"].empty?
375
+ @anchors[t["id"]] = anchor_struct(i + 1, t, "Requirement", "requirement")
371
376
  end
372
- d.xpath("//xmlns:sections/child::*").each do |s|
373
- hierarchical_asset_names(s, @anchors[s["id"]][:label])
377
+ end
378
+
379
+ def sequential_recommendation_names(clause)
380
+ clause.xpath(ns(".//recommendation")).each_with_index do |t, i|
381
+ next if t["id"].nil? || t["id"].empty?
382
+ @anchors[t["id"]] = anchor_struct(i + 1, t, "Recommendation", "recommendation")
374
383
  end
375
384
  end
376
385
 
@@ -219,7 +219,8 @@ module IsoDoc
219
219
  isoxml.xpath(ns("//bibliography/clause | "\
220
220
  "//bibliography/references")).each do |f|
221
221
  out.div do |div|
222
- div.p **{ class: "h1Annex" } do |h1|
222
+ #div.p **{ class: "h1Annex" } do |h1|
223
+ div.h1 do |h1|
223
224
  f&.at(ns("./title"))&.children.each { |n| parse(n, h1) }
224
225
  end
225
226
  f.elements.reject do |e|
@@ -243,7 +244,8 @@ module IsoDoc
243
244
  def keywords(_docxml, out)
244
245
  kw = @meta.get[:keywords]
245
246
  kw.empty? and return
246
- out.div **{ class: "Section3" } do |div|
247
+ #out.div **{ class: "Section3" } do |div|
248
+ out.div do |div|
247
249
  clause_name(nil, "Keywords", div, class: "IntroTitle")
248
250
  div.p kw.sort.join("; ")
249
251
  end
@@ -259,10 +261,12 @@ module IsoDoc
259
261
  isoxml.xpath(ns(FRONT_CLAUSE)).each do |c|
260
262
  foreword(isoxml, out) and next if c.name == "foreword"
261
263
  next if skip_render(c, isoxml)
264
+ title = c&.at(ns("./title"))
265
+ patent = ["Call for Patent Claims", "Patent Disclosure Notice"].include? title&.text
262
266
  out.div **attr_code(id: c["id"]) do |s|
263
- clause_name(get_anchors[c['id']][:label],
264
- c&.at(ns("./title"))&.content, s,
265
- class: c.name == "executivesummary" ? "NormalTitle" :
267
+ page_break(s) if patent
268
+ clause_name(get_anchors[c['id']][:label], title&.content, s,
269
+ class: (c.name == "executivesummary") ? "NormalTitle" :
266
270
  "IntroTitle")
267
271
  c.elements.reject { |c1| c1.name == "title" }.each do |c1|
268
272
  parse(c1, s)
@@ -449,8 +453,8 @@ module IsoDoc
449
453
  # NIST documents don't repeat the title
450
454
  # middle_title(out)
451
455
  clause isoxml, out
452
- annex isoxml, out
453
456
  bibliography isoxml, out
457
+ annex isoxml, out
454
458
  end
455
459
 
456
460
  def info(isoxml, out)
@@ -487,31 +491,41 @@ module IsoDoc
487
491
  end
488
492
  end
489
493
 
494
+ def middle_section_asset_names(d)
495
+ middle_sections =
496
+ "//xmlns:preface/child::* | //xmlns:sections/child::*"
497
+ sequential_asset_names(d.xpath(middle_sections))
498
+ end
490
499
 
491
- def prefaceprefix(nodes)
492
- i = 0
493
- nodes.each do |n|
494
- case n.name
495
- when "executivesummary" then @anchors[n["id"]][:prefix] = "ES"
496
- when "abstract" then @anchors[n["id"]][:prefix] = "ABS"
497
- when "reviewernote" then @anchors[n["id"]][:prefix] = "NTR"
498
- else
499
- @anchors[n["id"]][:prefix] = "PR" + i.to_s
500
- i += 1
501
- end
500
+ def sequential_asset_names(clause)
501
+ super
502
+ sequential_permission_names(clause)
503
+ sequential_requirement_names(clause)
504
+ sequential_recommendation_names(clause)
505
+ end
506
+
507
+ def sequential_permission_names(clause)
508
+ clause.xpath(ns(".//permission")).each_with_index do |t, i|
509
+ next if t["id"].nil? || t["id"].empty?
510
+ @anchors[t["id"]] = anchor_struct(i + 1, t, "Permission", "permission")
502
511
  end
503
512
  end
504
513
 
505
- def middle_section_asset_names(d)
506
- prefaceprefix(d.xpath("//xmlns:preface/child::*"))
507
- d.xpath("//xmlns:preface/child::*").each do |s|
508
- hierarchical_asset_names(s, @anchors[s["id"]][:prefix])
514
+ def sequential_requirement_names(clause)
515
+ clause.xpath(ns(".//requirement")).each_with_index do |t, i|
516
+ next if t["id"].nil? || t["id"].empty?
517
+ @anchors[t["id"]] = anchor_struct(i + 1, t, "Requirement", "requirement")
509
518
  end
510
- d.xpath("//xmlns:sections/child::*").each do |s|
511
- hierarchical_asset_names(s, @anchors[s["id"]][:label])
519
+ end
520
+
521
+ def sequential_recommendation_names(clause)
522
+ clause.xpath(ns(".//recommendation")).each_with_index do |t, i|
523
+ next if t["id"].nil? || t["id"].empty?
524
+ @anchors[t["id"]] = anchor_struct(i + 1, t, "Recommendation", "recommendation")
512
525
  end
513
526
  end
514
527
 
528
+
515
529
  def hierarchical_asset_names(clause, num)
516
530
  super
517
531
  hierarchical_permission_names(clause, num)
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module NIST
3
- VERSION = "0.0.3"
3
+ VERSION = "0.0.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-nist
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-01-31 00:00:00.000000000 Z
11
+ date: 2019-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor