metanorma-nist 0.2.12 → 0.2.13

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: 18066163fe2d1a7b3a3b7908653d02db8b2c234980a714e6025054989518e223
4
- data.tar.gz: b899172a1d0e7cecf9fc29b50ea8b2ceade96893b6362afd4ae7ec0c581d7805
3
+ metadata.gz: '0358fc3c71f2a0379e237955bf326de2fc3ef23dfbe1037439fa1675e6146204'
4
+ data.tar.gz: 3db63a1cdc702ae79bd8e8fd93aa0b4949ab48edca044c75e33fc7935d0d3ef0
5
5
  SHA512:
6
- metadata.gz: 428aeef37e0d21eac1172bb2b9d0175ef35793e75cfdc6bff24f453df25a21d970c8251f27b19646d0100c9651577862d3a7df36a233730f0ccb8ac9183da87a
7
- data.tar.gz: fa6f9a7a182400ec0c35e171c02f13f8a8de3ef3c42ff0e5dc0f373e8090acd7088170009de33aeb598c32a702adc4cc917409c47990afd0b7637a995d364349
6
+ metadata.gz: 9759b0496b5a6e336976ddfe9d0def562c912714db5d71d42ffe37879e39e6d0f054034f096cfc012fb02500c80a69fbda6329a872a2158222fe2f6a50b1b0a4
7
+ data.tar.gz: 0f311aeeea52c4bccf0ddea2ebcb1301e9aeab6222f7cd8c72aa1c9d81d97d11b7b10787adb2d00c2006ba21e6f0533531c66aa6f488c8c13b21c2425ab8990a
@@ -92,19 +92,15 @@ module Asciidoctor
92
92
  </clause>
93
93
  END
94
94
 
95
- def boilerplate(x_orig)
96
- x = x_orig.dup
97
- x.root.add_namespace(nil, EXAMPLE_NAMESPACE)
98
- x = Nokogiri::XML(x.to_xml)
99
- conv = IsoDoc::NIST::HtmlConvert.new({})
100
- conv.i18n_init("en", "Latn")
101
- conv.metadata_init("en", "Latn", {})
102
- conv.info(x, nil)
95
+ def boilerplate_isodoc(xmldoc)
96
+ conv = super
103
97
  conv.labels = conv.labels.merge({nist_division: @nistdivision,
104
98
  nist_division_address: @nistdivisionaddress})
105
- file = @boilerplateauthority ? "#{@localdir}/#{@boilerplateauthority}" :
106
- File.join(File.dirname(__FILE__), @series == "nist-cswp" ? "nist_intro_cswp.xml" : "nist_intro.xml")
107
- conv.populate_template((File.read(file, encoding: "UTF-8")), nil)
99
+ conv
100
+ end
101
+
102
+ def boilerplate_file(xmldoc)
103
+ File.join(@libdir, @series == "nist-cswp" ? "nist_intro_cswp.xml" : "nist_intro.xml")
108
104
  end
109
105
  end
110
106
  end
@@ -56,6 +56,7 @@ module Asciidoctor
56
56
  end
57
57
  end
58
58
 
59
+ =begin
59
60
  def move_authority_before_preface(x, preface)
60
61
  if x.at("//boilerplate")
61
62
  boilerplate = x.at("//boilerplate")
@@ -64,9 +65,10 @@ module Asciidoctor
64
65
  preface.previous = boilerplate(x)
65
66
  end
66
67
  end
68
+ =end
67
69
 
68
70
  def move_sections_into_preface(x, preface)
69
- move_authority_before_preface(x, preface)
71
+ #move_authority_before_preface(x, preface)
70
72
  abstract = x.at("//abstract") and preface.add_child abstract.remove
71
73
  foreword = x.at("//foreword") and preface.add_child foreword.remove
72
74
  intro = x.at("//introduction") and preface.add_child intro.remove
@@ -137,21 +139,30 @@ module Asciidoctor
137
139
  ret
138
140
  end
139
141
 
