metanorma-nist 0.0.1 → 0.0.2
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/README.adoc +2 -10
- data/Rakefile +6 -0
- data/lib/asciidoctor/nist/biblio.rng +21 -11
- data/lib/asciidoctor/nist/front.rb +1 -41
- data/lib/asciidoctor/nist/isodoc.rng +3 -0
- data/lib/isodoc/nist/html/html_nist_titlepage.html +4 -2
- data/lib/isodoc/nist/html/htmlstyle.scss +4 -1
- data/lib/isodoc/nist/html/nist.scss +30 -6
- data/lib/isodoc/nist/html/word_nist_titlepage.html +7 -6
- data/lib/isodoc/nist/html/wordstyle.scss +33 -0
- data/lib/isodoc/nist/metadata.rb +2 -20
- data/lib/isodoc/nist/word_convert.rb +13 -0
- data/lib/metanorma/nist/version.rb +1 -1
- data/metanorma-nist.gemspec +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: efbc5ed91c60f75c2357b75e8e4b46aff94fbbda2e5ff42b5ae23ccdacee11b8
|
|
4
|
+
data.tar.gz: e11867a00497daa2adde0df1a6589fa8100e3ede705e9c35aabb06083b5bee95
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b22030c9411714d60f7d5a4331ebdb558801a4054844658179c82ce8df69cb7893d38ba704438df0092407e4708d3b7317ce83221aa82db768f90ba85e994a7f
|
|
7
|
+
data.tar.gz: c8f098eec3c4b877b86425f06bfc5d82c5b4e0dbd9472a75073ce18389d0ded1936923348d1d51050df38c663f8f3689e4bf72b3be7b5fc06a64d68b6308a825
|
data/README.adoc
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
= metanorma-nist: Metanorma processor for the NIST SP 800 document classes
|
|
2
2
|
|
|
3
3
|
image:https://img.shields.io/gem/v/metanorma-nist.svg["Gem Version", link="https://rubygems.org/gems/metanorma-nist"]
|
|
4
|
-
image:https://img.shields.io/travis/riboseinc/metanorma-nist/master.svg["Build Status", link="https://travis-ci.
|
|
4
|
+
image:https://img.shields.io/travis/riboseinc/metanorma-nist/master.svg["Build Status", link="https://travis-ci.com/riboseinc/metanorma-nist"]
|
|
5
5
|
image:https://codeclimate.com/github/riboseinc/metanorma-nist/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/riboseinc/metanorma-nist"]
|
|
6
6
|
|
|
7
7
|
WARNING: This gem is still under development.
|
|
@@ -202,15 +202,7 @@ The following document attributes are specific to this document class:
|
|
|
202
202
|
|
|
203
203
|
`:keywords:`:: Comma-delimited list of the keywords associated with the document.
|
|
204
204
|
|
|
205
|
-
`:
|
|
206
|
-
A second person is indicated by using a numeric suffix: `:fullname:`, `:fullname_2:`, `fullname_3:`, &c.
|
|
207
|
-
|
|
208
|
-
`:surname{_i}:`:: The surname of a person who is a contributor to the document.
|
|
209
|
-
`:givenname{_i}:`:: The given name(s) of a person who is a contributor to the document.
|
|
210
|
-
`:role{_i}:`:: The role of a a person who is a contributor to the document. By default,
|
|
211
|
-
they are coded as an `editor`; they can also be represented as an `author`.
|
|
212
|
-
|
|
213
|
-
`:email:`:: Email contact for document
|
|
205
|
+
`:doc-email:`:: Email contact for document
|
|
214
206
|
|
|
215
207
|
== Asciidoctor features specific to NIST
|
|
216
208
|
|
data/Rakefile
ADDED
|
@@ -286,18 +286,23 @@
|
|
|
286
286
|
</define>
|
|
287
287
|
<define name="address">
|
|
288
288
|
<element name="address">
|
|
289
|
-
<
|
|
289
|
+
<choice>
|
|
290
290
|
<!-- iso191606 TODO -->
|
|
291
|
-
<
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
291
|
+
<group>
|
|
292
|
+
<oneOrMore>
|
|
293
|
+
<ref name="street"/>
|
|
294
|
+
</oneOrMore>
|
|
295
|
+
<ref name="city"/>
|
|
296
|
+
<optional>
|
|
297
|
+
<ref name="state"/>
|
|
298
|
+
</optional>
|
|
299
|
+
<ref name="country"/>
|
|
300
|
+
<optional>
|
|
301
|
+
<ref name="postcode"/>
|
|
302
|
+
</optional>
|
|
303
|
+
</group>
|
|
304
|
+
<ref name="formattedAddress"/>
|
|
305
|
+
</choice>
|
|
301
306
|
</element>
|
|
302
307
|
</define>
|
|
303
308
|
<define name="street">
|
|
@@ -325,6 +330,11 @@
|
|
|
325
330
|
<text/>
|
|
326
331
|
</element>
|
|
327
332
|
</define>
|
|
333
|
+
<define name="formattedAddress">
|
|
334
|
+
<element name="formattedAddress">
|
|
335
|
+
<text/>
|
|
336
|
+
</element>
|
|
337
|
+
</define>
|
|
328
338
|
<define name="person-identifier">
|
|
329
339
|
<element name="identifier">
|
|
330
340
|
<attribute name="type">
|
|
@@ -20,46 +20,6 @@ module Asciidoctor
|
|
|
20
20
|
personal_author(node, xml)
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
-
def personal_author(node, xml)
|
|
24
|
-
personal_editor(node, xml)
|
|
25
|
-
if node.attr("fullname") || node.attr("surname")
|
|
26
|
-
personal_author1(node, xml, "")
|
|
27
|
-
end
|
|
28
|
-
i = 2
|
|
29
|
-
while node.attr("fullname_#{i}") || node.attr("surname_#{i}")
|
|
30
|
-
personal_author1(node, xml, "_#{i}")
|
|
31
|
-
i += 1
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
def personal_editor(node, xml)
|
|
36
|
-
return unless node.attr("editor")
|
|
37
|
-
xml.contributor do |c|
|
|
38
|
-
c.role **{ type: "editor" }
|
|
39
|
-
c.person do |p|
|
|
40
|
-
p.name do |n|
|
|
41
|
-
n.completename node.attr("editor")
|
|
42
|
-
end
|
|
43
|
-
end
|
|
44
|
-
end
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
def personal_author1(node, xml, suffix)
|
|
48
|
-
xml.contributor do |c|
|
|
49
|
-
c.role **{ type: node&.attr("role#{suffix}")&.downcase || "editor" }
|
|
50
|
-
c.person do |p|
|
|
51
|
-
p.name do |n|
|
|
52
|
-
if node.attr("fullname#{suffix}")
|
|
53
|
-
n.completename node.attr("fullname#{suffix}")
|
|
54
|
-
else
|
|
55
|
-
n.forename node.attr("givenname#{suffix}")
|
|
56
|
-
n.surname node.attr("surname#{suffix}")
|
|
57
|
-
end
|
|
58
|
-
end
|
|
59
|
-
end
|
|
60
|
-
end
|
|
61
|
-
end
|
|
62
|
-
|
|
63
23
|
def metadata_publisher(node, xml)
|
|
64
24
|
xml.contributor do |c|
|
|
65
25
|
c.role **{ type: "publisher" }
|
|
@@ -122,7 +82,7 @@ module Asciidoctor
|
|
|
122
82
|
|
|
123
83
|
def metadata_source(node, xml)
|
|
124
84
|
super
|
|
125
|
-
node.attr("email") && xml.
|
|
85
|
+
node.attr("doc-email") && xml.uri(node.attr("doc-email"), type: "email")
|
|
126
86
|
end
|
|
127
87
|
|
|
128
88
|
def title(node, xml)
|
|
@@ -43,9 +43,11 @@
|
|
|
43
43
|
<div class="rule-thick"></div>
|
|
44
44
|
|
|
45
45
|
<div class="authors-container">
|
|
46
|
-
{% for
|
|
46
|
+
{% for affiliation in authors_affiliations %}
|
|
47
|
+
{% for author in affiliation[1] %}
|
|
47
48
|
<div class="author">{{ author }}</div>
|
|
48
|
-
|
|
49
|
+
{% endfor %}
|
|
50
|
+
<div class="affiliation">{{affiliation[0]}}</div>
|
|
49
51
|
{% endfor %}
|
|
50
52
|
</div>
|
|
51
53
|
|
|
@@ -678,19 +678,21 @@ span.nistvariable {
|
|
|
678
678
|
background-color: #e1eef1;
|
|
679
679
|
padding: 1.2em;
|
|
680
680
|
margin: 2em 0 1em 0;
|
|
681
|
+
padding-left: 2em;
|
|
681
682
|
}
|
|
682
683
|
|
|
683
684
|
.example .example-title {
|
|
684
685
|
font-weight: 700;
|
|
685
686
|
text-transform: uppercase;
|
|
686
|
-
text-align: center;
|
|
687
687
|
margin-top:0;
|
|
688
|
+
margin-left:-1.5em;
|
|
688
689
|
}
|
|
689
690
|
|
|
690
691
|
.pseudocode {
|
|
691
692
|
background-color: #dddddd;
|
|
692
693
|
padding: 1.2em;
|
|
693
694
|
margin: 2em 0 1em 0;
|
|
695
|
+
padding-left: 2em;
|
|
694
696
|
}
|
|
695
697
|
|
|
696
698
|
.pseudocode .example-title {
|
|
@@ -698,6 +700,7 @@ span.nistvariable {
|
|
|
698
700
|
text-transform: uppercase;
|
|
699
701
|
text-align: center;
|
|
700
702
|
margin-top:0;
|
|
703
|
+
margin-left:-1.5em;
|
|
701
704
|
}
|
|
702
705
|
|
|
703
706
|
.recommend {
|
|
@@ -13,6 +13,22 @@ p.Author, li.Author, div.Author
|
|
|
13
13
|
mso-bidi-font-family:"Times New Roman";
|
|
14
14
|
mso-ansi-language:EN-US;
|
|
15
15
|
mso-fareast-language:EN-US;}
|
|
16
|
+
p.Affiliation, li.Affiliation, div.Affiliation
|
|
17
|
+
{mso-style-name:Author;
|
|
18
|
+
mso-style-unhide:no;
|
|
19
|
+
mso-style-qformat:yes;
|
|
20
|
+
margin:0cm;
|
|
21
|
+
margin-bottom:.0001pt;
|
|
22
|
+
text-align:right;
|
|
23
|
+
font-style:italic;
|
|
24
|
+
mso-pagination:widow-orphan;
|
|
25
|
+
mso-hyphenate:none;
|
|
26
|
+
font-size:14.0pt;
|
|
27
|
+
font-family:"Times New Roman",serif;
|
|
28
|
+
mso-fareast-font-family:"Times New Roman";
|
|
29
|
+
mso-bidi-font-family:"Times New Roman";
|
|
30
|
+
mso-ansi-language:EN-US;
|
|
31
|
+
mso-fareast-language:EN-US;}
|
|
16
32
|
p.ReportNumber, li.ReportNumber, div.ReportNumber
|
|
17
33
|
{mso-style-name:"Report Number";
|
|
18
34
|
mso-style-unhide:no;
|
|
@@ -715,13 +731,17 @@ div.coverpage_warning
|
|
|
715
731
|
aside {
|
|
716
732
|
font-size:10.0pt;
|
|
717
733
|
}
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
734
|
+
|
|
735
|
+
.example-title {
|
|
736
|
+
font-weight: bold;
|
|
737
|
+
margin-left: -36.0pt;
|
|
721
738
|
}
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
739
|
+
|
|
740
|
+
p.example, li.example, div.example, td.example {
|
|
741
|
+
margin-top: 0cm;
|
|
742
|
+
margin-right: 36.0pt;
|
|
743
|
+
margin-bottom: 0cm;
|
|
744
|
+
margin-left: 36.0pt;
|
|
725
745
|
mso-pagination:none;
|
|
726
746
|
font-size:10.0pt;
|
|
727
747
|
font-family:$bodyfont;}
|
|
@@ -730,6 +750,10 @@ td.example p.MsoListParagraph {
|
|
|
730
750
|
font-size: 10.0pt;
|
|
731
751
|
}
|
|
732
752
|
|
|
753
|
+
td.example p.MsoListParagraph {
|
|
754
|
+
font-size: 10.0pt;
|
|
755
|
+
}
|
|
756
|
+
|
|
733
757
|
span.note_label, span.example_label, td.example_label, td.note_label
|
|
734
758
|
{
|
|
735
759
|
font-size: 10.0pt;
|
|
@@ -152,13 +152,14 @@ mso-fareast-font-family:"Times New Roman";mso-ansi-language:EN-US;mso-fareast-la
|
|
|
152
152
|
EN-US;mso-bidi-language:AR-SA;margin-bottom:0.0pt'><br clear="all" style='page-break-before:auto;'/>
|
|
153
153
|
</span>
|
|
154
154
|
|
|
155
|
-
<div>
|
|
156
|
-
|
|
157
|
-
{% for author in
|
|
158
|
-
<p class="Author">{{ author }}</
|
|
155
|
+
<div class="authors-container">
|
|
156
|
+
{% for affiliation in authors_affiliations %}
|
|
157
|
+
{% for author in affiliation[1] %}
|
|
158
|
+
<p class="Author">{{ author }}</div>
|
|
159
159
|
{% endfor %}
|
|
160
|
-
|
|
161
|
-
|
|
160
|
+
<p class="Affiliation">{{affiliation[0]}}</div>
|
|
161
|
+
{% endfor %}
|
|
162
|
+
</div>
|
|
162
163
|
|
|
163
164
|
<span lang="EN-US" style='font-size:14.0pt;font-family:"Times New Roman",serif;
|
|
164
165
|
mso-fareast-font-family:"Times New Roman";color:black;mso-ansi-language:EN-US;
|
|
@@ -348,6 +348,39 @@ h1
|
|
|
348
348
|
mso-ansi-language:EN-GB;
|
|
349
349
|
mso-fareast-language:JA;
|
|
350
350
|
mso-bidi-font-weight:normal;}
|
|
351
|
+
.h1Preface
|
|
352
|
+
{mso-style-priority:1;
|
|
353
|
+
mso-style-unhide:no;
|
|
354
|
+
mso-style-qformat:yes;
|
|
355
|
+
mso-style-link:"Heading 1 Char";
|
|
356
|
+
mso-style-next:Normal;
|
|
357
|
+
margin-top:0in;
|
|
358
|
+
margin-right:0in;
|
|
359
|
+
margin-bottom:12.0pt;
|
|
360
|
+
margin-left:.4in;
|
|
361
|
+
text-align:center;
|
|
362
|
+
text-indent:-.4in;
|
|
363
|
+
mso-pagination:none;
|
|
364
|
+
page-break-after:avoid;
|
|
365
|
+
page-break-before:avoid;
|
|
366
|
+
mso-hyphenate:none;
|
|
367
|
+
tab-stops:list .4in;
|
|
368
|
+
background:white;
|
|
369
|
+
mso-layout-grid-align:none;
|
|
370
|
+
border:none;
|
|
371
|
+
mso-border-alt:none;
|
|
372
|
+
padding:0in;
|
|
373
|
+
mso-padding-alt:1.0pt 4.0pt 1.0pt 4.0pt;
|
|
374
|
+
font-size:12.0pt;
|
|
375
|
+
mso-bidi-font-size:10.0pt;
|
|
376
|
+
font-family:$headerfont;
|
|
377
|
+
mso-fareast-font-family:$headerfont;
|
|
378
|
+
color:black;
|
|
379
|
+
mso-font-kerning:0pt;
|
|
380
|
+
mso-ansi-language:EN-GB;
|
|
381
|
+
mso-fareast-language:JA;
|
|
382
|
+
font-weight:bold;
|
|
383
|
+
mso-bidi-font-weight:normal;}
|
|
351
384
|
|
|
352
385
|
h1.AbstractTitle, h1.IntroTitle {
|
|
353
386
|
background:white;
|
data/lib/isodoc/nist/metadata.rb
CHANGED
|
@@ -22,25 +22,7 @@ module IsoDoc
|
|
|
22
22
|
def author(isoxml, _out)
|
|
23
23
|
tc = isoxml.at(ns("//bibdata/editorialgroup/committee"))
|
|
24
24
|
set(:tc, tc.text.upcase) if tc
|
|
25
|
-
|
|
26
|
-
"or xmlns:role/@type = 'editor']/person/name"))
|
|
27
|
-
set(:authors, extract_person_names(authors))
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
def extract_person_names(authors)
|
|
31
|
-
ret = []
|
|
32
|
-
authors.each do |a|
|
|
33
|
-
if a.at(ns("./completename"))
|
|
34
|
-
ret << a.at(ns("./completename")).text
|
|
35
|
-
else
|
|
36
|
-
fn = []
|
|
37
|
-
forenames = a.xpath(ns("./forename"))
|
|
38
|
-
forenames.each { |f| fn << f.text }
|
|
39
|
-
surname = a&.at(ns("./surname"))&.text
|
|
40
|
-
ret << fn.join(" ") + " " + surname
|
|
41
|
-
end
|
|
42
|
-
end
|
|
43
|
-
ret
|
|
25
|
+
personal_authors(isoxml)
|
|
44
26
|
end
|
|
45
27
|
|
|
46
28
|
def docid(isoxml, _out)
|
|
@@ -108,7 +90,7 @@ module IsoDoc
|
|
|
108
90
|
|
|
109
91
|
def url(xml, _out)
|
|
110
92
|
super
|
|
111
|
-
a = xml.at(ns("//bibdata/
|
|
93
|
+
a = xml.at(ns("//bibdata/uri[@type = 'email']")) and set(:email, a.text)
|
|
112
94
|
end
|
|
113
95
|
|
|
114
96
|
end
|
|
@@ -99,6 +99,19 @@ module IsoDoc
|
|
|
99
99
|
%{\\1#{WORD_TOC_PREFACE1}}) + WORD_TOC_SUFFIX1
|
|
100
100
|
end
|
|
101
101
|
|
|
102
|
+
def word_preface_cleanup(docxml)
|
|
103
|
+
docxml.xpath("//h1[@class = 'AbstractTitle'] | //h1[@class = 'IntroTitle']").each do |h2|
|
|
104
|
+
h2.name = "p"
|
|
105
|
+
h2["class"] = "h1Preface"
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
def word_cleanup(docxml)
|
|
110
|
+
super
|
|
111
|
+
word_preface_cleanup(docxml)
|
|
112
|
+
docxml
|
|
113
|
+
end
|
|
114
|
+
|
|
102
115
|
# Henceforth identical to html
|
|
103
116
|
|
|
104
117
|
def abstract(isoxml, out)
|
data/metanorma-nist.gemspec
CHANGED
|
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
|
|
|
27
27
|
spec.add_dependency "htmlentities", "~> 4.3.4"
|
|
28
28
|
spec.add_dependency "ruby-jing"
|
|
29
29
|
|
|
30
|
-
spec.add_dependency "metanorma-standoc", "~> 1.
|
|
30
|
+
spec.add_dependency "metanorma-standoc", "~> 1.1.0"
|
|
31
31
|
spec.add_dependency "isodoc", "~> 0.9.0"
|
|
32
32
|
|
|
33
33
|
spec.add_development_dependency "bundler", "~> 2.0.1"
|
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: 0.0.
|
|
4
|
+
version: 0.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-01-
|
|
11
|
+
date: 2019-01-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: asciidoctor
|
|
@@ -58,14 +58,14 @@ dependencies:
|
|
|
58
58
|
requirements:
|
|
59
59
|
- - "~>"
|
|
60
60
|
- !ruby/object:Gem::Version
|
|
61
|
-
version: 1.
|
|
61
|
+
version: 1.1.0
|
|
62
62
|
type: :runtime
|
|
63
63
|
prerelease: false
|
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
|
65
65
|
requirements:
|
|
66
66
|
- - "~>"
|
|
67
67
|
- !ruby/object:Gem::Version
|
|
68
|
-
version: 1.
|
|
68
|
+
version: 1.1.0
|
|
69
69
|
- !ruby/object:Gem::Dependency
|
|
70
70
|
name: isodoc
|
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -250,6 +250,7 @@ files:
|
|
|
250
250
|
- Gemfile
|
|
251
251
|
- LICENSE
|
|
252
252
|
- README.adoc
|
|
253
|
+
- Rakefile
|
|
253
254
|
- bin/console
|
|
254
255
|
- bin/rspec
|
|
255
256
|
- bin/setup
|