metanorma-rsd 1.4.4 → 1.4.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/macos.yml +0 -7
- data/.github/workflows/ubuntu.yml +0 -7
- data/.github/workflows/windows.yml +0 -8
- data/lib/asciidoctor/rsd/biblio.rng +107 -32
- data/lib/asciidoctor/rsd/converter.rb +4 -16
- data/lib/asciidoctor/rsd/isodoc.rng +28 -1
- data/lib/isodoc/rsd/base_convert.rb +0 -6
- data/lib/isodoc/rsd/html/scripts.html +4 -20
- data/lib/isodoc/rsd/metadata.rb +0 -10
- data/lib/isodoc/rsd/pdf_convert.rb +16 -19
- data/lib/isodoc/rsd/rsd.standard.xsl +6391 -0
- data/lib/metanorma/rsd/processor.rb +4 -0
- data/lib/metanorma/rsd/version.rb +1 -1
- data/metanorma.yml +3 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ba559a92fb5dfdc07a3841c0f0fee4532efc6707667ed1e7d36b034d1869c02
|
4
|
+
data.tar.gz: 5b1155129af97fc10d19de0189355311ab5e212a4b81ebc0ae5357d197679d25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7bbe7a4ac00c6222f13d572cd29edb7f069b5723a2fe43c94a1fbfaca4de2cc544f1f0887b9dcb34089c413dd8289e233719411dc4fbe5be7d343fe62d60648a
|
7
|
+
data.tar.gz: 8f8a7871dc1145a3e3c55822b02cdff99b794eaa67ac2c4732cdffef0fd44831c53cf4836bf9d3a195ce03cbb15f962bd4aaa01cbb5de1e209d9a4635a641d95
|
data/.github/workflows/macos.yml
CHANGED
@@ -26,13 +26,6 @@ jobs:
|
|
26
26
|
run: |
|
27
27
|
sudo gem install bundler --force
|
28
28
|
bundle install --jobs 4 --retry 3
|
29
|
-
- name: Use Node
|
30
|
-
uses: actions/setup-node@v1
|
31
|
-
with:
|
32
|
-
node-version: '8'
|
33
|
-
- name: Install Puppeteer
|
34
|
-
run: |
|
35
|
-
npm install -g puppeteer
|
36
29
|
- name: Install PlantUML
|
37
30
|
run: |
|
38
31
|
brew install plantuml
|
@@ -26,13 +26,6 @@ jobs:
|
|
26
26
|
run: |
|
27
27
|
gem install bundler
|
28
28
|
bundle install --jobs 4 --retry 3
|
29
|
-
- name: Use Node
|
30
|
-
uses: actions/setup-node@v1
|
31
|
-
with:
|
32
|
-
node-version: '8'
|
33
|
-
- name: Install Puppeteer
|
34
|
-
run: |
|
35
|
-
npm install -g puppeteer
|
36
29
|
- name: Install PlantUML
|
37
30
|
run: |
|
38
31
|
sudo bash -c "curl -L https://github.com/riboseinc/plantuml-install/raw/master/ubuntu.sh | bash"
|
@@ -27,15 +27,7 @@ jobs:
|
|
27
27
|
run: |
|
28
28
|
gem install bundler
|
29
29
|
bundle config --local path vendor/bundle
|
30
|
-
bundle update
|
31
30
|
bundle install --jobs 4 --retry 3
|
32
|
-
- name: Use Node
|
33
|
-
uses: actions/setup-node@v1
|
34
|
-
with:
|
35
|
-
node-version: '8'
|
36
|
-
- name: Install Puppeteer
|
37
|
-
run: |
|
38
|
-
npm install -g puppeteer
|
39
31
|
- name: Install PlantUML
|
40
32
|
run: |
|
41
33
|
cinst -y plantuml
|
@@ -49,11 +49,17 @@
|
|
49
49
|
</define>
|
50
50
|
<define name="stage">
|
51
51
|
<element name="stage">
|
52
|
+
<optional>
|
53
|
+
<attribute name="abbreviation"/>
|
54
|
+
</optional>
|
52
55
|
<text/>
|
53
56
|
</element>
|
54
57
|
</define>
|
55
58
|
<define name="substage">
|
56
59
|
<element name="substage">
|
60
|
+
<optional>
|
61
|
+
<attribute name="abbreviation"/>
|
62
|
+
</optional>
|
57
63
|
<text/>
|
58
64
|
</element>
|
59
65
|
</define>
|
@@ -452,9 +458,14 @@
|
|
452
458
|
<attribute name="bibitemid">
|
453
459
|
<data type="IDREF"/>
|
454
460
|
</attribute>
|
455
|
-
<
|
456
|
-
<
|
457
|
-
|
461
|
+
<choice>
|
462
|
+
<zeroOrMore>
|
463
|
+
<ref name="locality"/>
|
464
|
+
</zeroOrMore>
|
465
|
+
<zeroOrMore>
|
466
|
+
<ref name="localityStack"/>
|
467
|
+
</zeroOrMore>
|
468
|
+
</choice>
|
458
469
|
<optional>
|
459
470
|
<ref name="date"/>
|
460
471
|
</optional>
|
@@ -469,6 +480,25 @@
|
|
469
480
|
<ref name="BibItemLocality"/>
|
470
481
|
</element>
|
471
482
|
</define>
|
483
|
+
<define name="localityStack">
|
484
|
+
<element name="localityStack">
|
485
|
+
<zeroOrMore>
|
486
|
+
<ref name="locality"/>
|
487
|
+
</zeroOrMore>
|
488
|
+
</element>
|
489
|
+
</define>
|
490
|
+
<define name="sourceLocality">
|
491
|
+
<element name="sourceLocality">
|
492
|
+
<ref name="BibItemLocality"/>
|
493
|
+
</element>
|
494
|
+
</define>
|
495
|
+
<define name="sourceLocalityStack">
|
496
|
+
<element name="sourceLocalityStack">
|
497
|
+
<zeroOrMore>
|
498
|
+
<ref name="sourceLocality"/>
|
499
|
+
</zeroOrMore>
|
500
|
+
</element>
|
501
|
+
</define>
|
472
502
|
<define name="BibItemLocality">
|
473
503
|
<attribute name="type">
|
474
504
|
<ref name="LocalityType"/>
|
@@ -737,6 +767,8 @@
|
|
737
767
|
<value>unchanged</value>
|
738
768
|
<value>circulated</value>
|
739
769
|
<value>adapted</value>
|
770
|
+
<value>vote-started</value>
|
771
|
+
<value>vote-ended</value>
|
740
772
|
</choice>
|
741
773
|
</define>
|
742
774
|
<define name="bdate">
|
@@ -989,38 +1021,63 @@
|
|
989
1021
|
</define>
|
990
1022
|
<define name="DocRelationType">
|
991
1023
|
<choice>
|
992
|
-
<value>obsoletes</value>
|
993
|
-
<value>obsoletedBy</value>
|
994
|
-
<value>supersedes</value>
|
995
|
-
<value>supersededBy</value>
|
996
|
-
<value>updates</value>
|
997
|
-
<value>updatedBy</value>
|
998
|
-
<value>complements</value>
|
999
|
-
<value>derivedFrom</value>
|
1000
|
-
<value>translatedFrom</value>
|
1001
|
-
<value>hasTranslation</value>
|
1002
|
-
<value>adoptedFrom</value>
|
1003
|
-
<value>equivalent</value>
|
1004
|
-
<value>identical</value>
|
1005
|
-
<value>nonequivalent</value>
|
1006
|
-
<value>includedIn</value>
|
1007
1024
|
<value>includes</value>
|
1008
|
-
<value>
|
1009
|
-
<value>instanceOf</value>
|
1010
|
-
<value>partOf</value>
|
1025
|
+
<value>includedIn</value>
|
1011
1026
|
<value>hasPart</value>
|
1012
|
-
<value>
|
1013
|
-
<value>draftOf</value>
|
1027
|
+
<value>partOf</value>
|
1014
1028
|
<value>merges</value>
|
1029
|
+
<value>mergedInto</value>
|
1015
1030
|
<value>splits</value>
|
1016
|
-
<value>
|
1017
|
-
<value>
|
1018
|
-
<value>
|
1019
|
-
<value>
|
1020
|
-
<value>
|
1021
|
-
<value>
|
1031
|
+
<value>splitInto</value>
|
1032
|
+
<value>instance</value>
|
1033
|
+
<value>hasInstance</value>
|
1034
|
+
<value>exemplarOf</value>
|
1035
|
+
<value>hasExemplar</value>
|
1036
|
+
<value>manifestationOf</value>
|
1037
|
+
<value>hasManifestation</value>
|
1038
|
+
<value>reproductionOf</value>
|
1039
|
+
<value>hasReproduction</value>
|
1040
|
+
<value>reprintOf</value>
|
1041
|
+
<value>hasReprint</value>
|
1042
|
+
<value>expressionOf</value>
|
1043
|
+
<value>hasExpression</value>
|
1044
|
+
<value>translatedFrom</value>
|
1045
|
+
<value>hasTranslation</value>
|
1046
|
+
<value>arrangementOf</value>
|
1047
|
+
<value>hasArrangement</value>
|
1048
|
+
<value>abridgementOf</value>
|
1049
|
+
<value>hasAbridgement</value>
|
1050
|
+
<value>annotationOf</value>
|
1051
|
+
<value>hasAnnotation</value>
|
1052
|
+
<value>draftOf</value>
|
1053
|
+
<value>hasDraft</value>
|
1054
|
+
<value>editionOf</value>
|
1055
|
+
<value>hasEdition</value>
|
1056
|
+
<value>updates</value>
|
1057
|
+
<value>updatedBy</value>
|
1058
|
+
<value>derivedFrom</value>
|
1059
|
+
<value>derives</value>
|
1022
1060
|
<value>describes</value>
|
1023
1061
|
<value>describedBy</value>
|
1062
|
+
<value>catalogues</value>
|
1063
|
+
<value>cataloguedBy</value>
|
1064
|
+
<value>hasSuccessor</value>
|
1065
|
+
<value>successorOf</value>
|
1066
|
+
<value>adaptedFrom</value>
|
1067
|
+
<value>hasAdaptation</value>
|
1068
|
+
<value>adoptedFrom</value>
|
1069
|
+
<value>adoptedAs</value>
|
1070
|
+
<value>reviewOf</value>
|
1071
|
+
<value>hasReview</value>
|
1072
|
+
<value>commentaryOf</value>
|
1073
|
+
<value>hasCommentary</value>
|
1074
|
+
<value>related</value>
|
1075
|
+
<value>complements</value>
|
1076
|
+
<value>complementOf</value>
|
1077
|
+
<value>obsoletes</value>
|
1078
|
+
<value>obsoletedBy</value>
|
1079
|
+
<value>cited</value>
|
1080
|
+
<value>isCitedIn</value>
|
1024
1081
|
</choice>
|
1025
1082
|
</define>
|
1026
1083
|
<define name="docrelation">
|
@@ -1028,12 +1085,30 @@
|
|
1028
1085
|
<attribute name="type">
|
1029
1086
|
<ref name="DocRelationType"/>
|
1030
1087
|
</attribute>
|
1088
|
+
<optional>
|
1089
|
+
<element name="description">
|
1090
|
+
<ref name="FormattedString"/>
|
1091
|
+
</element>
|
1092
|
+
</optional>
|
1031
1093
|
<element name="bibitem">
|
1032
1094
|
<ref name="BibliographicItem"/>
|
1033
1095
|
</element>
|
1034
|
-
<
|
1035
|
-
<
|
1036
|
-
|
1096
|
+
<choice>
|
1097
|
+
<zeroOrMore>
|
1098
|
+
<ref name="locality"/>
|
1099
|
+
</zeroOrMore>
|
1100
|
+
<zeroOrMore>
|
1101
|
+
<ref name="localityStack"/>
|
1102
|
+
</zeroOrMore>
|
1103
|
+
</choice>
|
1104
|
+
<choice>
|
1105
|
+
<zeroOrMore>
|
1106
|
+
<ref name="sourceLocality"/>
|
1107
|
+
</zeroOrMore>
|
1108
|
+
<zeroOrMore>
|
1109
|
+
<ref name="sourceLocalityStack"/>
|
1110
|
+
</zeroOrMore>
|
1111
|
+
</choice>
|
1037
1112
|
</element>
|
1038
1113
|
</define>
|
1039
1114
|
<define name="version">
|
@@ -7,23 +7,10 @@ module Asciidoctor
|
|
7
7
|
# schema encapsulation of the document for validation
|
8
8
|
#
|
9
9
|
class Converter < Asciidoctor::Generic::Converter
|
10
|
-
|
11
|
-
|
12
|
-
def metadata_recipient(node, xml)
|
13
|
-
recipient = node.attr("recipient") || return
|
14
|
-
xml.recipient recipient
|
15
|
-
end
|
16
|
-
|
17
|
-
def metadata_security(node, xml)
|
18
|
-
security = node.attr("security") || return
|
19
|
-
xml.security security
|
20
|
-
end
|
10
|
+
XML_ROOT_TAG = 'rsd-standard'.freeze
|
11
|
+
XML_NAMESPACE = 'https://www.metanorma.org/ns/rsd'.freeze
|
21
12
|
|
22
|
-
|
23
|
-
super
|
24
|
-
metadata_security(node, xml)
|
25
|
-
metadata_recipient(node, xml)
|
26
|
-
end
|
13
|
+
register_for "rsd"
|
27
14
|
|
28
15
|
def sectiontype(node, level = true)
|
29
16
|
ret = node&.attr("heading")&.downcase ||
|
@@ -73,6 +60,7 @@ module Asciidoctor
|
|
73
60
|
end
|
74
61
|
|
75
62
|
def pdf_converter(node)
|
63
|
+
return nil if node.attr("no-pdf")
|
76
64
|
IsoDoc::Rsd::PdfConvert.new(html_extract_attributes(node))
|
77
65
|
end
|
78
66
|
|
@@ -303,8 +303,23 @@
|
|
303
303
|
<ref name="paragraph"/>
|
304
304
|
</element>
|
305
305
|
</define>
|
306
|
+
<define name="TextElement" combine="choice">
|
307
|
+
<ref name="concept"/>
|
308
|
+
</define>
|
306
309
|
</include>
|
307
310
|
<!-- end overrides -->
|
311
|
+
<define name="concept">
|
312
|
+
<element name="concept">
|
313
|
+
<optional>
|
314
|
+
<attribute name="term"/>
|
315
|
+
</optional>
|
316
|
+
<choice>
|
317
|
+
<ref name="eref"/>
|
318
|
+
<ref name="xref"/>
|
319
|
+
<ref name="termref"/>
|
320
|
+
</choice>
|
321
|
+
</element>
|
322
|
+
</define>
|
308
323
|
<define name="BasicBlock" combine="choice">
|
309
324
|
<choice>
|
310
325
|
<ref name="requirement"/>
|
@@ -911,7 +926,10 @@
|
|
911
926
|
</define>
|
912
927
|
<define name="origin">
|
913
928
|
<element name="origin">
|
914
|
-
<
|
929
|
+
<choice>
|
930
|
+
<ref name="erefType"/>
|
931
|
+
<ref name="termref"/>
|
932
|
+
</choice>
|
915
933
|
</element>
|
916
934
|
</define>
|
917
935
|
<define name="modification">
|
@@ -919,6 +937,15 @@
|
|
919
937
|
<ref name="paragraph"/>
|
920
938
|
</element>
|
921
939
|
</define>
|
940
|
+
<define name="termref">
|
941
|
+
<element name="termref">
|
942
|
+
<attribute name="base"/>
|
943
|
+
<attribute name="target"/>
|
944
|
+
<optional>
|
945
|
+
<text/>
|
946
|
+
</optional>
|
947
|
+
</element>
|
948
|
+
</define>
|
922
949
|
<define name="structuredidentifier">
|
923
950
|
<element name="structuredidentifier">
|
924
951
|
<optional>
|
@@ -5,12 +5,6 @@ module IsoDoc
|
|
5
5
|
@meta = Metadata.new(lang, script, labels)
|
6
6
|
end
|
7
7
|
|
8
|
-
def info(isoxml, out)
|
9
|
-
@meta.security isoxml, out
|
10
|
-
@meta.recipient isoxml, out
|
11
|
-
super
|
12
|
-
end
|
13
|
-
|
14
8
|
def annex_name(annex, name, div)
|
15
9
|
div.h1 **{ class: "Annex" } do |t|
|
16
10
|
t << "#{anchor(annex['id'], :label)}<br/><br/>"
|
@@ -1,24 +1,8 @@
|
|
1
1
|
<script>
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
'smoothScrolling': true, //enable or disable smooth scrolling on click
|
7
|
-
'prefix': 'toc', //prefix for anchor tags and class names
|
8
|
-
'onHighlight': function(el) {}, //called when a new section is highlighted
|
9
|
-
'highlightOnScroll': true, //add class to heading that is currently in focus
|
10
|
-
'highlightOffset': 100, //offset to trigger the next headline
|
11
|
-
'anchorName': function(i, heading, prefix) { //custom function for anchor name
|
12
|
-
return prefix+i;
|
13
|
-
},
|
14
|
-
'headerText': function(i, heading, $heading) { //custom function building the header-item text
|
15
|
-
return $heading.text();
|
16
|
-
},
|
17
|
-
'itemClass': function(i, heading, $heading, prefix) { // custom function for item class
|
18
|
-
return $heading[0].tagName.toLowerCase();
|
19
|
-
}
|
20
|
-
});
|
21
|
-
|
2
|
+
$("#toc").on('click', 'li', function(e) {
|
3
|
+
$(this).parent().find('li.toc-active').removeClass('toc-active');
|
4
|
+
$(this).addClass('toc-active');
|
5
|
+
});
|
22
6
|
</script>
|
23
7
|
|
24
8
|
<script>
|
data/lib/isodoc/rsd/metadata.rb
CHANGED
@@ -8,16 +8,6 @@ module IsoDoc
|
|
8
8
|
Metanorma::Rsd.configuration
|
9
9
|
end
|
10
10
|
|
11
|
-
def security(isoxml, _out)
|
12
|
-
security = isoxml.at(ns("//bibdata/ext/security")) || return
|
13
|
-
set(:security, security.text)
|
14
|
-
end
|
15
|
-
|
16
|
-
def recipient(isoxml, _out)
|
17
|
-
recipient = isoxml.at(ns("//bibdata/ext/recipient")) || return
|
18
|
-
set(:recipient, recipient.text)
|
19
|
-
end
|
20
|
-
|
21
11
|
def version(isoxml, _out)
|
22
12
|
super
|
23
13
|
revdate = get[:revdate]
|
@@ -1,33 +1,30 @@
|
|
1
1
|
require "isodoc"
|
2
|
-
require "isodoc/generic/pdf_convert"
|
3
2
|
require "isodoc/rsd/metadata"
|
4
3
|
|
5
4
|
module IsoDoc
|
6
5
|
module Rsd
|
7
6
|
# A {Converter} implementation that generates PDF HTML output, and a
|
8
7
|
# document schema encapsulation of the document for validation
|
9
|
-
class PdfConvert <
|
10
|
-
def
|
11
|
-
|
8
|
+
class PdfConvert < IsoDoc::XslfoPdfConvert
|
9
|
+
def initialize(options)
|
10
|
+
@libdir = File.dirname(__FILE__)
|
11
|
+
super
|
12
12
|
end
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
14
|
+
def convert(filename, file = nil, debug = false)
|
15
|
+
file = File.read(filename, encoding: "utf-8") if file.nil?
|
16
|
+
docxml, outname_html, dir = convert_init(file, filename, debug)
|
17
|
+
/\.xml$/.match(filename) or
|
18
|
+
filename = Tempfile.open([outname_html, ".xml"], encoding: "utf-8") do |f|
|
19
|
+
f.write file
|
20
|
+
f.path
|
21
|
+
end
|
22
|
+
FileUtils.rm_rf dir
|
23
|
+
::Metanorma::Output::XslfoPdf.new.convert(
|
24
|
+
filename, outname_html + ".pdf",
|
25
|
+
File.join(@libdir, "rsd.standard.xsl"))
|
26
26
|
end
|
27
27
|
end
|
28
|
-
|
29
|
-
include BaseConvert
|
30
|
-
end
|
31
28
|
end
|
32
29
|
end
|
33
30
|
|