142
+ TERM_CLAUSE = "//sections/terms | "\
143
+ "//sections/clause[descendant::terms] | "\
144
+ "//annex/terms | "\
145
+ "//annex[descendant::terms] ".freeze
146
+
147
+ def boilerplate_cleanup(xmldoc)
148
+ #require "byebug"; byebug
149
+ super
150
+ end
151
+
152
+ =begin
140
153
  TERM_CLAUSE = "//sections/terms | "\
141
154
  "//sections/clause[descendant::terms] | "\
142
155
  "//annex/terms | "\
143
156
  "//annex/clause[descendant::terms] ".freeze
144
157
 
145
158
  def boilerplate_cleanup(xmldoc)
146
- isodoc = IsoDoc::Convert.new({})
147
- @lang = xmldoc&.at("//bibdata/language")&.text
148
- @script = xmldoc&.at("//bibdata/script")&.text
149
- isodoc.i18n_init(@lang, @script)
159
+ isodoc = boilerplate_isodoc(xmldoc)
150
160
  f = xmldoc.at(self.class::TERM_CLAUSE) and
151
161
  term_defs_boilerplate(f.at("../title"),
152
162
  xmldoc.xpath(".//termdocsource"),
153
163
  f.at(".//term"), f.at(".//p"), isodoc)
154
164
  end
165
+ =end
155
166
 
156
167
  def sort_biblio(bib)
157
168
  @citation_order = {}
@@ -107,7 +107,6 @@ module Asciidoctor
107
107
  @commitmenttolicence = node.attr("commitment-to-licence")
108
108
  @patentcontact = node.attr("patent-contact")
109
109
  @biblioasappendix = node.attr("biblio-as-appendix")
110
- @boilerplateauthority = node.attr("boilerplate-authority")
111
110
  @nistdivision = node.attr("nist-division") ||
112
111
  "Computer Security Division, Information Technology Laboratory"
113
112
  @nistdivisionaddress = node.attr("nist-division-address") ||
@@ -1,6 +1,7 @@
1
1
  require "isodoc"
2
2
  require_relative "metadata"
3
3
  require_relative "xrefs"
4
+ require_relative "refs"
4
5
  require "fileutils"
5
6
 
6
7
  module IsoDoc
@@ -96,27 +97,13 @@ module IsoDoc
96
97
  when "requirement" then requirement_parse(node, out)
97
98
  when "permission" then permission_parse(node, out)
98
99
  when "errata" then errata_parse(node, out)
99
- when "legal-statement" then children_parse(node, out)
100
- when "license-statement" then children_parse(node, out)
101
- when "feedback-statement" then children_parse(node, out)
102
100
  else
103
101
  super
104
102
  end
105
103
  end
106
104
 
107
105
  def boilerplate(node, out)
108
- boilerplate = node.at(ns("//boilerplate")) or return
109
- out.div **{class: "authority"} do |s|
110
- boilerplate.children.each do |n|
111
- if n.name == "title"
112
- s.h1 do |h|
113
- n.children.each { |nn| parse(nn, h) }
114
- end
115
- else
116
- parse(n, s)
117
- end
118
- end
119
- end
106
+ super
120
107
  page_break(out)
121
108
  end
122
109
 
@@ -170,8 +157,6 @@ module IsoDoc
170
157
  "//terms[parent::sections]".freeze
171
158
 
172
159
  def middle(isoxml, out)
173
- # NIST documents don't repeat the title
174
- #middle_title(out)
175
160
  clause isoxml, out
176
161
  bibliography isoxml, out
177
162
  annex isoxml, out
@@ -235,57 +220,6 @@ module IsoDoc
235
220
  end
236
221
  end
237
222
 
