metanorma-generic 2.4.0 → 2.4.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/generic/html/word_generic_intro.html +0 -3
- data/lib/isodoc/generic/metadata.rb +4 -1
- data/lib/isodoc/generic/utils.rb +8 -3
- data/lib/isodoc/generic/word_convert.rb +25 -18
- data/lib/metanorma/generic/generic.rng +38 -5
- data/lib/metanorma/generic/isodoc.rng +41 -14
- data/lib/metanorma/generic/version.rb +1 -1
- data/metanorma-generic.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f01093350c674908eb5364ed8961536ff3dc4d129dd653ab321da120df792214
|
4
|
+
data.tar.gz: f350457717265bc34ef4df9d4e8626685cd5909fc6a3627fadc6d91834e0de9d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8dd9a8044c3430195378e0fffee524d0008c562aba56b16ab9221a0cc0bef451c53ddb43acbebfe2c06fdb79a43e45b37e4c90b7a3f75cbaa76c17937adc10e2
|
7
|
+
data.tar.gz: 53cfa9e244fde4a48d41b5a769ebac4ce481b3a3454811d7606d854f8b3dd0bb1c8083c384b7d43b4fccfff3450c9b1957d0165cbf27d2ff755574471467592b
|
@@ -11,7 +11,10 @@ class Nokogiri::XML::Node
|
|
11
11
|
h[:text] = text&.strip
|
12
12
|
a = attribute_nodes.map(&:to_hash)
|
13
13
|
if element? && !a.empty?
|
14
|
-
h[:attr] = a.inject({})
|
14
|
+
h[:attr] = a.inject({}) do |m, v|
|
15
|
+
m[v[:name]] = v[:text]
|
16
|
+
m
|
17
|
+
end
|
15
18
|
end
|
16
19
|
c = children.map(&:to_hash)
|
17
20
|
if element? && !(c&.size == 1 && c[0][:kind] == "text")
|
data/lib/isodoc/generic/utils.rb
CHANGED
@@ -12,11 +12,16 @@ module IsoDoc
|
|
12
12
|
def baselocation(loc)
|
13
13
|
return nil if loc.nil?
|
14
14
|
return "" if loc.empty?
|
15
|
+
|
15
16
|
return loc
|
16
|
-
f = defined?(self.class::_file)
|
17
|
-
|
17
|
+
f = if defined?(self.class::_file)
|
18
|
+
(self.class::_file || __FILE__)
|
19
|
+
else
|
20
|
+
__FILE__
|
21
|
+
end
|
18
22
|
File.expand_path(File.join(
|
19
|
-
|
23
|
+
File.dirname(f), "..", "..", "..", loc
|
24
|
+
))
|
20
25
|
end
|
21
26
|
end
|
22
27
|
end
|
@@ -17,44 +17,51 @@ module IsoDoc
|
|
17
17
|
attr_accessor :_file
|
18
18
|
end
|
19
19
|
|
20
|
-
def self.inherited(
|
21
|
-
k._file = caller_locations.first.absolute_path
|
20
|
+
def self.inherited(k)
|
21
|
+
k._file = caller_locations(1..1).first.absolute_path
|
22
22
|
end
|
23
23
|
|
24
24
|
def default_fonts(options)
|
25
25
|
{
|
26
26
|
bodyfont: (
|
27
|
-
options[:script] == "Hans"
|
28
|
-
|
27
|
+
if options[:script] == "Hans"
|
28
|
+
'"Source Han Sans",serif'
|
29
|
+
else
|
30
|
+
configuration.word_bodyfont || '"Arial",sans-serif'
|
31
|
+
end
|
29
32
|
),
|
30
33
|
headerfont: (
|
31
|
-
options[:script] == "Hans"
|
32
|
-
|
34
|
+
if options[:script] == "Hans"
|
35
|
+
'"Source Han Sans",sans-serif'
|
36
|
+
else
|
37
|
+
configuration.word_headerfont || '"Arial",sans-serif'
|
38
|
+
end
|
33
39
|
),
|
34
|
-
monospacefont:
|
40
|
+
monospacefont: configuration.word_monospacefont || '"Courier New",monospace',
|
35
41
|
normalfontsize: configuration.word_normalfontsize,
|
36
42
|
smallerfontsize: configuration.word_smallerfontsize,
|
37
43
|
footnotefontsize: configuration.word_footnotefontsize,
|
38
44
|
monospacefontsize: configuration.word_monospacefontsize,
|
39
|
-
}.transform_values { |v| v&.empty? ? nil : v
|
45
|
+
}.transform_values { |v| v&.empty? ? nil : v }
|
40
46
|
end
|
41
47
|
|
42
|
-
def default_file_locations(
|
48
|
+
def default_file_locations(_options)
|
43
49
|
{
|
44
50
|
wordstylesheet: baselocation(configuration.wordstylesheet) ||
|
45
|
-
|
51
|
+
html_doc_path("wordstyle.scss"),
|
46
52
|
standardstylesheet: baselocation(configuration.standardstylesheet) ||
|
47
|
-
|
53
|
+
html_doc_path("generic.scss"),
|
48
54
|
header: baselocation(configuration.header) ||
|
49
|
-
|
55
|
+
html_doc_path("header.html"),
|
50
56
|
wordcoverpage: baselocation(configuration.wordcoverpage) ||
|
51
|
-
|
57
|
+
html_doc_path("word_generic_titlepage.html"),
|
52
58
|
wordintropage: baselocation(configuration.wordintropage) ||
|
53
|
-
|
54
|
-
i18nyaml: (configuration.i18nyaml.is_a?(String)
|
55
|
-
|
56
|
-
|
57
|
-
|
59
|
+
html_doc_path("word_generic_intro.html"),
|
60
|
+
i18nyaml: (if configuration.i18nyaml.is_a?(String)
|
61
|
+
baselocation(configuration.i18nyaml)
|
62
|
+
end),
|
63
|
+
ulstyle: "l3",
|
64
|
+
olstyle: "l2",
|
58
65
|
}.transform_values { |v| v&.empty? ? nil : v }
|
59
66
|
end
|
60
67
|
|
@@ -1,7 +1,40 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<grammar ns=
|
3
|
-
<!--
|
4
|
-
|
5
|
-
|
2
|
+
<grammar ns='https://www.metanorma.org/ns/generic' xmlns="http://relaxng.org/ns/structure/1.0">
|
3
|
+
<!--
|
4
|
+
VERSION v1.2.1
|
5
|
+
Currently we inherit from a namespaced grammar, isostandard. Until we inherit from isodoc,
|
6
|
+
we cannot have a new default namespace: we will end up with a grammar with two different
|
7
|
+
namespaces, one for isostandard and one for csand additions. And we do not want that.
|
8
|
+
-->
|
9
|
+
<include href="isodoc.rng">
|
10
|
+
<start>
|
11
|
+
<ref name="generic"/>
|
12
|
+
</start>
|
13
|
+
</include>
|
14
|
+
<define name="generic-standard">
|
15
|
+
<element name="generic-standard">
|
16
|
+
<ref name="Root-Attributes"/>
|
17
|
+
<ref name="bibdata"/>
|
18
|
+
<zeroOrMore>
|
19
|
+
<ref name="termdocsource"/>
|
20
|
+
</zeroOrMore>
|
21
|
+
<optional>
|
22
|
+
<ref name="misccontainer"/>
|
23
|
+
</optional>
|
24
|
+
<optional>
|
25
|
+
<ref name="boilerplate"/>
|
26
|
+
</optional>
|
27
|
+
<ref name="preface"/>
|
28
|
+
<oneOrMore>
|
29
|
+
<ref name="sections"/>
|
30
|
+
</oneOrMore>
|
31
|
+
<zeroOrMore>
|
32
|
+
<ref name="annex"/>
|
33
|
+
</zeroOrMore>
|
34
|
+
<ref name="bibliography"/>
|
35
|
+
<zeroOrMore>
|
36
|
+
<ref name="indexsect"/>
|
37
|
+
</zeroOrMore>
|
38
|
+
</element>
|
39
|
+
</define>
|
6
40
|
</grammar>
|
7
|
-
<!-- end overrides -->
|
@@ -17,6 +17,7 @@
|
|
17
17
|
these elements; we just want one namespace for any child grammars
|
18
18
|
of this.
|
19
19
|
-->
|
20
|
+
<!-- VERSION v1.2.1 -->
|
20
21
|
<grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
21
22
|
<include href="reqt.rng"/>
|
22
23
|
<include href="basicdoc.rng">
|
@@ -382,6 +383,9 @@
|
|
382
383
|
<optional>
|
383
384
|
<ref name="dl"/>
|
384
385
|
</optional>
|
386
|
+
<optional>
|
387
|
+
<ref name="source"/>
|
388
|
+
</optional>
|
385
389
|
</element>
|
386
390
|
</define>
|
387
391
|
<define name="figure">
|
@@ -404,9 +408,6 @@
|
|
404
408
|
<attribute name="class"/>
|
405
409
|
</optional>
|
406
410
|
<ref name="BlockAttributes"/>
|
407
|
-
<optional>
|
408
|
-
<ref name="source"/>
|
409
|
-
</optional>
|
410
411
|
<optional>
|
411
412
|
<ref name="tname"/>
|
412
413
|
</optional>
|
@@ -431,6 +432,20 @@
|
|
431
432
|
<zeroOrMore>
|
432
433
|
<ref name="note"/>
|
433
434
|
</zeroOrMore>
|
435
|
+
<optional>
|
436
|
+
<ref name="source"/>
|
437
|
+
</optional>
|
438
|
+
</element>
|
439
|
+
</define>
|
440
|
+
<define name="source">
|
441
|
+
<element name="source">
|
442
|
+
<attribute name="status">
|
443
|
+
<ref name="SourceStatusType"/>
|
444
|
+
</attribute>
|
445
|
+
<ref name="origin"/>
|
446
|
+
<optional>
|
447
|
+
<ref name="modification"/>
|
448
|
+
</optional>
|
434
449
|
</element>
|
435
450
|
</define>
|
436
451
|
<define name="sourcecode">
|
@@ -1335,15 +1350,19 @@
|
|
1335
1350
|
</choice>
|
1336
1351
|
</element>
|
1337
1352
|
</define>
|
1353
|
+
<define name="Root-Attributes">
|
1354
|
+
<attribute name="version"/>
|
1355
|
+
<attribute name="schema-version"/>
|
1356
|
+
<attribute name="type">
|
1357
|
+
<choice>
|
1358
|
+
<value>semantic</value>
|
1359
|
+
<value>presentation</value>
|
1360
|
+
</choice>
|
1361
|
+
</attribute>
|
1362
|
+
</define>
|
1338
1363
|
<define name="standard-document">
|
1339
1364
|
<element name="standard-document">
|
1340
|
-
<
|
1341
|
-
<attribute name="type">
|
1342
|
-
<choice>
|
1343
|
-
<value>semantic</value>
|
1344
|
-
<value>presentation</value>
|
1345
|
-
</choice>
|
1346
|
-
</attribute>
|
1365
|
+
<ref name="Root-Attributes"/>
|
1347
1366
|
<ref name="bibdata"/>
|
1348
1367
|
<optional>
|
1349
1368
|
<ref name="misccontainer"/>
|
@@ -2099,10 +2118,7 @@
|
|
2099
2118
|
<define name="termsource">
|
2100
2119
|
<element name="termsource">
|
2101
2120
|
<attribute name="status">
|
2102
|
-
<
|
2103
|
-
<value>identical</value>
|
2104
|
-
<value>modified</value>
|
2105
|
-
</choice>
|
2121
|
+
<ref name="SourceStatusType"/>
|
2106
2122
|
</attribute>
|
2107
2123
|
<attribute name="type">
|
2108
2124
|
<choice>
|
@@ -2116,6 +2132,17 @@
|
|
2116
2132
|
</optional>
|
2117
2133
|
</element>
|
2118
2134
|
</define>
|
2135
|
+
<define name="SourceStatusType">
|
2136
|
+
<choice>
|
2137
|
+
<value>identical</value>
|
2138
|
+
<value>modified</value>
|
2139
|
+
<value>restyled</value>
|
2140
|
+
<value>context-added</value>
|
2141
|
+
<value>generalisation</value>
|
2142
|
+
<value>specialisation</value>
|
2143
|
+
<value>unspecified</value>
|
2144
|
+
</choice>
|
2145
|
+
</define>
|
2119
2146
|
<define name="origin">
|
2120
2147
|
<element name="origin">
|
2121
2148
|
<choice>
|
data/metanorma-generic.gemspec
CHANGED
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
|
29
29
|
|
30
30
|
spec.add_dependency "htmlentities", "~> 4.3.4"
|
31
|
-
spec.add_dependency "metanorma-standoc", "~> 2.4.
|
31
|
+
spec.add_dependency "metanorma-standoc", "~> 2.4.2"
|
32
32
|
spec.add_dependency "ruby-jing"
|
33
33
|
|
34
34
|
spec.add_development_dependency "debug"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-generic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.
|
4
|
+
version: 2.4.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: 2023-
|
11
|
+
date: 2023-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: htmlentities
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 2.4.
|
33
|
+
version: 2.4.2
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 2.4.
|
40
|
+
version: 2.4.2
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: ruby-jing
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|