metanorma-unece 0.0.14 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +12 -10
- data/appveyor.yml +7 -2
- data/lib/asciidoctor/unece/biblio.rng +44 -15
- data/lib/asciidoctor/unece/converter.rb +14 -8
- data/lib/asciidoctor/unece/isodoc.rng +128 -71
- data/lib/asciidoctor/unece/isostandard.rng +29 -304
- data/lib/asciidoctor/unece/reqt.rng +5 -0
- data/lib/asciidoctor/unece/unece.rng +11 -83
- data/lib/asciidoctor/unece/validate.rb +22 -0
- data/lib/isodoc/unece/base_convert.rb +215 -0
- data/lib/isodoc/unece/html/html_unece_plenary_titlepage.html +3 -3
- data/lib/isodoc/unece/html/html_unece_titlepage.html +3 -3
- data/lib/isodoc/unece/html_convert.rb +5 -206
- data/lib/isodoc/unece/metadata.rb +12 -17
- data/lib/isodoc/unece/word_convert.rb +87 -291
- data/lib/metanorma/unece/version.rb +1 -1
- data/metanorma-unece.gemspec +3 -3
- metadata +10 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 94a9e725c503ae0d9f0a2f84a520aa8235ec8a5f690c2e0590077668f9b29969
|
4
|
+
data.tar.gz: eaf413caf83d91417418d3146a1f874003f6c32ffedcb2fa8bfc403818e40349
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91bc77d7dc15555c35204569d22752f65125b4940444f03bf7f7f57984e2ed889cd1feabdfa7a57f759addacf93b83e6e90e8dc244ff22d24b1a08464ef41dea
|
7
|
+
data.tar.gz: 1a564e01993e2d46661bec2d5bc6a6a92b469038524a193ff5ae863df26c0184ec65cc46b249a3fdc6f9a941b6bbf9a88c438e334bfbfabe36e20d121edf1d03
|
data/.travis.yml
CHANGED
@@ -1,15 +1,17 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
# Auto-generated !!! Do not edit it manually
|
2
|
+
# use ci-master https://github.com/metanorma/metanorma-build-scripts
|
3
3
|
language: ruby
|
4
|
+
cache: bundler
|
5
|
+
os:
|
6
|
+
- linux
|
7
|
+
- osx
|
4
8
|
rvm:
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
- travis_retry sudo apt-get update
|
12
|
-
- sudo bash -c "curl -L https://raw.githubusercontent.com/metanorma/plantuml-install/master/ubuntu.sh | bash"
|
9
|
+
- 2.5
|
10
|
+
- 2.4
|
11
|
+
- ruby-head
|
12
|
+
before_install:
|
13
|
+
- gem install bundler -v 2.0.1
|
14
|
+
- bundle update
|
13
15
|
matrix:
|
14
16
|
allow_failures:
|
15
17
|
- rvm: ruby-head
|
data/appveyor.yml
CHANGED
@@ -1,10 +1,14 @@
|
|
1
|
+
# Auto-generated !!! Do not edit it manually
|
2
|
+
# use ci-master https://github.com/metanorma/metanorma-build-scripts
|
1
3
|
version: '{build}'
|
2
4
|
|
5
|
+
cache:
|
6
|
+
- vendor/bundle
|
7
|
+
|
3
8
|
environment:
|
4
9
|
matrix:
|
5
10
|
- RUBY_VERSION: 25
|
6
11
|
- RUBY_VERSION: 24
|
7
|
-
- RUBY_VERSION: 23
|
8
12
|
- RUBY_VERSION: _trunk
|
9
13
|
|
10
14
|
matrix:
|
@@ -17,6 +21,8 @@ install:
|
|
17
21
|
|
18
22
|
build_script:
|
19
23
|
- set PATH=C:\Ruby%RUBY_VERSION%\bin;%PATH%
|
24
|
+
- set GIT_TERMINAL_PROMPT=0
|
25
|
+
- bundle config --local path vendor/bundle
|
20
26
|
- bundle update
|
21
27
|
- bundle install
|
22
28
|
|
@@ -27,4 +33,3 @@ before_test:
|
|
27
33
|
|
28
34
|
test_script:
|
29
35
|
- bundle exec rake
|
30
|
-
|
@@ -35,7 +35,28 @@
|
|
35
35
|
</define>
|
36
36
|
<define name="status">
|
37
37
|
<element name="status">
|
38
|
-
<ref name="
|
38
|
+
<ref name="stage"/>
|
39
|
+
<optional>
|
40
|
+
<ref name="substage"/>
|
41
|
+
</optional>
|
42
|
+
<optional>
|
43
|
+
<ref name="iteration"/>
|
44
|
+
</optional>
|
45
|
+
</element>
|
46
|
+
</define>
|
47
|
+
<define name="stage">
|
48
|
+
<element name="stage">
|
49
|
+
<text/>
|
50
|
+
</element>
|
51
|
+
</define>
|
52
|
+
<define name="substage">
|
53
|
+
<element name="substage">
|
54
|
+
<text/>
|
55
|
+
</element>
|
56
|
+
</define>
|
57
|
+
<define name="iteration">
|
58
|
+
<element name="iteration">
|
59
|
+
<text/>
|
39
60
|
</element>
|
40
61
|
</define>
|
41
62
|
<define name="language">
|
@@ -523,9 +544,9 @@
|
|
523
544
|
<zeroOrMore>
|
524
545
|
<ref name="script"/>
|
525
546
|
</zeroOrMore>
|
526
|
-
<
|
547
|
+
<zeroOrMore>
|
527
548
|
<ref name="abstract"/>
|
528
|
-
</
|
549
|
+
</zeroOrMore>
|
529
550
|
<optional>
|
530
551
|
<ref name="status"/>
|
531
552
|
</optional>
|
@@ -636,22 +657,27 @@
|
|
636
657
|
<ref name="ISO8601Date"/>
|
637
658
|
</optional>
|
638
659
|
</define>
|
660
|
+
<define name="BibliographicDateType">
|
661
|
+
<choice>
|
662
|
+
<value>published</value>
|
663
|
+
<value>accessed</value>
|
664
|
+
<value>created</value>
|
665
|
+
<value>implemented</value>
|
666
|
+
<value>obsoleted</value>
|
667
|
+
<value>confirmed</value>
|
668
|
+
<value>updated</value>
|
669
|
+
<value>issued</value>
|
670
|
+
<value>transmitted</value>
|
671
|
+
<value>copied</value>
|
672
|
+
<value>unchanged</value>
|
673
|
+
<value>circulated</value>
|
674
|
+
</choice>
|
675
|
+
</define>
|
639
676
|
<define name="bdate">
|
640
677
|
<element name="date">
|
641
678
|
<attribute name="type">
|
642
679
|
<choice>
|
643
|
-
<
|
644
|
-
<value>accessed</value>
|
645
|
-
<value>created</value>
|
646
|
-
<value>implemented</value>
|
647
|
-
<value>obsoleted</value>
|
648
|
-
<value>confirmed</value>
|
649
|
-
<value>updated</value>
|
650
|
-
<value>issued</value>
|
651
|
-
<value>transmitted</value>
|
652
|
-
<value>copied</value>
|
653
|
-
<value>unchanged</value>
|
654
|
-
<value>circulated</value>
|
680
|
+
<ref name="BibliographicDateType"/>
|
655
681
|
<text/>
|
656
682
|
</choice>
|
657
683
|
</attribute>
|
@@ -805,6 +831,9 @@
|
|
805
831
|
</define>
|
806
832
|
<define name="biblionote">
|
807
833
|
<element name="note">
|
834
|
+
<optional>
|
835
|
+
<attribute name="type"/>
|
836
|
+
</optional>
|
808
837
|
<ref name="FormattedString"/>
|
809
838
|
</element>
|
810
839
|
</define>
|
@@ -1,6 +1,7 @@
|
|
1
1
|
require "asciidoctor"
|
2
2
|
require "asciidoctor/standoc/converter"
|
3
3
|
require "fileutils"
|
4
|
+
require_relative "validate"
|
4
5
|
|
5
6
|
module Asciidoctor
|
6
7
|
module Unece
|
@@ -31,6 +32,7 @@ module Asciidoctor
|
|
31
32
|
end
|
32
33
|
|
33
34
|
def metadata_committee(node, xml)
|
35
|
+
return unless node.attr("committee")
|
34
36
|
xml.editorialgroup do |a|
|
35
37
|
a.committee node.attr("committee"),
|
36
38
|
**attr_code(type: node.attr("committee-type"))
|
@@ -55,10 +57,6 @@ module Asciidoctor
|
|
55
57
|
end
|
56
58
|
end
|
57
59
|
|
58
|
-
def metadata_status(node, xml)
|
59
|
-
xml.status(**{ format: "plain" }) { |s| s << node.attr("status") }
|
60
|
-
end
|
61
|
-
|
62
60
|
def metadata_id(node, xml)
|
63
61
|
dn = node.attr("docnumber")
|
64
62
|
if docstatus = node.attr("status")
|
@@ -101,14 +99,18 @@ module Asciidoctor
|
|
101
99
|
def metadata_language(node, xml)
|
102
100
|
languages = node&.attr("language")&.split(/,[ ]*/) || %w(ar ru en fr zh es)
|
103
101
|
languages.each { |l| xml.language l }
|
102
|
+
end
|
103
|
+
|
104
|
+
def metadata_submission_language(node, xml)
|
104
105
|
languages = node&.attr("submissionlanguage")&.split(/,[ ]*/) || []
|
105
106
|
languages.each { |l| xml.submissionlanguage l }
|
106
107
|
end
|
107
108
|
|
108
|
-
def
|
109
|
+
def metadata_ext(node, xml)
|
109
110
|
super
|
110
111
|
metadata_distribution(node, xml)
|
111
112
|
metadata_session(node, xml)
|
113
|
+
metadata_submission_language(node, xml)
|
112
114
|
end
|
113
115
|
|
114
116
|
def title_validate(root)
|
@@ -194,10 +196,14 @@ module Asciidoctor
|
|
194
196
|
end
|
195
197
|
end
|
196
198
|
|
197
|
-
def
|
198
|
-
|
199
|
-
super
|
199
|
+
def admonition_attrs(node)
|
200
|
+
attr_code(super.merge("unnumbered": node.option?("unnumbered")))
|
200
201
|
end
|
202
|
+
|
203
|
+
#def clause_parse(attrs, xml, node)
|
204
|
+
#abstract_parse(attrs, xml, node) && return if node.attr("style") == "abstract"
|
205
|
+
#super
|
206
|
+
#end
|
201
207
|
end
|
202
208
|
end
|
203
209
|
end
|
@@ -19,27 +19,16 @@
|
|
19
19
|
-->
|
20
20
|
<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
21
21
|
<include href="reqt.rng"/>
|
22
|
-
<include href="biblio.rng"
|
23
|
-
<define name="status">
|
24
|
-
<element name="status">
|
25
|
-
<choice>
|
26
|
-
<value>proposal</value>
|
27
|
-
<value>working_draft</value>
|
28
|
-
<value>committee_draft</value>
|
29
|
-
<value>draft_standard</value>
|
30
|
-
<value>final_draft</value>
|
31
|
-
<value>published</value>
|
32
|
-
<value>withdrawn</value>
|
33
|
-
</choice>
|
34
|
-
</element>
|
35
|
-
</define>
|
36
|
-
</include>
|
22
|
+
<include href="biblio.rng"/>
|
37
23
|
<start>
|
38
24
|
<ref name="standard-document"/>
|
39
25
|
</start>
|
40
26
|
<define name="standard-document">
|
41
27
|
<element name="standard-document">
|
42
28
|
<ref name="bibdata"/>
|
29
|
+
<optional>
|
30
|
+
<ref name="boilerplate"/>
|
31
|
+
</optional>
|
43
32
|
<optional>
|
44
33
|
<ref name="preface"/>
|
45
34
|
</optional>
|
@@ -64,6 +53,42 @@
|
|
64
53
|
</oneOrMore>
|
65
54
|
</element>
|
66
55
|
</define>
|
56
|
+
<define name="boilerplate">
|
57
|
+
<element name="boilerplate">
|
58
|
+
<optional>
|
59
|
+
<ref name="copyright-statement"/>
|
60
|
+
</optional>
|
61
|
+
<optional>
|
62
|
+
<ref name="license-statement"/>
|
63
|
+
</optional>
|
64
|
+
<optional>
|
65
|
+
<ref name="legal-statement"/>
|
66
|
+
</optional>
|
67
|
+
<optional>
|
68
|
+
<ref name="feedback-statement"/>
|
69
|
+
</optional>
|
70
|
+
</element>
|
71
|
+
</define>
|
72
|
+
<define name="copyright-statement">
|
73
|
+
<element name="copyright-statement">
|
74
|
+
<ref name="Content-Section"/>
|
75
|
+
</element>
|
76
|
+
</define>
|
77
|
+
<define name="license-statement">
|
78
|
+
<element name="license-statement">
|
79
|
+
<ref name="Content-Section"/>
|
80
|
+
</element>
|
81
|
+
</define>
|
82
|
+
<define name="legal-statement">
|
83
|
+
<element name="legal-statement">
|
84
|
+
<ref name="Content-Section"/>
|
85
|
+
</element>
|
86
|
+
</define>
|
87
|
+
<define name="feedback-statement">
|
88
|
+
<element name="feedback-statement">
|
89
|
+
<ref name="Content-Section"/>
|
90
|
+
</element>
|
91
|
+
</define>
|
67
92
|
<define name="sections">
|
68
93
|
<element name="sections">
|
69
94
|
<oneOrMore>
|
@@ -446,6 +471,11 @@
|
|
446
471
|
<attribute name="id">
|
447
472
|
<data type="ID"/>
|
448
473
|
</attribute>
|
474
|
+
<optional>
|
475
|
+
<attribute name="unnumbered">
|
476
|
+
<data type="boolean"/>
|
477
|
+
</attribute>
|
478
|
+
</optional>
|
449
479
|
<ref name="stem"/>
|
450
480
|
<optional>
|
451
481
|
<ref name="dl"/>
|
@@ -494,6 +524,11 @@
|
|
494
524
|
<attribute name="id">
|
495
525
|
<data type="ID"/>
|
496
526
|
</attribute>
|
527
|
+
<optional>
|
528
|
+
<attribute name="unnumbered">
|
529
|
+
<data type="boolean"/>
|
530
|
+
</attribute>
|
531
|
+
</optional>
|
497
532
|
<optional>
|
498
533
|
<attribute name="lang"/>
|
499
534
|
</optional>
|
@@ -533,6 +568,14 @@
|
|
533
568
|
<attribute name="id">
|
534
569
|
<data type="ID"/>
|
535
570
|
</attribute>
|
571
|
+
<optional>
|
572
|
+
<attribute name="unnumbered">
|
573
|
+
<data type="boolean"/>
|
574
|
+
</attribute>
|
575
|
+
</optional>
|
576
|
+
<optional>
|
577
|
+
<attribute name="alt"/>
|
578
|
+
</optional>
|
536
579
|
<optional>
|
537
580
|
<ref name="tname"/>
|
538
581
|
</optional>
|
@@ -647,6 +690,11 @@
|
|
647
690
|
<attribute name="id">
|
648
691
|
<data type="ID"/>
|
649
692
|
</attribute>
|
693
|
+
<optional>
|
694
|
+
<attribute name="unnumbered">
|
695
|
+
<data type="boolean"/>
|
696
|
+
</attribute>
|
697
|
+
</optional>
|
650
698
|
<oneOrMore>
|
651
699
|
<choice>
|
652
700
|
<ref name="formula"/>
|
@@ -690,6 +738,11 @@
|
|
690
738
|
<attribute name="id">
|
691
739
|
<data type="ID"/>
|
692
740
|
</attribute>
|
741
|
+
<optional>
|
742
|
+
<attribute name="unnumbered">
|
743
|
+
<data type="boolean"/>
|
744
|
+
</attribute>
|
745
|
+
</optional>
|
693
746
|
<optional>
|
694
747
|
<ref name="source"/>
|
695
748
|
</optional>
|
@@ -735,6 +788,20 @@
|
|
735
788
|
<ref name="bookmark"/>
|
736
789
|
</choice>
|
737
790
|
</define>
|
791
|
+
<define name="PureTextElement">
|
792
|
+
<choice>
|
793
|
+
<text/>
|
794
|
+
<ref name="em"/>
|
795
|
+
<ref name="strong"/>
|
796
|
+
<ref name="sub"/>
|
797
|
+
<ref name="sup"/>
|
798
|
+
<ref name="tt"/>
|
799
|
+
<ref name="keyword"/>
|
800
|
+
<ref name="strike"/>
|
801
|
+
<ref name="smallcap"/>
|
802
|
+
<ref name="br"/>
|
803
|
+
</choice>
|
804
|
+
</define>
|
738
805
|
<define name="source">
|
739
806
|
<element name="source">
|
740
807
|
<ref name="TypedUri"/>
|
@@ -742,42 +809,58 @@
|
|
742
809
|
</define>
|
743
810
|
<define name="em">
|
744
811
|
<element name="em">
|
745
|
-
<
|
812
|
+
<zeroOrMore>
|
813
|
+
<ref name="PureTextElement"/>
|
814
|
+
</zeroOrMore>
|
746
815
|
</element>
|
747
816
|
</define>
|
748
817
|
<define name="strong">
|
749
818
|
<element name="strong">
|
750
|
-
<
|
819
|
+
<zeroOrMore>
|
820
|
+
<ref name="PureTextElement"/>
|
821
|
+
</zeroOrMore>
|
751
822
|
</element>
|
752
823
|
</define>
|
753
824
|
<define name="tt">
|
754
825
|
<element name="tt">
|
755
|
-
<
|
826
|
+
<zeroOrMore>
|
827
|
+
<ref name="PureTextElement"/>
|
828
|
+
</zeroOrMore>
|
756
829
|
</element>
|
757
830
|
</define>
|
758
831
|
<define name="keyword">
|
759
832
|
<element name="keyword">
|
760
|
-
<
|
833
|
+
<zeroOrMore>
|
834
|
+
<ref name="PureTextElement"/>
|
835
|
+
</zeroOrMore>
|
761
836
|
</element>
|
762
837
|
</define>
|
763
838
|
<define name="sub">
|
764
839
|
<element name="sub">
|
765
|
-
<
|
840
|
+
<zeroOrMore>
|
841
|
+
<ref name="PureTextElement"/>
|
842
|
+
</zeroOrMore>
|
766
843
|
</element>
|
767
844
|
</define>
|
768
845
|
<define name="sup">
|
769
846
|
<element name="sup">
|
770
|
-
<
|
847
|
+
<zeroOrMore>
|
848
|
+
<ref name="PureTextElement"/>
|
849
|
+
</zeroOrMore>
|
771
850
|
</element>
|
772
851
|
</define>
|
773
852
|
<define name="strike">
|
774
853
|
<element name="strike">
|
775
|
-
<
|
854
|
+
<zeroOrMore>
|
855
|
+
<ref name="PureTextElement"/>
|
856
|
+
</zeroOrMore>
|
776
857
|
</element>
|
777
858
|
</define>
|
778
859
|
<define name="smallcap">
|
779
860
|
<element name="smallcap">
|
780
|
-
<
|
861
|
+
<zeroOrMore>
|
862
|
+
<ref name="PureTextElement"/>
|
863
|
+
</zeroOrMore>
|
781
864
|
</element>
|
782
865
|
</define>
|
783
866
|
<define name="br">
|
@@ -838,6 +921,9 @@
|
|
838
921
|
<attribute name="type">
|
839
922
|
<ref name="ReferenceFormat"/>
|
840
923
|
</attribute>
|
924
|
+
<optional>
|
925
|
+
<attribute name="alt"/>
|
926
|
+
</optional>
|
841
927
|
<text/>
|
842
928
|
</element>
|
843
929
|
</define>
|
@@ -1019,57 +1105,28 @@
|
|
1019
1105
|
</zeroOrMore>
|
1020
1106
|
</element>
|
1021
1107
|
</define>
|
1022
|
-
<define name="
|
1023
|
-
<
|
1024
|
-
<
|
1025
|
-
|
1026
|
-
|
1027
|
-
|
1028
|
-
<oneOrMore>
|
1029
|
-
<ref name="btitle"/>
|
1030
|
-
</oneOrMore>
|
1031
|
-
<optional>
|
1032
|
-
<ref name="formattedref"/>
|
1033
|
-
</optional>
|
1034
|
-
<zeroOrMore>
|
1035
|
-
<ref name="bsource"/>
|
1036
|
-
</zeroOrMore>
|
1037
|
-
<zeroOrMore>
|
1038
|
-
<ref name="docidentifier"/>
|
1039
|
-
</zeroOrMore>
|
1040
|
-
<optional>
|
1041
|
-
<ref name="docnumber"/>
|
1042
|
-
</optional>
|
1043
|
-
<zeroOrMore>
|
1044
|
-
<ref name="bdate"/>
|
1045
|
-
</zeroOrMore>
|
1046
|
-
<zeroOrMore>
|
1047
|
-
<ref name="contributor"/>
|
1048
|
-
</zeroOrMore>
|
1049
|
-
<optional>
|
1050
|
-
<ref name="edition"/>
|
1051
|
-
</optional>
|
1052
|
-
<optional>
|
1053
|
-
<ref name="version"/>
|
1054
|
-
</optional>
|
1055
|
-
<zeroOrMore>
|
1056
|
-
<ref name="biblionote"/>
|
1057
|
-
</zeroOrMore>
|
1058
|
-
<zeroOrMore>
|
1059
|
-
<ref name="language"/>
|
1060
|
-
</zeroOrMore>
|
1061
|
-
<zeroOrMore>
|
1062
|
-
<ref name="script"/>
|
1063
|
-
</zeroOrMore>
|
1108
|
+
<define name="ext">
|
1109
|
+
<element name="ext">
|
1110
|
+
<ref name="BibDataExtensionType"/>
|
1111
|
+
</element>
|
1112
|
+
</define>
|
1113
|
+
<define name="BibDataExtensionType">
|
1064
1114
|
<optional>
|
1065
|
-
<ref name="
|
1115
|
+
<ref name="doctype"/>
|
1066
1116
|
</optional>
|
1117
|
+
</define>
|
1118
|
+
<define name="doctype">
|
1119
|
+
<element name="doctype">
|
1120
|
+
<ref name="DocumentType"/>
|
1121
|
+
</element>
|
1122
|
+
</define>
|
1123
|
+
<define name="DocumentType">
|
1124
|
+
<value>document</value>
|
1125
|
+
</define>
|
1126
|
+
<define name="BibData">
|
1127
|
+
<ref name="BibliographicItem"/>
|
1067
1128
|
<optional>
|
1068
|
-
<ref name="
|
1129
|
+
<ref name="ext"/>
|
1069
1130
|
</optional>
|
1070
|
-
<ref name="copyright"/>
|
1071
|
-
<zeroOrMore>
|
1072
|
-
<ref name="docrelation"/>
|
1073
|
-
</zeroOrMore>
|
1074
1131
|
</define>
|
1075
1132
|
</grammar>
|