238
- NIST_PUBLISHER_XPATH =
239
- "./contributor[xmlns:role/@type = 'publisher']/"\
240
- "organization[abbreviation = 'NIST' or xmlns:name = 'NIST']".freeze
241
-
242
- # we are taking the ref number/code out as prefix to reference
243
- def nonstd_bibitem(list, b, ordinal, bibliography)
244
- list.p **attr_code(iso_bibitem_entry_attrs(b, bibliography)) do |r|
245
- if !b.at(ns("./formattedref"))
246
- nist_reference_format(b, r)
247
- else
248
- reference_format(b, r)
249
- end
250
- end
251
- end
252
-
253
- def std_bibitem_entry(list, b, ordinal, biblio)
254
- nonstd_bibitem(list, b, ordinal, biblio)
255
- end
256
-
257
- def reference_format(b, r)
258
- id = bibitem_ref_code(b)
259
- code = render_identifier(id)
260
- if id["type"] == "metanorma"
261
- r << "[#{code}] "
262
- insert_tab(r, 1)
263
- end
264
- reference_format1(b, r)
265
- r << " [#{code}] " unless id["type"] == "metanorma"
266
- end
267
-
268
- def reference_format1(b, r)
269
- if ftitle = b.at(ns("./formattedref"))
270
- ftitle&.children&.each { |n| parse(n, r) }
271
- else
272
- title = b.at(ns("./title[@language = '#{@language}']")) || b.at(ns("./title"))
273
- r.i do |i|
274
- title&.children&.each { |n| parse(n, i) }
275
- end
276
- end
277
- end
278
-
279
- def omit_docid_prefix(prefix)
280
- return true if prefix.nil? || prefix.empty?
281
- super || prefix == "NIST"
282
- end
283
-
284
- def nist_reference_format(b, r)
285
- bibitem = b.dup.to_xml
286
- r.parent.add_child ::Iso690Render.render(bibitem, true)
287
- end
288
-
289
223
  def foreword(isoxml, out)
290
224
  f = isoxml.at(ns("//foreword")) || return
291
225
  out.div **attr_code(id: f["id"]) do |s|
@@ -423,13 +423,36 @@ p.IntroTitle, li.IntroTitle, div.IntroTitle
423
423
  tab-stops:20.15pt;
424
424
  font-size:14.0pt;
425
425
  mso-bidi-font-size:11.0pt;
426
- page-break-before:always;
427
426
  font-family:$headerfont;
428
427
  mso-fareast-font-family:$headerfont;
429
428
  mso-bidi-font-family:$headerfont;
430
429
  mso-ansi-language:EN-GB;
431
430
  font-weight:bold;
431
+ page-break-before:always;
432
432
  mso-bidi-font-weight:normal;}
433
+ p.TitlePageSubhead, li.TitlePageSubhead, div.TitlePageSubhead {
434
+ mso-style-noshow:yes;
435
+ mso-style-unhide:no;
436
+ mso-style-parent:"Foreword Title";
437
+ margin-top:0cm;
438
+ margin-right:0cm;
439
+ margin-bottom:15.5pt;
440
+ margin-left:0cm;
441
+ text-align:center;
442
+ line-height:15.5pt;
443
+ mso-pagination:widow-orphan;
444
+ page-break-after:avoid;
445
+ mso-hyphenate:none;
446
+ tab-stops:20.15pt;
447
+ font-size:14.0pt;
448
+ mso-bidi-font-size:11.0pt;
449
+ font-family:$headerfont;
450
+ mso-fareast-font-family:$headerfont;
451
+ mso-bidi-font-family:$headerfont;
452
+ mso-ansi-language:EN-GB;
453
+ font-weight:bold;
454
+ mso-bidi-font-weight:normal;
455
+ }
433
456
  p.Terms, li.Terms, div.Terms
434
457
  {mso-style-name:"Term\(s\)";
435
458
  mso-style-priority:8;
@@ -770,6 +793,34 @@ div.WordSection1
770
793
  mso-even-footer:url("file:///C:/Doc/FILENAME_files/header.html") ef2;
771
794
  mso-footer:url("file:///C:/Doc/FILENAME_files/header.html") f2;
772
795
  mso-paper-source:0;}
