metanorma-bsi 0.0.1 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of metanorma-bsi might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +43 -0
- data/.github/workflows/release_github_packages.yml +49 -0
- data/.hound.yml +3 -1
- data/.rubocop.yml +4 -8
- data/README.adoc +95 -11
- data/lib/asciidoctor/bsi/biblio.rng +1 -0
- data/lib/asciidoctor/bsi/bsi.rng +32 -4
- data/lib/asciidoctor/bsi/bsi_intro_en.xml +87 -61
- data/lib/asciidoctor/bsi/cleanup.rb +15 -8
- data/lib/asciidoctor/bsi/cleanup_ref.rb +10 -21
- data/lib/asciidoctor/bsi/converter.rb +7 -5
- data/lib/asciidoctor/bsi/front.rb +26 -5
- data/lib/asciidoctor/bsi/isodoc.rng +191 -3
- data/lib/asciidoctor/bsi/isostandard.rng +12 -0
- data/lib/asciidoctor/bsi/validate.rb +5 -6
- data/lib/asciidoctor/bsi/validate_list.rb +2 -2
- data/lib/isodoc/bsi/base_convert.rb +2 -1
- data/lib/isodoc/bsi/bsi.international-standard.xsl +3380 -2349
- data/lib/isodoc/bsi/html/htmlstyle.css +43 -22
- data/lib/isodoc/bsi/html/htmlstyle.scss +46 -22
- data/lib/isodoc/bsi/html_convert.rb +2 -2
- data/lib/isodoc/bsi/i18n-en.yaml +4 -4
- data/lib/isodoc/bsi/metadata.rb +2 -2
- data/lib/isodoc/bsi/presentation_xml_convert.rb +26 -5
- data/lib/isodoc/bsi/xref.rb +11 -4
- data/lib/metanorma/bsi/version.rb +1 -1
- data/metanorma-bsi.gemspec +2 -2
- data/spec/asciidoctor/base_spec.rb +564 -494
- data/spec/asciidoctor/blocks_spec.rb +192 -195
- data/spec/asciidoctor/cleanup_spec.rb +361 -361
- data/spec/asciidoctor/refs_spec.rb +8 -78
- data/spec/asciidoctor/section_spec.rb +227 -227
- data/spec/asciidoctor/validate_spec.rb +26 -1
- data/spec/isodoc/blocks_spec.rb +56 -21
- data/spec/isodoc/i18n_spec.rb +156 -234
- data/spec/isodoc/inline_spec.rb +7 -7
- data/spec/isodoc/iso_spec.rb +4 -4
- data/spec/isodoc/metadata_spec.rb +0 -1
- data/spec/isodoc/ref_spec.rb +7 -7
- data/spec/isodoc/section_spec.rb +400 -343
- data/spec/isodoc/terms_spec.rb +224 -225
- data/spec/isodoc/xref_spec.rb +1347 -1360
- data/spec/metanorma/processor_spec.rb +37 -40
- data/spec/spec_helper.rb +6 -4
- data/spec/vcr_cassettes/iso-639.yml +19 -19
- data/spec/vcr_cassettes/isobib_get_639_1967.yml +17 -17
- data/spec/vcr_cassettes/multistandard.yml +15 -193
- metadata +7 -5
@@ -224,6 +224,27 @@ a.FootnoteRef + a.FootnoteRef:before {
|
|
224
224
|
#cancelled {
|
225
225
|
border-bottom: solid 3px #2E382E; }
|
226
226
|
|
227
|
+
@font-face {
|
228
|
+
font-family: 'Gesta';
|
229
|
+
src: url("https://www.bsigroup.com/ui/fonts/bsigesta-light-webfont.eot");
|
230
|
+
src: url("https://www.bsigroup.com/ui/fonts/bsigesta-light-webfont.eot?#iefix") format("embedded-opentype"), url("https://www.bsigroup.com/ui/fonts/bsigesta-light-webfont.woff") format("woff"), url("https://www.bsigroup.com/ui/fonts/bsigesta-light-webfont.ttf") format("truetype"), url("https://www.bsigroup.com/ui/fonts/bsigesta-light-webfont.svg#GestaLtRegular") format("svg");
|
231
|
+
font-weight: 300;
|
232
|
+
font-style: normal; }
|
233
|
+
|
234
|
+
@font-face {
|
235
|
+
font-family: 'Gesta';
|
236
|
+
src: url("https://www.bsigroup.com/ui/fonts/bsigesta-webfont.eot");
|
237
|
+
src: url("https://www.bsigroup.com/ui/fonts/bsigesta-webfont.eot?#iefix") format("embedded-opentype"), url("https://www.bsigroup.com/ui/fonts/bsigesta-webfont.woff") format("woff"), url("https://www.bsigroup.com/ui/fonts/bsigesta-webfont.ttf") format("truetype"), url("https://www.bsigroup.com/ui/fonts/bsigesta-webfont.svg#GestaRegular") format("svg");
|
238
|
+
font-weight: 400;
|
239
|
+
font-style: normal; }
|
240
|
+
|
241
|
+
@font-face {
|
242
|
+
font-family: 'Gesta';
|
243
|
+
src: url("https://www.bsigroup.com/ui/fonts/bsigesta-medium-webfont.eot");
|
244
|
+
src: url("https://www.bsigroup.com/ui/fonts/bsigesta-medium-webfont.eot?#iefix") format("embedded-opentype"), url("https://www.bsigroup.com/ui/fonts/bsigesta-medium-webfont.woff") format("woff"), url("https://www.bsigroup.com/ui/fonts/bsigesta-medium-webfont.ttf") format("truetype"), url("https://www.bsigroup.com/ui/fonts/bsigesta-medium-webfont.svg#GestaMdRegular") format("svg");
|
245
|
+
font-weight: 500;
|
246
|
+
font-style: normal; }
|
247
|
+
|
227
248
|
body {
|
228
249
|
line-height: 1.3; }
|
229
250
|
|
@@ -655,34 +676,34 @@ ul, ol {
|
|
655
676
|
list-style-type: none; }
|
656
677
|
|
657
678
|
/* https://github.com/metanorma/metanorma-iso/issues/319 : ordered list rendering */
|
658
|
-
ol[type="
|
679
|
+
ol[type="a"] {
|
659
680
|
counter-reset: alphabet; }
|
660
681
|
|
661
|
-
ol[type="
|
682
|
+
ol[type="1"] {
|
662
683
|
counter-reset: arabic; }
|
663
684
|
|
664
|
-
ol[type="
|
685
|
+
ol[type="i"] {
|
665
686
|
counter-reset: roman; }
|
666
687
|
|
667
|
-
ol[type="
|
688
|
+
ol[type="A"] {
|
668
689
|
counter-reset: alphabet_upper; }
|
669
690
|
|
670
|
-
ol[type="
|
691
|
+
ol[type="I"] {
|
671
692
|
counter-reset: roman_upper; }
|
672
693
|
|
673
|
-
ol[type="
|
694
|
+
ol[type="a"] ol[type="a"] {
|
674
695
|
counter-reset: alphabet2; }
|
675
696
|
|
676
|
-
ol[type="
|
697
|
+
ol[type="1"] ol[type="1"] {
|
677
698
|
counter-reset: arabic2; }
|
678
699
|
|
679
|
-
ol[type="
|
700
|
+
ol[type="i"] ol[type="i"] {
|
680
701
|
counter-reset: roman2; }
|
681
702
|
|
682
|
-
ol[type="
|
703
|
+
ol[type="A"] ol[type="A"] {
|
683
704
|
counter-reset: alphabet_upper2; }
|
684
705
|
|
685
|
-
ol[type="
|
706
|
+
ol[type="I"] ol[type="I"] {
|
686
707
|
counter-reset: roman_upper2; }
|
687
708
|
|
688
709
|
ol {
|
@@ -696,29 +717,29 @@ ol > li:before {
|
|
696
717
|
position: absolute;
|
697
718
|
left: -1.4em; }
|
698
719
|
|
699
|
-
ol[type="
|
720
|
+
ol[type="i"] > li:before {
|
700
721
|
left: -2.0em; }
|
701
722
|
|
702
|
-
ol[type="
|
723
|
+
ol[type="I"] > li:before {
|
703
724
|
left: -2.3em; }
|
704
725
|
|
705
|
-
ol[type="
|
726
|
+
ol[type="a"] > li:before {
|
706
727
|
counter-increment: alphabet;
|
707
728
|
content: counter(alphabet, lower-alpha) ") "; }
|
708
729
|
|
709
|
-
ol[type="
|
730
|
+
ol[type="1"] > li:before {
|
710
731
|
counter-increment: arabic;
|
711
732
|
content: counter(arabic, decimal) ") "; }
|
712
733
|
|
713
|
-
ol[type="
|
734
|
+
ol[type="i"] > li:before {
|
714
735
|
counter-increment: roman;
|
715
736
|
content: counter(roman, lower-roman) ") "; }
|
716
737
|
|
717
|
-
ol[type="
|
738
|
+
ol[type="A"] > li:before {
|
718
739
|
counter-increment: alphabet_upper;
|
719
740
|
content: counter(alphabet_upper, upper-alpha) ") "; }
|
720
741
|
|
721
|
-
ol[type="
|
742
|
+
ol[type="I"] > li:before {
|
722
743
|
counter-increment: roman_upper;
|
723
744
|
content: counter(roman_upper, upper-roman) ") "; }
|
724
745
|
|
@@ -726,23 +747,23 @@ ol > li:before {
|
|
726
747
|
counter-increment: alphabet;
|
727
748
|
content: counter(alphabet, lower-alpha) ") "; }
|
728
749
|
|
729
|
-
ol[type="
|
750
|
+
ol[type="a"] ol[type="a"] > li:before {
|
730
751
|
counter-increment: alphabet2;
|
731
752
|
content: counter(alphabet2, lower-alpha) ") "; }
|
732
753
|
|
733
|
-
ol[type="
|
754
|
+
ol[type="1"] ol[type="1"] > li:before {
|
734
755
|
counter-increment: arabic2;
|
735
756
|
content: counter(arabic2, decimal) ") "; }
|
736
757
|
|
737
|
-
ol[type="
|
758
|
+
ol[type="i"] ol[type="i"] > li:before {
|
738
759
|
counter-increment: roman2;
|
739
760
|
content: counter(roman2, lower-roman) ") "; }
|
740
761
|
|
741
|
-
ol[type="
|
762
|
+
ol[type="A"] ol[type="A"] > li:before {
|
742
763
|
counter-increment: alphabet_upper2;
|
743
764
|
content: counter(alphabet_upper2, upper-alpha) ") "; }
|
744
765
|
|
745
|
-
ol[type="
|
766
|
+
ol[type="I"] ol[type="I"] > li:before {
|
746
767
|
counter-increment: roman_upper2;
|
747
768
|
content: counter(roman_upper2, upper-roman) ") "; }
|
748
769
|
|
@@ -9,6 +9,30 @@
|
|
9
9
|
|
10
10
|
@import 'base_style/all';
|
11
11
|
|
12
|
+
@font-face {
|
13
|
+
font-family: 'Gesta';
|
14
|
+
src: url("https://www.bsigroup.com/ui/fonts/bsigesta-light-webfont.eot");
|
15
|
+
src: url("https://www.bsigroup.com/ui/fonts/bsigesta-light-webfont.eot?#iefix") format("embedded-opentype"), url("https://www.bsigroup.com/ui/fonts/bsigesta-light-webfont.woff") format("woff"), url("https://www.bsigroup.com/ui/fonts/bsigesta-light-webfont.ttf") format("truetype"), url("https://www.bsigroup.com/ui/fonts/bsigesta-light-webfont.svg#GestaLtRegular") format("svg");
|
16
|
+
font-weight: 300;
|
17
|
+
font-style: normal;
|
18
|
+
}
|
19
|
+
|
20
|
+
@font-face {
|
21
|
+
font-family: 'Gesta';
|
22
|
+
src: url("https://www.bsigroup.com/ui/fonts/bsigesta-webfont.eot");
|
23
|
+
src: url("https://www.bsigroup.com/ui/fonts/bsigesta-webfont.eot?#iefix") format("embedded-opentype"), url("https://www.bsigroup.com/ui/fonts/bsigesta-webfont.woff") format("woff"), url("https://www.bsigroup.com/ui/fonts/bsigesta-webfont.ttf") format("truetype"), url("https://www.bsigroup.com/ui/fonts/bsigesta-webfont.svg#GestaRegular") format("svg");
|
24
|
+
font-weight: 400;
|
25
|
+
font-style: normal;
|
26
|
+
}
|
27
|
+
|
28
|
+
@font-face {
|
29
|
+
font-family: 'Gesta';
|
30
|
+
src: url("https://www.bsigroup.com/ui/fonts/bsigesta-medium-webfont.eot");
|
31
|
+
src: url("https://www.bsigroup.com/ui/fonts/bsigesta-medium-webfont.eot?#iefix") format("embedded-opentype"), url("https://www.bsigroup.com/ui/fonts/bsigesta-medium-webfont.woff") format("woff"), url("https://www.bsigroup.com/ui/fonts/bsigesta-medium-webfont.ttf") format("truetype"), url("https://www.bsigroup.com/ui/fonts/bsigesta-medium-webfont.svg#GestaMdRegular") format("svg");
|
32
|
+
font-weight: 500;
|
33
|
+
font-style: normal;
|
34
|
+
}
|
35
|
+
|
12
36
|
body {
|
13
37
|
line-height: 1.3;
|
14
38
|
}
|
@@ -393,34 +417,34 @@ ul, ol {margin-left: 2em;}
|
|
393
417
|
|
394
418
|
/* https://github.com/metanorma/metanorma-iso/issues/319 : ordered list rendering */
|
395
419
|
|
396
|
-
ol[type="
|
420
|
+
ol[type="a"] {
|
397
421
|
counter-reset: alphabet;
|
398
422
|
}
|
399
|
-
ol[type="
|
423
|
+
ol[type="1"] {
|
400
424
|
counter-reset: arabic;
|
401
425
|
}
|
402
|
-
ol[type="
|
426
|
+
ol[type="i"] {
|
403
427
|
counter-reset: roman;
|
404
428
|
}
|
405
|
-
ol[type="
|
429
|
+
ol[type="A"] {
|
406
430
|
counter-reset: alphabet_upper;
|
407
431
|
}
|
408
|
-
ol[type="
|
432
|
+
ol[type="I"] {
|
409
433
|
counter-reset: roman_upper;
|
410
434
|
}
|
411
|
-
ol[type="
|
435
|
+
ol[type="a"] ol[type="a"] {
|
412
436
|
counter-reset: alphabet2;
|
413
437
|
}
|
414
|
-
ol[type="
|
438
|
+
ol[type="1"] ol[type="1"] {
|
415
439
|
counter-reset: arabic2;
|
416
440
|
}
|
417
|
-
ol[type="
|
441
|
+
ol[type="i"] ol[type="i"] {
|
418
442
|
counter-reset: roman2;
|
419
443
|
}
|
420
|
-
ol[type="
|
444
|
+
ol[type="A"] ol[type="A"] {
|
421
445
|
counter-reset: alphabet_upper2;
|
422
446
|
}
|
423
|
-
ol[type="
|
447
|
+
ol[type="I"] ol[type="I"] {
|
424
448
|
counter-reset: roman_upper2;
|
425
449
|
}
|
426
450
|
ol {
|
@@ -435,29 +459,29 @@ ol > li:before {
|
|
435
459
|
position: absolute;
|
436
460
|
left: -1.4em;
|
437
461
|
}
|
438
|
-
ol[type="
|
462
|
+
ol[type="i"] > li:before {
|
439
463
|
left: -2.0em;
|
440
464
|
}
|
441
|
-
ol[type="
|
465
|
+
ol[type="I"] > li:before {
|
442
466
|
left: -2.3em;
|
443
467
|
}
|
444
|
-
ol[type="
|
468
|
+
ol[type="a"] > li:before {
|
445
469
|
counter-increment: alphabet;
|
446
470
|
content: counter(alphabet, lower-alpha)") "
|
447
471
|
}
|
448
|
-
ol[type="
|
472
|
+
ol[type="1"] > li:before {
|
449
473
|
counter-increment: arabic;
|
450
474
|
content: counter(arabic, decimal)") "
|
451
475
|
}
|
452
|
-
ol[type="
|
476
|
+
ol[type="i"] > li:before {
|
453
477
|
counter-increment: roman;
|
454
478
|
content: counter(roman, lower-roman)") "
|
455
479
|
}
|
456
|
-
ol[type="
|
480
|
+
ol[type="A"] > li:before {
|
457
481
|
counter-increment: alphabet_upper;
|
458
482
|
content: counter(alphabet_upper, upper-alpha)") "
|
459
483
|
}
|
460
|
-
ol[type="
|
484
|
+
ol[type="I"] > li:before {
|
461
485
|
counter-increment: roman_upper;
|
462
486
|
content: counter(roman_upper, upper-roman)") "
|
463
487
|
}
|
@@ -465,23 +489,23 @@ ol > li:before {
|
|
465
489
|
counter-increment: alphabet;
|
466
490
|
content: counter(alphabet, lower-alpha)") "
|
467
491
|
}
|
468
|
-
ol[type="
|
492
|
+
ol[type="a"] ol[type="a"] > li:before {
|
469
493
|
counter-increment: alphabet2;
|
470
494
|
content: counter(alphabet2, lower-alpha)") "
|
471
495
|
}
|
472
|
-
ol[type="
|
496
|
+
ol[type="1"] ol[type="1"] > li:before {
|
473
497
|
counter-increment: arabic2;
|
474
498
|
content: counter(arabic2, decimal)") "
|
475
499
|
}
|
476
|
-
ol[type="
|
500
|
+
ol[type="i"] ol[type="i"] > li:before {
|
477
501
|
counter-increment: roman2;
|
478
502
|
content: counter(roman2, lower-roman)") "
|
479
503
|
}
|
480
|
-
ol[type="
|
504
|
+
ol[type="A"] ol[type="A"] > li:before {
|
481
505
|
counter-increment: alphabet_upper2;
|
482
506
|
content: counter(alphabet_upper2, upper-alpha)") "
|
483
507
|
}
|
484
|
-
ol[type="
|
508
|
+
ol[type="I"] ol[type="I"] > li:before {
|
485
509
|
counter-increment: roman_upper2;
|
486
510
|
content: counter(roman_upper2, upper-roman)") "
|
487
511
|
}
|
@@ -14,8 +14,8 @@ module IsoDoc
|
|
14
14
|
# TODO : true font is BSI Gesta, which is a webfont
|
15
15
|
def default_fonts(options)
|
16
16
|
{
|
17
|
-
bodyfont: (options[:script] == "Hans" ? '"Source Han Sans",serif' : '"Tahoma",sans-serif'),
|
18
|
-
headerfont: (options[:script] == "Hans" ? '"Source Han Sans",sans-serif' : '"Tahoma",sans-serif'),
|
17
|
+
bodyfont: (options[:script] == "Hans" ? '"Source Han Sans",serif' : '"Gesta","Tahoma",sans-serif'),
|
18
|
+
headerfont: (options[:script] == "Hans" ? '"Source Han Sans",sans-serif' : '"Gesta","Tahoma",sans-serif'),
|
19
19
|
monospacefont: '"Courier New",monospace',
|
20
20
|
monospacefontsize: "1.0em",
|
21
21
|
footnotefontsize: "0.9em",
|
data/lib/isodoc/bsi/i18n-en.yaml
CHANGED
@@ -1,7 +1,6 @@
|
|
1
|
-
introduction:
|
2
|
-
|
3
|
-
|
4
|
-
BSI: BRITISH STANDARDS INSTITUTE
|
1
|
+
introduction: Introduction
|
2
|
+
foreword: Foreword
|
3
|
+
BSI: BRITISH STANDARDS INSTITUTION
|
5
4
|
formula: Equation
|
6
5
|
inequality: Inequality
|
7
6
|
section_iev: Section
|
@@ -38,6 +37,7 @@ internal_external_terms_boilerplate: |
|
|
38
37
|
given in % and the following apply.</p>
|
39
38
|
commentary: COMMENTARY %1 ON %2
|
40
39
|
commentary_xref: Commentary %1 on %2
|
40
|
+
related_refs: "The following BSI references relate to the work on this document:"
|
41
41
|
doctype_dict:
|
42
42
|
international-standard: International Standard
|
43
43
|
technical-specification: Technical Specification
|
data/lib/isodoc/bsi/metadata.rb
CHANGED
@@ -16,7 +16,7 @@ module IsoDoc
|
|
16
16
|
unpublished(docstatus.text) and
|
17
17
|
set(:stageabbr, docstatus["abbreviation"])
|
18
18
|
end
|
19
|
-
revdate = isoxml.at(ns("//version/revision-date"))
|
19
|
+
revdate = isoxml.at(ns("//bibdata/version/revision-date"))
|
20
20
|
set(:revdate, revdate&.text)
|
21
21
|
end
|
22
22
|
|
@@ -24,7 +24,7 @@ module IsoDoc
|
|
24
24
|
status.to_i.positive? && status.to_i < 60
|
25
25
|
end
|
26
26
|
|
27
|
-
|
27
|
+
def docid(isoxml, _out)
|
28
28
|
dn = isoxml.at(ns("//bibdata/docidentifier[@type = 'BS']"))
|
29
29
|
set(:docnumber, dn&.text)
|
30
30
|
end
|
@@ -25,7 +25,7 @@ module IsoDoc
|
|
25
25
|
prefix_name(node, "", n[:label].upcase, "name")
|
26
26
|
end
|
27
27
|
|
28
|
-
def eref_localities1_zh(target, type, from, to,
|
28
|
+
def eref_localities1_zh(target, type, from, to, node, delim)
|
29
29
|
subsection = from&.text&.match(/\./)
|
30
30
|
ret = if delim == ";"
|
31
31
|
";"
|
@@ -38,24 +38,24 @@ module IsoDoc
|
|
38
38
|
loc = (@i18n.locality[type] || type.sub(/^locality:/, "").capitalize)
|
39
39
|
ret += " #{loc}" unless subsection && type == "clause" ||
|
40
40
|
type == "list" || target.match(/^IEV$|^IEC 60050-/) ||
|
41
|
-
|
41
|
+
node["droploc"] == "true"
|
42
42
|
ret += ")" if type == "list"
|
43
43
|
ret
|
44
44
|
end
|
45
45
|
|
46
|
-
def eref_localities1(target, type, from, to, delim,
|
46
|
+
def eref_localities1(target, type, from, to, delim, node, lang = "en")
|
47
47
|
return "" if type == "anchor"
|
48
48
|
|
49
49
|
subsection = from&.text&.match(/\./)
|
50
50
|
type = type.downcase
|
51
51
|
lang == "zh" and
|
52
|
-
return l10n(eref_localities1_zh(target, type, from, to,
|
52
|
+
return l10n(eref_localities1_zh(target, type, from, to, node, delim))
|
53
53
|
ret = if delim == ";"
|
54
54
|
";"
|
55
55
|
else
|
56
56
|
type == "list" ? "" : delim
|
57
57
|
end
|
58
|
-
ret += eref_locality_populate(type,
|
58
|
+
ret += eref_locality_populate(type, node) unless subsection &&
|
59
59
|
type == "clause" || type == "list" ||
|
60
60
|
target.match(/^IEV$|^IEC 60050-/)
|
61
61
|
range = " #{from.text}" if from
|
@@ -66,6 +66,27 @@ module IsoDoc
|
|
66
66
|
l10n(ret)
|
67
67
|
end
|
68
68
|
|
69
|
+
def clause(docxml)
|
70
|
+
super
|
71
|
+
ids = docxml.xpath(ns("//bibdata/relation[@type = 'related']/bibitem"))
|
72
|
+
.each_with_object([]) { |x, m| m << x.at(ns("./docidentifier")).text }
|
73
|
+
return if ids.empty?
|
74
|
+
|
75
|
+
docxml.at(ns("//preface")).elements.first.previous = <<~SECTION
|
76
|
+
<clause type="related-refs">
|
77
|
+
<p>#{@i18n.related_refs}<br/>#{ids.join('<br/>')}</p>
|
78
|
+
</clause>
|
79
|
+
SECTION
|
80
|
+
end
|
81
|
+
|
82
|
+
def annex1(elem)
|
83
|
+
lbl = @xrefs.anchor(elem["id"], :label)
|
84
|
+
if t = elem.at(ns("./title"))
|
85
|
+
t.children = "<strong>#{t.children.to_xml}</strong>"
|
86
|
+
end
|
87
|
+
prefix_name(elem, "<br/>", lbl, "title")
|
88
|
+
end
|
89
|
+
|
69
90
|
include Init
|
70
91
|
end
|
71
92
|
end
|
data/lib/isodoc/bsi/xref.rb
CHANGED
@@ -20,8 +20,9 @@ module IsoDoc
|
|
20
20
|
|
21
21
|
def commentary_link(target, docxml)
|
22
22
|
link = @anchors.dig(target, :xref) || "???"
|
23
|
-
if @anchors.dig(target, :type) == "clause" ||
|
24
|
-
docxml.at(ns("//clause[@id = '#{target}']"))
|
23
|
+
if (@anchors.dig(target, :type) == "clause" ||
|
24
|
+
docxml.at(ns("//clause[@id = '#{target}']"))) &&
|
25
|
+
@anchors.dig(target, :subtype) != "annex"
|
25
26
|
link = "#{@labels['clause']} #{@anchors[target][:label]}"
|
26
27
|
end
|
27
28
|
link
|
@@ -41,7 +42,7 @@ module IsoDoc
|
|
41
42
|
else
|
42
43
|
l10n("(#{@labels['inform_annex']})")
|
43
44
|
end
|
44
|
-
l10n("<strong>#{@labels['annex']} #{num}</strong><
|
45
|
+
l10n("<strong>#{@labels['annex']} #{num}</strong><tab/>#{obl}")
|
45
46
|
end
|
46
47
|
|
47
48
|
def termnote_anchor_names(docxml)
|
@@ -87,6 +88,11 @@ module IsoDoc
|
|
87
88
|
end
|
88
89
|
end
|
89
90
|
|
91
|
+
def annex_names(clause, num)
|
92
|
+
super
|
93
|
+
@anchors[clause["id"]][:subtype] = "annex"
|
94
|
+
end
|
95
|
+
|
90
96
|
def annex_names1(clause, num, level)
|
91
97
|
@anchors[clause["id"]] =
|
92
98
|
{ xref: "<strong>#{num}</strong>", label: num, level: level }
|
@@ -105,7 +111,8 @@ module IsoDoc
|
|
105
111
|
notes.each do |n|
|
106
112
|
next if n["id"].nil? || n["id"].empty?
|
107
113
|
|
108
|
-
idx =
|
114
|
+
idx =
|
115
|
+
notes.size == 1 && !n["number"] ? "" : " #{c.increment(n).print}"
|
109
116
|
@anchors[n["id"]] = anchor_struct(idx, n, @labels["list"], "list",
|
110
117
|
false)
|
111
118
|
list_item_anchor_names(n, @anchors[n["id"]], 1, "", notes.size > 3)
|
data/metanorma-bsi.gemspec
CHANGED
@@ -25,10 +25,10 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.require_paths = ["lib"]
|
26
26
|
spec.files = `git ls-files`.split("\n")
|
27
27
|
spec.test_files = `git ls-files -- {spec}/*`.split("\n")
|
28
|
-
spec.required_ruby_version = Gem::Requirement.new(">= 2.
|
28
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
|
29
29
|
|
30
30
|
spec.add_dependency "metanorma-iso", "~> 1.8.0"
|
31
|
-
spec.add_dependency "mn2sts", "~> 1.
|
31
|
+
spec.add_dependency "mn2sts", "~> 1.8.0"
|
32
32
|
spec.add_dependency "ruby-jing"
|
33
33
|
|
34
34
|
spec.add_development_dependency "byebug"
|