metanorma-nist 1.2.8 → 1.2.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +3 -0
- data/.rubocop.yml +0 -4
- data/README.adoc +23 -3
- data/lib/asciidoctor/nist/basicdoc.rng +52 -3
- data/lib/asciidoctor/nist/boilerplate.rb +5 -3
- data/lib/asciidoctor/nist/cleanup.rb +4 -3
- data/lib/asciidoctor/nist/converter.rb +5 -2
- data/lib/asciidoctor/nist/front.rb +37 -46
- data/lib/asciidoctor/nist/front_id.rb +18 -7
- data/lib/asciidoctor/nist/isodoc.rng +114 -3
- data/lib/asciidoctor/nist/nist_intro.xml +9 -9
- data/lib/asciidoctor/nist/nist_intro_cswp.xml +9 -9
- data/lib/asciidoctor/nist/validate.rb +17 -6
- data/lib/isodoc/nist/base_convert.rb +2 -3
- data/lib/isodoc/nist/html/header_cswp.html +2 -3
- data/lib/isodoc/nist/html/html_nist_titlepage.html +5 -3
- data/lib/isodoc/nist/html/word_nist_titlepage.html +8 -8
- data/lib/isodoc/nist/html/word_nist_titlepage_cswp.html +2 -0
- data/lib/isodoc/nist/html_convert.rb +6 -8
- data/lib/isodoc/nist/metadata.rb +28 -40
- data/lib/isodoc/nist/metadata_id.rb +3 -7
- data/lib/isodoc/nist/nist.csts.xsl +4844 -0
- data/lib/isodoc/nist/nist.cswp.xsl +517 -292
- data/lib/isodoc/nist/nist.sp.xsl +503 -327
- data/lib/isodoc/nist/pdf_convert.rb +5 -1
- data/lib/isodoc/nist/presentation_xml_convert.rb +30 -10
- data/lib/isodoc/nist/refs.rb +4 -20
- data/lib/isodoc/nist/render.rb +42 -40
- data/lib/isodoc/nist/render_dates.rb +8 -9
- data/lib/isodoc/nist/word_convert.rb +5 -6
- data/lib/isodoc/nist/xref.rb +11 -5
- data/lib/metanorma/nist/processor.rb +12 -0
- data/lib/metanorma/nist/version.rb +1 -1
- data/metanorma-nist.gemspec +2 -2
- metadata +8 -8
- data/lib/metanorma/nist/fonts_manifest.yaml +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f05d4a7aa6eab8094080eabca5f37047291220bcadd29327fe79dbbdda23e1a
|
4
|
+
data.tar.gz: c22cb715ade934a51e95072988976c83758d414fbe4e38e1ba47686dd3c37991
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12e27e427e31e5eba00a66a1d2b949147577859c557b061c83a7e75ed9ce28ca8cdcfc9b5a39ae7487646b61fa778238c0afd9d770b64ba3990c7f47cb0032b8
|
7
|
+
data.tar.gz: 481e55314eab8e92e83817f9c653103cb44811e670b430b4d6bb5366cfa040394b075afcb8b656471742d54e11e26565975f9de254cdd3003f0592c75f910350
|
data/.github/workflows/rake.yml
CHANGED
data/.rubocop.yml
CHANGED
data/README.adoc
CHANGED
@@ -299,7 +299,7 @@ Can be a number, or text (e.g. "initial", "final").
|
|
299
299
|
`:series:`:: The publication series that the document belongs to. Legal values are:
|
300
300
|
+
|
301
301
|
--
|
302
|
-
*
|
302
|
+
* nist-ams
|
303
303
|
* building-science
|
304
304
|
* nist-fips
|
305
305
|
* nist-gcr
|
@@ -321,11 +321,28 @@ Can be a number, or text (e.g. "initial", "final").
|
|
321
321
|
* csrc-use-case
|
322
322
|
* csrc-building-block
|
323
323
|
* nist-cswp
|
324
|
+
* nist-csts
|
324
325
|
--
|
325
326
|
|
326
327
|
Documents belonging to different series are expected to be rendered differently. As of this
|
327
|
-
writing, styling has been provided for `nist-cswp` (Cybersecurity White Papers)
|
328
|
-
`nist-sp` (SP-800).
|
328
|
+
writing, styling has been provided for `nist-cswp` (Cybersecurity White Papers),
|
329
|
+
`nist-csts` (Cybersecurity Technical Specifications, added in v1.2.10), and for `nist-sp` (SP-800).
|
330
|
+
|
331
|
+
`:series-title:`:: (Added in v1.2.10)
|
332
|
+
`:series-mrprefix:`:: (Added in v1.2.10)
|
333
|
+
`:series-abbrev:`:: (Added in v1.2.10) The formal documents published by NIST belong to a registered
|
334
|
+
list of series, each with a predefined title and abbreviation. Non-formal documents instead belong
|
335
|
+
to ad hoc series defined for the purposes of Metanorma, such as `nist-csts`. That particular series
|
336
|
+
acts as an umbrella for user-defined series of publications; so when it is used, the user needs to provide
|
337
|
+
a title (e.g. "Automated Cryptographic Validation Protocol") and abbreviation (e.g. ACVP) for the user-defined
|
338
|
+
series. The user also needs to provide the prefix by which the series will be identified in the machine-readable
|
339
|
+
NIST identifier, when it is at variance with the abbreviation.
|
340
|
+
+
|
341
|
+
--
|
342
|
+
In this case, CSTS is retained as the primary series of the publication (and all CSTS documents
|
343
|
+
are rendered the same way), and ACVP is modelled as a secondary series specific to CSTS. However,
|
344
|
+
the series information rendered for the document involves the user-defined series, not CSTS itself.
|
345
|
+
--
|
329
346
|
|
330
347
|
`:comment-from:`:: The beginning of the period during which comments may be submitted to the NIST
|
331
348
|
document draft. ISO-8601 date.
|
@@ -643,6 +660,9 @@ which will be converted to the tag `nistvariable` in Metanorma XML:
|
|
643
660
|
----
|
644
661
|
---
|
645
662
|
|
663
|
+
In the rest of Metanorma, `{{{ ... }}}` is used to introduce AsciiDoc markup into sourcecode.
|
664
|
+
In the NIST flavour, this is done through `{{{{ ... }}}}`
|
665
|
+
|
646
666
|
=== Errata
|
647
667
|
|
648
668
|
Errata are marked up as an Asciidoctor table with role attribute `[.errata]`.
|
@@ -596,6 +596,7 @@
|
|
596
596
|
<ref name="bookmark"/>
|
597
597
|
<ref name="image"/>
|
598
598
|
<ref name="index"/>
|
599
|
+
<ref name="index-xref"/>
|
599
600
|
</choice>
|
600
601
|
</define>
|
601
602
|
<define name="PureTextElement">
|
@@ -728,13 +729,61 @@
|
|
728
729
|
</define>
|
729
730
|
<define name="index">
|
730
731
|
<element name="index">
|
731
|
-
<attribute name="primary"/>
|
732
732
|
<optional>
|
733
|
-
<attribute name="
|
733
|
+
<attribute name="to">
|
734
|
+
<data type="IDREF"/>
|
735
|
+
</attribute>
|
736
|
+
</optional>
|
737
|
+
<element name="primary">
|
738
|
+
<oneOrMore>
|
739
|
+
<ref name="PureTextElement"/>
|
740
|
+
</oneOrMore>
|
741
|
+
</element>
|
742
|
+
<optional>
|
743
|
+
<element name="secondary">
|
744
|
+
<oneOrMore>
|
745
|
+
<ref name="PureTextElement"/>
|
746
|
+
</oneOrMore>
|
747
|
+
</element>
|
748
|
+
</optional>
|
749
|
+
<optional>
|
750
|
+
<element name="tertiary">
|
751
|
+
<oneOrMore>
|
752
|
+
<ref name="PureTextElement"/>
|
753
|
+
</oneOrMore>
|
754
|
+
</element>
|
755
|
+
</optional>
|
756
|
+
</element>
|
757
|
+
</define>
|
758
|
+
<define name="index-xref">
|
759
|
+
<element name="index-xref">
|
760
|
+
<attribute name="also">
|
761
|
+
<data type="boolean"/>
|
762
|
+
</attribute>
|
763
|
+
<element name="primary">
|
764
|
+
<oneOrMore>
|
765
|
+
<ref name="PureTextElement"/>
|
766
|
+
</oneOrMore>
|
767
|
+
</element>
|
768
|
+
<optional>
|
769
|
+
<element name="secondary">
|
770
|
+
<oneOrMore>
|
771
|
+
<ref name="PureTextElement"/>
|
772
|
+
</oneOrMore>
|
773
|
+
</element>
|
734
774
|
</optional>
|
735
775
|
<optional>
|
736
|
-
<
|
776
|
+
<element name="tertiary">
|
777
|
+
<oneOrMore>
|
778
|
+
<ref name="PureTextElement"/>
|
779
|
+
</oneOrMore>
|
780
|
+
</element>
|
737
781
|
</optional>
|
782
|
+
<element name="target">
|
783
|
+
<oneOrMore>
|
784
|
+
<ref name="PureTextElement"/>
|
785
|
+
</oneOrMore>
|
786
|
+
</element>
|
738
787
|
</element>
|
739
788
|
</define>
|
740
789
|
<!-- bare ID element, used for referencing arbitrary spans of text -->
|
@@ -24,6 +24,7 @@ module Asciidoctor
|
|
24
24
|
"csrc-use-case": "CSRC Use Case",
|
25
25
|
"csrc-building-block": "CSRC Building Block",
|
26
26
|
"nist-cswp": "NIST Cybersecurity White Paper",
|
27
|
+
"nist-csts": "NIST Cybersecurity Technical Specification",
|
27
28
|
}.freeze
|
28
29
|
|
29
30
|
SERIES_ABBR = {
|
@@ -49,6 +50,7 @@ module Asciidoctor
|
|
49
50
|
"csrc-use-case": "CSRC Use Case",
|
50
51
|
"csrc-building-block": "CSRC Building Block",
|
51
52
|
"nist-cswp": "NIST CSWP",
|
53
|
+
"nist-csts": "NIST CSTS",
|
52
54
|
}.freeze
|
53
55
|
|
54
56
|
CALL_FOR_PATENT_CLAIMS = <<~END.freeze
|
@@ -94,13 +96,13 @@ module Asciidoctor
|
|
94
96
|
|
95
97
|
def boilerplate_isodoc(xmldoc)
|
96
98
|
conv = super
|
97
|
-
conv.i18n.set(
|
98
|
-
conv.i18n.set(
|
99
|
+
conv.i18n.set("nist_division", @nistdivision)
|
100
|
+
conv.i18n.set("nist_division_address", @nistdivisionaddress)
|
99
101
|
conv
|
100
102
|
end
|
101
103
|
|
102
104
|
def boilerplate_file(xmldoc)
|
103
|
-
File.join(@libdir, @
|
105
|
+
File.join(@libdir, @cswp ? "nist_intro_cswp.xml" : "nist_intro.xml")
|
104
106
|
end
|
105
107
|
end
|
106
108
|
end
|
@@ -16,10 +16,11 @@ module Asciidoctor
|
|
16
16
|
xmldoc.xpath("//sourcecode").each do |x|
|
17
17
|
x.traverse do |n|
|
18
18
|
next unless n.text?
|
19
|
-
|
20
|
-
|
19
|
+
next unless /\{\{\{/.match(n.text)
|
20
|
+
n.replace(Nokogiri::XML::NodeSet.new(n.document, nistvariable_insert(n)))
|
21
21
|
end
|
22
22
|
end
|
23
|
+
super
|
23
24
|
end
|
24
25
|
|
25
26
|
# skip annex/terms/terms, which is empty node
|
@@ -72,7 +73,7 @@ module Asciidoctor
|
|
72
73
|
end
|
73
74
|
|
74
75
|
def callforpatentclaims(x, preface)
|
75
|
-
return if @
|
76
|
+
return if @cswp
|
76
77
|
if @callforpatentclaims
|
77
78
|
docemail = x&.at("//uri[@type = 'email']")&.text || "???"
|
78
79
|
docnumber = x&.at("//docnumber")&.text || "???"
|
@@ -62,7 +62,7 @@ module Asciidoctor
|
|
62
62
|
end
|
63
63
|
|
64
64
|
def olist(node)
|
65
|
-
id =
|
65
|
+
id = Metanorma::Utils::anchor_or_uuid(node)
|
66
66
|
noko do |xml|
|
67
67
|
xml.ol **attr_code(id: id, class: node.attr("class")) do |xml_ol|
|
68
68
|
node.items.each { |item| li(xml_ol, item) }
|
@@ -72,7 +72,7 @@ module Asciidoctor
|
|
72
72
|
|
73
73
|
def glossary(node)
|
74
74
|
noko do |xml|
|
75
|
-
xml.dl **{id:
|
75
|
+
xml.dl **{id: Metanorma::Utils::anchor_or_uuid(node),
|
76
76
|
type: "glossary"} do |xml_dl|
|
77
77
|
node.items.each do |terms, dd|
|
78
78
|
dt(terms, xml_dl)
|
@@ -103,7 +103,10 @@ module Asciidoctor
|
|
103
103
|
@nistdivisionaddress = node.attr("nist-division-address") ||
|
104
104
|
"100 Bureau Drive (Mail Stop 8930) Gaithersburg, MD 20899-8930"
|
105
105
|
@series = node.attr("series")
|
106
|
+
@cswp = %w(nist-cswp nist-csts).include?(@series)
|
106
107
|
super
|
108
|
+
@sourcecode_markup_start = node.attr("sourcecode-markup-start") || "{{{{"
|
109
|
+
@sourcecode_markup_end = node.attr("sourcecode-markup-end") || "}}}}"
|
107
110
|
end
|
108
111
|
|
109
112
|
def outputs(node, ret)
|
@@ -21,7 +21,7 @@ module Asciidoctor
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def asciidoc_sub(text)
|
24
|
-
|
24
|
+
Metanorma::Utils::asciidoc_sub(text)
|
25
25
|
end
|
26
26
|
|
27
27
|
def title_subtitle(node, t, at)
|
@@ -29,8 +29,7 @@ module Asciidoctor
|
|
29
29
|
t.title(**attr_code(at.merge(type: "subtitle"))) do |t1|
|
30
30
|
t1 << asciidoc_sub(node.attr("title-sub"))
|
31
31
|
end
|
32
|
-
node.attr("title-sub-short") and
|
33
|
-
t.title(**attr_code(at.merge(type: "short-subtitle"))) do |t1|
|
32
|
+
node.attr("title-sub-short") and t.title(**attr_code(at.merge(type: "short-subtitle"))) do |t1|
|
34
33
|
t1 << asciidoc_sub(node.attr("title-sub-short"))
|
35
34
|
end
|
36
35
|
end
|
@@ -46,8 +45,7 @@ module Asciidoctor
|
|
46
45
|
t.title(**attr_code(at.merge(type: "main"))) do |t1|
|
47
46
|
t1 << (asciidoc_sub(node.attr("title-main")) || node.title)
|
48
47
|
end
|
49
|
-
node.attr("title-main-short") and
|
50
|
-
t.title(**attr_code(at.merge(type: "short-title"))) do |t1|
|
48
|
+
node.attr("title-main-short") and t.title(**attr_code(at.merge(type: "short-title"))) do |t1|
|
51
49
|
t1 << asciidoc_sub(node.attr("title-main-short"))
|
52
50
|
end
|
53
51
|
end
|
@@ -85,21 +83,16 @@ module Asciidoctor
|
|
85
83
|
end
|
86
84
|
|
87
85
|
def metadata_committee(node, xml)
|
88
|
-
return unless node.attr("technical-committee") ||
|
89
|
-
node.attr("subcommittee") ||
|
86
|
+
return unless node.attr("technical-committee") || node.attr("subcommittee") ||
|
90
87
|
node.attr("workgroup") || node.attr("workinggroup")
|
91
88
|
xml.editorialgroup do |a|
|
92
|
-
node.attr("technical-committee") and
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
(node.attr("workgroup") || node.attr("workinggroup")) and
|
100
|
-
a.workgroup(node.attr("workgroup") || node.attr("workinggroup"),
|
101
|
-
**attr_code(type: node.attr("workgroup-type"),
|
102
|
-
number: node.attr("workgroup-number")))
|
89
|
+
c = node.attr("technical-committee") and a.committee(c)
|
90
|
+
c = node.attr("subcommittee") and
|
91
|
+
a.subcommittee(c, **attr_code(type: node.attr("subcommittee-type"),
|
92
|
+
number: node.attr("subcommittee-number")))
|
93
|
+
c = (node.attr("workgroup") || node.attr("workinggroup")) and
|
94
|
+
a.workgroup(c,
|
95
|
+
**attr_code(type: node.attr("workgroup-type"), number: node.attr("workgroup-number")))
|
103
96
|
end
|
104
97
|
end
|
105
98
|
|
@@ -114,16 +107,26 @@ module Asciidoctor
|
|
114
107
|
|
115
108
|
def metadata_source(node, xml)
|
116
109
|
super
|
117
|
-
node.attr("doc-email")
|
118
|
-
node.attr("doi")
|
110
|
+
node.attr("doc-email") and xml.uri(node.attr("doc-email"), type: "email")
|
111
|
+
node.attr("doi") and xml.uri(node.attr("doi"), type: "doi")
|
119
112
|
end
|
120
113
|
|
121
114
|
def metadata_series(node, xml)
|
122
115
|
series = node.attr("series") || "nist-sp"
|
123
116
|
series and xml.series **{ type: "main" } do |s|
|
124
117
|
s.title (SERIES.dig(series.to_sym) || series)
|
125
|
-
SERIES_ABBR.dig(series.to_sym) and
|
126
|
-
|
118
|
+
SERIES_ABBR.dig(series.to_sym) and s.abbreviation SERIES_ABBR.dig(series.to_sym)
|
119
|
+
end
|
120
|
+
metadata_subseries(node, xml)
|
121
|
+
end
|
122
|
+
|
123
|
+
def metadata_subseries(node, xml)
|
124
|
+
title = node.attr("series-title")
|
125
|
+
abbrev = node.attr("series-abbrev")
|
126
|
+
return unless (title || abbrev)
|
127
|
+
xml.series **{ type: "secondary" } do |s|
|
128
|
+
title and s.title title
|
129
|
+
abbrev and s.abbreviation abbrev
|
127
130
|
end
|
128
131
|
end
|
129
132
|
|
@@ -143,13 +146,11 @@ module Asciidoctor
|
|
143
146
|
end
|
144
147
|
|
145
148
|
def relaton_relation_descriptions
|
146
|
-
super.merge({ "supersedes" => "obsoletes",
|
147
|
-
"superseded-by" => "obsoleted-by", })
|
149
|
+
super.merge({ "supersedes" => "obsoletes", "superseded-by" => "obsoleted-by", })
|
148
150
|
end
|
149
151
|
|
150
152
|
def metadata_getrelation(node, xml, type, desc = nil)
|
151
|
-
if type == "obsoleted-by" and desc.nil? and
|
152
|
-
node.attr("superseding-status")
|
153
|
+
if type == "obsoleted-by" and desc.nil? and node.attr("superseding-status")
|
153
154
|
metadata_superseding_doc(node, xml)
|
154
155
|
end
|
155
156
|
super
|
@@ -166,29 +167,24 @@ module Asciidoctor
|
|
166
167
|
metadata_superseding_dates(b, node)
|
167
168
|
b.status do |s|
|
168
169
|
s.stage node.attr("superseding-status")
|
169
|
-
iter = node.attr("superseding-iteration") and
|
170
|
-
s.iteration iter
|
170
|
+
iter = node.attr("superseding-iteration") and s.iteration iter
|
171
171
|
end
|
172
172
|
end
|
173
173
|
end
|
174
174
|
end
|
175
175
|
|
176
176
|
def metadata_superseding_ids(b, xml)
|
177
|
-
did = xml&.parent&.at("./ancestor::bibdata/docidentifier"
|
178
|
-
|
179
|
-
didl = xml&.parent&.at("./ancestor::bibdata/docidentifier"\
|
180
|
-
"[@type = 'nist-long']")&.text
|
177
|
+
did = xml&.parent&.at("./ancestor::bibdata/docidentifier[@type = 'NIST']")&.text
|
178
|
+
didl = xml&.parent&.at("./ancestor::bibdata/docidentifier[@type = 'nist-long']")&.text
|
181
179
|
b.docidentifier did, **{ type: "NIST" }
|
182
180
|
b.docidentifier didl, **{ type: "nist-long" }
|
183
181
|
end
|
184
182
|
|
185
183
|
def metadata_superseding_dates(b, node)
|
186
|
-
cdate = node.attr("superseding-circulated-date") and
|
187
|
-
b.date **{ type: "circulated" } do |d|
|
184
|
+
cdate = node.attr("superseding-circulated-date") and b.date **{ type: "circulated" } do |d|
|
188
185
|
d.on cdate
|
189
186
|
end
|
190
|
-
cdate = node.attr("superseding-issued-date") and
|
191
|
-
b.date **{ type: "issued" } do |d|
|
187
|
+
cdate = node.attr("superseding-issued-date") and b.date **{ type: "issued" } do |d|
|
192
188
|
d.on cdate
|
193
189
|
end
|
194
190
|
end
|
@@ -198,24 +194,21 @@ module Asciidoctor
|
|
198
194
|
b.title **{ type: "main" } do |t|
|
199
195
|
t << asciidoc_sub(node.attr("superseding-title"))
|
200
196
|
end
|
201
|
-
node.attr("superseding-subtitle") and
|
202
|
-
b.title **{ type: "subtitle" } do |t|
|
197
|
+
node.attr("superseding-subtitle") and b.title **{ type: "subtitle" } do |t|
|
203
198
|
t << asciidoc_sub(node.attr("superseding-subtitle"))
|
204
199
|
end
|
205
200
|
else
|
206
201
|
b.title **{ type: "main" } do |t|
|
207
202
|
t << (asciidoc_sub(node.attr("title-main")) || node.title)
|
208
203
|
end
|
209
|
-
node.attr("title-sub") and
|
210
|
-
b.title **{ type: "subtitle" } do |t|
|
204
|
+
node.attr("title-sub") and b.title **{ type: "subtitle" } do |t|
|
211
205
|
t << asciidoc_sub(node.attr("title-sub"))
|
212
206
|
end
|
213
207
|
end
|
214
208
|
end
|
215
209
|
|
216
210
|
def metadata_superseding_authors(b, node)
|
217
|
-
node.attr("superseding-authors") and
|
218
|
-
node.attr("superseding-authors").split(/,\s*/).each do |a|
|
211
|
+
node.attr("superseding-authors") and node.attr("superseding-authors").split(/,\s*/).each do |a|
|
219
212
|
b.contributor do |c|
|
220
213
|
c.role nil, **{ type: "author" }
|
221
214
|
c.person do |p|
|
@@ -228,10 +221,8 @@ module Asciidoctor
|
|
228
221
|
end
|
229
222
|
|
230
223
|
def metadata_note(node, xml)
|
231
|
-
note = node.attr("bib-additional-note") and
|
232
|
-
|
233
|
-
note = node.attr("bib-withdrawal-note") and
|
234
|
-
xml.note note, **{ type: "withdrawal-note" }
|
224
|
+
note = node.attr("bib-additional-note") and xml.note note, **{ type: "additional-note" }
|
225
|
+
note = node.attr("bib-withdrawal-note") and xml.note note, **{ type: "withdrawal-note" }
|
235
226
|
note = node.attr("bib-withdrawal-announcement-link") and
|
236
227
|
xml.note note, **{ type: "withdrawal-announcement-link" }
|
237
228
|
end
|
@@ -24,6 +24,9 @@ module Asciidoctor
|
|
24
24
|
{
|
25
25
|
id: dn0,
|
26
26
|
series: node.attr("series"),
|
27
|
+
subseries: node.attr("series-title") || node.attr("series-abbrev"),
|
28
|
+
subseries_abbr: node.attr("series-abbrev"),
|
29
|
+
subseries_mr: node.attr("series-mrprefix") || node.attr("series-abbrev"),
|
27
30
|
edition: node.attr("edition"),
|
28
31
|
version: node.attr("version"),
|
29
32
|
revision: node.attr("revision"),
|
@@ -52,8 +55,7 @@ module Asciidoctor
|
|
52
55
|
else
|
53
56
|
args = id_args(node, dn0) || return
|
54
57
|
xml.docidentifier add_id_parts(args, false), **attr_code(type: "NIST")
|
55
|
-
xml.docidentifier add_id_parts(args, true),
|
56
|
-
**attr_code(type: "nist-long")
|
58
|
+
xml.docidentifier add_id_parts(args, true), **attr_code(type: "nist-long")
|
57
59
|
xml.docidentifier add_id_parts_mr(args), **attr_code(type: "nist-mr")
|
58
60
|
end
|
59
61
|
end
|
@@ -67,10 +69,20 @@ module Asciidoctor
|
|
67
69
|
IsoDoc::NIST::Metadata.new(nil, nil, @i18n).status_abbr(stage, iter)
|
68
70
|
end
|
69
71
|
|
72
|
+
def id_series_name(args, type)
|
73
|
+
if args[:series] == "nist-csts"
|
74
|
+
return ret = case type
|
75
|
+
when :long then args[:subseries]
|
76
|
+
when :short then args[:subseries_abbr]
|
77
|
+
when :mr then args[:subseries_mr]
|
78
|
+
end
|
79
|
+
end
|
80
|
+
type == :long ?
|
81
|
+
SERIES.dig(args[:series].to_sym) : SERIES_ABBR.dig(args[:series].to_sym)
|
82
|
+
end
|
83
|
+
|
70
84
|
def add_id_parts(args, long)
|
71
|
-
args[:series] and series_name = long ?
|
72
|
-
SERIES.dig(args[:series].to_sym) :
|
73
|
-
SERIES_ABBR.dig(args[:series].to_sym)
|
85
|
+
args[:series] and series_name = id_series_name(args, (long ? :long : :short))
|
74
86
|
dn = (series_name || "NIST #{args[:series]}") + " " + args[:id]
|
75
87
|
dn += " Volume #{args[:vol]}" if args[:vol]
|
76
88
|
dn += "," if args[:vol] && args[:revision]
|
@@ -107,8 +119,7 @@ module Asciidoctor
|
|
107
119
|
|
108
120
|
def add_id_parts_mr(args)
|
109
121
|
ret = ["NIST"]
|
110
|
-
args[:series] and
|
111
|
-
ret << SERIES_ABBR&.dig(args[:series].to_sym)&.sub(/^NIST /, "")
|
122
|
+
args[:series] and ret << id_series_name(args, :mr)&.sub(/^NIST /, "")
|
112
123
|
stage = status_abbr(args[:stage], nil) || ""
|
113
124
|
stage += "[-#{args[:iter]}]" if args[:iter]
|
114
125
|
ret << stage unless stage.empty?
|