796
+ @page WordSection2L {
797
+ size:11.0in 8.5in;
798
+ margin:1.0in 1.0in 1.0in 1.0in;
799
+ mso-header-margin:0.5in;
800
+ mso-footer-margin:0.5in;
801
+ {% if status == "Public Draft" %}
802
+ mso-line-numbers-count-by:1;
803
+ mso-line-numbers-restart:continuous;
804
+ {% endif %}
805
+ mso-even-header:url("file:///C:/Doc/FILENAME_files/header.html") eh2;
806
+ mso-header:url("file:///C:/Doc/FILENAME_files/header.html") h2;
807
+ mso-even-footer:url("file:///C:/Doc/FILENAME_files/header.html") ef2;
808
+ mso-footer:url("file:///C:/Doc/FILENAME_files/header.html") f2;
809
+ mso-paper-source:0;}
810
+ @page WordSection2P {
811
+ size:8.5in 11.0in;
812
+ margin:1.0in 1.0in 1.0in 1.0in;
813
+ mso-header-margin:0.5in;
814
+ mso-footer-margin:0.5in;
815
+ {% if status == "Public Draft" %}
816
+ mso-line-numbers-count-by:1;
817
+ mso-line-numbers-restart:continuous;
818
+ {% endif %}
819
+ mso-even-header:url("file:///C:/Doc/FILENAME_files/header.html") eh2;
820
+ mso-header:url("file:///C:/Doc/FILENAME_files/header.html") h2;
821
+ mso-even-footer:url("file:///C:/Doc/FILENAME_files/header.html") ef2;
822
+ mso-footer:url("file:///C:/Doc/FILENAME_files/header.html") f2;
823
+ mso-paper-source:0;}
773
824
  div.WordSection2
774
825
  {page:WordSection2;}
775
826
  @page WordSection3 {
@@ -787,6 +838,34 @@ div.WordSection2
787
838
  mso-even-footer:url("file:///C:/Doc/FILENAME_files/header.html") ef3;
788
839
  mso-footer:url("file:///C:/Doc/FILENAME_files/header.html") f3;
789
840
  mso-paper-source:0;}
841
+ @page WordSection3L {
842
+ size:11.0in 8.5in;
843
+ margin:1.0in 1.0in 1.0in 1.0in;
844
+ mso-header-margin:0.5in;
845
+ mso-footer-margin:0.5in;
846
+ {% if status == "Public Draft" %}
847
+ mso-line-numbers-count-by:1;
848
+ mso-line-numbers-restart:continuous;
849
+ {% endif %}
850
+ mso-even-header:url("file:///C:/Doc/FILENAME_files/header.html") eh2;
851
+ mso-header:url("file:///C:/Doc/FILENAME_files/header.html") h2;
852
+ mso-even-footer:url("file:///C:/Doc/FILENAME_files/header.html") ef3;
853
+ mso-footer:url("file:///C:/Doc/FILENAME_files/header.html") f3;
854
+ mso-paper-source:0;}
855
+ @page WordSection3P {
856
+ size:8.5in 11.0in;
857
+ margin:1.0in 1.0in 1.0in 1.0in;
858
+ mso-header-margin:0.5in;
859
+ mso-footer-margin:0.5in;
860
+ {% if status == "Public Draft" %}
861
+ mso-line-numbers-count-by:1;
862
+ mso-line-numbers-restart:continuous;
863
+ {% endif %}
864
+ mso-even-header:url("file:///C:/Doc/FILENAME_files/header.html") eh2;
865
+ mso-header:url("file:///C:/Doc/FILENAME_files/header.html") h2;
866
+ mso-even-footer:url("file:///C:/Doc/FILENAME_files/header.html") ef3;
867
+ mso-footer:url("file:///C:/Doc/FILENAME_files/header.html") f3;
868
+ mso-paper-source:0;}
790
869
  div.WordSection3
791
870
  {page:WordSection3;}
792
871
  table.MsoISOTable
@@ -373,13 +373,36 @@ p.IntroTitle, li.IntroTitle, div.IntroTitle
373
373
  tab-stops:20.15pt;
