metanorma-iso 2.3.0 → 2.3.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/iso/base_convert.rb +6 -0
- data/lib/isodoc/iso/html/isodoc-dis.css +8 -8
- data/lib/isodoc/iso/html/isodoc-dis.scss +8 -8
- data/lib/isodoc/iso/html/isodoc.css +8 -8
- data/lib/isodoc/iso/html/isodoc.scss +8 -8
- data/lib/isodoc/iso/html/style-human.css +30 -1
- data/lib/isodoc/iso/html/style-iso.css +30 -1
- data/lib/isodoc/iso/init.rb +12 -1
- data/lib/isodoc/iso/iso.amendment.xsl +277 -221
- data/lib/isodoc/iso/iso.international-standard.xsl +277 -221
- data/lib/isodoc/iso/presentation_xml_convert.rb +1 -1
- data/lib/isodoc/iso/word_cleanup.rb +4 -0
- data/lib/isodoc/iso/word_dis_cleanup.rb +14 -1
- data/lib/isodoc/iso/word_dis_convert.rb +1 -7
- data/lib/isodoc/iso/xref.rb +1 -0
- data/lib/isodoc/iso/xref_section.rb +3 -4
- data/lib/metanorma/iso/isodoc.rng +11 -1
- data/lib/metanorma/iso/version.rb +1 -1
- data/lib/relaton/render/config.yml +2 -1
- data/lib/relaton/render/general.rb +6 -0
- data/lib/relaton/render/parse.rb +20 -0
- metadata +3 -2
@@ -35,10 +35,15 @@ module IsoDoc
|
|
35
35
|
docxml.xpath("//p[not(@class)]").each { |p| p["class"] = "MsoBodyText" }
|
36
36
|
end
|
37
37
|
|
38
|
+
def sourcecode_style
|
39
|
+
"Code"
|
40
|
+
end
|
41
|
+
|
38
42
|
def dis_styles1(docxml)
|
39
43
|
amd_style(docxml)
|
40
44
|
code_style(docxml)
|
41
45
|
figure_style(docxml)
|
46
|
+
formula_style(docxml)
|
42
47
|
note_style(docxml)
|
43
48
|
example_style(docxml)
|
44
49
|
dis_style_interactions(docxml)
|
@@ -158,6 +163,14 @@ module IsoDoc
|
|
158
163
|
end
|
159
164
|
end
|
160
165
|
|
166
|
+
def formula_style(docxml)
|
167
|
+
docxml.xpath("//div[@class = 'Formula']").each do |f|
|
168
|
+
f.xpath(".//p[not(@class)]").each do |p|
|
169
|
+
p["class"] = "Formula"
|
170
|
+
end
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
161
174
|
def code_style(doc)
|
162
175
|
span_style((doc.xpath("//tt//b") - doc.xpath("//tt//i//b")),
|
163
176
|
"ISOCodebold")
|
@@ -206,7 +219,7 @@ module IsoDoc
|
|
206
219
|
p["class"] = "zzCopyright"
|
207
220
|
p["style"] = "text-indent:20.15pt;"
|
208
221
|
p.replace(to_xml(p).gsub(%r{<br/>}, "</p>\n<p class='zzCopyright' " \
|
209
|
-
|
222
|
+
"style='text-indent:20.15pt;'>"))
|
210
223
|
end
|
211
224
|
docxml.xpath("//p[@class = 'zzCopyrightHdr']")&.each do |p|
|
212
225
|
# p["class"] = "zzCopyright"
|
@@ -63,13 +63,7 @@ module IsoDoc
|
|
63
63
|
TOC
|
64
64
|
end
|
65
65
|
|
66
|
-
def
|
67
|
-
ret = super
|
68
|
-
ret[:sdo] = std_docid_semantic(ret[:sdo])
|
69
|
-
ret
|
70
|
-
end
|
71
|
-
|
72
|
-
def make_tr_attr(cell, row, totalrows, header)
|
66
|
+
def make_tr_attr(cell, row, totalrows, header, bordered)
|
73
67
|
super.merge(header: header)
|
74
68
|
end
|
75
69
|
|
data/lib/isodoc/iso/xref.rb
CHANGED
@@ -188,6 +188,7 @@ module IsoDoc
|
|
188
188
|
x = @anchors_previous[id][:xref_bare] || @anchors_previous[id][:xref]
|
189
189
|
@anchors[id][:xref] = l10n("#{table_label}, #{x}")
|
190
190
|
@anchors[id][:modspec] = @anchors_previous[id][:modspec]
|
191
|
+
@anchors[id][:subtype] = "modspec" # prevents citetbl style from beign applied
|
191
192
|
true
|
192
193
|
end
|
193
194
|
|
@@ -3,10 +3,9 @@ module IsoDoc
|
|
3
3
|
class Xref < IsoDoc::Xref
|
4
4
|
# we can reference 0-number clauses in introduction
|
5
5
|
def introduction_names(clause)
|
6
|
-
|
7
|
-
|
6
|
+
clause.nil? and return
|
8
7
|
clause.at(ns("./clause")) and
|
9
|
-
@anchors[clause["id"]] = { label:
|
8
|
+
@anchors[clause["id"]] = { label: nil, level: 1, type: "clause",
|
10
9
|
xref: clause.at(ns("./title"))&.text }
|
11
10
|
i = Counter.new
|
12
11
|
clause.xpath(ns("./clause")).each do |c|
|
@@ -43,7 +42,7 @@ module IsoDoc
|
|
43
42
|
@anchors[clause["id"]] =
|
44
43
|
{ label: num, level: level, xref: num, subtype: "clause" }
|
45
44
|
i = Counter.new
|
46
|
-
clause.xpath(ns("./clause | ./terms | ./term | ./definitions | "\
|
45
|
+
clause.xpath(ns("./clause | ./terms | ./term | ./definitions | " \
|
47
46
|
"./references"))
|
48
47
|
.each do |c|
|
49
48
|
i.increment(c)
|
@@ -571,6 +571,11 @@
|
|
571
571
|
<ref name="MultilingualRenderingType"/>
|
572
572
|
</attribute>
|
573
573
|
</optional>
|
574
|
+
<optional>
|
575
|
+
<attribute name="linenums">
|
576
|
+
<data type="boolean"/>
|
577
|
+
</attribute>
|
578
|
+
</optional>
|
574
579
|
<optional>
|
575
580
|
<ref name="tname"/>
|
576
581
|
</optional>
|
@@ -1238,6 +1243,11 @@
|
|
1238
1243
|
</define>
|
1239
1244
|
<define name="concept">
|
1240
1245
|
<element name="concept">
|
1246
|
+
<optional>
|
1247
|
+
<attribute name="bold">
|
1248
|
+
<data type="boolean"/>
|
1249
|
+
</attribute>
|
1250
|
+
</optional>
|
1241
1251
|
<optional>
|
1242
1252
|
<attribute name="ital">
|
1243
1253
|
<data type="boolean"/>
|
@@ -2653,7 +2663,7 @@
|
|
2653
2663
|
<value>full</value>
|
2654
2664
|
<value>short</value>
|
2655
2665
|
<value>id</value>
|
2656
|
-
<
|
2666
|
+
<text/>
|
2657
2667
|
</choice>
|
2658
2668
|
</define>
|
2659
2669
|
<define name="erefTypeWithConnective">
|
@@ -18,11 +18,12 @@ seriestemplate: "{% if series_formatted %}{{ series_formatted }}{%else%}{% if se
|
|
18
18
|
journaltemplate: "<em>{% if series_abbr %}{{series_abbr}}{% else %}{{series_title}}{% endif %}</em> ({{series_run}}) {{ labels['volume'] }}_{{series_num}} {{ labels['part'] }}_{{series_partnumber}}"
|
19
19
|
template:
|
20
20
|
# skip standardidentifier, it is inserted in front of formattedref within metanorma
|
21
|
-
standard: "<em><span_class='stddocTitle'>{{ title }}</span></em> ,_{{ extent }}."
|
21
|
+
standard: "{% if home_standard %}<em><span_class='stddocTitle'>{{ title }}</span></em> ,_{{ extent }}{% else %}<smallcap>{{ creatornames }}</smallcap>. <em><span_class='stddocTitle'>{{ title }}</span></em> ,_{{ extent }} . {{ labels['version'] | capitalize }}_{{ edition_raw }}. {{labels['updated'] | capitalize }}_{{date_updated}}. {{status | capitalize}}. {{ authorizer }}. {{ labels['availablefrom'] }}:_<span_class='biburl'>{{ uri }}</span>.{% endif %}"
|
22
22
|
website: "<smallcap>{{ creatornames }}</smallcap> ({{ role }}) . <em><span_class='stddocTitle'>{{ title }}</span></em> [website]. {{ labels['version'] | capitalize }}_{{ edition_raw }}. {{place}}: {{ publisher }}. {{date}}. {{ labels['updated'] | capitalize }}:_{{date_updated}}. ._{{ labels['availablefrom'] }}:_<span_class='biburl'>{{ uri }}</span>. [{{ labels['viewed'] }}:_{{date_accessed}}]. "
|
23
23
|
book: "<smallcap>{{ creatornames }}</smallcap> ({{role}}) . <em>{{ title }}</em> . {{ edition | capitalize_first }}. ({{ series }}). {% if place %}{{place}}{%else%}{{ labels['no_place']}}{%endif%}: {{publisher}}. {{date}}. {{size}}. {{extent}}. ._{{ labels['availablefrom'] }}:_<span_class='biburl'>{{ uri }}</span>. {{ labels['at'] | capitalize}}:_{{ access_location }}. [{{ labels['viewed'] }}:_{{date_accessed}}]."
|
24
24
|
booklet: book
|
25
25
|
manual: book
|
26
|
+
techreport: book
|
26
27
|
proceedings: book
|
27
28
|
inbook: "<smallcap>{{ creatornames }}</smallcap> ({{role}}) . {{ title }} . <em>{{host_title}}</em> ({{host_role}} {{ host_creatornames}}). {{ edition | capitalize_first }}. ({{ series }}). {% if place %}{{place}}{%else%}{{ labels['no_place']}}{%endif%}: {{publisher}}. {{date}}. {{size}}. {{extent}}. ._{{ labels['availablefrom'] }}:_<span_class='biburl'>{{ uri }}</span>. {{ labels['at'] | capitalize}}:_{{ access_location }}. [{{ labels['viewed'] }}:_{{date_accessed}}]."
|
28
29
|
inproceedings: inbook
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require "relaton-render"
|
2
|
+
require_relative "parse"
|
2
3
|
|
3
4
|
module Relaton
|
4
5
|
module Render
|
@@ -7,6 +8,11 @@ module Relaton
|
|
7
8
|
def config_loc
|
8
9
|
YAML.load_file(File.join(File.dirname(__FILE__), "config.yml"))
|
9
10
|
end
|
11
|
+
|
12
|
+
def klass_initialize(_options)
|
13
|
+
super
|
14
|
+
@parseklass = Relaton::Render::ISO::Parse
|
15
|
+
end
|
10
16
|
end
|
11
17
|
end
|
12
18
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Relaton
|
2
|
+
module Render
|
3
|
+
module ISO
|
4
|
+
class Parse < ::Relaton::Render::Parse
|
5
|
+
def simple_or_host_xml2hash(doc, host)
|
6
|
+
ret = super
|
7
|
+
ret.merge(home_standard: home_standard(doc, ret[:publisher_raw]))
|
8
|
+
end
|
9
|
+
|
10
|
+
def home_standard(_doc, pubs)
|
11
|
+
pubs&.any? do |r|
|
12
|
+
["International Organization for Standardization", "ISO",
|
13
|
+
"International Electrotechnical Commission", "IEC"]
|
14
|
+
.include?(r[:nonpersonal])
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-iso
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-12-
|
11
|
+
date: 2022-12-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: metanorma-standoc
|
@@ -395,6 +395,7 @@ files:
|
|
395
395
|
- lib/metanorma/requirements/requirements.rb
|
396
396
|
- lib/relaton/render/config.yml
|
397
397
|
- lib/relaton/render/general.rb
|
398
|
+
- lib/relaton/render/parse.rb
|
398
399
|
- metanorma-iso.gemspec
|
399
400
|
homepage: https://github.com/metanorma/metanorma-iso
|
400
401
|
licenses:
|