metanorma-nist 1.0.6 → 1.0.7

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: d4718e306a8584f427aa244ce10552c267eca1310510e99981582dc7d028ba3d
4
- data.tar.gz: 4c976e465bfbd218bd3b02577ce2a2ee64b031cec48a5168a717d91f04cc6698
3
+ metadata.gz: 72c7502d9dc8978bc2402c8fdd67a5cb1c8d1c2776c15d74468ea5310d4f6d62
4
+ data.tar.gz: b1ce3e575c5037b59efe26d4ad95081fa54faccb3314cb9e38f697a0636cf6df
5
5
  SHA512:
6
- metadata.gz: ca687ca19884fd7aa3d63e174811448a8bc2380a60721bdb39d87c76d6a93951223bb27f70f4f54d422476f82255606fcc798cb0f3734a937472391a09e551f1
7
- data.tar.gz: 5cd16e3ed0dd3bd4f9b6655f50e184c6499fd784599436b3d81a2e422e90d69505ece3bcdc1b9f08118588ff03d14e48e784686baa523048279ac8b0dd575c69
6
+ metadata.gz: 6cb6ee595c62afbf5b0e827d8f06b56bc8eb19f382c7f01f6937eca0eb73a88d666a9261545d28330290e3e57a7cd4d8d4d08bfa793b4deecedecf53999f9553
7
+ data.tar.gz: b340ff8aa99bdfd02185c86235624ab56cf18193be0265da03e5770d9d95e6df1be22c8bed76db2d90d3189f9297e4a264281d888838b29e8bffe9a59268aa29
@@ -151,36 +151,12 @@ module Asciidoctor
151
151
  end
152
152
  end
153
153
 
154
- def section(node)
155
- a = section_attributes(node)
156
- noko do |xml|
157
- case sectiontype(node)
158
- #when "normative references" then norm_ref_parse(a, xml, node)
159
- when "terms and definitions"
160
- if node.attr("style") == "appendix" && node.level == 1
161
- @term_def = true
162
- terms_annex_parse(a, xml, node)
163
- @term_def = false
164
- else
165
- clause_parse(a, xml, node)
166
- end
167
- when "acknowledgements"
168
- acknowledgements_parse(a, xml, node)
169
- else
170
- if @term_def
171
- term_def_subclause_parse(a, xml, node)
172
- elsif @biblio then bibliography_parse(a, xml, node)
173
- elsif node.attr("style") == "bibliography"
174
- bibliography_parse(a, xml, node)
175
- elsif node.attr("style") == "abstract"
176
- abstract_parse(a, xml, node)
177
- elsif node.attr("style") == "appendix" && node.level == 1
178
- annex_parse(a, xml, node)
179
- else
180
- clause_parse(a, xml, node)
181
- end
182
- end
183
- end.join("\n")
154
+ def term_def_parse(attrs, xml, node, toplevel)
155
+ if node.attr("style") == "appendix" && node.level == 1
156
+ terms_annex_parse(attrs, xml, node)
157
+ else
158
+ clause_parse(attrs, xml, node)
159
+ end
184
160
  end
185
161
 
186
162
  def bibliography_parse(a, xml, node)
@@ -129,6 +129,9 @@
129
129
  </choice>
130
130
  </attribute>
131
131
  </optional>
132
+ <attribute name="normative">
133
+ <data type="boolean"/>
134
+ </attribute>
132
135
  <optional>
133
136
  <ref name="section-title"/>
134
137
  </optional>
@@ -303,11 +306,11 @@
303
306
  <ref name="paragraph"/>
304
307
  </element>
305
308
  </define>
306
- <define name="TextElement" combine="choice">
307
- <ref name="concept"/>
308
- </define>
309
309
  </include>
310
310
  <!-- end overrides -->
311
+ <define name="TextElement" combine="choice">
312
+ <ref name="concept"/>
313
+ </define>
311
314
  <define name="concept">
312
315
  <element name="concept">
313
316
  <optional>
@@ -116,12 +116,6 @@ module IsoDoc
116
116
  Date.parse(isodate).strftime("%m-%d-%Y")
117
117
  end
118
118
 
119
- def MMMddyyyy(isodate)
120
- return nil if isodate.nil?
121
- isodate += "-01" if /^\d\d\d\d-\d\d$/.match(isodate)
122
- Date.parse(isodate).strftime("%B %d, %Y")
123
- end
124
-
125
119
  def keywords(ixml, _out)
126
120
  keywords = []
127
121
  ixml.xpath(ns("//bibdata/keyword")).each { |kw| keywords << kw.text }
@@ -1391,19 +1391,21 @@
1391
1391
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
1392
1392
  </xsl:if>
1393
1393
  <!-- <xsl:text>[</xsl:text> --><xsl:value-of select="@citeas" disable-output-escaping="yes"/><!-- <xsl:text>]</xsl:text> -->
1394
- <xsl:if test="nist:locality">
1395
- <xsl:text>, </xsl:text>
1396
- <xsl:choose>
1397
- <xsl:when test="nist:locality/@type = 'section'">Section </xsl:when>
1398
- <xsl:when test="nist:locality/@type = 'clause'">Clause </xsl:when>
1399
- <xsl:otherwise/>
1400
- </xsl:choose>
1401
- <xsl:apply-templates select="nist:locality"/>
1402
- </xsl:if>
1394
+
1395
+ <xsl:apply-templates select="nist:localityStack"/>
1396
+
1403
1397
  </fo:basic-link>
