metanorma-ieee 1.1.2 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/html2doc/ieee_wp/lists.rb +22 -0
- data/lib/html2doc/ieee_wp.rb +6 -0
- data/lib/isodoc/ieee/base_convert.rb +5 -0
- data/lib/isodoc/ieee/html/header_wp.html +348 -0
- data/lib/isodoc/ieee/html/ieee_wp.css +3316 -0
- data/lib/isodoc/ieee/html/ieee_wp.scss +3174 -0
- data/lib/isodoc/ieee/html/word_ieee_colophon_wp.html +129 -0
- data/lib/isodoc/ieee/html/word_ieee_intro_wp.html +142 -0
- data/lib/isodoc/ieee/html/word_ieee_titlepage_wp.html +333 -0
- data/lib/isodoc/ieee/html/wordstyle_wp.css +5795 -0
- data/lib/isodoc/ieee/html/wordstyle_wp.scss +5357 -0
- data/lib/isodoc/ieee/html/wp_image001.emz +0 -0
- data/lib/isodoc/ieee/html/wp_image003.emz +0 -0
- data/lib/isodoc/ieee/html/wp_image008.emz +0 -0
- data/lib/isodoc/ieee/i18n-en.yaml +1 -0
- data/lib/isodoc/ieee/metadata.rb +15 -5
- data/lib/isodoc/ieee/presentation_xml_convert.rb +44 -5
- data/lib/isodoc/ieee/word_authority.rb +14 -13
- data/lib/isodoc/ieee/word_cleanup.rb +43 -20
- data/lib/isodoc/ieee/word_cleanup_blocks.rb +23 -17
- data/lib/isodoc/ieee/word_convert.rb +26 -5
- data/lib/isodoc/ieee/word_wp_cleanup.rb +220 -0
- data/lib/isodoc/ieee/word_wp_convert.rb +115 -0
- data/lib/isodoc/ieee/xref.rb +24 -2
- data/lib/metanorma/ieee/basicdoc.rng +18 -2
- data/lib/metanorma/ieee/biblio.rng +1 -1
- data/lib/metanorma/ieee/boilerplate_wp.adoc +95 -0
- data/lib/metanorma/ieee/cleanup.rb +10 -6
- data/lib/metanorma/ieee/cleanup_ref.rb +8 -0
- data/lib/metanorma/ieee/converter.rb +5 -2
- data/lib/metanorma/ieee/front.rb +13 -12
- data/lib/metanorma/ieee/isodoc.rng +18 -1
- data/lib/metanorma/ieee/validate.rb +5 -5
- data/lib/metanorma/ieee/version.rb +1 -1
- data/lib/metanorma-ieee.rb +1 -0
- data/lib/relaton/render/config.yml +6 -6
- metadata +18 -2
@@ -0,0 +1,220 @@
|
|
1
|
+
module IsoDoc
|
2
|
+
module IEEE
|
3
|
+
class WordWPConvert < WordConvert
|
4
|
+
def stylesmap
|
5
|
+
{
|
6
|
+
example: "IEEEStdsParagraph", # x
|
7
|
+
MsoNormal: "MsoBodyText",
|
8
|
+
NormRef: "MsoBodyText",
|
9
|
+
Biblio: "References",
|
10
|
+
figure: "MsoBodyText",
|
11
|
+
formula: "IEEEStdsEquation", # x
|
12
|
+
Sourcecode: "IEEEStdsComputerCode", # x
|
13
|
+
TableTitle: "TableTitles",
|
14
|
+
FigureTitle: "FigureHeadings",
|
15
|
+
admonition: "IEEEStdsWarning", # x
|
16
|
+
abstract: "Abstract",
|
17
|
+
AbstractTitle: "Unnumberedheading",
|
18
|
+
level1frontmatter: "Unnumberedheading",
|
19
|
+
level2frontmatter: "IEEEStdsLevel2frontmatter", # x
|
20
|
+
level3frontmatter: "IEEEStdsLevel3frontmatter", # x
|
21
|
+
level1header: "IEEESectionHeader",
|
22
|
+
level2header: "IEEEStdsLevel2Header", # x
|
23
|
+
level3header: "IEEEStdsLevel3Header", # x
|
24
|
+
level4header: "IEEEStdsLevel4Header", # x
|
25
|
+
level5header: "IEEEStdsLevel5Header", # x
|
26
|
+
level6header: "IEEEStdsLevel6Header", # x
|
27
|
+
zzSTDTitle1: "Titleofdocument",
|
28
|
+
tabledata_center: "IEEEStdsTableData-Center", # x
|
29
|
+
tabledata_left: "Tablecelltext",
|
30
|
+
table_head: "IEEEStdsTableLineHead", # x
|
31
|
+
table_subhead: "IEEEStdsTableLineSubhead", # x
|
32
|
+
table_columnhead: "Tablecolumnheader",
|
33
|
+
nameslist: "IEEEnames",
|
34
|
+
intro: "Intro",
|
35
|
+
}
|
36
|
+
end
|
37
|
+
|
38
|
+
APPENDIX_STYLE = %w(Appendix Appendixlevel2 Appendixlevel3).freeze
|
39
|
+
|
40
|
+
def headings_style(hdr, idx)
|
41
|
+
if hdr.at("./ancestor::div[@class = 'Annex']")
|
42
|
+
headings_style_annex(hdr, idx)
|
43
|
+
elsif hdr.at("./ancestor::div[@class = 'Section3' or " \
|
44
|
+
"@class = 'WordSectionContents']")
|
45
|
+
headings_style_preface(hdr, idx)
|
46
|
+
else
|
47
|
+
headings_style_body(hdr, idx)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
def headings_style_annex(hdr, idx)
|
52
|
+
hdr.delete("class")
|
53
|
+
if idx == 1
|
54
|
+
hdr.next = BLUELINE
|
55
|
+
hdr["style"] = "margin-left:0cm;#{hdr['style']}"
|
56
|
+
else
|
57
|
+
hdr["class"] = "Unnumberedheading"
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
def headings_style_preface(hdr, idx)
|
62
|
+
hdr.name = "p"
|
63
|
+
hdr["class"] = stylesmap["level#{idx}frontmatter".to_sym]
|
64
|
+
end
|
65
|
+
|
66
|
+
def headings_style_body(hdr, idx)
|
67
|
+
idx == 1 and hdr.name = "p"
|
68
|
+
if hdr["class"] != stylesmap[:AbstractTitle]
|
69
|
+
if idx == 1
|
70
|
+
hdr["class"] = stylesmap["level#{idx}header".to_sym]
|
71
|
+
else
|
72
|
+
hdr["style"] = "mso-list:l22 level#{idx} lfo33;#{hdr['style']}"
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
def toWord(result, filename, dir, header)
|
78
|
+
result = from_xhtml(word_cleanup(to_xhtml(result)))
|
79
|
+
.gsub("-DOUBLE_HYPHEN_ESCAPE-", "--")
|
80
|
+
@wordstylesheet = wordstylesheet_update
|
81
|
+
::Html2Doc::IEEE_WP.new(
|
82
|
+
filename: filename,
|
83
|
+
imagedir: @localdir,
|
84
|
+
stylesheet: @wordstylesheet&.path,
|
85
|
+
header_file: header&.path, dir: dir,
|
86
|
+
asciimathdelims: [@openmathdelim, @closemathdelim],
|
87
|
+
liststyles: { ul: @ulstyle, ol: @olstyle }
|
88
|
+
).process(result)
|
89
|
+
header&.unlink
|
90
|
+
@wordstylesheet.unlink if @wordstylesheet.is_a?(Tempfile)
|
91
|
+
end
|
92
|
+
|
93
|
+
def table_cleanup(docxml)
|
94
|
+
super
|
95
|
+
docxml.xpath("//div[@class = 'table_container']//div[@class = 'Note']//p")
|
96
|
+
.each do |n|
|
97
|
+
n["class"] = "Tablenotes"
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
def authority_cleanup(docxml)
|
102
|
+
%w(copyright disclaimers tm participants).each do |t|
|
103
|
+
authority_cleanup1(docxml, t)
|
104
|
+
end
|
105
|
+
authority_style(docxml)
|
106
|
+
end
|
107
|
+
|
108
|
+
def authority_style(docxml)
|
109
|
+
copyright_style(docxml)
|
110
|
+
legal_style(docxml)
|
111
|
+
officer_style(docxml)
|
112
|
+
end
|
113
|
+
|
114
|
+
def feedback_table(docxml)
|
115
|
+
docxml.at("//div[@class = 'boilerplate-copyright']")&.xpath(".//table")
|
116
|
+
&.each do |t|
|
117
|
+
t.xpath(".//tr").each do |tr|
|
118
|
+
feedback_table1(tr)
|
119
|
+
end
|
120
|
+
t.replace(t.at(".//tbody").elements)
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
def feedback_table1(trow)
|
125
|
+
trow.name = "p"
|
126
|
+
trow["class"] = "CopyrightInformationPage"
|
127
|
+
trow["align"] = "left"
|
128
|
+
trow.xpath("./td").each do |td|
|
129
|
+
td.next_element and td << "<span style='mso-tab-count:1'> </span>"
|
130
|
+
td.xpath("./p").each { |p| p.replace(p.children) }
|
131
|
+
td.replace(td.children)
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
def copyright_style(docxml)
|
136
|
+
docxml.at("//div[@class = 'boilerplate-copyright']")&.xpath(".//p")
|
137
|
+
&.each do |p|
|
138
|
+
p["class"] ||= "CopyrightInformationPage"
|
139
|
+
end
|
140
|
+
feedback_table(docxml)
|
141
|
+
end
|
142
|
+
|
143
|
+
def legal_style(docxml)
|
144
|
+
%w(disclaimers tm).each do |e|
|
145
|
+
docxml.at("//div[@id = 'boilerplate-#{e}']")&.xpath(".//p")
|
146
|
+
&.each do |p|
|
147
|
+
p["class"] ||= "Disclaimertext"
|
148
|
+
end
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
def officer_style(docxml)
|
153
|
+
officemember_style(docxml)
|
154
|
+
end
|
155
|
+
|
156
|
+
def officemember_style(docxml)
|
157
|
+
docxml.xpath("//p[@type = 'officemember' or @type = 'officeorgmember']")
|
158
|
+
.each do |p|
|
159
|
+
p["class"] = stylesmap[:nameslist]
|
160
|
+
end
|
161
|
+
end
|
162
|
+
|
163
|
+
BLUELINE = <<~XHTML.freeze
|
164
|
+
<o:wrapblock><v:line id="Line_x0020_23" o:spid="_x0000_s2052"
|
165
|
+
style='visibility:visible;mso-wrap-style:square;mso-left-percent:-10001;
|
166
|
+
mso-top-percent:-10001;mso-position-horizontal:absolute;
|
167
|
+
mso-position-horizontal-relative:char;mso-position-vertical:absolute;
|
168
|
+
mso-position-vertical-relative:line;mso-left-percent:-10001;mso-top-percent:-10001'
|
169
|
+
from="55.05pt,2953.75pt" to="217pt,2953.75pt"
|
170
|
+
o:gfxdata="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
|
198
|
+
" strokecolor="#00aeef" strokeweight="8pt">
|
199
|
+
<o:lock v:ext="edit" shapetype="f"/>
|
200
|
+
<w:wrap type="topAndBottom" anchorx="page"/>
|
201
|
+
</v:line></o:wrapblock><br style='mso-ignore:vglayout' clear='ALL'/>
|
202
|
+
XHTML
|
203
|
+
|
204
|
+
def abstract_cleanup(docxml)
|
205
|
+
if f = docxml.at("//div[@class = 'abstract_div']")
|
206
|
+
abstract_cleanup1(f, nil)
|
207
|
+
end
|
208
|
+
end
|
209
|
+
|
210
|
+
def abstract_cleanup1(source, _dest)
|
211
|
+
source.elements.reject { |e| %w(h1 h2).include?(e.name) }.each do |e|
|
212
|
+
e.xpath("self::p | .//p").each do |p|
|
213
|
+
p["class"] ||= stylesmap[:abstract]
|
214
|
+
p["style"] = "margin-left:0cm;margin-right:0.25cm;#{p['style']}"
|
215
|
+
end
|
216
|
+
end
|
217
|
+
end
|
218
|
+
end
|
219
|
+
end
|
220
|
+
end
|
@@ -0,0 +1,115 @@
|
|
1
|
+
require_relative "word_wp_cleanup"
|
2
|
+
|
3
|
+
module IsoDoc
|
4
|
+
module IEEE
|
5
|
+
class WordWPConvert < WordConvert
|
6
|
+
def initialize(options)
|
7
|
+
@libdir ||= File.dirname(__FILE__) # rubocop:disable Lint/DisjunctiveAssignmentInConstructor
|
8
|
+
options.merge!(default_file_locations(nil)).merge!(default_fonts(nil))
|
9
|
+
super
|
10
|
+
end
|
11
|
+
|
12
|
+
def init_wp(options); end
|
13
|
+
|
14
|
+
def default_file_locations(_options)
|
15
|
+
{ wordstylesheet: html_doc_path("wordstyle_wp.scss"),
|
16
|
+
standardstylesheet: html_doc_path("ieee_wp.scss"),
|
17
|
+
header: html_doc_path("header_wp.html"),
|
18
|
+
wordcoverpage: html_doc_path("word_ieee_titlepage_wp.html"),
|
19
|
+
wordintropage: html_doc_path("word_ieee_intro_wp.html"),
|
20
|
+
ulstyle: "l23", olstyle: "l16" }
|
21
|
+
end
|
22
|
+
|
23
|
+
def default_fonts(_options)
|
24
|
+
{ bodyfont: '"Calibri",sans-serif',
|
25
|
+
headerfont: '"Arial Black",sans-serif',
|
26
|
+
monospacefont: '"Courier New",monospace',
|
27
|
+
normalfontsize: "11.0pt",
|
28
|
+
footnotefontsize: "7.0pt",
|
29
|
+
smallerfontsize: "10.0pt",
|
30
|
+
monospacefontsize: "10.0pt" }
|
31
|
+
end
|
32
|
+
|
33
|
+
def make_body3(body, docxml)
|
34
|
+
body.div class: "WordSection3" do |div3|
|
35
|
+
middle_title_ieee(docxml, div3)
|
36
|
+
content(div3, docxml, ns(self.class::MAIN_ELEMENTS))
|
37
|
+
end
|
38
|
+
section_break(body)
|
39
|
+
body.div class: "WordSection4" do |div3|
|
40
|
+
backcover div3
|
41
|
+
footnotes div3
|
42
|
+
comments div3
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def backcover(out)
|
47
|
+
out << populate_template(
|
48
|
+
File.read(html_doc_path("word_ieee_colophon_wp.html")), :word
|
49
|
+
)
|
50
|
+
end
|
51
|
+
|
52
|
+
def figure_attrs(node)
|
53
|
+
attr_code(id: node["id"], class: "figure",
|
54
|
+
style: "#{keep_style(node)};text-align:center;")
|
55
|
+
end
|
56
|
+
|
57
|
+
ABSTRACT_MARGIN =
|
58
|
+
"margin-top:18.0pt;margin-right:7.2pt;margin-bottom:6.0pt;" \
|
59
|
+
"margin-left:0cm;".freeze
|
60
|
+
|
61
|
+
def para_parse(node, out)
|
62
|
+
node["class"] == "zzSTDTitle1" and
|
63
|
+
return middle_title_ieee(node.document.root, out)
|
64
|
+
super
|
65
|
+
end
|
66
|
+
|
67
|
+
def middle_title_ieee(docxml, out)
|
68
|
+
super
|
69
|
+
out << BLUELINE
|
70
|
+
out.p
|
71
|
+
end
|
72
|
+
|
73
|
+
def abstract(clause, out)
|
74
|
+
out.div **attr_code(id: clause["id"], class: "abstract_div") do |s|
|
75
|
+
abstract_body(clause, s)
|
76
|
+
end
|
77
|
+
page_break(out)
|
78
|
+
end
|
79
|
+
|
80
|
+
def abstract_body(clause, out)
|
81
|
+
clause_name(clause, clause.at(ns("./title")), out,
|
82
|
+
{ class: stylesmap[:AbstractTitle],
|
83
|
+
style: ABSTRACT_MARGIN })
|
84
|
+
clause.elements.each { |e| parse(e, out) unless e.name == "title" }
|
85
|
+
end
|
86
|
+
|
87
|
+
def clause(node, out)
|
88
|
+
super
|
89
|
+
node.next_element and page_break(out) # only main clauses
|
90
|
+
end
|
91
|
+
|
92
|
+
def figure_parse1(node, out)
|
93
|
+
out.div **figure_attrs(node) do |div|
|
94
|
+
figure_name_parse(node, div, node.at(ns("./name")))
|
95
|
+
node.children.each do |n|
|
96
|
+
figure_key(out) if n.name == "dl"
|
97
|
+
parse(n, div) unless n.name == "name"
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
def clause_parse_subtitle(title, heading)
|
103
|
+
title&.parent&.name == "annex" or return super
|
104
|
+
end
|
105
|
+
|
106
|
+
def variant_title(node, out)
|
107
|
+
node.parent.name == "annex" or return super
|
108
|
+
out.p { |e| e << " " }
|
109
|
+
out.p **attr_code(class: "Unnumberedheading") do |p|
|
110
|
+
node.children.each { |c| parse(c, p) }
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
data/lib/isodoc/ieee/xref.rb
CHANGED
@@ -11,8 +11,14 @@ module IsoDoc
|
|
11
11
|
@hierarchical_assets = options[:hierarchicalassets]
|
12
12
|
end
|
13
13
|
|
14
|
+
def initial_anchor_names(doc)
|
15
|
+
@doctype = doc&.at(ns("//bibdata/ext/doctype"))&.text
|
16
|
+
super
|
17
|
+
end
|
18
|
+
|
14
19
|
def clause_order_main(docxml)
|
15
|
-
[
|
20
|
+
ret = [
|
21
|
+
{ path: "//sections/abstract" }, # whitepaper
|
16
22
|
{ path: "//clause[@type = 'overview']" },
|
17
23
|
{ path: @klass.norm_ref_xpath },
|
18
24
|
{ path: "//sections/terms | " \
|
@@ -21,6 +27,16 @@ module IsoDoc
|
|
21
27
|
"//sections/clause[descendant::definitions][not(descendant::terms)]" },
|
22
28
|
{ path: @klass.middle_clause(docxml), multi: true },
|
23
29
|
]
|
30
|
+
docxml.at(ns("//bibdata/ext/doctype"))&.text == "whitepaper" and
|
31
|
+
ret << { path: @klass.bibliography_xpath }
|
32
|
+
ret
|
33
|
+
end
|
34
|
+
|
35
|
+
def clause_order_back(docxml)
|
36
|
+
ret = super
|
37
|
+
docxml.at(ns("//bibdata/ext/doctype"))&.text == "whitepaper" and
|
38
|
+
ret.shift
|
39
|
+
ret
|
24
40
|
end
|
25
41
|
|
26
42
|
def middle_sections
|
@@ -83,7 +99,13 @@ module IsoDoc
|
|
83
99
|
end
|
84
100
|
|
85
101
|
def annex_name_lbl(clause, num)
|
86
|
-
|
102
|
+
if @doctype == "whitepaper"
|
103
|
+
title = Common::case_with_markup(@labels["annex"], "capital",
|
104
|
+
@script)
|
105
|
+
l10n("#{title} #{num}")
|
106
|
+
else
|
107
|
+
super.sub(%r{<br/>(.*)$}, "<br/><span class='obligation'>\\1</span>")
|
108
|
+
end
|
87
109
|
end
|
88
110
|
end
|
89
111
|
end
|
@@ -346,6 +346,8 @@
|
|
346
346
|
<ref name="keyword"/>
|
347
347
|
<ref name="xref"/>
|
348
348
|
<ref name="hyperlink"/>
|
349
|
+
<ref name="index"/>
|
350
|
+
<ref name="index-xref"/>
|
349
351
|
</choice>
|
350
352
|
</oneOrMore>
|
351
353
|
</element>
|
@@ -623,6 +625,8 @@
|
|
623
625
|
<ref name="eref"/>
|
624
626
|
<ref name="xref"/>
|
625
627
|
<ref name="hyperlink"/>
|
628
|
+
<ref name="index"/>
|
629
|
+
<ref name="index-xref"/>
|
626
630
|
</choice>
|
627
631
|
</zeroOrMore>
|
628
632
|
</element>
|
@@ -636,6 +640,8 @@
|
|
636
640
|
<ref name="eref"/>
|
637
641
|
<ref name="xref"/>
|
638
642
|
<ref name="hyperlink"/>
|
643
|
+
<ref name="index"/>
|
644
|
+
<ref name="index-xref"/>
|
639
645
|
</choice>
|
640
646
|
</zeroOrMore>
|
641
647
|
</element>
|
@@ -648,6 +654,8 @@
|
|
648
654
|
<ref name="eref"/>
|
649
655
|
<ref name="xref"/>
|
650
656
|
<ref name="hyperlink"/>
|
657
|
+
<ref name="index"/>
|
658
|
+
<ref name="index-xref"/>
|
651
659
|
</choice>
|
652
660
|
</zeroOrMore>
|
653
661
|
</element>
|
@@ -655,7 +663,11 @@
|
|
655
663
|
<define name="keyword">
|
656
664
|
<element name="keyword">
|
657
665
|
<zeroOrMore>
|
658
|
-
<
|
666
|
+
<choice>
|
667
|
+
<ref name="PureTextElement"/>
|
668
|
+
<ref name="index"/>
|
669
|
+
<ref name="index-xref"/>
|
670
|
+
</choice>
|
659
671
|
</zeroOrMore>
|
660
672
|
</element>
|
661
673
|
</define>
|
@@ -676,7 +688,11 @@
|
|
676
688
|
<define name="strike">
|
677
689
|
<element name="strike">
|
678
690
|
<zeroOrMore>
|
679
|
-
<
|
691
|
+
<choice>
|
692
|
+
<ref name="PureTextElement"/>
|
693
|
+
<ref name="index"/>
|
694
|
+
<ref name="index-xref"/>
|
695
|
+
</choice>
|
680
696
|
</zeroOrMore>
|
681
697
|
</element>
|
682
698
|
</define>
|
@@ -0,0 +1,95 @@
|
|
1
|
+
== copyright-statement
|
2
|
+
=== {blank}
|
3
|
+
[align=left]
|
4
|
+
The Institute of Electrical and Electronics Engineers, Inc. 3 Park Avenue, New York, NY 10016-5997, USA
|
5
|
+
|
6
|
+
=== {blank}
|
7
|
+
Copyright © {{ docyear }} by The Institute of Electrical and Electronics Engineers, Inc.
|
8
|
+
|
9
|
+
All rights reserved. {{ issueddate }}. Printed in the United States of America.
|
10
|
+
|
11
|
+
=== {blank}
|
12
|
+
[[_isbn_pdf_print]]
|
13
|
+
[%unnumbered]
|
14
|
+
|===
|
15
|
+
|PDF: |ISBN {{ isbn_pdf }} |{{ stdid_pdf }}
|
16
|
+
{% if isbn_print %}
|
17
|
+
|Print: |ISBN {{ isbn_print }} |{{ stdid_print}}
|
18
|
+
{% endif %}
|
19
|
+
|===
|
20
|
+
|
21
|
+
=== {blank}
|
22
|
+
IEEE is a registered trademark in the U.S. Patent & Trademark Office, owned by The Institute of Electrical and Electronics Engineers, Incorporated. All other trademarks are the property of the respective trademark owners.
|
23
|
+
|
24
|
+
=== {blank}
|
25
|
+
IEEE prohibits discrimination, harassment, and bullying. +
|
26
|
+
For more information, visit https://www.ieee.org/about/corporate/governance/p9-26.html[].
|
27
|
+
|
28
|
+
No part of this publication may be reproduced in any form, in an electronic retrieval system or otherwise, without the prior written permission of the publisher.
|
29
|
+
|
30
|
+
Find IEEE standards and standards-related product listings at: http://standards.ieee.org[].
|
31
|
+
|
32
|
+
== legal-statement
|
33
|
+
[[boilerplate-tm]]
|
34
|
+
=== Trademarks and Disclaimers
|
35
|
+
|
36
|
+
IEEE believes the information in this publication is accurate as of its publication date; such information is subject to change without notice. IEEE is not responsible for any inadvertent errors.
|
37
|
+
|
38
|
+
The ideas and proposals in this specification are the respective author’s views and do not represent the views of the affiliated organization.
|
39
|
+
|
40
|
+
[[boilerplate-disclaimers]]
|
41
|
+
=== Notice and Disclaimer of Liability Concerning the Use of IEEE SA Documents
|
42
|
+
|
43
|
+
This IEEE Standards Association ("IEEE SA") publication ("Work") is not a consensus standard document. Specifically, this document is NOT AN IEEE STANDARD. Information contained in this Work has been created by, or obtained from, sources believed to be reliable, and reviewed by members of the activity that produced this Work. IEEE and the {{ working_group }} expressly disclaim all warranties (express, implied, and statutory) related to this Work, including, but not limited to, the warranties of: merchantability; fitness for a particular purpose; non-infringement; quality, accuracy, effectiveness, currency, or completeness of the Work or content within the Work. In addition, IEEE and the {{ working_group }} disclaim any and all conditions relating to: results; and workmanlike effort. This document is supplied "AS IS" and "WITH ALL FAULTS."
|
44
|
+
|
45
|
+
Although the {{ working_group }} members who have created this Work believe that the information and guidance given in this Work serve as an enhancement to users, all persons must rely upon their own skill and judgment when making use of it. IN NO EVENT SHALL IEEE SA OR {{ working_group }} MEMBERS BE LIABLE FOR ANY ERRORS OR OMISSIONS OR DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO: PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS WORK, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE AND REGARDLESS OF WHETHER SUCH DAMAGE WAS FORESEEABLE.
|
46
|
+
|
47
|
+
Further, information contained in this Work may be protected by intellectual property rights held by third parties or organizations, and the use of this information may require the user to negotiate with any such rights holders in order to legally acquire the rights to do so, and such rights holders may refuse to grant such rights. Attention is also called to the possibility that implementation of any or all of this Work may require use of subject matter covered by patent rights. By publication of this Work, no position is taken by the IEEE with respect to the existence or validity of any patent rights in connection therewith. The IEEE is not responsible for identifying patent rights for which a license may be required, or for conducting inquiries into the legal validity or scope of patents claims. Users are expressly advised that determination of the validity of any patent rights, and the risk of infringement of such rights, is entirely their own responsibility. No commitment to grant licenses under patent rights on a reasonable or non-discriminatory basis has been sought or received from any rights holder.
|
48
|
+
|
49
|
+
This Work is published with the understanding that IEEE and the {{ working_group }} members are supplying information through this Work, not attempting to render engineering or other professional services. If such services are required, the assistance of an appropriate professional should be sought. IEEE is not responsible for the statements and opinions advanced in this Work.
|
50
|
+
|
51
|
+
|
52
|
+
[[boilerplate-participants]]
|
53
|
+
=== Acknowledgements
|
54
|
+
|
55
|
+
[[boilerplate-participants-blank]]
|
56
|
+
==== {blank}
|
57
|
+
|
58
|
+
Special thanks are given to the following reviewers of this paper:
|
59
|
+
|
60
|
+
++++
|
61
|
+
<membership>
|
62
|
+
++++
|
63
|
+
|
64
|
+
* {blank}
|
65
|
+
name::: Balloter1
|
66
|
+
role::: Member
|
67
|
+
* {blank}
|
68
|
+
name::: Balloter2
|
69
|
+
role::: Member
|
70
|
+
* {blank}
|
71
|
+
name::: Balloter3
|
72
|
+
role::: Member
|
73
|
+
* {blank}
|
74
|
+
name::: Balloter4
|
75
|
+
role::: Member
|
76
|
+
* {blank}
|
77
|
+
name::: Balloter5
|
78
|
+
role::: Member
|
79
|
+
* {blank}
|
80
|
+
name::: Balloter6
|
81
|
+
role::: Member
|
82
|
+
* {blank}
|
83
|
+
name::: Balloter7
|
84
|
+
role::: Member
|
85
|
+
* {blank}
|
86
|
+
name::: Balloter8
|
87
|
+
role::: Member
|
88
|
+
* {blank}
|
89
|
+
name::: Balloter9
|
90
|
+
role::: Member
|
91
|
+
|
92
|
+
++++
|
93
|
+
</membership>
|
94
|
+
++++
|
95
|
+
|
@@ -143,13 +143,17 @@ module Metanorma
|
|
143
143
|
i
|
144
144
|
end
|
145
145
|
|
146
|
-
|
147
|
-
@document_scheme == "ieee-sa-2021" or return
|
146
|
+
PARTICIPANT_BOILERPLATE_LOCATIONS =
|
148
147
|
{ "boilerplate-participants-wg": "working group",
|
149
148
|
"boilerplate-participants-bg": "balloting group",
|
150
|
-
"boilerplate-participants-sb": "standards board"
|
151
|
-
|
152
|
-
|
149
|
+
"boilerplate-participants-sb": "standards board",
|
150
|
+
"boilerplate-participants-blank": nil }.freeze
|
151
|
+
|
152
|
+
def participants(xml)
|
153
|
+
@document_scheme == "ieee-sa-2021" or return
|
154
|
+
PARTICIPANT_BOILERPLATE_LOCATIONS.each do |k, v|
|
155
|
+
populate_participants(xml, k.to_s, v)
|
156
|
+
end
|
153
157
|
p = xml.at(".//p[@type = 'emeritus_sign']")
|
154
158
|
ul = xml.at("//clause[@id = 'boilerplate-participants-sb']//ul")
|
155
159
|
p && ul and ul.next = p
|
@@ -157,7 +161,7 @@ module Metanorma
|
|
157
161
|
end
|
158
162
|
|
159
163
|
def populate_participants(xml, target, subtitle)
|
160
|
-
t = xml.at("//clause[@id = '#{target}']/membership")
|
164
|
+
t = xml.at("//clause[@id = '#{target}']/membership") or return
|
161
165
|
s = xml.xpath("//clause[@type = 'participants']/clause").detect do |x|
|
162
166
|
n = x.at("./title") and n.text.strip.downcase == subtitle
|
163
167
|
end
|
@@ -125,6 +125,14 @@ module Metanorma
|
|
125
125
|
ref.at("./docidentifier[@type = 'metanorma-ordinal']") || ret
|
126
126
|
end
|
127
127
|
end
|
128
|
+
|
129
|
+
def section_names_refs_cleanup(xml)
|
130
|
+
if @doctype == "whitepaper"
|
131
|
+
replace_title(xml, "//bibliography/references",
|
132
|
+
@i18n&.references, true)
|
133
|
+
else super
|
134
|
+
end
|
135
|
+
end
|
128
136
|
end
|
129
137
|
end
|
130
138
|
end
|
@@ -61,8 +61,11 @@ module Metanorma
|
|
61
61
|
nil, false, "#{@filename}.pdf")
|
62
62
|
end
|
63
63
|
|
64
|
-
def boilerplate_file(
|
65
|
-
|
64
|
+
def boilerplate_file(xmldoc)
|
65
|
+
file = "boilerplate.adoc"
|
66
|
+
doctype = xmldoc.at("//bibdata/ext/doctype")&.text
|
67
|
+
doctype == "whitepaper" and file = "boilerplate_wp.adoc"
|
68
|
+
File.join(@libdir, file)
|
66
69
|
end
|
67
70
|
|
68
71
|
def html_extract_attributes(node)
|
data/lib/metanorma/ieee/front.rb
CHANGED
@@ -4,11 +4,10 @@ module Metanorma
|
|
4
4
|
module IEEE
|
5
5
|
class Converter < Standoc::Converter
|
6
6
|
def metadata_committee(node, xml)
|
7
|
-
|
8
|
-
|
7
|
+
node.attr("committee") || node.attr("society") ||
|
8
|
+
node.attr("working-group") or return
|
9
9
|
node.attr("balloting-group") && !node.attr("balloting-group-type") and
|
10
10
|
node.set_attr("balloting-group-type", "individual")
|
11
|
-
|
12
11
|
xml.editorialgroup do |a|
|
13
12
|
committee_component("society", node, a)
|
14
13
|
committee_component("balloting-group", node, a)
|
@@ -50,15 +49,17 @@ module Metanorma
|
|
50
49
|
publishers = node.attr("copyright-holder") || node.attr("publisher") ||
|
51
50
|
"IEEE"
|
52
51
|
csv_split(publishers).each do |p|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
52
|
+
metadata_copyright1(node, p, xml)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
def metadata_copyright1(node, pub, xml)
|
57
|
+
xml.copyright do |c|
|
58
|
+
c.from (node.attr("copyright-year") || Date.today.year)
|
59
|
+
c.owner do |owner|
|
60
|
+
owner.organization do |o|
|
61
|
+
organization(o, pub, true, node,
|
62
|
+
!(node.attr("copyright-holder") || node.attr("publisher")))
|
62
63
|
end
|
63
64
|
end
|
64
65
|
end
|