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.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +3 -0
  3. data/.rubocop.yml +0 -4
  4. data/README.adoc +23 -3
  5. data/lib/asciidoctor/nist/basicdoc.rng +52 -3
  6. data/lib/asciidoctor/nist/boilerplate.rb +5 -3
  7. data/lib/asciidoctor/nist/cleanup.rb +4 -3
  8. data/lib/asciidoctor/nist/converter.rb +5 -2
  9. data/lib/asciidoctor/nist/front.rb +37 -46
  10. data/lib/asciidoctor/nist/front_id.rb +18 -7
  11. data/lib/asciidoctor/nist/isodoc.rng +114 -3
  12. data/lib/asciidoctor/nist/nist_intro.xml +9 -9
  13. data/lib/asciidoctor/nist/nist_intro_cswp.xml +9 -9
  14. data/lib/asciidoctor/nist/validate.rb +17 -6
  15. data/lib/isodoc/nist/base_convert.rb +2 -3
  16. data/lib/isodoc/nist/html/header_cswp.html +2 -3
  17. data/lib/isodoc/nist/html/html_nist_titlepage.html +5 -3
  18. data/lib/isodoc/nist/html/word_nist_titlepage.html +8 -8
  19. data/lib/isodoc/nist/html/word_nist_titlepage_cswp.html +2 -0
  20. data/lib/isodoc/nist/html_convert.rb +6 -8
  21. data/lib/isodoc/nist/metadata.rb +28 -40
  22. data/lib/isodoc/nist/metadata_id.rb +3 -7
  23. data/lib/isodoc/nist/nist.csts.xsl +4844 -0
  24. data/lib/isodoc/nist/nist.cswp.xsl +517 -292
  25. data/lib/isodoc/nist/nist.sp.xsl +503 -327
  26. data/lib/isodoc/nist/pdf_convert.rb +5 -1
  27. data/lib/isodoc/nist/presentation_xml_convert.rb +30 -10
  28. data/lib/isodoc/nist/refs.rb +4 -20
  29. data/lib/isodoc/nist/render.rb +42 -40
  30. data/lib/isodoc/nist/render_dates.rb +8 -9
  31. data/lib/isodoc/nist/word_convert.rb +5 -6
  32. data/lib/isodoc/nist/xref.rb +11 -5
  33. data/lib/metanorma/nist/processor.rb +12 -0
  34. data/lib/metanorma/nist/version.rb +1 -1
  35. data/metanorma-nist.gemspec +2 -2
  36. metadata +8 -8
  37. data/lib/metanorma/nist/fonts_manifest.yaml +0 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 76b612ddae877500cbbc398c12a44867549fa1c987772eb781fc7aa33ac63e2b
4
- data.tar.gz: d6def5426449912f9890f09834da5ed430c1fc04958b8c2850d59c5730b7cae7
3
+ metadata.gz: 6f05d4a7aa6eab8094080eabca5f37047291220bcadd29327fe79dbbdda23e1a
4
+ data.tar.gz: c22cb715ade934a51e95072988976c83758d414fbe4e38e1ba47686dd3c37991
5
5
  SHA512:
6
- metadata.gz: 5ce949e7353a14d240b75037b5a68736490a3fd2efe227af16d34ec0b7b1ecb82c689117bc743cc99f33f68a22824d40ed8126516d929de75e14767de2e78bd4
7
- data.tar.gz: e077d67bfb18798c77dbd0573e0988771b0a6d273149950c7ba5f11a12f50c17a728c5d978eaee82f716696fcdbe9fd50b29015485f918913cda27059ec71fd9
6
+ metadata.gz: 12e27e427e31e5eba00a66a1d2b949147577859c557b061c83a7e75ed9ce28ca8cdcfc9b5a39ae7487646b61fa778238c0afd9d770b64ba3990c7f47cb0032b8
7
+ data.tar.gz: 481e55314eab8e92e83817f9c653103cb44811e670b430b4d6bb5366cfa040394b075afcb8b656471742d54e11e26565975f9de254cdd3003f0592c75f910350
@@ -36,6 +36,9 @@ jobs:
36
36
  with:
37
37
  ruby-version: ${{ matrix.ruby }}
38
38
 
39
+ - if: matrix.os == 'macos-latest'
40
+ run: brew install autoconf automake libtool
41
+
39
42
  - uses: actions/cache@v2
40
43
  with:
41
44
  path: vendor/bundle
data/.rubocop.yml CHANGED
@@ -4,7 +4,3 @@
4
4
 
5
5
  inherit_from:
6
6
  - https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
7
- AllCops:
8
- TargetRubyVersion: 2.3
9
- Rails:
10
- Enabled: true
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
- * nist-ams
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) and for
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="secondary"/>
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
- <attribute name="tertiary"/>
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(:nist_division, @nistdivision)
98
- conv.i18n.set(:nist_division_address, @nistdivisionaddress)
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, @series == "nist-cswp" ? "nist_intro_cswp.xml" : "nist_intro.xml")
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
- n.replace(Nokogiri::XML::NodeSet.new(n.document,
20
- nistvariable_insert(n)))
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 @series == "nist-cswp"
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 = Asciidoctor::Standoc::Utils::anchor_or_uuid(node)
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: Asciidoctor::Standoc::Utils::anchor_or_uuid(node),
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
- Asciidoctor::Standoc::Utils::asciidoc_sub(text)
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
- a.committee(node.attr("technical-committee"))
94
- node.attr("subcommittee") and
95
- a.subcommittee(
96
- node.attr("subcommittee"),
97
- **attr_code(type: node.attr("subcommittee-type"),
98
- number: node.attr("subcommittee-number")))
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") && xml.uri(node.attr("doc-email"), type: "email")
118
- node.attr("doi") && xml.uri(node.attr("doi"), type: "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
- s.abbreviation SERIES_ABBR.dig(series.to_sym)
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
- "[@type = 'NIST']")&.text
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
- xml.note note, **{ type: "additional-note" }
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?