1404
1398
  <!-- </fo:inline> -->
1405
1399
  </xsl:template>
1406
1400
 
1401
+ <xsl:template match="nist:locality">
1402
+ <xsl:choose>
1403
+ <xsl:when test="@type = 'section'">Section </xsl:when>
1404
+ <xsl:when test="@type = 'clause'">Clause </xsl:when>
1405
+ <xsl:otherwise/>
1406
+ </xsl:choose>
1407
+ <xsl:text> </xsl:text><xsl:value-of select="nist:referenceFrom"/>
1408
+ </xsl:template>
1407
1409
 
1408
1410
  <xsl:template match="nist:terms[nist:term[nist:preferred and nist:definition]]">
1409
1411
  <fo:block id="{@id}">
@@ -2092,7 +2092,7 @@
2092
2092
  </xsl:variable>
2093
2093
  <fo:list-item>
2094
2094
  <fo:list-item-label end-indent="label-end()">
2095
- <fo:block>
2095
+ <fo:block display-align="center">
2096
2096
  <xsl:choose>
2097
2097
  <!-- <xsl:when test="local-name(..) = 'ul'">&#x2014;</xsl:when>--> <!-- dash -->
2098
2098
  <xsl:when test="local-name(..) = 'ul'">•</xsl:when>
@@ -2340,19 +2340,21 @@
2340
2340
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
2341
2341
  </xsl:if>
2342
2342
  <xsl:text>[</xsl:text><xsl:value-of select="@citeas" disable-output-escaping="yes"/><xsl:text>]</xsl:text>
2343
- <xsl:if test="nist:locality">
2344
- <xsl:text>, </xsl:text>
2345
- <xsl:choose>
2346
- <xsl:when test="nist:locality/@type = 'section'">Section </xsl:when>
2347
- <xsl:when test="nist:locality/@type = 'clause'">Clause </xsl:when>
2348
- <xsl:otherwise/>
2349
- </xsl:choose>
2350
- <xsl:apply-templates select="nist:locality"/>
2351
- </xsl:if>
2343
+
2344
+ <xsl:apply-templates select="nist:localityStack"/>
2345
+
2352
2346
  </fo:basic-link>
2353
2347
  <!-- </fo:inline> -->
2354
2348
  </xsl:template>
2355
2349
 
2350
+ <xsl:template match="nist:locality">
2351
+ <xsl:choose>
2352
+ <xsl:when test="@type = 'section'">Section </xsl:when>
2353
+ <xsl:when test="@type = 'clause'">Clause </xsl:when>
2354
+ <xsl:otherwise/>
2355
+ </xsl:choose>
2356
+ <xsl:text> </xsl:text><xsl:value-of select="nist:referenceFrom"/>
2357
+ </xsl:template>
2356
2358
 
2357
2359
  <xsl:template match="nist:terms[nist:term[nist:preferred and nist:definition]]">
2358
2360
  <fo:block id="{@id}">
@@ -70,27 +70,6 @@ module IsoDoc
70
70
  "-"
71
71
  end
72
72
 
73
- def annex_names(clause, num)
74
- @anchors[clause["id"]] = { label: annex_name_lbl(clause, num), type: "clause",
75
- xref: "#{@annex_lbl} #{num}", level: 1 }
76
- clause.xpath(ns("./clause")).each_with_index do |c, i|
77
- annex_names1(c, "#{num}.#{i + 1}", 2)
78
- end
79
- clause.xpath(ns("./terms | ./term | ./references")).each_with_index do |c, i|
80
- suppress_biblio_title(c) ?
81
- annex_names1(c, "#{num}", 1) : annex_names1(c, "#{num}.#{i + 1}", 2)
82
- end
83
- hierarchical_asset_names(clause, num)
84
- end
85
-
86
- def annex_names1(clause, num, level)
87
- @anchors[clause["id"]] = { label: num, xref: "#{@annex_lbl} #{num}",
88
- level: level, type: "clause" }
89
- clause.xpath(ns("./clause | ./terms | ./term | ./references")).each_with_index do |c, i|
90
- annex_names1(c, "#{num}.#{i + 1}", level + 1)
91
- end
92
- end
93
-
94
73
  def terms_parse(node, out)
95
74
  out.div **attr_code(id: node["id"]) do |div|
96
75
  node.at(ns("./title")) and
@@ -3,6 +3,9 @@ require "metanorma/processor"
3
3
  module Metanorma
4
4
  module NIST
5
5
  class Processor < Metanorma::Processor
6
+ def self.fonts_used
7
+ ["Times New Roman", "Arial", "Courier New"]
8
+ end
6
9
 
7
10
  def initialize
8
11
  @short = :nist
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module NIST
3
- VERSION = "1.0.6"
3
+ VERSION = "1.0.7"
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: 1.0.6
4
+ version: 1.0.7
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-05-01 00:00:00.000000000 Z
11
+ date: 2020-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlentities