metanorma-iho 0.5.8 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isodoc/iho/base_convert.rb +1 -105
- data/lib/isodoc/iho/html/html_iho_titlepage.html +2 -0
- data/lib/isodoc/iho/html/htmlstyle.css +6 -0
- data/lib/isodoc/iho/html/htmlstyle.scss +1 -0
- data/lib/isodoc/iho/html/iho.css +18 -12
- data/lib/isodoc/iho/html/iho.scss +18 -10
- data/lib/isodoc/iho/html/word_iho_titlepage.html +1 -0
- data/lib/isodoc/iho/iho.specification.xsl +1611 -415
- data/lib/isodoc/iho/iho.standard.xsl +1611 -415
- data/lib/isodoc/iho/init.rb +1 -1
- data/lib/isodoc/iho/pdf_convert.rb +2 -3
- data/lib/isodoc/iho/presentation_xml_convert.rb +5 -1
- data/lib/isodoc/iho/xref.rb +16 -13
- data/lib/metanorma/iho/biblio.rng +69 -42
- data/lib/metanorma/iho/isodoc.rng +65 -0
- data/lib/metanorma/iho/version.rb +1 -1
- data/lib/relaton/render/config.yml +8 -0
- data/lib/relaton/render/fields.rb +23 -0
- data/lib/relaton/render/general.rb +25 -0
- data/lib/relaton/render/parse.rb +31 -0
- data/metanorma-iho.gemspec +1 -2
- metadata +9 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7dc1b7ada828c3a0407939118556e3139cf716b2eed6a667efcd60ad04db7a26
|
4
|
+
data.tar.gz: c63a014a83f8ee957fe2289b6f6766872057dfce4114c921d81996470e6061e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00a02daff0371d8c38b9a8c9d34a520ce0d9c38b98b991c112be43b0f780ce8492a66ca870ca4504fa1afc8951869ca8831d66a07a23b803224f63a0204682a6
|
7
|
+
data.tar.gz: 7d36bb8c4eca511eb7b94a38443068ff6e9ff2214be6bef15d5d2fa81e330997dd1aa1161f51a01253ac7eb3e9c2e17b8bc09567f543a184f1c59c7d54d8ede8
|
@@ -18,119 +18,15 @@ module IsoDoc
|
|
18
18
|
def std_bibitem_entry(list, bib, ordinal, biblio)
|
19
19
|
list.p **attr_code(iso_bibitem_entry_attrs(bib, biblio)) do |ref|
|
20
20
|
prefix_bracketed_ref(ref, "[#{ordinal}]")
|
21
|
-
|
21
|
+
reference_format(bib, ref)
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
-
def nodes_to_span(node)
|
26
|
-
noko do |xml|
|
27
|
-
xml.span do |s|
|
28
|
-
node&.children&.each { |x| parse(x, s) }
|
29
|
-
end
|
30
|
-
end.join
|
31
|
-
end
|
32
|
-
|
33
|
-
def multiplenames_and(names)
|
34
|
-
return "" if names.empty?
|
35
|
-
return names[0] if names.length == 1
|
36
|
-
return "#{names[0]} and #{names[1]}" if names.length == 2
|
37
|
-
|
38
|
-
names[0..-2].join(", ") + " and #{names[-1]}"
|
39
|
-
end
|
40
|
-
|
41
|
-
def extract_publisher(bib)
|
42
|
-
c = bib
|
43
|
-
.xpath(ns("./contributor[role/@type = 'publisher'][organization]"))
|
44
|
-
abbrs = []
|
45
|
-
names = []
|
46
|
-
c&.each do |c1|
|
47
|
-
n = c1.at(ns("./organization/name")) or next
|
48
|
-
abbrs << (c1.at(ns("./organization/abbreviation")) || n)
|
49
|
-
names << nodes_to_span(n)
|
50
|
-
end
|
51
|
-
return [nil, nil] if names.empty?
|
52
|
-
|
53
|
-
[multiplenames_and(names), abbrs.map(&:text).join("/")]
|
54
|
-
end
|
55
|
-
|
56
|
-
def inline_bibitem_ref_code(bib)
|
57
|
-
id = bib.at(ns("./docidentifier[not(@type = 'DOI' or "\
|
58
|
-
"@type = 'metanorma' or @type = 'ISSN' or "\
|
59
|
-
"@type = 'ISBN' or @type = 'rfc-anchor' or "\
|
60
|
-
"@type = 'metanorma-ordinal')]"))
|
61
|
-
id ||= bib.at(ns("./docidentifier[not(@type = 'metanorma' or "\
|
62
|
-
"@type = 'metanorma-ordinal')]"))
|
63
|
-
return [nil, id, nil, nil] if id
|
64
|
-
|
65
|
-
id = Nokogiri::XML::Node.new("docidentifier", bib.document)
|
66
|
-
id << "(NO ID)"
|
67
|
-
[nil, id, nil, nil]
|
68
|
-
end
|
69
|
-
|
70
|
-
def extract_edition(bib)
|
71
|
-
bib&.at(ns("./edition"))&.text
|
72
|
-
end
|
73
|
-
|
74
|
-
def extract_uri(bib)
|
75
|
-
bib.at(ns("./uri[@type = 'src']")) || bib.at(ns("./uri"))
|
76
|
-
end
|
77
|
-
|
78
25
|
def omit_docid_prefix(prefix)
|
79
26
|
return true if prefix == "IHO"
|
80
27
|
|
81
28
|
super
|
82
29
|
end
|
83
|
-
|
84
|
-
def render_identifier(id)
|
85
|
-
if !id[1].nil? && (id[1]["type"] == "IHO")
|
86
|
-
id[1].children = id[1].text.sub(/^IHO /, "")
|
87
|
-
end
|
88
|
-
super
|
89
|
-
end
|
90
|
-
|
91
|
-
def extract_author(bib)
|
92
|
-
c = bib.xpath(ns("./contributor[role/@type = 'author']"))
|
93
|
-
c = bib.xpath(ns("./contributor[role/@type = 'editor']")) if c.empty?
|
94
|
-
return extract_publisher(bib)[0] if c.empty?
|
95
|
-
|
96
|
-
c.map do |c1|
|
97
|
-
c1&.at(ns("./organization/name"))&.text || extract_person_name(c1)
|
98
|
-
end.reject { |e| e.nil? || e.empty? }.join(", ")
|
99
|
-
end
|
100
|
-
|
101
|
-
def extract_person_name(bib)
|
102
|
-
p = bib.at(ns("./person/name")) or return
|
103
|
-
c = p.at(ns("./completename")) and return c.text
|
104
|
-
s = p&.at(ns("./surname"))&.text or return
|
105
|
-
i = p.xpath(ns("./initial")) and
|
106
|
-
front = i.map { |e| e.text.gsub(/[^[:upper:]]/, "") }.join
|
107
|
-
i.empty? and f = p.xpath(ns("./forename")) and
|
108
|
-
front = f.map { |e| e.text[0].upcase }.join
|
109
|
-
front ? "#{s} #{front}" : s
|
110
|
-
end
|
111
|
-
|
112
|
-
def iho?(bib)
|
113
|
-
extract_publisher(bib)[1] == "IHO"
|
114
|
-
end
|
115
|
-
|
116
|
-
# [{number}] {docID} edition {edition}: {title}, {author/organization}
|
117
|
-
def standard_citation(out, bib)
|
118
|
-
if ftitle = bib.at(ns("./formattedref"))
|
119
|
-
ftitle&.children&.each { |n| parse(n, out) }
|
120
|
-
else
|
121
|
-
id = render_identifier(inline_bibitem_ref_code(bib))
|
122
|
-
out << id[:sdo] if id[:sdo]
|
123
|
-
ed = extract_edition(bib) if iho?(bib)
|
124
|
-
out << " edition #{ed}" if ed
|
125
|
-
out << ": " if id[:sdo] || ed
|
126
|
-
iso_title(bib)&.children&.each { |n| parse(n, out) }
|
127
|
-
out << ", "
|
128
|
-
author = extract_author(bib)
|
129
|
-
out << author
|
130
|
-
u = extract_uri(bib)
|
131
|
-
out << " (<a href='#{u.text}'>#{u.text}</a>)" if u
|
132
|
-
end
|
133
|
-
end
|
134
30
|
end
|
135
31
|
end
|
136
32
|
end
|
data/lib/isodoc/iho/html/iho.css
CHANGED
@@ -111,7 +111,7 @@ p.AdmonitionTitle, p.RecommendationTitle {
|
|
111
111
|
mso-bidi-font-family: {{bodyfont}};
|
112
112
|
mso-ansi-language: EN-GB; }
|
113
113
|
|
114
|
-
p.TableTitle {
|
114
|
+
p.TableTitle, p.ListTitle {
|
115
115
|
mso-style-unhide: no;
|
116
116
|
mso-style-qformat: yes;
|
117
117
|
mso-style-parent: "";
|
@@ -142,13 +142,15 @@ p.Note, div.Note, li.Note, p.TableFootnote, div.TableFootnote, li.TableFootnote
|
|
142
142
|
line-height: {{normalfontsize}};
|
143
143
|
mso-pagination: widow-orphan;
|
144
144
|
tab-stops: 20.15pt;
|
145
|
-
font-size: {{smallerfontsize}};
|
146
145
|
mso-bidi-font-size: {{smallerfontsize}};
|
147
|
-
font-family: {{bodyfont}};
|
148
146
|
mso-fareast-font-family: {{bodyfont}};
|
149
147
|
mso-bidi-font-family: {{bodyfont}};
|
150
148
|
mso-ansi-language: EN-GB; }
|
151
149
|
|
150
|
+
p.Note, div.Note, li.Note, p.TableFootnote, div.TableFootnote, li.TableFootnote {
|
151
|
+
font-size: {{smallerfontsize}};
|
152
|
+
font-family: {{bodyfont}}; }
|
153
|
+
|
152
154
|
p.ANNEX, li.ANNEX, div.ANNEX {
|
153
155
|
mso-style-name: ANNEX;
|
154
156
|
mso-style-priority: 10;
|
@@ -493,12 +495,14 @@ p.Quote, li.Quote, div.Quote {
|
|
493
495
|
line-height: {{normalfontsize}};
|
494
496
|
mso-pagination: widow-orphan;
|
495
497
|
tab-stops: 20.15pt;
|
496
|
-
font-size: {{normalfontsize}};
|
497
|
-
font-family: {{bodyfont}};
|
498
498
|
mso-fareast-font-family: {{bodyfont}};
|
499
499
|
mso-bidi-font-family: {{bodyfont}};
|
500
500
|
mso-ansi-language: EN-GB; }
|
501
501
|
|
502
|
+
p.Quote, li.Quote {
|
503
|
+
font-size: {{normalfontsize}};
|
504
|
+
font-family: {{bodyfont}}; }
|
505
|
+
|
502
506
|
p.QuoteAttribution {
|
503
507
|
text-align: right;
|
504
508
|
mso-style-priority: 99;
|
@@ -528,8 +532,6 @@ p.Admonition, li.Admonition, div.Admonition {
|
|
528
532
|
mso-border-themecolor: accent1;
|
529
533
|
padding: 0cm;
|
530
534
|
mso-padding-alt: 10.0pt 10.0pt 10.0pt 10.0pt;
|
531
|
-
font-size: {{normalfontsize}};
|
532
|
-
font-family: {{bodyfont}};
|
533
535
|
mso-ascii-font-family: {{bodyfont}};
|
534
536
|
mso-ascii-theme-font: minor-latin;
|
535
537
|
mso-fareast-font-family: {{bodyfont}};
|
@@ -540,7 +542,11 @@ p.Admonition, li.Admonition, div.Admonition {
|
|
540
542
|
mso-bidi-theme-font: minor-bidi;
|
541
543
|
color: #4472C4;
|
542
544
|
mso-themecolor: accent1;
|
543
|
-
mso-ansi-language: EN-AU;
|
545
|
+
mso-ansi-language: EN-AU; }
|
546
|
+
|
547
|
+
p.Admonition, li.Admonition {
|
548
|
+
font-size: {{normalfontsize}};
|
549
|
+
font-family: {{bodyfont}};
|
544
550
|
font-style: italic; }
|
545
551
|
|
546
552
|
p.Code, li.Code, div.Code {
|
@@ -765,7 +771,9 @@ aside {
|
|
765
771
|
|
766
772
|
p.example, li.example, td.example {
|
767
773
|
margin-right: 0pt;
|
768
|
-
margin-left: 0pt;
|
774
|
+
margin-left: 0pt;
|
775
|
+
font-size: {{smallerfontsize}};
|
776
|
+
font-family: {{bodyfont}}; }
|
769
777
|
|
770
778
|
div.example {
|
771
779
|
margin-right: 36.0pt;
|
@@ -774,9 +782,7 @@ div.example {
|
|
774
782
|
margin-bottom: 0cm; }
|
775
783
|
|
776
784
|
p.example, li.example, div.example, td.example {
|
777
|
-
mso-pagination: none;
|
778
|
-
font-size: {{smallerfontsize}};
|
779
|
-
font-family: {{bodyfont}}; }
|
785
|
+
mso-pagination: none; }
|
780
786
|
|
781
787
|
td.example p.MsoListParagraph {
|
782
788
|
font-size: {{smallerfontsize}}; }
|
@@ -105,7 +105,7 @@ p.AdmonitionTitle, p.RecommendationTitle
|
|
105
105
|
mso-fareast-font-family:$bodyfont;
|
106
106
|
mso-bidi-font-family:$bodyfont;
|
107
107
|
mso-ansi-language:EN-GB;}
|
108
|
-
p.TableTitle
|
108
|
+
p.TableTitle, p.ListTitle
|
109
109
|
{mso-style-unhide:no;
|
110
110
|
mso-style-qformat:yes;
|
111
111
|
mso-style-parent:"";
|
@@ -135,12 +135,14 @@ p.Note, div.Note, li.Note, p.TableFootnote, div.TableFootnote, li.TableFootnote
|
|
135
135
|
line-height:$normalfontsize;
|
136
136
|
mso-pagination:widow-orphan;
|
137
137
|
tab-stops:20.15pt;
|
138
|
-
font-size:$smallerfontsize;
|
139
138
|
mso-bidi-font-size:$smallerfontsize;
|
140
|
-
font-family:$bodyfont;
|
141
139
|
mso-fareast-font-family:$bodyfont;
|
142
140
|
mso-bidi-font-family:$bodyfont;
|
143
141
|
mso-ansi-language:EN-GB;}
|
142
|
+
p.Note, div.Note, li.Note, p.TableFootnote, div.TableFootnote, li.TableFootnote {
|
143
|
+
font-size:$smallerfontsize;
|
144
|
+
font-family:$bodyfont;
|
145
|
+
}
|
144
146
|
p.ANNEX, li.ANNEX, div.ANNEX
|
145
147
|
{mso-style-name:ANNEX;
|
146
148
|
mso-style-priority:10;
|
@@ -470,11 +472,13 @@ p.Quote, li.Quote, div.Quote
|
|
470
472
|
line-height:$normalfontsize;
|
471
473
|
mso-pagination:widow-orphan;
|
472
474
|
tab-stops:20.15pt;
|
473
|
-
font-size:$normalfontsize;
|
474
|
-
font-family:$bodyfont;
|
475
475
|
mso-fareast-font-family:$bodyfont;
|
476
476
|
mso-bidi-font-family:$bodyfont;
|
477
477
|
mso-ansi-language:EN-GB;}
|
478
|
+
p.Quote, li.Quote {
|
479
|
+
font-size:$normalfontsize;
|
480
|
+
font-family:$bodyfont;
|
481
|
+
}
|
478
482
|
p.QuoteAttribution
|
479
483
|
{text-align:right;
|
480
484
|
mso-style-priority:99;
|
@@ -504,8 +508,6 @@ p.Admonition, li.Admonition, div.Admonition
|
|
504
508
|
mso-border-themecolor:accent1;
|
505
509
|
padding:0cm;
|
506
510
|
mso-padding-alt:10.0pt 10.0pt 10.0pt 10.0pt;
|
507
|
-
font-size:$normalfontsize;
|
508
|
-
font-family:$bodyfont;
|
509
511
|
mso-ascii-font-family:$bodyfont;
|
510
512
|
mso-ascii-theme-font:minor-latin;
|
511
513
|
mso-fareast-font-family:$bodyfont;
|
@@ -517,7 +519,12 @@ p.Admonition, li.Admonition, div.Admonition
|
|
517
519
|
color:#4472C4;
|
518
520
|
mso-themecolor:accent1;
|
519
521
|
mso-ansi-language:EN-AU;
|
520
|
-
|
522
|
+
}
|
523
|
+
p.Admonition, li.Admonition {
|
524
|
+
font-size:$normalfontsize;
|
525
|
+
font-family:$bodyfont;
|
526
|
+
font-style:italic;
|
527
|
+
}
|
521
528
|
p.Code, li.Code, div.Code
|
522
529
|
{mso-style-name:Code;
|
523
530
|
mso-style-priority:16;
|
@@ -720,6 +727,8 @@ margin-left: -36.0pt;
|
|
720
727
|
p.example, li.example, td.example {
|
721
728
|
margin-right: 0pt;
|
722
729
|
margin-left: 0pt;
|
730
|
+
font-size:$smallerfontsize;
|
731
|
+
font-family:$bodyfont;
|
723
732
|
}
|
724
733
|
|
725
734
|
div.example {
|
@@ -731,8 +740,7 @@ div.example {
|
|
731
740
|
|
732
741
|
p.example, li.example, div.example, td.example {
|
733
742
|
mso-pagination:none;
|
734
|
-
|
735
|
-
font-family:$bodyfont;}
|
743
|
+
}
|
736
744
|
|
737
745
|
td.example p.MsoListParagraph {
|
738
746
|
font-size: $smallerfontsize;
|