metanorma-generic 1.4.5 → 1.4.10
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 +10 -10
- data/.github/workflows/ubuntu.yml +25 -11
- data/.github/workflows/windows.yml +11 -12
- data/README.adoc +2 -2
- data/lib/asciidoctor/generic/biblio.rng +144 -49
- data/lib/asciidoctor/generic/converter.rb +65 -22
- data/lib/asciidoctor/generic/isodoc.rng +49 -5
- data/lib/isodoc/generic/base_convert.rb +5 -0
- data/lib/isodoc/generic/html/scripts.html +14 -27
- data/lib/isodoc/generic/html_convert.rb +2 -4
- data/lib/isodoc/generic/metadata.rb +10 -0
- data/lib/metanorma/generic.rb +21 -1
- data/lib/metanorma/generic/processor.rb +21 -2
- data/lib/metanorma/generic/version.rb +1 -1
- data/metanorma-generic.gemspec +1 -1
- data/metanorma.yml.example +42 -0
- metadata +4 -5
- data/lib/isodoc/generic/html/scripts.pdf.html +0 -72
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b2e83e4ce44a73159911a4cd610b632b91d1a71ddf73a328d07a53eceebd80a
|
4
|
+
data.tar.gz: 2da7ff5ca318ba325109418e6b18cbb32503c6d8bb3e850fd929c29d57da7d9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 231efadc36e7e42df4c3bdea0288aa8b36b5a161d19cc5c5021bf45d657e825f5d69044cd25012ec37b374eb588256fbf0a97fb9d5dbe5b98e07fe63958df5c3
|
7
|
+
data.tar.gz: d77d7a46e601ec30063ceae7dfc21d355ef22575b0d73779d2acfead46dccf56d08d6fb47d695107803036a163372e2bf28b862b83ae1972625655cb011f1481
|
data/.github/workflows/macos.yml
CHANGED
@@ -1,21 +1,28 @@
|
|
1
|
-
# Auto-generated
|
2
|
-
#
|
1
|
+
# Auto-generated by Cimas: Do not edit it manually!
|
2
|
+
# See https://github.com/metanorma/cimas
|
3
3
|
name: macos
|
4
4
|
|
5
5
|
on:
|
6
6
|
push:
|
7
7
|
branches: [ master ]
|
8
8
|
pull_request:
|
9
|
-
|
9
|
+
paths-ignore:
|
10
|
+
- .github/workflows/ubuntu.yml
|
11
|
+
- .github/workflows/windows.yml
|
10
12
|
|
11
13
|
jobs:
|
12
14
|
test-macos:
|
13
15
|
name: Test on Ruby ${{ matrix.ruby }} macOS
|
14
16
|
runs-on: macos-latest
|
17
|
+
continue-on-error: ${{ matrix.experimental }}
|
15
18
|
strategy:
|
16
19
|
fail-fast: false
|
17
20
|
matrix:
|
18
21
|
ruby: [ '2.6', '2.5', '2.4' ]
|
22
|
+
experimental: [false]
|
23
|
+
include:
|
24
|
+
- ruby: '2.7'
|
25
|
+
experimental: true
|
19
26
|
steps:
|
20
27
|
- uses: actions/checkout@master
|
21
28
|
- name: Use Ruby
|
@@ -27,13 +34,6 @@ jobs:
|
|
27
34
|
run: |
|
28
35
|
sudo gem install bundler --force
|
29
36
|
bundle install --jobs 4 --retry 3
|
30
|
-
- name: Use Node
|
31
|
-
uses: actions/setup-node@v1
|
32
|
-
with:
|
33
|
-
node-version: '8'
|
34
|
-
- name: Install Puppeteer
|
35
|
-
run: |
|
36
|
-
npm install -g puppeteer
|
37
37
|
- name: Run specs
|
38
38
|
run: |
|
39
39
|
bundle exec rake
|
@@ -1,21 +1,30 @@
|
|
1
|
-
# Auto-generated
|
2
|
-
#
|
1
|
+
# Auto-generated by Cimas: Do not edit it manually!
|
2
|
+
# See https://github.com/metanorma/cimas
|
3
3
|
name: ubuntu
|
4
4
|
|
5
5
|
on:
|
6
6
|
push:
|
7
7
|
branches: [ master ]
|
8
|
+
tags:
|
9
|
+
- '*'
|
8
10
|
pull_request:
|
9
|
-
|
11
|
+
paths-ignore:
|
12
|
+
- .github/workflows/macos.yml
|
13
|
+
- .github/workflows/windows.yml
|
10
14
|
|
11
15
|
jobs:
|
12
16
|
test-linux:
|
13
17
|
name: Test on Ruby ${{ matrix.ruby }} Ubuntu
|
14
18
|
runs-on: ubuntu-latest
|
19
|
+
continue-on-error: ${{ matrix.experimental }}
|
15
20
|
strategy:
|
16
21
|
fail-fast: false
|
17
22
|
matrix:
|
18
23
|
ruby: [ '2.6', '2.5', '2.4' ]
|
24
|
+
experimental: [false]
|
25
|
+
include:
|
26
|
+
- ruby: '2.7'
|
27
|
+
experimental: true
|
19
28
|
steps:
|
20
29
|
- uses: actions/checkout@master
|
21
30
|
- name: Use Ruby
|
@@ -25,15 +34,20 @@ jobs:
|
|
25
34
|
architecture: 'x64'
|
26
35
|
- name: Update gems
|
27
36
|
run: |
|
28
|
-
gem install bundler
|
37
|
+
gem install bundler
|
29
38
|
bundle install --jobs 4 --retry 3
|
30
|
-
- name: Use Node
|
31
|
-
uses: actions/setup-node@v1
|
32
|
-
with:
|
33
|
-
node-version: '8'
|
34
|
-
- name: Install Puppeteer
|
35
|
-
run: |
|
36
|
-
npm install -g puppeteer
|
37
39
|
- name: Run specs
|
38
40
|
run: |
|
39
41
|
bundle exec rake
|
42
|
+
- name: Trigger dependent repositories
|
43
|
+
if: github.ref == 'refs/heads/master' && matrix.ruby == '2.6'
|
44
|
+
env:
|
45
|
+
GH_USERNAME: ${{ secrets.PAT_USERNAME }}
|
46
|
+
GH_ACCESS_TOKEN: ${{ secrets.PAT_TOKEN }}
|
47
|
+
run: |
|
48
|
+
curl -LO --retry 3 https://raw.githubusercontent.com/metanorma/metanorma-build-scripts/master/trigger-gh-actions.sh
|
49
|
+
[[ -f ".github/workflows/dependent_repos.env" ]] && source .github/workflows/dependent_repos.env
|
50
|
+
for repo in $DEPENDENT_REPOS
|
51
|
+
do
|
52
|
+
sh trigger-gh-actions.sh $ORGANISATION $repo $GH_USERNAME $GH_ACCESS_TOKEN $GITHUB_REPOSITORY "{ \"ref\": \"${GITHUB_REF}\" }"
|
53
|
+
done
|
@@ -1,21 +1,28 @@
|
|
1
|
-
# Auto-generated
|
2
|
-
#
|
1
|
+
# Auto-generated by Cimas: Do not edit it manually!
|
2
|
+
# See https://github.com/metanorma/cimas
|
3
3
|
name: windows
|
4
4
|
|
5
5
|
on:
|
6
6
|
push:
|
7
7
|
branches: [ master ]
|
8
8
|
pull_request:
|
9
|
-
|
9
|
+
paths-ignore:
|
10
|
+
- .github/workflows/macos.yml
|
11
|
+
- .github/workflows/ubuntu.yml
|
10
12
|
|
11
13
|
jobs:
|
12
14
|
test-windows:
|
13
15
|
name: Test on Ruby ${{ matrix.ruby }} Windows
|
14
16
|
runs-on: windows-latest
|
17
|
+
continue-on-error: ${{ matrix.experimental }}
|
15
18
|
strategy:
|
16
19
|
fail-fast: false
|
17
20
|
matrix:
|
18
21
|
ruby: [ '2.6', '2.5', '2.4' ]
|
22
|
+
experimental: [false]
|
23
|
+
include:
|
24
|
+
- ruby: '2.7'
|
25
|
+
experimental: true
|
19
26
|
steps:
|
20
27
|
- uses: actions/checkout@master
|
21
28
|
- name: Use Ruby
|
@@ -26,17 +33,9 @@ jobs:
|
|
26
33
|
- name: Update gems
|
27
34
|
shell: pwsh
|
28
35
|
run: |
|
29
|
-
gem install bundler
|
36
|
+
gem install bundler
|
30
37
|
bundle config --local path vendor/bundle
|
31
|
-
bundle update
|
32
38
|
bundle install --jobs 4 --retry 3
|
33
|
-
- name: Use Node
|
34
|
-
uses: actions/setup-node@v1
|
35
|
-
with:
|
36
|
-
node-version: '8'
|
37
|
-
- name: Install Puppeteer
|
38
|
-
run: |
|
39
|
-
npm install -g puppeteer
|
40
39
|
- name: Run specs
|
41
40
|
run: |
|
42
41
|
bundle exec rake
|
data/README.adoc
CHANGED
@@ -5,8 +5,8 @@ Formerly known as metanorma-acme
|
|
5
5
|
image:https://img.shields.io/gem/v/metanorma-generic.svg["Gem Version", link="https://rubygems.org/gems/metanorma-generic"]
|
6
6
|
image:https://github.com/metanorma/metanorma-generic/workflows/macos/badge.svg["Build Status (macOS)", link="https://github.com/metanorma/metanorma-generic/actions?workflow=macos"]
|
7
7
|
image:https://github.com/metanorma/metanorma-generic/workflows/ubuntu/badge.svg["Build Status (ubuntu)", link="https://github.com/metanorma/metanorma-generic/actions?workflow=ubuntu"]
|
8
|
-
image:https://github.com/metanorma/metanorma-generic/workflows/windows/badge.svg["Build Status (
|
9
|
-
image:https://codeclimate.com/github/metanorma/metanorma-
|
8
|
+
image:https://github.com/metanorma/metanorma-generic/workflows/windows/badge.svg["Build Status (Windows)", link="https://github.com/metanorma/metanorma-generic/actions?workflow=windows"]
|
9
|
+
image:https://codeclimate.com/github/metanorma/metanorma-acme/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/metanorma/metanorma-acme"]
|
10
10
|
image:https://img.shields.io/github/issues-pr-raw/metanorma/metanorma-generic.svg["Pull Requests", link="https://github.com/metanorma/metanorma-generic/pulls"]
|
11
11
|
image:https://img.shields.io/github/commits-since/metanorma/metanorma-generic/latest.svg["Commits since latest",link="https://github.com/metanorma/metanorma-generic/releases"]
|
12
12
|
|
@@ -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>
|
@@ -82,7 +88,7 @@
|
|
82
88
|
<text/>
|
83
89
|
</element>
|
84
90
|
</define>
|
85
|
-
<define name="
|
91
|
+
<define name="LocalizedString1">
|
86
92
|
<optional>
|
87
93
|
<!-- multiple languages and scripts possible: comma delimit them if so -->
|
88
94
|
<attribute name="language"/>
|
@@ -92,6 +98,16 @@
|
|
92
98
|
</optional>
|
93
99
|
<text/>
|
94
100
|
</define>
|
101
|
+
<define name="LocalizedString">
|
102
|
+
<choice>
|
103
|
+
<ref name="LocalizedString1"/>
|
104
|
+
<oneOrMore>
|
105
|
+
<element name="variant">
|
106
|
+
<ref name="LocalizedString1"/>
|
107
|
+
</element>
|
108
|
+
</oneOrMore>
|
109
|
+
</choice>
|
110
|
+
</define>
|
95
111
|
<!--
|
96
112
|
Unlike UML, change type to format: type is overloaded
|
97
113
|
Would be need if plain were default value and could omit the attribute
|
@@ -115,7 +131,7 @@
|
|
115
131
|
</optional>
|
116
132
|
<ref name="LocalizedStringOrXsAny"/>
|
117
133
|
</define>
|
118
|
-
<define name="
|
134
|
+
<define name="LocalizedStringOrXsAny1">
|
119
135
|
<optional>
|
120
136
|
<!-- multiple languages and scripts possible: comma delimit them if so -->
|
121
137
|
<attribute name="language"/>
|
@@ -130,6 +146,16 @@
|
|
130
146
|
</choice>
|
131
147
|
</oneOrMore>
|
132
148
|
</define>
|
149
|
+
<define name="LocalizedStringOrXsAny">
|
150
|
+
<choice>
|
151
|
+
<ref name="LocalizedStringOrXsAny1"/>
|
152
|
+
<oneOrMore>
|
153
|
+
<element name="variant">
|
154
|
+
<ref name="LocalizedStringOrXsAny1"/>
|
155
|
+
</element>
|
156
|
+
</oneOrMore>
|
157
|
+
</choice>
|
158
|
+
</define>
|
133
159
|
<define name="contributor">
|
134
160
|
<element name="contributor">
|
135
161
|
<zeroOrMore>
|
@@ -452,9 +478,14 @@
|
|
452
478
|
<attribute name="bibitemid">
|
453
479
|
<data type="IDREF"/>
|
454
480
|
</attribute>
|
455
|
-
<
|
456
|
-
<
|
457
|
-
|
481
|
+
<choice>
|
482
|
+
<zeroOrMore>
|
483
|
+
<ref name="locality"/>
|
484
|
+
</zeroOrMore>
|
485
|
+
<zeroOrMore>
|
486
|
+
<ref name="localityStack"/>
|
487
|
+
</zeroOrMore>
|
488
|
+
</choice>
|
458
489
|
<optional>
|
459
490
|
<ref name="date"/>
|
460
491
|
</optional>
|
@@ -469,6 +500,25 @@
|
|
469
500
|
<ref name="BibItemLocality"/>
|
470
501
|
</element>
|
471
502
|
</define>
|
503
|
+
<define name="localityStack">
|
504
|
+
<element name="localityStack">
|
505
|
+
<zeroOrMore>
|
506
|
+
<ref name="locality"/>
|
507
|
+
</zeroOrMore>
|
508
|
+
</element>
|
509
|
+
</define>
|
510
|
+
<define name="sourceLocality">
|
511
|
+
<element name="sourceLocality">
|
512
|
+
<ref name="BibItemLocality"/>
|
513
|
+
</element>
|
514
|
+
</define>
|
515
|
+
<define name="sourceLocalityStack">
|
516
|
+
<element name="sourceLocalityStack">
|
517
|
+
<zeroOrMore>
|
518
|
+
<ref name="sourceLocality"/>
|
519
|
+
</zeroOrMore>
|
520
|
+
</element>
|
521
|
+
</define>
|
472
522
|
<define name="BibItemLocality">
|
473
523
|
<attribute name="type">
|
474
524
|
<ref name="LocalityType"/>
|
@@ -611,9 +661,9 @@
|
|
611
661
|
<optional>
|
612
662
|
<ref name="status"/>
|
613
663
|
</optional>
|
614
|
-
<
|
664
|
+
<zeroOrMore>
|
615
665
|
<ref name="copyright"/>
|
616
|
-
</
|
666
|
+
</zeroOrMore>
|
617
667
|
<zeroOrMore>
|
618
668
|
<ref name="docrelation"/>
|
619
669
|
</zeroOrMore>
|
@@ -703,21 +753,11 @@
|
|
703
753
|
</define>
|
704
754
|
<define name="TypedTitleString">
|
705
755
|
<optional>
|
706
|
-
<attribute name="type"
|
707
|
-
<ref name="TitleType"/>
|
708
|
-
</attribute>
|
756
|
+
<attribute name="type"/>
|
709
757
|
</optional>
|
710
758
|
<ref name="FormattedString"/>
|
711
759
|
</define>
|
712
|
-
|
713
|
-
<choice>
|
714
|
-
<value>alternative</value>
|
715
|
-
<value>original</value>
|
716
|
-
<value>unofficial</value>
|
717
|
-
<value>subtitle</value>
|
718
|
-
<value>main</value>
|
719
|
-
</choice>
|
720
|
-
</define>
|
760
|
+
<!-- TitleType = ( "alternative" | "original" | "unofficial" | "subtitle" | "main" ) -->
|
721
761
|
<define name="TypedUri">
|
722
762
|
<optional>
|
723
763
|
<attribute name="type"/>
|
@@ -747,6 +787,8 @@
|
|
747
787
|
<value>unchanged</value>
|
748
788
|
<value>circulated</value>
|
749
789
|
<value>adapted</value>
|
790
|
+
<value>vote-started</value>
|
791
|
+
<value>vote-ended</value>
|
750
792
|
</choice>
|
751
793
|
</define>
|
752
794
|
<define name="bdate">
|
@@ -979,7 +1021,17 @@
|
|
979
1021
|
<optional>
|
980
1022
|
<ref name="to"/>
|
981
1023
|
</optional>
|
982
|
-
<
|
1024
|
+
<oneOrMore>
|
1025
|
+
<ref name="owner"/>
|
1026
|
+
</oneOrMore>
|
1027
|
+
<optional>
|
1028
|
+
<ref name="copyright_scope"/>
|
1029
|
+
</optional>
|
1030
|
+
</element>
|
1031
|
+
</define>
|
1032
|
+
<define name="copyright_scope">
|
1033
|
+
<element name="scope">
|
1034
|
+
<text/>
|
983
1035
|
</element>
|
984
1036
|
</define>
|
985
1037
|
<define name="from">
|
@@ -999,38 +1051,63 @@
|
|
999
1051
|
</define>
|
1000
1052
|
<define name="DocRelationType">
|
1001
1053
|
<choice>
|
1002
|
-
<value>obsoletes</value>
|
1003
|
-
<value>obsoletedBy</value>
|
1004
|
-
<value>supersedes</value>
|
1005
|
-
<value>supersededBy</value>
|
1006
|
-
<value>updates</value>
|
1007
|
-
<value>updatedBy</value>
|
1008
|
-
<value>complements</value>
|
1009
|
-
<value>derivedFrom</value>
|
1010
|
-
<value>translatedFrom</value>
|
1011
|
-
<value>hasTranslation</value>
|
1012
|
-
<value>adoptedFrom</value>
|
1013
|
-
<value>equivalent</value>
|
1014
|
-
<value>identical</value>
|
1015
|
-
<value>nonequivalent</value>
|
1016
|
-
<value>includedIn</value>
|
1017
1054
|
<value>includes</value>
|
1018
|
-
<value>
|
1019
|
-
<value>instanceOf</value>
|
1020
|
-
<value>partOf</value>
|
1055
|
+
<value>includedIn</value>
|
1021
1056
|
<value>hasPart</value>
|
1022
|
-
<value>
|
1023
|
-
<value>draftOf</value>
|
1057
|
+
<value>partOf</value>
|
1024
1058
|
<value>merges</value>
|
1059
|
+
<value>mergedInto</value>
|
1025
1060
|
<value>splits</value>
|
1026
|
-
<value>
|
1027
|
-
<value>
|
1028
|
-
<value>
|
1029
|
-
<value>
|
1030
|
-
<value>
|
1031
|
-
<value>
|
1061
|
+
<value>splitInto</value>
|
1062
|
+
<value>instance</value>
|
1063
|
+
<value>hasInstance</value>
|
1064
|
+
<value>exemplarOf</value>
|
1065
|
+
<value>hasExemplar</value>
|
1066
|
+
<value>manifestationOf</value>
|
1067
|
+
<value>hasManifestation</value>
|
1068
|
+
<value>reproductionOf</value>
|
1069
|
+
<value>hasReproduction</value>
|
1070
|
+
<value>reprintOf</value>
|
1071
|
+
<value>hasReprint</value>
|
1072
|
+
<value>expressionOf</value>
|
1073
|
+
<value>hasExpression</value>
|
1074
|
+
<value>translatedFrom</value>
|
1075
|
+
<value>hasTranslation</value>
|
1076
|
+
<value>arrangementOf</value>
|
1077
|
+
<value>hasArrangement</value>
|
1078
|
+
<value>abridgementOf</value>
|
1079
|
+
<value>hasAbridgement</value>
|
1080
|
+
<value>annotationOf</value>
|
1081
|
+
<value>hasAnnotation</value>
|
1082
|
+
<value>draftOf</value>
|
1083
|
+
<value>hasDraft</value>
|
1084
|
+
<value>editionOf</value>
|
1085
|
+
<value>hasEdition</value>
|
1086
|
+
<value>updates</value>
|
1087
|
+
<value>updatedBy</value>
|
1088
|
+
<value>derivedFrom</value>
|
1089
|
+
<value>derives</value>
|
1032
1090
|
<value>describes</value>
|
1033
1091
|
<value>describedBy</value>
|
1092
|
+
<value>catalogues</value>
|
1093
|
+
<value>cataloguedBy</value>
|
1094
|
+
<value>hasSuccessor</value>
|
1095
|
+
<value>successorOf</value>
|
1096
|
+
<value>adaptedFrom</value>
|
1097
|
+
<value>hasAdaptation</value>
|
1098
|
+
<value>adoptedFrom</value>
|
1099
|
+
<value>adoptedAs</value>
|
1100
|
+
<value>reviewOf</value>
|
1101
|
+
<value>hasReview</value>
|
1102
|
+
<value>commentaryOf</value>
|
1103
|
+
<value>hasCommentary</value>
|
1104
|
+
<value>related</value>
|
1105
|
+
<value>complements</value>
|
1106
|
+
<value>complementOf</value>
|
1107
|
+
<value>obsoletes</value>
|
1108
|
+
<value>obsoletedBy</value>
|
1109
|
+
<value>cited</value>
|
1110
|
+
<value>isCitedIn</value>
|
1034
1111
|
</choice>
|
1035
1112
|
</define>
|
1036
1113
|
<define name="docrelation">
|
@@ -1038,12 +1115,30 @@
|
|
1038
1115
|
<attribute name="type">
|
1039
1116
|
<ref name="DocRelationType"/>
|
1040
1117
|
</attribute>
|
1118
|
+
<optional>
|
1119
|
+
<element name="description">
|
1120
|
+
<ref name="FormattedString"/>
|
1121
|
+
</element>
|
1122
|
+
</optional>
|
1041
1123
|
<element name="bibitem">
|
1042
1124
|
<ref name="BibliographicItem"/>
|
1043
1125
|
</element>
|
1044
|
-
<
|
1045
|
-
<
|
1046
|
-
|
1126
|
+
<choice>
|
1127
|
+
<zeroOrMore>
|
1128
|
+
<ref name="locality"/>
|
1129
|
+
</zeroOrMore>
|
1130
|
+
<zeroOrMore>
|
1131
|
+
<ref name="localityStack"/>
|
1132
|
+
</zeroOrMore>
|
1133
|
+
</choice>
|
1134
|
+
<choice>
|
1135
|
+
<zeroOrMore>
|
1136
|
+
<ref name="sourceLocality"/>
|
1137
|
+
</zeroOrMore>
|
1138
|
+
<zeroOrMore>
|
1139
|
+
<ref name="sourceLocalityStack"/>
|
1140
|
+
</zeroOrMore>
|
1141
|
+
</choice>
|
1047
1142
|
</element>
|
1048
1143
|
</define>
|
1049
1144
|
<define name="version">
|
@@ -14,6 +14,14 @@ module Asciidoctor
|
|
14
14
|
|
15
15
|
register_for "generic"
|
16
16
|
|
17
|
+
def xml_root_tag
|
18
|
+
configuration.xml_root_tag || XML_ROOT_TAG
|
19
|
+
end
|
20
|
+
|
21
|
+
def xml_namespace
|
22
|
+
configuration.document_namespace || XML_NAMESPACE
|
23
|
+
end
|
24
|
+
|
17
25
|
def baselocation(loc)
|
18
26
|
return nil if loc.nil?
|
19
27
|
File.expand_path(File.join(File.dirname(self.class::_file || __FILE__), "..", "..", "..", loc))
|
@@ -23,7 +31,7 @@ module Asciidoctor
|
|
23
31
|
xml.contributor do |c|
|
24
32
|
c.role **{ type: "author" }
|
25
33
|
c.organization do |a|
|
26
|
-
a.name configuration.
|
34
|
+
a.name configuration.organization_name_long
|
27
35
|
end
|
28
36
|
end
|
29
37
|
personal_author(node, xml)
|
@@ -33,7 +41,7 @@ module Asciidoctor
|
|
33
41
|
xml.contributor do |c|
|
34
42
|
c.role **{ type: "publisher" }
|
35
43
|
c.organization do |a|
|
36
|
-
a.name configuration.
|
44
|
+
a.name configuration.organization_name_long
|
37
45
|
end
|
38
46
|
end
|
39
47
|
end
|
@@ -52,6 +60,15 @@ module Asciidoctor
|
|
52
60
|
end
|
53
61
|
end
|
54
62
|
|
63
|
+
def metadata_status(node, xml)
|
64
|
+
xml.status do |s|
|
65
|
+
s.stage ( node.attr("status") || node.attr("docstage") ||
|
66
|
+
configuration.default_stage || "published" )
|
67
|
+
x = node.attr("substage") and s.substage x
|
68
|
+
x = node.attr("iteration") and s.iteration x
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
55
72
|
def docidentifier_cleanup(xmldoc)
|
56
73
|
template = configuration.docid_template ||
|
57
74
|
"{{ organization_name_short }} {{ docnumeric }}"
|
@@ -61,7 +78,8 @@ module Asciidoctor
|
|
61
78
|
end
|
62
79
|
|
63
80
|
def metadata_id(node, xml)
|
64
|
-
xml.docidentifier
|
81
|
+
xml.docidentifier **{ type:
|
82
|
+
configuration.organization_name_short } do |i|
|
65
83
|
i << "DUMMY"
|
66
84
|
end
|
67
85
|
xml.docnumber { |i| i << node.attr("docnumber") }
|
@@ -73,34 +91,28 @@ module Asciidoctor
|
|
73
91
|
c.from from
|
74
92
|
c.owner do |owner|
|
75
93
|
owner.organization do |o|
|
76
|
-
o.name configuration.
|
94
|
+
o.name configuration.organization_name_long
|
77
95
|
end
|
78
96
|
end
|
79
97
|
end
|
80
98
|
end
|
81
99
|
|
82
|
-
def
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
result << noko { |ixml| middle node, ixml }
|
88
|
-
result << "</#{root_tag}>"
|
89
|
-
result = textcleanup(result)
|
90
|
-
ret1 = cleanup(Nokogiri::XML(result))
|
91
|
-
validate(ret1) unless @novalid
|
92
|
-
ret1.root.add_namespace(nil, configuration.document_namespace ||
|
93
|
-
XML_NAMESPACE)
|
94
|
-
ret1
|
100
|
+
def metadata_ext(node, ext)
|
101
|
+
super
|
102
|
+
Array(configuration.metadata_extensions).each do |e|
|
103
|
+
a = node.attr(e) and ext.send e, a
|
104
|
+
end
|
95
105
|
end
|
96
106
|
|
97
107
|
def doctype(node)
|
98
108
|
d = node.attr("doctype")
|
99
|
-
|
100
|
-
|
109
|
+
configuration.doctypes or return d == "article" ? "standard" : d
|
110
|
+
default = configuration.default_doctype || Array(configuration.doctypes).dig(0) ||
|
111
|
+
"standard"
|
112
|
+
unless Array(configuration.doctypes).include? d
|
101
113
|
@log.add("Document Attributes", nil,
|
102
|
-
"#{d} is not a legal document type: reverting to '
|
103
|
-
d =
|
114
|
+
"#{d} is not a legal document type: reverting to '#{default}'")
|
115
|
+
d = default
|
104
116
|
end
|
105
117
|
d
|
106
118
|
end
|
@@ -110,6 +122,20 @@ module Asciidoctor
|
|
110
122
|
set_default_values_from_yaml_file(path_to_config_file)
|
111
123
|
end
|
112
124
|
|
125
|
+
def sectiontype_streamline(ret)
|
126
|
+
if configuration.termsdefs_titles.map(&:downcase).include? (ret)
|
127
|
+
"terms and definitions"
|
128
|
+
elsif configuration.symbols_titles.map(&:downcase).include? (ret)
|
129
|
+
"symbols and abbreviated terms"
|
130
|
+
elsif configuration.normref_titles.map(&:downcase).include? (ret)
|
131
|
+
"normative references"
|
132
|
+
elsif configuration.bibliography_titles.map(&:downcase).include? (ret)
|
133
|
+
"bibliography"
|
134
|
+
else
|
135
|
+
ret
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
113
139
|
def document(node)
|
114
140
|
read_config_file(node.attr("customize")) if node.attr("customize")
|
115
141
|
init(node)
|
@@ -121,7 +147,7 @@ module Asciidoctor
|
|
121
147
|
File.open(filename, "w") { |f| f.write(ret) }
|
122
148
|
html_converter(node).convert filename unless node.attr("nodoc")
|
123
149
|
word_converter(node).convert filename unless node.attr("nodoc")
|
124
|
-
pdf_converter(node)
|
150
|
+
pdf_converter(node)&.convert filename unless node.attr("nodoc")
|
125
151
|
end
|
126
152
|
@log.write(@localdir + @filename + ".err") unless @novalid
|
127
153
|
@files_to_delete.each { |f| FileUtils.rm f }
|
@@ -135,6 +161,23 @@ module Asciidoctor
|
|
135
161
|
File.join(File.dirname(__FILE__), "generic.rng"))
|
136
162
|
end
|
137
163
|
|
164
|
+
def content_validate(doc)
|
165
|
+
super
|
166
|
+
bibdata_validate(doc.root)
|
167
|
+
end
|
168
|
+
|
169
|
+
def bibdata_validate(doc)
|
170
|
+
stage_validate(doc)
|
171
|
+
end
|
172
|
+
|
173
|
+
def stage_validate(xmldoc)
|
174
|
+
stages = configuration&.stage_abbreviations&.keys || return
|
175
|
+
stages.empty? and return
|
176
|
+
stage = xmldoc&.at("//bibdata/status/stage")&.text
|
177
|
+
stages.include? stage or
|
178
|
+
@log.add("Document Attributes", nil, "#{stage} is not a recognised status")
|
179
|
+
end
|
180
|
+
|
138
181
|
def sections_cleanup(x)
|
139
182
|
super
|
140
183
|
x.xpath("//*[@inline-header]").each do |h|
|
@@ -53,6 +53,14 @@
|
|
53
53
|
<optional>
|
54
54
|
<attribute name="alt"/>
|
55
55
|
</optional>
|
56
|
+
<optional>
|
57
|
+
<attribute name="case">
|
58
|
+
<choice>
|
59
|
+
<value>capital</value>
|
60
|
+
<value>lowercase</value>
|
61
|
+
</choice>
|
62
|
+
</attribute>
|
63
|
+
</optional>
|
56
64
|
<text/>
|
57
65
|
</element>
|
58
66
|
</define>
|
@@ -101,9 +109,7 @@
|
|
101
109
|
<ref name="structuredidentifier"/>
|
102
110
|
</zeroOrMore>
|
103
111
|
</define>
|
104
|
-
|
105
|
-
<text/>
|
106
|
-
</define>
|
112
|
+
<!-- TitleType = text -->
|
107
113
|
<define name="sections">
|
108
114
|
<element name="sections">
|
109
115
|
<oneOrMore>
|
@@ -131,6 +137,9 @@
|
|
131
137
|
</choice>
|
132
138
|
</attribute>
|
133
139
|
</optional>
|
140
|
+
<attribute name="normative">
|
141
|
+
<data type="boolean"/>
|
142
|
+
</attribute>
|
134
143
|
<optional>
|
135
144
|
<ref name="section-title"/>
|
136
145
|
</optional>
|
@@ -307,6 +316,21 @@
|
|
307
316
|
</define>
|
308
317
|
</include>
|
309
318
|
<!-- end overrides -->
|
319
|
+
<define name="TextElement" combine="choice">
|
320
|
+
<ref name="concept"/>
|
321
|
+
</define>
|
322
|
+
<define name="concept">
|
323
|
+
<element name="concept">
|
324
|
+
<optional>
|
325
|
+
<attribute name="term"/>
|
326
|
+
</optional>
|
327
|
+
<choice>
|
328
|
+
<ref name="eref"/>
|
329
|
+
<ref name="xref"/>
|
330
|
+
<ref name="termref"/>
|
331
|
+
</choice>
|
332
|
+
</element>
|
333
|
+
</define>
|
310
334
|
<define name="BasicBlock" combine="choice">
|
311
335
|
<choice>
|
312
336
|
<ref name="requirement"/>
|
@@ -886,7 +910,15 @@
|
|
886
910
|
<attribute name="id">
|
887
911
|
<data type="ID"/>
|
888
912
|
</attribute>
|
889
|
-
<
|
913
|
+
<oneOrMore>
|
914
|
+
<choice>
|
915
|
+
<ref name="paragraph"/>
|
916
|
+
<ref name="ul"/>
|
917
|
+
<ref name="ol"/>
|
918
|
+
<ref name="dl"/>
|
919
|
+
<ref name="formula"/>
|
920
|
+
</choice>
|
921
|
+
</oneOrMore>
|
890
922
|
</element>
|
891
923
|
</define>
|
892
924
|
<define name="termexample">
|
@@ -913,7 +945,10 @@
|
|
913
945
|
</define>
|
914
946
|
<define name="origin">
|
915
947
|
<element name="origin">
|
916
|
-
<
|
948
|
+
<choice>
|
949
|
+
<ref name="erefType"/>
|
950
|
+
<ref name="termref"/>
|
951
|
+
</choice>
|
917
952
|
</element>
|
918
953
|
</define>
|
919
954
|
<define name="modification">
|
@@ -921,6 +956,15 @@
|
|
921
956
|
<ref name="paragraph"/>
|
922
957
|
</element>
|
923
958
|
</define>
|
959
|
+
<define name="termref">
|
960
|
+
<element name="termref">
|
961
|
+
<attribute name="base"/>
|
962
|
+
<attribute name="target"/>
|
963
|
+
<optional>
|
964
|
+
<text/>
|
965
|
+
</optional>
|
966
|
+
</element>
|
967
|
+
</define>
|
924
968
|
<define name="structuredidentifier">
|
925
969
|
<element name="structuredidentifier">
|
926
970
|
<optional>
|
@@ -1,26 +1,9 @@
|
|
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
|
-
|
24
7
|
<script>
|
25
8
|
//TOC toggle animation
|
26
9
|
$('#toggle').on('click', function(){
|
@@ -58,12 +41,16 @@ $('#toggle').on('click', function(){
|
|
58
41
|
</script>
|
59
42
|
|
60
43
|
<script>
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
44
|
+
// @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt Expat
|
45
|
+
//
|
46
|
+
// AnchorJS - v4.2.2 - 2020-04-20
|
47
|
+
// https://www.bryanbraun.com/anchorjs/
|
48
|
+
// Copyright (c) 2020 Bryan Braun; Licensed MIT
|
49
|
+
//
|
50
|
+
// @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt Expat
|
51
|
+
!function(A,e){"use strict";"function"==typeof define&&define.amd?define([],e):"object"==typeof module&&module.exports?module.exports=e():(A.AnchorJS=e(),A.anchors=new A.AnchorJS)}(this,function(){"use strict";return function(A){function f(A){A.icon=A.hasOwnProperty("icon")?A.icon:"",A.visible=A.hasOwnProperty("visible")?A.visible:"hover",A.placement=A.hasOwnProperty("placement")?A.placement:"right",A.ariaLabel=A.hasOwnProperty("ariaLabel")?A.ariaLabel:"Anchor",A.class=A.hasOwnProperty("class")?A.class:"",A.base=A.hasOwnProperty("base")?A.base:"",A.truncate=A.hasOwnProperty("truncate")?Math.floor(A.truncate):64,A.titleText=A.hasOwnProperty("titleText")?A.titleText:""}function p(A){var e;if("string"==typeof A||A instanceof String)e=[].slice.call(document.querySelectorAll(A));else{if(!(Array.isArray(A)||A instanceof NodeList))throw new Error("The selector provided to AnchorJS was invalid.");e=[].slice.call(A)}return e}this.options=A||{},this.elements=[],f(this.options),this.isTouchDevice=function(){return!!("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)},this.add=function(A){var e,t,i,n,o,s,a,r,c,h,l,u,d=[];if(f(this.options),"touch"===(l=this.options.visible)&&(l=this.isTouchDevice()?"always":"hover"),0===(e=p(A=A||"h2, h3, h4, h5, h6")).length)return this;for(!function(){if(null!==document.head.querySelector("style.anchorjs"))return;var A,e=document.createElement("style");e.className="anchorjs",e.appendChild(document.createTextNode("")),void 0===(A=document.head.querySelector('[rel="stylesheet"],style'))?document.head.appendChild(e):document.head.insertBefore(e,A);e.sheet.insertRule(".anchorjs-link{opacity:0;text-decoration:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}",e.sheet.cssRules.length),e.sheet.insertRule(":hover>.anchorjs-link,.anchorjs-link:focus{opacity:1}",e.sheet.cssRules.length),e.sheet.insertRule("[data-anchorjs-icon]::after{content:attr(data-anchorjs-icon)}",e.sheet.cssRules.length),e.sheet.insertRule('@font-face{font-family:anchorjs-icons;src:url(data:n/a;base64,AAEAAAALAIAAAwAwT1MvMg8yG2cAAAE4AAAAYGNtYXDp3gC3AAABpAAAAExnYXNwAAAAEAAAA9wAAAAIZ2x5ZlQCcfwAAAH4AAABCGhlYWQHFvHyAAAAvAAAADZoaGVhBnACFwAAAPQAAAAkaG10eASAADEAAAGYAAAADGxvY2EACACEAAAB8AAAAAhtYXhwAAYAVwAAARgAAAAgbmFtZQGOH9cAAAMAAAAAunBvc3QAAwAAAAADvAAAACAAAQAAAAEAAHzE2p9fDzz1AAkEAAAAAADRecUWAAAAANQA6R8AAAAAAoACwAAAAAgAAgAAAAAAAAABAAADwP/AAAACgAAA/9MCrQABAAAAAAAAAAAAAAAAAAAAAwABAAAAAwBVAAIAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAMCQAGQAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAg//0DwP/AAEADwABAAAAAAQAAAAAAAAAAAAAAIAAAAAAAAAIAAAACgAAxAAAAAwAAAAMAAAAcAAEAAwAAABwAAwABAAAAHAAEADAAAAAIAAgAAgAAACDpy//9//8AAAAg6cv//f///+EWNwADAAEAAAAAAAAAAAAAAAAACACEAAEAAAAAAAAAAAAAAAAxAAACAAQARAKAAsAAKwBUAAABIiYnJjQ3NzY2MzIWFxYUBwcGIicmNDc3NjQnJiYjIgYHBwYUFxYUBwYGIwciJicmNDc3NjIXFhQHBwYUFxYWMzI2Nzc2NCcmNDc2MhcWFAcHBgYjARQGDAUtLXoWOR8fORYtLTgKGwoKCjgaGg0gEhIgDXoaGgkJBQwHdR85Fi0tOAobCgoKOBoaDSASEiANehoaCQkKGwotLXoWOR8BMwUFLYEuehYXFxYugC44CQkKGwo4GkoaDQ0NDXoaShoKGwoFBe8XFi6ALjgJCQobCjgaShoNDQ0NehpKGgobCgoKLYEuehYXAAAADACWAAEAAAAAAAEACAAAAAEAAAAAAAIAAwAIAAEAAAAAAAMACAAAAAEAAAAAAAQACAAAAAEAAAAAAAUAAQALAAEAAAAAAAYACAAAAAMAAQQJAAEAEAAMAAMAAQQJAAIABgAcAAMAAQQJAAMAEAAMAAMAAQQJAAQAEAAMAAMAAQQJAAUAAgAiAAMAAQQJAAYAEAAMYW5jaG9yanM0MDBAAGEAbgBjAGgAbwByAGoAcwA0ADAAMABAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAH//wAP) format("truetype")}',e.sheet.cssRules.length)}(),t=document.querySelectorAll("[id]"),i=[].map.call(t,function(A){return A.id}),o=0;o<e.length;o++)if(this.hasAnchorJSLink(e[o]))d.push(o);else{if(e[o].hasAttribute("id"))n=e[o].getAttribute("id");else if(e[o].hasAttribute("data-anchor-id"))n=e[o].getAttribute("data-anchor-id");else{for(c=r=this.urlify(e[o].textContent),a=0;void 0!==s&&(c=r+"-"+a),a+=1,-1!==(s=i.indexOf(c)););s=void 0,i.push(c),e[o].setAttribute("id",c),n=c}(h=document.createElement("a")).className="anchorjs-link "+this.options.class,h.setAttribute("aria-label",this.options.ariaLabel),h.setAttribute("data-anchorjs-icon",this.options.icon),this.options.titleText&&(h.title=this.options.titleText),u=document.querySelector("base")?window.location.pathname+window.location.search:"",u=this.options.base||u,h.href=u+"#"+n,"always"===l&&(h.style.opacity="1"),""===this.options.icon&&(h.style.font="1em/1 anchorjs-icons","left"===this.options.placement&&(h.style.lineHeight="inherit")),"left"===this.options.placement?(h.style.position="absolute",h.style.marginLeft="-1em",h.style.paddingRight="0.5em",e[o].insertBefore(h,e[o].firstChild)):(h.style.paddingLeft="0.375em",e[o].appendChild(h))}for(o=0;o<d.length;o++)e.splice(d[o]-o,1);return this.elements=this.elements.concat(e),this},this.remove=function(A){for(var e,t,i=p(A),n=0;n<i.length;n++)(t=i[n].querySelector(".anchorjs-link"))&&(-1!==(e=this.elements.indexOf(i[n]))&&this.elements.splice(e,1),i[n].removeChild(t));return this},this.removeAll=function(){this.remove(this.elements)},this.urlify=function(A){return this.options.truncate||f(this.options),A.trim().replace(/\'/gi,"").replace(/[& +$,:;=?@"#{}|^~[`%!'<>\]\.\/\(\)\*\\\n\t\b\v]/g,"-").replace(/-{2,}/g,"-").substring(0,this.options.truncate).replace(/^-+|-+$/gm,"").toLowerCase()},this.hasAnchorJSLink=function(A){var e=A.firstChild&&-1<(" "+A.firstChild.className+" ").indexOf(" anchorjs-link "),t=A.lastChild&&-1<(" "+A.lastChild.className+" ").indexOf(" anchorjs-link ");return e||t||!1}}});
|
52
|
+
// @license-end
|
53
|
+
</script>
|
67
54
|
|
68
55
|
<script>
|
69
56
|
/*
|
@@ -50,10 +50,8 @@ module IsoDoc
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def googlefonts
|
53
|
-
|
54
|
-
|
55
|
-
<link href="https://fonts.googleapis.com/css?family=Overpass:300,300i,600,900" rel="stylesheet">
|
56
|
-
HEAD
|
53
|
+
return unless configuration.webfont
|
54
|
+
Array(configuration.webfont).map { |x| %{<link href="#{x.gsub(/\&/, '&')}" rel="stylesheet">} }.join("\n")
|
57
55
|
end
|
58
56
|
|
59
57
|
include BaseConvert
|
@@ -9,6 +9,9 @@ module IsoDoc
|
|
9
9
|
here = File.dirname(__FILE__)
|
10
10
|
default_logo_path = File.expand_path(File.join(here, "html", "logo.jpg"))
|
11
11
|
set(:logo, baselocation(configuration.logo_path) || default_logo_path)
|
12
|
+
unless configuration.logo_paths.nil?
|
13
|
+
set(:logo_paths, Array(configuration.logo_paths).map { |p| baselocation(p) })
|
14
|
+
end
|
12
15
|
end
|
13
16
|
|
14
17
|
class << self
|
@@ -43,6 +46,13 @@ module IsoDoc
|
|
43
46
|
stages = configuration&.published_stages || ["published"]
|
44
47
|
!(Array(stages).map { |m| m.downcase }.include? status.downcase)
|
45
48
|
end
|
49
|
+
|
50
|
+
def ext(isoxml, out)
|
51
|
+
Array(configuration.metadata_extensions).each do |e|
|
52
|
+
b = isoxml&.at(ns("//bibdata/ext/#{e}"))&.text or next
|
53
|
+
set(e.to_sym, b)
|
54
|
+
end
|
55
|
+
end
|
46
56
|
end
|
47
57
|
end
|
48
58
|
end
|
data/lib/metanorma/generic.rb
CHANGED
@@ -7,17 +7,21 @@ module Metanorma
|
|
7
7
|
module Generic
|
8
8
|
ORGANIZATION_NAME_SHORT = "Acme"
|
9
9
|
ORGANIZATION_NAME_LONG = "Acme Corp."
|
10
|
-
DOCUMENT_NAMESPACE = "https://metanorma.org/ns/generic"
|
10
|
+
DOCUMENT_NAMESPACE = "https://www.metanorma.org/ns/generic"
|
11
11
|
YAML_CONFIG_FILE = 'metanorma.yml'
|
12
12
|
|
13
13
|
class Configuration
|
14
14
|
CONFIG_ATTRS = %i[
|
15
15
|
organization_name_short
|
16
16
|
organization_name_long
|
17
|
+
bibliography_titles
|
17
18
|
document_namespace
|
18
19
|
docid_template
|
20
|
+
doctypes
|
21
|
+
default_doctype
|
19
22
|
i18nyaml
|
20
23
|
logo_path
|
24
|
+
logo_paths
|
21
25
|
header
|
22
26
|
htmlcoverpage
|
23
27
|
htmlintropage
|
@@ -25,12 +29,19 @@ module Metanorma
|
|
25
29
|
html_bodyfont
|
26
30
|
html_headerfont
|
27
31
|
html_monospacefont
|
32
|
+
metadata_extensions
|
33
|
+
metanorma_name
|
34
|
+
normref_titles
|
28
35
|
published_stages
|
36
|
+
default_stage
|
29
37
|
stage_abbreviations
|
30
38
|
scripts
|
31
39
|
scripts_pdf
|
32
40
|
standardstylesheet
|
41
|
+
symbols_titles
|
42
|
+
termsdefs_titles
|
33
43
|
validate_rng_file
|
44
|
+
webfont
|
34
45
|
wordcoverpage
|
35
46
|
wordintropage
|
36
47
|
wordstylesheet
|
@@ -58,6 +69,15 @@ module Metanorma
|
|
58
69
|
self.organization_name_short ||= ORGANIZATION_NAME_SHORT
|
59
70
|
self.organization_name_long ||= ORGANIZATION_NAME_LONG
|
60
71
|
self.document_namespace ||= DOCUMENT_NAMESPACE
|
72
|
+
self.termsdefs_titles ||=
|
73
|
+
["Terms and definitions", "Terms, definitions, symbols and abbreviated terms",
|
74
|
+
"Terms, definitions, symbols and abbreviations", "Terms, definitions and symbols",
|
75
|
+
"Terms, definitions and abbreviations", "Terms, definitions and abbreviated terms"]
|
76
|
+
self.symbols_titles ||=
|
77
|
+
["Symbols and abbreviated terms", "Symbols", "Abbreviated terms", "Abbreviations"]
|
78
|
+
self.normref_titles ||=
|
79
|
+
["Normative references"]
|
80
|
+
self.bibliography_titles ||= ["Bibliography"]
|
61
81
|
end
|
62
82
|
|
63
83
|
def set_default_values_from_yaml_file(config_file)
|
@@ -2,11 +2,30 @@ require "metanorma/processor"
|
|
2
2
|
|
3
3
|
module Metanorma
|
4
4
|
module Generic
|
5
|
+
def self.fonts_used
|
6
|
+
{
|
7
|
+
html: [
|
8
|
+
configuration.html_bodyfont || "Overpass", configuration.html_headerfont || "Overpass",
|
9
|
+
configuration.html_monospacefont || "Space Mono"
|
10
|
+
].uniq,
|
11
|
+
doc: [
|
12
|
+
configuration.word_bodyfont || "Overpass", configuration.word_headerfont || "Overpass",
|
13
|
+
configuration.word_monospacefont || "Space Mono"].uniq,
|
14
|
+
pdf: [
|
15
|
+
configuration.word_bodyfont || "Overpass", configuration.word_headerfont || "Overpass",
|
16
|
+
configuration.word_monospacefont || "Space Mono"].uniq,
|
17
|
+
}
|
18
|
+
end
|
19
|
+
|
5
20
|
class Processor < Metanorma::Processor
|
21
|
+
def configuration
|
22
|
+
Metanorma::Generic.configuration
|
23
|
+
end
|
24
|
+
|
6
25
|
def initialize
|
7
|
-
@short = :generic
|
26
|
+
@short = configuration&.metanorma_name&.to_sym || :generic
|
8
27
|
@input_format = :asciidoc
|
9
|
-
@asciidoctor_backend = :generic
|
28
|
+
@asciidoctor_backend = configuration&.metanorma_name&.to_sym || :generic
|
10
29
|
end
|
11
30
|
|
12
31
|
def output_formats
|
data/metanorma-generic.gemspec
CHANGED
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
|
|
28
28
|
|
29
29
|
spec.add_dependency "htmlentities", "~> 4.3.4"
|
30
30
|
spec.add_dependency "ruby-jing"
|
31
|
-
spec.add_dependency "metanorma-standoc", "~> 1.
|
31
|
+
spec.add_dependency "metanorma-standoc", "~> 1.4.0"
|
32
32
|
spec.add_dependency "isodoc", "~> 1.0.0"
|
33
33
|
|
34
34
|
spec.add_development_dependency "byebug", "~> 9.1"
|
data/metanorma.yml.example
CHANGED
@@ -1,12 +1,19 @@
|
|
1
|
+
metanorma_name: generic
|
1
2
|
organization_name_short: My Organization
|
2
3
|
organization_name_long: My Organization name
|
3
4
|
document_namespace: https://open.ribose.com/standards/mine
|
4
5
|
xml_root_tag: 'mine-standard'
|
5
6
|
logo_path: /metanorma-mine/lib/isodoc/mine/html/logo.jpg
|
7
|
+
logo_paths:
|
8
|
+
- /metanorma-mine/lib/isodoc/mine/html/logo1.jpg
|
9
|
+
- /metanorma-mine/lib/isodoc/mine/html/logo2.jpg
|
6
10
|
validate_rng_file: /metanorma-mine/lib/asciidoctor/mine/mine.rng
|
7
11
|
htmlcoverpage: /metanorma-mine/lib/isodoc/mine/html/html_mine_titlepage.html
|
8
12
|
htmlintropage: /metanorma-mine/lib/isodoc/mine/html/html_mine_intro.html
|
9
13
|
htmlstylesheet: /metanorma-mine/lib/isodoc/mine/html/htmlstyle.scss
|
14
|
+
html_bodyfont: '"Source Sans Pro",sans-serif'
|
15
|
+
html_headerfont: '"Source Sans Pro",sans-serif'
|
16
|
+
html_monospacefont: '"Source Code Pro",monospace'
|
10
17
|
scripts: /metanorma-mine/lib/isodoc/mine/html/scripts.html
|
11
18
|
scripts_pdf: /metanorma-mine/lib/isodoc/mine/html/scripts.prd.html
|
12
19
|
standardstylesheet: /metanorma-mine/lib/isodoc/mine/html/
|
@@ -14,6 +21,41 @@ header: /metanorma-mine/lib/isodoc/mine/html/header.html
|
|
14
21
|
wordcoverpage: /metanorma-mine/lib/isodoc/mine/html/word_mine_titlepage.html
|
15
22
|
wordintropage: /metanorma-mine/lib/isodoc/mine/html/word_mine_intro.html
|
16
23
|
wordstylesheet: /metanorma-mine/lib/isodoc/mine/html/wordstyle.scss
|
24
|
+
word_bodyfont: '"Source Sans Pro","Arial",sans-serif'
|
25
|
+
word_headerfont: '"Source Sans Pro","Arial",sans-serif'
|
26
|
+
word_monospacefont: '"Source Code Pro",monospace'
|
17
27
|
docid_template: "{{ organization_name_short }} {{ docnumeric }}"
|
28
|
+
metadata_extensions:
|
29
|
+
- security
|
18
30
|
published_stages:
|
19
31
|
- published
|
32
|
+
stage_abbreviations:
|
33
|
+
draft-proposal:
|
34
|
+
draft-development:
|
35
|
+
draft-testing:
|
36
|
+
draft-implementation:
|
37
|
+
in-force:
|
38
|
+
retired:
|
39
|
+
metadata_extensions:
|
40
|
+
- security
|
41
|
+
- recipient
|
42
|
+
doctypes:
|
43
|
+
- standard
|
44
|
+
- recommendation
|
45
|
+
default_doctype: standard
|
46
|
+
termsdefs_titles:
|
47
|
+
- Terms and definitions
|
48
|
+
- Terms, definitions, symbols and abbreviated terms
|
49
|
+
- Terms, definitions, symbols and abbreviations
|
50
|
+
- Terms, definitions and symbls
|
51
|
+
- Terms, definitions and abbreviations
|
52
|
+
- Terms, definitions and abbreviated terms
|
53
|
+
symbols_titles:
|
54
|
+
- Symbols and abbreviated terms
|
55
|
+
- Symbols
|
56
|
+
- Abbreviated terms
|
57
|
+
- Abbreviations
|
58
|
+
normref_titles:
|
59
|
+
- Normative references
|
60
|
+
bibliography_titles
|
61
|
+
- Bibliography
|
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: 1.4.
|
4
|
+
version: 1.4.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: htmlentities
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.
|
47
|
+
version: 1.4.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.
|
54
|
+
version: 1.4.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: isodoc
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -235,7 +235,6 @@ files:
|
|
235
235
|
- lib/isodoc/generic/html/htmlstyle.scss
|
236
236
|
- lib/isodoc/generic/html/logo.jpg
|
237
237
|
- lib/isodoc/generic/html/scripts.html
|
238
|
-
- lib/isodoc/generic/html/scripts.pdf.html
|
239
238
|
- lib/isodoc/generic/html/word_generic_intro.html
|
240
239
|
- lib/isodoc/generic/html/word_generic_titlepage.html
|
241
240
|
- lib/isodoc/generic/html/wordstyle.scss
|
@@ -1,72 +0,0 @@
|
|
1
|
-
<script>
|
2
|
-
//TOC generation
|
3
|
-
$('#toc').toc({
|
4
|
-
'selectors': toclevel(), //elements to use as headings
|
5
|
-
'container': 'main', //element to find all selectors in
|
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': false, //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
|
-
|
22
|
-
</script>
|
23
|
-
|
24
|
-
<script>
|
25
|
-
//TOC toggle animation
|
26
|
-
$('#toggle').on('click', function(){
|
27
|
-
if( $('nav').is(':visible') ) {
|
28
|
-
$('nav').animate({ 'left': '-353px' }, 'slow', function(){
|
29
|
-
$('nav').hide();
|
30
|
-
});
|
31
|
-
$('.container').animate({ 'padding-left': '31px' }, 'slow');
|
32
|
-
}
|
33
|
-
else {
|
34
|
-
$('nav').show();
|
35
|
-
$('nav').animate({ 'left': '0px' }, 'slow');
|
36
|
-
$('.container').animate({ 'padding-left': '360px' }, 'slow');
|
37
|
-
}
|
38
|
-
});
|
39
|
-
</script>
|
40
|
-
|
41
|
-
<script>
|
42
|
-
// Scroll to top button
|
43
|
-
window.onscroll = function() {scrollFunction()};
|
44
|
-
|
45
|
-
function scrollFunction() {
|
46
|
-
if (document.body.scrollTop > 100 || document.documentElement.scrollTop > 100) {
|
47
|
-
document.getElementById("myBtn").style.display = "block";
|
48
|
-
} else {
|
49
|
-
document.getElementById("myBtn").style.display = "none";
|
50
|
-
}
|
51
|
-
}
|
52
|
-
|
53
|
-
// When the user clicks on the button, scroll to the top of the document
|
54
|
-
function topFunction() {
|
55
|
-
document.body.scrollTop = 0;
|
56
|
-
document.documentElement.scrollTop = 0;
|
57
|
-
}
|
58
|
-
</script>
|
59
|
-
|
60
|
-
<script>
|
61
|
-
/*
|
62
|
-
$(document).ready(function() {
|
63
|
-
$('[id^=toc]').each(function ()
|
64
|
-
{
|
65
|
-
var currentToc = $(this);
|
66
|
-
var url = window.location.href;
|
67
|
-
currentToc.wrap("<a href='" + url + "#" + currentToc.attr("id") + "' </a>");
|
68
|
-
});
|
69
|
-
});
|
70
|
-
*/
|
71
|
-
</script>
|
72
|
-
|