metanorma-nist 1.0.6 → 1.0.7
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 +4 -4
- data/lib/asciidoctor/nist/converter.rb +6 -30
- data/lib/asciidoctor/nist/isodoc.rng +6 -3
- data/lib/isodoc/nist/metadata.rb +0 -6
- data/lib/isodoc/nist/nist.cswp.xsl +11 -9
- data/lib/isodoc/nist/nist.sp.xsl +12 -10
- data/lib/isodoc/nist/xrefs.rb +0 -21
- data/lib/metanorma/nist/processor.rb +3 -0
- data/lib/metanorma/nist/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 72c7502d9dc8978bc2402c8fdd67a5cb1c8d1c2776c15d74468ea5310d4f6d62
|
4
|
+
data.tar.gz: b1ce3e575c5037b59efe26d4ad95081fa54faccb3314cb9e38f697a0636cf6df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
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>
|
data/lib/isodoc/nist/metadata.rb
CHANGED
@@ -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
|
-
|
1395
|
-
|
1396
|
-
|
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}">
|
data/lib/isodoc/nist/nist.sp.xsl
CHANGED
@@ -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'">—</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
|
-
|
2344
|
-
|
2345
|
-
|
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}">
|
data/lib/isodoc/nist/xrefs.rb
CHANGED
@@ -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
|
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.
|
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-
|
11
|
+
date: 2020-05-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: htmlentities
|