374
374
  font-size:14.0pt;
375
375
  mso-bidi-font-size:11.0pt;
376
- page-break-before:always;
377
376
  font-family:$headerfont;
378
377
  mso-fareast-font-family:$headerfont;
379
378
  mso-bidi-font-family:$headerfont;
380
379
  mso-ansi-language:EN-GB;
381
380
  font-weight:bold;
381
+ page-break-before:always;
382
382
  mso-bidi-font-weight:normal;}
383
+ p.TitlePageSubhead, li.TitlePageSubhead, div.TitlePageSubhead {
384
+ mso-style-noshow:yes;
385
+ mso-style-unhide:no;
386
+ mso-style-parent:"Foreword Title";
387
+ margin-top:0cm;
388
+ margin-right:0cm;
389
+ margin-bottom:15.5pt;
390
+ margin-left:0cm;
391
+ text-align:center;
392
+ line-height:15.5pt;
393
+ mso-pagination:widow-orphan;
394
+ page-break-after:avoid;
395
+ mso-hyphenate:none;
396
+ tab-stops:20.15pt;
397
+ font-size:14.0pt;
398
+ mso-bidi-font-size:11.0pt;
399
+ font-family:$headerfont;
400
+ mso-fareast-font-family:$headerfont;
401
+ mso-bidi-font-family:$headerfont;
402
+ mso-ansi-language:EN-GB;
403
+ font-weight:bold;
404
+ mso-bidi-font-weight:normal;
405
+ }
383
406
  p.Terms, li.Terms, div.Terms
384
407
  {mso-style-name:"Term\(s\)";
385
408
  mso-style-priority:8;
@@ -722,6 +745,34 @@ div.WordSection1
722
745
  mso-even-footer:url("file:///C:/Doc/FILENAME_files/header.html") ef1;
723
746
  mso-footer:url("file:///C:/Doc/FILENAME_files/header.html") f2;
724
747
  mso-paper-source:0;}
748
+ @page WordSection2L {
749
+ size:11.0in 8.5in;
750
+ margin:1.0in 1.0in 1.0in 1.0in;
751
+ mso-header-margin:0.5in;
752
+ mso-footer-margin:0.5in;
753
+ {% if status == "Public Draft" %}
754
+ mso-line-numbers-count-by:1;
755
+ mso-line-numbers-restart:continuous;
756
+ {% endif %}
757
+ mso-first-header:url("file:///C:/Doc/FILENAME_files/header.html") fh1;
758
+ mso-header:url("file:///C:/Doc/FILENAME_files/header.html") h1;
759
+ mso-even-footer:url("file:///C:/Doc/FILENAME_files/header.html") ef1;
760
+ mso-footer:url("file:///C:/Doc/FILENAME_files/header.html") f2;
761
+ mso-paper-source:0;}
762
+ @page WordSection2P {
763
+ size:8.5in 11.0in;
764
+ margin:1.0in 1.0in 1.0in 1.0in;
765
+ mso-header-margin:0.5in;
766
+ mso-footer-margin:0.5in;
767
+ {% if status == "Public Draft" %}
768
+ mso-line-numbers-count-by:1;
769
+ mso-line-numbers-restart:continuous;
770
+ {% endif %}
771
+ mso-first-header:url("file:///C:/Doc/FILENAME_files/header.html") fh1;
772
+ mso-header:url("file:///C:/Doc/FILENAME_files/header.html") h1;
773
+ mso-even-footer:url("file:///C:/Doc/FILENAME_files/header.html") ef1;
774
+ mso-footer:url("file:///C:/Doc/FILENAME_files/header.html") f2;
775
+ mso-paper-source:0;}
725
776
  div.WordSection2
726
777
  {page:WordSection2;}
727
778
  @page WordSection3 {
@@ -739,6 +790,34 @@ div.WordSection2
739
790
  mso-even-footer:url("file:///C:/Doc/FILENAME_files/header.html") ef3;
740
791
  mso-footer:url("file:///C:/Doc/FILENAME_files/header.html") f3;
741
792
  mso-paper-source:0;}
793
+ @page WordSection3L {
794
+ size:11.0in 8.5in;
795
+ margin:1.0in 1.0in 1.0in 1.0in;
796
+ mso-header-margin:0.5in;
797
+ mso-footer-margin:0.5in;
798
+ {% if status == "Public Draft" %}
799
+ mso-line-numbers-count-by:1;
800
+ mso-line-numbers-restart:continuous;
801
+ {% endif %}
802
+ mso-first-header:url("file:///C:/Doc/FILENAME_files/header.html") fh1;
803
+ mso-header:url("file:///C:/Doc/FILENAME_files/header.html") h1;
804
+ mso-even-footer:url("file:///C:/Doc/FILENAME_files/header.html") ef3;
805
+ mso-footer:url("file:///C:/Doc/FILENAME_files/header.html") f3;
806
+ mso-paper-source:0;}
807
+ @page WordSection3P {
808
+ size:8.5in 11.0in;
809
+ margin:1.0in 1.0in 1.0in 1.0in;
810
+ mso-header-margin:0.5in;
811
+ mso-footer-margin:0.5in;
812
+ {% if status == "Public Draft" %}
813
+ mso-line-numbers-count-by:1;
814
+ mso-line-numbers-restart:continuous;
815
+ {% endif %}
816
+ mso-first-header:url("file:///C:/Doc/FILENAME_files/header.html") fh1;
817
+ mso-header:url("file:///C:/Doc/FILENAME_files/header.html") h1;
818
+ mso-even-footer:url("file:///C:/Doc/FILENAME_files/header.html") ef3;
819
+ mso-footer:url("file:///C:/Doc/FILENAME_files/header.html") f3;
820
+ mso-paper-source:0;}
742
821
  div.WordSection3
743
822
  {page:WordSection3;}
744
823
  table.MsoISOTable
@@ -104,12 +104,6 @@ module IsoDoc
104
104
  requirement_cleanup(docxml)
105
105
  end
106
106
 
107
- def html_preface(docxml)
108
- super
109
- authority_cleanup(docxml)
110
- docxml
111
- end
112
-
113
107
  def make_body3(body, docxml)
114
108
  body.div **{ class: "main-section" } do |div3|
115
109
  foreword docxml, div3
@@ -109,12 +109,6 @@ module IsoDoc
109
109
  requirement_cleanup(docxml)
110
110
  end
111
111
 
112
- def html_preface(docxml)
113
- super
114
- authority_cleanup(docxml)
115
- docxml
116
- end
117
-
118
112
  def bibliography(isoxml, out)
119
113
  f = isoxml.at(ns("//bibliography/clause | //bibliography/references")) || return
120
114
  page_break(out)
@@ -0,0 +1,56 @@
1
+ module IsoDoc
2
+ module NIST
3
+ module BaseConvert
4
+ NIST_PUBLISHER_XPATH =
5
+ "./contributor[xmlns:role/@type = 'publisher']/"\
6
+ "organization[abbreviation = 'NIST' or xmlns:name = 'NIST']".freeze
7
+
8
+ # we are taking the ref number/code out as prefix to reference
9
+ def nonstd_bibitem(list, b, ordinal, bibliography)
10
+ list.p **attr_code(iso_bibitem_entry_attrs(b, bibliography)) do |r|
11
+ if !b.at(ns("./formattedref"))
12
+ nist_reference_format(b, r)
13
+ else
14
+ reference_format(b, r)
15
+ end
16
+ end
17
+ end
18
+
19
+ def std_bibitem_entry(list, b, ordinal, biblio)
20
+ nonstd_bibitem(list, b, ordinal, biblio)
21
+ end
22
+
23
+ def reference_format(b, r)
24
+ id = bibitem_ref_code(b)
25
+ code = render_identifier(id)
26
+ if id["type"] == "metanorma"
27
+ r << "[#{code}] "
28
+ insert_tab(r, 1)
29
+ end
30
+ reference_format1(b, r)
31
+ r << " [#{code}] " unless id["type"] == "metanorma"
32
+ end
33
+
34
+ def reference_format1(b, r)
35
+ if ftitle = b.at(ns("./formattedref"))
36
+ ftitle&.children&.each { |n| parse(n, r) }
37
+ else
38
+ title = b.at(ns("./title[@language = '#{@language}']")) || b.at(ns("./title"))
39
+ r.i do |i|
40
+ title&.children&.each { |n| parse(n, i) }
41
+ end
42
+ end
43
+ end
44
+
45
+ def omit_docid_prefix(prefix)
46
+ return true if prefix.nil? || prefix.empty?
47
+ super || prefix == "NIST"
48
+ end
49
+
50
+ def nist_reference_format(b, r)
51
+ bibitem = b.dup.to_xml
52
+ r.parent.add_child ::Iso690Render.render(bibitem, true)
53
+ end
54
+ end
55
+ end
56
+ end
@@ -20,10 +20,6 @@ module IsoDoc
20
20
  @bibliographycount =
21
21
  docxml.xpath(ns("//bibliography/references | //annex/references | "\
22
22
  "//bibliography/clause/references")).size
23
- #FileUtils.cp html_doc_path(@series == "NIST CSWP" ? "logo_cswp.png" :
24
- #"logo.png"), "#{@localdir}/logo.png"
25
- #FileUtils.cp html_doc_path("deptofcommerce.png"),
26
- #"#{@localdir}/deptofcommerce.png"
27
23
  if @series == "NIST CSWP"
28
24
  @wordstylesheet_name = html_doc_path("wordstyle_cswp.scss")
29
25
  @standardstylesheet_name = html_doc_path("nist_cswp.scss")
@@ -88,7 +84,7 @@ module IsoDoc
88
84
  h.name = p
89
85
  h["class"] = "IntroTitle"
90
86
  end
91
- dest1 = docxml.xpath("//div[@class = 'authority6']")
87
+ dest1 = docxml.xpath("//div[@class = 'authority6' and not(@id = 'authority6')]")
92
88
  auth1 = docxml&.at("//div[@id = 'authority6']")&.remove
93
89
  dest1 and auth1 and dest1.each { |d| d.replace(auth1) }
94
90
  insert = docxml.at("//div[@class = 'WordSection2']")
@@ -96,6 +92,10 @@ module IsoDoc
96
92
  auth = docxml&.at("//div[@class = 'authority']")&.remove || return
97
93
  insert.children.first.add_previous_sibling(auth)
98
94
  end
95
+ authority_cleanup1(docxml)
96
+ end
97
+
98
+ def authority_cleanup1(docxml)
99
99
  a = docxml.at("//div[@id = 'authority1']") and a["class"] = "authority1"
100
100
  a = docxml.at("//div[@id = 'authority2']") and a["class"] = "authority2"
101
101
  a = docxml.at("//div[@id = 'authority3']") and a["class"] = "authority3"
@@ -235,7 +235,6 @@ module IsoDoc
235
235
  def word_cleanup(docxml)
236
236
  super
237
237
  word_preface_cleanup(docxml)
238
- authority_cleanup(docxml)
239
238
  docxml
240
239
  end
241
240
 
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module NIST
3
- VERSION = "0.2.12"
3
+ VERSION = "0.2.13"
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.2.12
4
+ version: 0.2.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-01-17 00:00:00.000000000 Z
11
+ date: 2020-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlentities
@@ -294,6 +294,7 @@ files:
294
294
  - lib/isodoc/nist/i18n-en.yaml
295
295
  - lib/isodoc/nist/metadata.rb
296
296
  - lib/isodoc/nist/pdf_convert.rb
297
+ - lib/isodoc/nist/refs.rb
297
298
  - lib/isodoc/nist/render.rb
298
299
  - lib/isodoc/nist/word_convert.rb
299
300
  - lib/isodoc/nist/xrefs.rb