metanorma-nist 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.adoc +137 -47
- data/lib/asciidoctor/nist/biblio.rng +22 -1
- data/lib/asciidoctor/nist/cleanup.rb +6 -6
- data/lib/asciidoctor/nist/converter.rb +1 -1
- data/lib/asciidoctor/nist/front.rb +41 -21
- data/lib/asciidoctor/nist/isodoc.rng +46 -15
- data/lib/asciidoctor/nist/isostandard.rng +3 -50
- data/lib/asciidoctor/nist/nist.rng +3 -38
- data/lib/asciidoctor/nist/nist_intro.xml +19 -15
- data/lib/isodoc/nist/base_convert.rb +86 -106
- data/lib/isodoc/nist/html/header.html +2 -2
- data/lib/isodoc/nist/html/html_nist_titlepage.html +1 -1
- data/lib/isodoc/nist/html/htmlstyle.scss +2 -0
- data/lib/isodoc/nist/html/nist.scss +4 -0
- data/lib/isodoc/nist/html/word_nist_titlepage.html +20 -11
- data/lib/isodoc/nist/html/wordstyle.scss +12 -12
- data/lib/isodoc/nist/html_convert.rb +7 -12
- data/lib/isodoc/nist/metadata.rb +136 -74
- data/lib/isodoc/nist/pdf_convert.rb +7 -12
- data/lib/isodoc/nist/render.rb +352 -0
- data/lib/isodoc/nist/word_convert.rb +14 -4
- data/lib/metanorma-nist.rb +1 -0
- data/lib/metanorma/nist/version.rb +1 -1
- data/metanorma-nist.gemspec +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 553e8bf36b10720beecc7e76b0bf8cc2141ea7dfa18b9389adb2355521df72cb
|
4
|
+
data.tar.gz: 4d050660b0d6954dd58bbee575fd62374bcdb2c931b9cce5f4271f30a79a6ecb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84ae66bfe9a43d1e79f65c9532116c73eec1a562020e206ce05883391e049dc46fe44a73f60d1ab66396eac6406065d5c36cc84a51b0c927f30b885c33aeee24
|
7
|
+
data.tar.gz: e7bf0c5bc1e70fab341d8c98f0cef3194e3795bae8c705b38bec555822a670b6a4c5682e4663dfbcc8663969b7bc7fe307856f97ba5e9274e261e2893464ce2c
|
data/README.adoc
CHANGED
@@ -130,9 +130,15 @@ introduced with `=`, is used.
|
|
130
130
|
|
131
131
|
`:technical-committee:`:: The name of the relevant committee producing the document.
|
132
132
|
|
133
|
-
`:
|
133
|
+
`:issued-date:`:: The date on which the document was authorised to be published.
|
134
|
+
Referred to within NIST as the "Publication Date". This is the date used on the document
|
135
|
+
cover page. Only applies to public documents;
|
134
136
|
drafts instead have a `:circulated-date:` attribute.
|
135
137
|
|
138
|
+
`:published-date:`:: The publication date for the document, when it was physically released.
|
139
|
+
Referred to within NIST as the "Release Date". This date is not used on the document cover
|
140
|
+
page; `:issued-date:` is used instead. The Release Date is included in NIST bibliographic metadata.
|
141
|
+
|
136
142
|
`:uri:`:: The URI to which this standard is published.
|
137
143
|
|
138
144
|
`:docnumber:`:: The internal identifier referring to this document. The identifier is a number;
|
@@ -141,7 +147,7 @@ docnumber-edition (if edition is present)
|
|
141
147
|
|
142
148
|
`:docidentifier:`:: The document identifier for the document. Normally this should not be supplied,
|
143
149
|
as the document identifier is composed from the document series, document number, document volume,
|
144
|
-
and edition/revision (e.g. _NIST SP 800 Revision 1_).
|
150
|
+
and edition/revision (e.g. _NIST SP 800 Revision 1_).
|
145
151
|
If the `:docidentifier:` value is provided, it will override this composed value.
|
146
152
|
|
147
153
|
`:edition:`:: Edition (revision) of the document. The value of
|
@@ -158,7 +164,7 @@ this attribute will be displayed as part of the heading, prefixed with "Revision
|
|
158
164
|
* `final-review`
|
159
165
|
--
|
160
166
|
|
161
|
-
`:substage:`:: Document substage. Indicates active status of draft or publication.
|
167
|
+
`:substage:`:: Document substage. Indicates active status of draft or publication.
|
162
168
|
If a draft or publication is inactive, that is reflected in the coverpage. The
|
163
169
|
permitted types are:
|
164
170
|
+
|
@@ -166,7 +172,7 @@ permitted types are:
|
|
166
172
|
* `active` (default)
|
167
173
|
* `retired` (applies only to drafts, when they are abandoned). The `:abandoned-date:` must
|
168
174
|
be provided, to indicate when the draft was abandoned.
|
169
|
-
* `withdrawn` (applies to drafts, when when they are superseded by the next draft stage,
|
175
|
+
* `withdrawn` (applies to drafts, when when they are superseded by the next draft stage,
|
170
176
|
and to published documents when they are superseded or no longer valid.
|
171
177
|
--
|
172
178
|
|
@@ -253,7 +259,7 @@ e.g. "Computer Security" for SP 800.
|
|
253
259
|
`:doi:`:: DOI URL for document (distinct from `:uri:`, which is the URL that NIST
|
254
260
|
publishes the document under.)
|
255
261
|
|
256
|
-
`:call-for-patent-claims:`:: Include the Call for Patent Claims in document drafts,
|
262
|
+
`:call-for-patent-claims:`:: Include the Call for Patent Claims in document drafts,
|
257
263
|
and the Patent Disclosure Notice in finalised documents.
|
258
264
|
|
259
265
|
`:commitment-to-licence:`:: Indicate in the Patent Disclosure Notice that
|
@@ -268,26 +274,26 @@ Can be a number, or text (e.g. "initial", "final").
|
|
268
274
|
`:series:`:: The publication series that the document belongs to. Legal values are:
|
269
275
|
+
|
270
276
|
--
|
271
|
-
* nist-ams
|
272
|
-
* building-science
|
273
|
-
* nist-fips
|
274
|
-
* nist-gcr
|
275
|
-
* nist-hb
|
276
|
-
* itl-bulletin
|
277
|
-
* jpcrd
|
278
|
-
* nist-jres
|
279
|
-
* letter-circular
|
280
|
-
* nist-monograph
|
281
|
-
* nist-ncstar
|
282
|
-
* nist-nsrds
|
283
|
-
* nistir
|
284
|
-
* product-stadnards
|
285
|
-
* nist-sp
|
286
|
-
* nist-tn
|
287
|
-
* other
|
288
|
-
* csrc-white-paper
|
289
|
-
* csrc-book
|
290
|
-
* csrc-use-case
|
277
|
+
* nist-ams
|
278
|
+
* building-science
|
279
|
+
* nist-fips
|
280
|
+
* nist-gcr
|
281
|
+
* nist-hb
|
282
|
+
* itl-bulletin
|
283
|
+
* jpcrd
|
284
|
+
* nist-jres
|
285
|
+
* letter-circular
|
286
|
+
* nist-monograph
|
287
|
+
* nist-ncstar
|
288
|
+
* nist-nsrds
|
289
|
+
* nistir
|
290
|
+
* product-stadnards
|
291
|
+
* nist-sp
|
292
|
+
* nist-tn
|
293
|
+
* other
|
294
|
+
* csrc-white-paper
|
295
|
+
* csrc-book
|
296
|
+
* csrc-use-case
|
291
297
|
* csrc-building-block
|
292
298
|
--
|
293
299
|
|
@@ -345,45 +351,54 @@ is not currently retired (as indicated through `:substage: retired`),
|
|
345
351
|
but will be in the future, that is still indicated in the rendering of the document.
|
346
352
|
|
347
353
|
`:sponsor:`::
|
348
|
-
The name of the organization that has sponsored the document, if applicable.
|
354
|
+
The name of the organization that has sponsored the document, if applicable. The attribute can
|
355
|
+
contain multiple lines and Metanorma formatting.
|
349
356
|
|
350
357
|
`:sponsor-logo:`::
|
351
358
|
The logo of the sponsoring organization, if applicable.
|
352
359
|
|
353
|
-
`:superseding-status
|
360
|
+
`:superseding-status:`:: Document status/stage of the superseding document, if this document is
|
354
361
|
superseded or withdrawn. Used for withdrawn drafts. Used for withdrawn published documents,
|
355
362
|
if an entry for the superseding document is not available on the CSRC website (where it can be
|
356
363
|
retrieved through the `:obsoleted-by:` document attribute.)
|
364
|
+
|
357
365
|
`:superseding-iteration:`:: The iteration of the stage of the superseding document,
|
358
366
|
in case there have been multiple drafts. Can be a number, or text (e.g. "initial", "final").
|
359
|
-
Used for withdrawn drafts.
|
367
|
+
Used for withdrawn drafts.
|
368
|
+
|
360
369
|
`:superseding-title:`:: The title of the draft document superseding this document.
|
361
370
|
If not supplied, the current title is assumed to have been retained. Used for withdrawn drafts.
|
362
371
|
Used for withdrawn published documents,
|
363
372
|
if an entry for the superseding document is not available on the CSRC website (where it can be
|
364
373
|
retrieved through the `:obsoleted-by:` document attribute.)
|
374
|
+
|
365
375
|
`:superseding-subtitle:`:: The subtitle of the draft document superseding this document.
|
366
376
|
If not supplied, the current subtitle is assumed to have been retained. Used for withdrawn drafts.
|
367
377
|
Used for withdrawn published documents,
|
368
378
|
if an entry for the superseding document is not available on the CSRC website (where it can be
|
369
379
|
retrieved through the `:obsoleted-by:` document attribute.)
|
380
|
+
|
370
381
|
`:superseding-circulated-date:`::
|
371
382
|
The date at which the draft document superseding this document is circulated. Used for withdrawn drafts.
|
372
|
-
|
373
|
-
|
383
|
+
|
384
|
+
`:superseding-issued-date:`::
|
385
|
+
The date at which the document superseding this document was authorised to be published.
|
374
386
|
Used for withdrawn published documents,
|
375
387
|
if an entry for the superseding document is not available on the CSRC website (where it can be
|
376
388
|
retrieved through the `:obsoleted-by:` document attribute.)
|
389
|
+
|
377
390
|
`:superseding-doi:`::
|
378
391
|
The DOI of the document superseding this document. Used for withdrawn drafts.
|
379
392
|
Used for withdrawn published documents,
|
380
393
|
if an entry for the superseding document is not available on the CSRC website (where it can be
|
381
394
|
retrieved through the `:obsoleted-by:` document attribute.)
|
395
|
+
|
382
396
|
`:superseding-url:`::
|
383
397
|
The URL of the document superseding this document. Used for withdrawn drafts.
|
384
398
|
Used for withdrawn published documents,
|
385
399
|
if an entry for the superseding document is not available on the CSRC website (where it can be
|
386
400
|
retrieved through the `:obsoleted-by:` document attribute.)
|
401
|
+
|
387
402
|
`:superseding-authors:`::
|
388
403
|
The authors of the superseding document. Comma-delimited. Used for withdrawn published documents,
|
389
404
|
if an entry for the superseding document is not available on the CSRC website (where it can be
|
@@ -391,7 +406,9 @@ retrieved through the `:obsoleted-by:` document attribute.)
|
|
391
406
|
|
392
407
|
`:bib-additional-note:`:: Additional note (optional), used on coverpage of withdrawn and retired drafts, and as
|
393
408
|
"Related Information" on coverpage of withdrawn published documents.
|
409
|
+
|
394
410
|
`:bib-withdrawal-note:`:: Withdrawal note, used on coverpage of withdrawn published documents.
|
411
|
+
|
395
412
|
`:bib-withdrawal-announcement-link:`:: Hyperlink to announcement of withdrawal, used on coverpage of withdrawn published documents.
|
396
413
|
|
397
414
|
== Asciidoctor features specific to NIST
|
@@ -402,20 +419,20 @@ The following markup is specific to this gem:
|
|
402
419
|
|
403
420
|
=== Authority statement
|
404
421
|
|
405
|
-
The authority statement in NIST consists of five sections
|
406
|
-
|
422
|
+
The authority statement in NIST consists of five sections. They are semantically encoded in Metanorma
|
423
|
+
XML under the `boilerplate` tag, as subclauses:
|
407
424
|
|
408
|
-
`authority1`:: The initial section of the authority section ("This publication has been developed
|
425
|
+
`boilerplate/legal-statement/clause[@id = 'authority1']`:: The initial section of the authority section ("This publication has been developed
|
409
426
|
by NIST...").
|
410
|
-
`authority2`:: The identifier, revision date, and URL of the document.
|
411
|
-
`authority3`:: The boxed disclaimer statement ("Any mention of commercial products or reference to commercial organizations...")
|
412
|
-
`authority4`:: The public comment period, for drafts
|
413
|
-
`authority5`:: The contact details for comments
|
427
|
+
`boilerplate/legal-statement/clause[@id = 'authority2']`:: The identifier, revision date, and URL of the document.
|
428
|
+
`boilerplate/legal-statement/clasue[@id = 'authority3']`:: The boxed disclaimer statement ("Any mention of commercial products or reference to commercial organizations...")
|
429
|
+
`boilerplate/feedback-statement/clause[@id = 'authority4']`:: The public comment period, for drafts
|
430
|
+
`boilerplate/feedback-statement/clause[@id = 'authority5']`:: The contact details for comments
|
414
431
|
|
415
432
|
The authority statement has been marked up in Metanorma XML rather than Asciidoctor because of its complexity.
|
416
433
|
If you wish to supply a different authority statement, you will need to provide a piece of Metanorma XML corresponding
|
417
434
|
to the existing default statement (available from link:lib/asciidoctor/nist/nist_intro.xml[]), and containing
|
418
|
-
text corresponding to the sections given above. You can give the location of your own authority statement file
|
435
|
+
text corresponding to the sections given above. You can give the location of your own authority statement file
|
419
436
|
relative to the current document through the document attribute `:boilerplate-authority:`.
|
420
437
|
|
421
438
|
=== Author affiliations
|
@@ -603,7 +620,7 @@ stem:[A= {x_1, x_2, ..., x_k}]:: The alphabet, i.e., the set of all possible sym
|
|
603
620
|
=== Document status
|
604
621
|
|
605
622
|
The following table illustrates how transitions between stages of NIST documents are indicated
|
606
|
-
using `:status:`, `:substage:`, `:iteration:`, and `:confirmed-date`.
|
623
|
+
using `:status:`, `:substage:`, `:iteration:`, and `:confirmed-date`.
|
607
624
|
|
608
625
|
|===
|
609
626
|
| ISO stage | NIST | 93 Repeat current phase | 98 Abandon | 99 Proceed
|
@@ -615,30 +632,103 @@ using `:status:`, `:substage:`, `:iteration:`, and `:confirmed-date`.
|
|
615
632
|
| 50 Approval | (NIST ERB review) | | `:status: draft-public`, `:substage: retired` | `:status: final`
|
616
633
|
| 60 Publication | `:status: final`
|
617
634
|
| 90 Review | `:status: final-review` | `:status: final`, `:confirmed-date: XXXX-XX-XX` | `:status: final`, `:substage: withdrawn` | `:status: draft-internal` (revise or amend)
|
618
|
-
| 95 Withdrawal | `:status: final`, `:substage: withdrawn` | | |
|
635
|
+
| 95 Withdrawal | `:status: final`, `:substage: withdrawn` | | |
|
619
636
|
|===
|
620
637
|
|
621
638
|
In the following, parentheses indicate optional attributes.
|
622
639
|
|
623
|
-
* For retired drafts, the following attributes must be provided: `:circulated-date:`,
|
640
|
+
* For retired drafts, the following attributes must be provided: `:circulated-date:`,
|
624
641
|
`:abandoned-date:`, (`:bib-additional-note:`)
|
625
642
|
* For withdrawn drafts, the following attributes must be provided: `:circulated-date:`, `:obsoleted-date:`,
|
626
|
-
`:superseding-status:`, (`:superseding-iteration:`), (`:superseding-title:`),
|
627
|
-
(`:superseding-subtitle:`), `:superseding-circulated-date:`, (`:superseding-doi:`),
|
643
|
+
`:superseding-status:`, (`:superseding-iteration:`), (`:superseding-title:`),
|
644
|
+
(`:superseding-subtitle:`), `:superseding-circulated-date:`, (`:superseding-doi:`),
|
628
645
|
(`:superseding-url:`), (`:bib-additional-note:`)
|
629
|
-
* For withdrawn published documents, the following attributes must be provided: `:
|
646
|
+
* For withdrawn published documents, the following attributes must be provided: `:issued-date:`, `:obsoleted-date:` (when
|
630
647
|
the current document is no longer in effect), `:superseded-date:` (when the transition period started, during which both
|
631
648
|
documents were in effect, if applicable; if not, this has the same value as `:obsoleted-date:`), `:revdate:` (for
|
632
|
-
when the withdrawal notice was added to the document), (`:bib-additional-note:`)
|
633
|
-
("Related Information" in the withdrawn document coverpage), `:obsoleted-by:` (giving the superseding document identifier),
|
649
|
+
when the withdrawal notice was added to the document), (`:bib-additional-note:`)
|
650
|
+
("Related Information" in the withdrawn document coverpage), `:obsoleted-by:` (giving the superseding document identifier),
|
634
651
|
`:nist-division:`, (`:bib-withdrawal-note:`), (`:bib-withdrawal-announcement-link:`). If the details
|
635
652
|
of the superseding document are not available to be retrieved from the CSRC website), the following attributes must
|
636
|
-
be provided: `:superseding-title:`, (`:superseding-subtitle:`), `:superseding-
|
653
|
+
be provided: `:superseding-title:`, (`:superseding-subtitle:`), `:superseding-issued-date:`, `:superseding-status:`,
|
637
654
|
`:superseding-doi:`, `:superseding-url:`.
|
638
655
|
|
656
|
+
=== Document identifier
|
657
|
+
|
658
|
+
There are three identifiers automatically generated by Metanorma for NIST documents; they
|
659
|
+
can be overridden by providing a `:docidentifier:` value.
|
660
|
+
|
661
|
+
* The NIST identifier is composed as follows:
|
662
|
+
** The Abbreviated NIST Series that the document belong to
|
663
|
+
** The document identifier within the series
|
664
|
+
** "Volume " followed by the volume number, if present
|
665
|
+
** A comma, if there is both a volume number and a revision number
|
666
|
+
** "Revision " followed by the revision number, if present
|
667
|
+
** The draft abbreviation in parentheses, if present:
|
668
|
+
*** The iteration number. For public drafts, the first iteration is abbreviated I, the final iteration as F.
|
669
|
+
For work-in-progress and preliminary drafts, the first iteration is not shown.
|
670
|
+
*** The abbreviation of the draft stage: WD for Work-In-Progress, PreD for Preliminary, PD for public.
|
671
|
+
*** So: WD, 2WD, 3WD, FWD; PreD, 2PreD, 3PreD, FPreD; IPD, 2PD, 3PD, FPD
|
672
|
+
** The update date, in parentheses, MMM dd, yyyy format, if present. The update date is:
|
673
|
+
*** If the document is published (`:status:` starts with `final`), the date of an errata release (`:update-date:`).
|
674
|
+
If there is a revision published for the document, that revision is by default now identified by a revision
|
675
|
+
number, rather than a publication date; but NIST practice varies, and this can be overridden by providing
|
676
|
+
a full identifier in `:docidentifier:`.
|
677
|
+
*** If the document is a draft (`:status:` starts with `draft`), the date at which the draft was circulated
|
678
|
+
(`:circulated-date:`). If `:circulated-date:` is not provided, the date the document was last revised,
|
679
|
+
`:revdate:`, may be used instead; but document citation assumes that the document is stable enough to be cited
|
680
|
+
only at the time it is formally released.
|
681
|
+
|
682
|
+
=== Hyperlinks
|
683
|
+
|
684
|
+
For accessibility, NIST authors are expected to insert tool tips into the hyperlinks they generate in Word documents.
|
685
|
+
The equivalent in Metanorma is to include alt text in any hyperlinks in Asciidoctor, using the `title` attribute
|
686
|
+
of hyperlinks, as illustrated in the following:
|
687
|
+
|
688
|
+
[source,asciidoctor]
|
689
|
+
--
|
690
|
+
http://www.example.com[See the example.com link,title=tooltip text]
|
691
|
+
--
|
692
|
+
|
693
|
+
=== Tables
|
694
|
+
|
695
|
+
For accessibility, NIST authors are expected to insert titles into tables in Word documents as summaries.
|
696
|
+
The equivalent in Metanorma is to include alt text in any hyperlinks in Asciidoctor, using the `alt` attribute
|
697
|
+
of tables, as illustrated in the following:
|
698
|
+
|
699
|
+
[source,asciidoctor]
|
700
|
+
--
|
701
|
+
[[table-crossreference-id]]
|
702
|
+
.Table caption
|
703
|
+
[alt="Table summary, for use in accessible media"]
|
704
|
+
|===
|
705
|
+
| Head | Head
|
706
|
+
|
707
|
+
| Body | Body
|
708
|
+
| Body | Body
|
709
|
+
|===
|
710
|
+
--
|
639
711
|
|
640
712
|
|
641
713
|
////
|
714
|
+
=== Sponsor
|
715
|
+
|
716
|
+
The title page templates cater for at most one sponsoring organization and its logo. If more than one
|
717
|
+
sponsor is involved, manual intervention will be required on the title page.
|
718
|
+
|
719
|
+
The sponsor logo (`:sponsor-logo:`) is an image file, and it appears on the left hand side of the Word
|
720
|
+
title page, oppose the NIST logo. The sponsor name (`:sponsor:`) appears underneath the logo. The attribute
|
721
|
+
can be just the name, or it can be a multi-line attribute, containing Asciidoctor markup. In that case,
|
722
|
+
it should be entered using Asciidoctor conventions for multi-line document attributes, with `\ +` used for
|
723
|
+
line breaks:
|
724
|
+
|
725
|
+
[source,asciidoctor]
|
726
|
+
----
|
727
|
+
:sponsor-logo:fema.gif
|
728
|
+
:sponsor: *Department of Homeland Security* \ + Janet Napolitano, _Secretary_ \ + *Federal Emergency Management Association* \ + Craig Fugate, _Administrator_ \ + *United States Fire Administration* \+ Kelvin J. Cochran, _Assistant Administrator_
|
729
|
+
----
|
730
|
+
////
|
731
|
+
|
642
732
|
|
643
733
|
== Examples
|
644
734
|
|
@@ -35,7 +35,28 @@
|
|
35
35
|
</define>
|
36
36
|
<define name="status">
|
37
37
|
<element name="status">
|
38
|
-
<ref name="
|
38
|
+
<ref name="stage"/>
|
39
|
+
<optional>
|
40
|
+
<ref name="substage"/>
|
41
|
+
</optional>
|
42
|
+
<optional>
|
43
|
+
<ref name="iteration"/>
|
44
|
+
</optional>
|
45
|
+
</element>
|
46
|
+
</define>
|
47
|
+
<define name="stage">
|
48
|
+
<element name="stage">
|
49
|
+
<text/>
|
50
|
+
</element>
|
51
|
+
</define>
|
52
|
+
<define name="substage">
|
53
|
+
<element name="substage">
|
54
|
+
<text/>
|
55
|
+
</element>
|
56
|
+
</define>
|
57
|
+
<define name="iteration">
|
58
|
+
<element name="iteration">
|
59
|
+
<text/>
|
39
60
|
</element>
|
40
61
|
</define>
|
41
62
|
<define name="language">
|
@@ -48,17 +48,17 @@ module Asciidoctor
|
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
51
|
-
def
|
52
|
-
if x.at("//
|
53
|
-
boilerplate = x.at("//
|
54
|
-
preface.
|
51
|
+
def move_authority_before_preface(x, preface)
|
52
|
+
if x.at("//boilerplate")
|
53
|
+
boilerplate = x.at("//boilerplate")
|
54
|
+
preface.previous = boilerplate.remove
|
55
55
|
else
|
56
|
-
preface.
|
56
|
+
preface.previous = boilerplate(x)
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|
60
60
|
def move_sections_into_preface(x, preface)
|
61
|
-
|
61
|
+
move_authority_before_preface(x, preface)
|
62
62
|
abstract = x.at("//abstract") and preface.add_child abstract.remove
|
63
63
|
foreword = x.at("//foreword") and preface.add_child foreword.remove
|
64
64
|
intro = x.at("//introduction") and preface.add_child intro.remove
|
@@ -176,7 +176,7 @@ module Asciidoctor
|
|
176
176
|
a = { id: Asciidoctor::Standoc::Utils::anchor_or_uuid(node) }
|
177
177
|
noko do |xml|
|
178
178
|
case sectiontype(node)
|
179
|
-
when "normative references" then norm_ref_parse(a, xml, node)
|
179
|
+
#when "normative references" then norm_ref_parse(a, xml, node)
|
180
180
|
when "glossary", "terminology"
|
181
181
|
if node.attr("style") == "appendix" && node.level == 1
|
182
182
|
@term_def = true
|
@@ -78,34 +78,54 @@ module Asciidoctor
|
|
78
78
|
did
|
79
79
|
end
|
80
80
|
|
81
|
+
def id_args(node, dn0)
|
82
|
+
{
|
83
|
+
id: dn0,
|
84
|
+
series: node.attr("series"),
|
85
|
+
revision: node.attr("revision"),
|
86
|
+
vol: node.attr("volume"),
|
87
|
+
stage: node.attr("status") || node.attr("docstage"),
|
88
|
+
iter: node.attr("iteration"),
|
89
|
+
date: /^draft/.match(node.attr("status") || node.attr("docstage")) ?
|
90
|
+
(node.attr("circulated-date") || node.attr("revdate")) :
|
91
|
+
node.attr("updated-date")
|
92
|
+
}
|
93
|
+
end
|
94
|
+
|
81
95
|
def metadata_id_compose(node, xml, dn0)
|
82
96
|
return unless dn0
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
xml.docidentifier add_id_parts(dn0, s, e, v, false),
|
87
|
-
**attr_code(type: "nist")
|
88
|
-
xml.docidentifier add_id_parts(dn0, s, e, v, true),
|
97
|
+
args = id_args(node, dn0)
|
98
|
+
xml.docidentifier add_id_parts(args, false), **attr_code(type: "nist")
|
99
|
+
xml.docidentifier add_id_parts(args, true),
|
89
100
|
**attr_code(type: "nist-long")
|
90
|
-
xml.docidentifier add_id_parts_mr(
|
91
|
-
|
101
|
+
xml.docidentifier add_id_parts_mr(args), **attr_code(type: "nist-mr")
|
102
|
+
end
|
103
|
+
|
104
|
+
def MMMddyyyy(isodate)
|
105
|
+
return nil if isodate.nil?
|
106
|
+
Date.parse(isodate).strftime("%B %d, %Y")
|
92
107
|
end
|
93
108
|
|
94
|
-
def add_id_parts(
|
109
|
+
def add_id_parts(args, long)
|
95
110
|
vol_delim = " Volume "
|
96
111
|
ed_delim = " Revision "
|
97
|
-
series and series_name = long ?
|
98
|
-
|
99
|
-
|
100
|
-
dn
|
101
|
-
dn += "
|
102
|
-
dn += "
|
112
|
+
args[:series] and series_name = long ?
|
113
|
+
SERIES.dig(args[:series].to_sym) :
|
114
|
+
SERIES_ABBR.dig(args[:series].to_sym)
|
115
|
+
dn = (series_name || "NIST #{args[:series]}") + " " + args[:id]
|
116
|
+
dn += "#{vol_delim}#{args[:vol]}" if args[:vol]
|
117
|
+
dn += "," if args[:vol] && args[:revision]
|
118
|
+
dn += "#{ed_delim}#{args[:revision]}" if args[:revision]
|
119
|
+
stage = IsoDoc::NIST::Metadata.new(nil, nil, {}).stage_abbr(args[:stage], args[:iter])
|
120
|
+
dn += " (#{stage})" if stage
|
121
|
+
dn += " (#{MMMddyyyy(args[:date])})" if args[:date]
|
103
122
|
dn
|
104
123
|
end
|
105
124
|
|
106
|
-
def add_id_parts_mr(
|
107
|
-
series and
|
108
|
-
|
125
|
+
def add_id_parts_mr(args)
|
126
|
+
args[:series] and
|
127
|
+
name = SERIES_ABBR.dig(args[:series].to_sym).sub(/^NIST /, "")
|
128
|
+
"NIST.#{name}.#{args[:vol]}.#{args[:revision]}.#{args[:date]}"
|
109
129
|
end
|
110
130
|
|
111
131
|
def metadata_author(node, xml)
|
@@ -141,7 +161,7 @@ module Asciidoctor
|
|
141
161
|
end
|
142
162
|
|
143
163
|
def metadata_status(node, xml)
|
144
|
-
status = node.attr("status") || "final"
|
164
|
+
status = node.attr("status") || node.attr("docstage") || "final"
|
145
165
|
xml.status do |s|
|
146
166
|
s.stage status
|
147
167
|
s.substage (node.attr("substage") || "active")
|
@@ -238,8 +258,8 @@ module Asciidoctor
|
|
238
258
|
b.date **{ type: "circulated" } do |d|
|
239
259
|
d.on cdate
|
240
260
|
end
|
241
|
-
cdate = node.attr("superseding-
|
242
|
-
b.date **{ type: "
|
261
|
+
cdate = node.attr("superseding-issued-date") and
|
262
|
+
b.date **{ type: "issued" } do |d|
|
243
263
|
d.on cdate
|
244
264
|
end
|
245
265
|
end
|