metanorma-ogc 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/asciidoctor/ogc/biblio.rng +33 -51
- data/lib/asciidoctor/ogc/isodoc.rng +6 -1
- data/lib/asciidoctor/ogc/isostandard.rng +3 -10
- data/lib/isodoc/ogc/html/htmlstyle.scss +1 -1
- data/lib/isodoc/ogc/html/ogc.scss +61 -0
- data/lib/isodoc/ogc/html_convert.rb +21 -12
- data/lib/isodoc/ogc/pdf_convert.rb +21 -13
- data/lib/isodoc/ogc/word_convert.rb +92 -6
- data/lib/metanorma/ogc/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a77fd983398d390d95aa82f46e12ce33a86501f4238bedcdebe2dc149d1f0962
|
4
|
+
data.tar.gz: 4f0b5aad19b3e6d8f5434d41328aa0d71a1df1a3b12dcd30a42232452be28c34
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c872166528dc90fefee0cf0e8af8f7bb5d9ffea093da95811eb6651655dc1e41e3a5e82f6a31d5f27bf6180f8b6466d96e0ad6a8c70658b6fb7ddfb9210efae
|
7
|
+
data.tar.gz: 7eb9b45dc65701d0db400832eafca7b06e9cfecbd25f82c463a89f396ceb2e232795c3319ee1fc889c8ecf03e18483665e06f843d776b2911ae21fd0511dde91
|
@@ -18,6 +18,21 @@
|
|
18
18
|
of this.
|
19
19
|
-->
|
20
20
|
<grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
21
|
+
<!--
|
22
|
+
https://www.myintervals.com/blog/2009/05/20/iso-8601-date-validation-that-doesnt-suck/
|
23
|
+
iso8601date = xsd:string { pattern = "([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24\:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?" }
|
24
|
+
Somewhat dumbed down for XSD regex:
|
25
|
+
-->
|
26
|
+
<define name="ISO8601DateTime">
|
27
|
+
<data type="string">
|
28
|
+
<param name="pattern">([\+\-]?\d{4})((-?)((0[1-9]|1[0-2])((-?)([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([\.,]\d+)?)?((:?)[0-5]\d([.,]\d+)?)?([zZ]|([\+\-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?</param>
|
29
|
+
</data>
|
30
|
+
</define>
|
31
|
+
<define name="ISO8601Date">
|
32
|
+
<data type="string">
|
33
|
+
<param name="pattern">([\+\-]?\d{4})((-?)((0[1-9]|1[0-2])((-?)([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6]))))?</param>
|
34
|
+
</data>
|
35
|
+
</define>
|
21
36
|
<define name="status">
|
22
37
|
<element name="status">
|
23
38
|
<ref name="LocalizedString"/>
|
@@ -375,10 +390,7 @@
|
|
375
390
|
</define>
|
376
391
|
<define name="date">
|
377
392
|
<element name="date">
|
378
|
-
<
|
379
|
-
<data type="gYear"/>
|
380
|
-
<data type="date"/>
|
381
|
-
</choice>
|
393
|
+
<ref name="ISO8601Date"/>
|
382
394
|
</element>
|
383
395
|
</define>
|
384
396
|
<define name="locality">
|
@@ -561,10 +573,7 @@
|
|
561
573
|
</define>
|
562
574
|
<define name="fetched">
|
563
575
|
<element name="fetched">
|
564
|
-
<
|
565
|
-
<data type="dateTime"/>
|
566
|
-
<data type="date"/>
|
567
|
-
</choice>
|
576
|
+
<ref name="ISO8601DateTime"/>
|
568
577
|
</element>
|
569
578
|
</define>
|
570
579
|
<define name="validity">
|
@@ -582,26 +591,17 @@
|
|
582
591
|
</define>
|
583
592
|
<define name="validityBegins">
|
584
593
|
<element name="validityBegins">
|
585
|
-
<
|
586
|
-
<data type="dateTime"/>
|
587
|
-
<data type="date"/>
|
588
|
-
</choice>
|
594
|
+
<ref name="ISO8601DateTime"/>
|
589
595
|
</element>
|
590
596
|
</define>
|
591
597
|
<define name="validityEnds">
|
592
598
|
<element name="validityEnds">
|
593
|
-
<
|
594
|
-
<data type="dateTime"/>
|
595
|
-
<data type="date"/>
|
596
|
-
</choice>
|
599
|
+
<ref name="ISO8601DateTime"/>
|
597
600
|
</element>
|
598
601
|
</define>
|
599
602
|
<define name="validityRevision">
|
600
603
|
<element name="revision">
|
601
|
-
<
|
602
|
-
<data type="dateTime"/>
|
603
|
-
<data type="date"/>
|
604
|
-
</choice>
|
604
|
+
<ref name="ISO8601DateTime"/>
|
605
605
|
</element>
|
606
606
|
</define>
|
607
607
|
<define name="TypedTitleString">
|
@@ -632,10 +632,7 @@
|
|
632
632
|
<attribute name="text"/>
|
633
633
|
</optional>
|
634
634
|
<optional>
|
635
|
-
<
|
636
|
-
<data type="gYear"/>
|
637
|
-
<data type="date"/>
|
638
|
-
</choice>
|
635
|
+
<ref name="ISO8601Date"/>
|
639
636
|
</optional>
|
640
637
|
</define>
|
641
638
|
<define name="bdate">
|
@@ -660,25 +657,16 @@
|
|
660
657
|
<choice>
|
661
658
|
<group>
|
662
659
|
<element name="from">
|
663
|
-
<
|
664
|
-
<data type="gYear"/>
|
665
|
-
<data type="date"/>
|
666
|
-
</choice>
|
660
|
+
<ref name="ISO8601Date"/>
|
667
661
|
</element>
|
668
662
|
<optional>
|
669
663
|
<element name="to">
|
670
|
-
<
|
671
|
-
<data type="gYear"/>
|
672
|
-
<data type="date"/>
|
673
|
-
</choice>
|
664
|
+
<ref name="ISO8601Date"/>
|
674
665
|
</element>
|
675
666
|
</optional>
|
676
667
|
</group>
|
677
668
|
<element name="on">
|
678
|
-
<
|
679
|
-
<data type="gYear"/>
|
680
|
-
<data type="date"/>
|
681
|
-
</choice>
|
669
|
+
<ref name="ISO8601Date"/>
|
682
670
|
</element>
|
683
671
|
</choice>
|
684
672
|
</element>
|
@@ -791,20 +779,12 @@
|
|
791
779
|
</define>
|
792
780
|
<define name="seriesfrom">
|
793
781
|
<element name="from">
|
794
|
-
<
|
795
|
-
<data type="dateTime"/>
|
796
|
-
<data type="date"/>
|
797
|
-
<data type="gYear"/>
|
798
|
-
</choice>
|
782
|
+
<ref name="ISO8601Date"/>
|
799
783
|
</element>
|
800
784
|
</define>
|
801
785
|
<define name="seriesto">
|
802
786
|
<element name="to">
|
803
|
-
<
|
804
|
-
<data type="dateTime"/>
|
805
|
-
<data type="date"/>
|
806
|
-
<data type="gYear"/>
|
807
|
-
</choice>
|
787
|
+
<ref name="ISO8601Date"/>
|
808
788
|
</element>
|
809
789
|
</define>
|
810
790
|
<define name="seriesnumber">
|
@@ -899,7 +879,7 @@
|
|
899
879
|
</define>
|
900
880
|
<define name="revision-date">
|
901
881
|
<element name="revision-date">
|
902
|
-
<
|
882
|
+
<ref name="ISO8601Date"/>
|
903
883
|
</element>
|
904
884
|
</define>
|
905
885
|
<define name="draft">
|
@@ -922,10 +902,12 @@
|
|
922
902
|
<define name="AnyElement">
|
923
903
|
<element>
|
924
904
|
<anyName/>
|
925
|
-
<
|
926
|
-
<
|
927
|
-
|
928
|
-
|
905
|
+
<oneOrMore>
|
906
|
+
<choice>
|
907
|
+
<text/>
|
908
|
+
<ref name="AnyElement"/>
|
909
|
+
</choice>
|
910
|
+
</oneOrMore>
|
929
911
|
</element>
|
930
912
|
</define>
|
931
913
|
</grammar>
|
@@ -250,24 +250,17 @@
|
|
250
250
|
<choice>
|
251
251
|
<group>
|
252
252
|
<element name="from">
|
253
|
-
<
|
254
|
-
<data type="gYear"/>
|
255
|
-
<data type="date"/>
|
256
|
-
</choice>
|
253
|
+
<ref name="ISO8601Date"/>
|
257
254
|
</element>
|
258
255
|
<optional>
|
259
256
|
<element name="to">
|
260
|
-
<
|
261
|
-
<data type="gYear"/>
|
262
|
-
<data type="date"/>
|
263
|
-
</choice>
|
257
|
+
<ref name="ISO8601Date"/>
|
264
258
|
</element>
|
265
259
|
</optional>
|
266
260
|
</group>
|
267
261
|
<element name="on">
|
268
262
|
<choice>
|
269
|
-
<
|
270
|
-
<data type="date"/>
|
263
|
+
<ref name="ISO8601Date"/>
|
271
264
|
<value>--</value>
|
272
265
|
</choice>
|
273
266
|
</element>
|
@@ -51,6 +51,44 @@ p.FigureTitle
|
|
51
51
|
mso-fareast-font-family:$bodyfont;
|
52
52
|
mso-bidi-font-family:$bodyfont;
|
53
53
|
mso-ansi-language:EN-GB;}
|
54
|
+
p.SourceTitle
|
55
|
+
{mso-style-unhide:no;
|
56
|
+
mso-style-qformat:yes;
|
57
|
+
mso-style-parent:"";
|
58
|
+
margin-top:0cm;
|
59
|
+
margin-right:0cm;
|
60
|
+
margin-bottom:6.0pt;
|
61
|
+
margin-left:0cm;
|
62
|
+
text-align:center;
|
63
|
+
line-height:12.0pt;
|
64
|
+
page-break-before:avoid;
|
65
|
+
mso-pagination:widow-orphan;
|
66
|
+
tab-stops:20.15pt;
|
67
|
+
font-size:11.0pt;
|
68
|
+
font-weight:bold;
|
69
|
+
font-family:$bodyfont;
|
70
|
+
mso-fareast-font-family:$bodyfont;
|
71
|
+
mso-bidi-font-family:$bodyfont;
|
72
|
+
mso-ansi-language:EN-GB;}
|
73
|
+
p.AdmonitionTitle
|
74
|
+
{mso-style-unhide:no;
|
75
|
+
mso-style-qformat:yes;
|
76
|
+
mso-style-parent:"";
|
77
|
+
margin-top:0cm;
|
78
|
+
margin-right:0cm;
|
79
|
+
margin-bottom:6.0pt;
|
80
|
+
margin-left:0cm;
|
81
|
+
text-align:center;
|
82
|
+
line-height:12.0pt;
|
83
|
+
page-break-after:avoid;
|
84
|
+
mso-pagination:widow-orphan;
|
85
|
+
tab-stops:20.15pt;
|
86
|
+
font-size:11.0pt;
|
87
|
+
font-weight:bold;
|
88
|
+
font-family:$bodyfont;
|
89
|
+
mso-fareast-font-family:$bodyfont;
|
90
|
+
mso-bidi-font-family:$bodyfont;
|
91
|
+
mso-ansi-language:EN-GB;}
|
54
92
|
p.TableTitle
|
55
93
|
{mso-style-unhide:no;
|
56
94
|
mso-style-qformat:yes;
|
@@ -300,6 +338,29 @@ p.zzContents, li.zzContents, div.zzContents
|
|
300
338
|
mso-ansi-language:EN-GB;
|
301
339
|
font-weight:bold;
|
302
340
|
mso-bidi-font-weight:normal;}
|
341
|
+
p.TOCTitle, li.TOCTitle, div.TOCTitle
|
342
|
+
{mso-style-name:zzContents;
|
343
|
+
mso-style-noshow:yes;
|
344
|
+
mso-style-unhide:no;
|
345
|
+
mso-style-next:"TOC 1";
|
346
|
+
margin-top:48.0pt;
|
347
|
+
margin-right:0cm;
|
348
|
+
margin-bottom:15.5pt;
|
349
|
+
margin-left:0cm;
|
350
|
+
line-height:15.5pt;
|
351
|
+
mso-line-height-rule:exactly;
|
352
|
+
mso-pagination:widow-orphan;
|
353
|
+
page-break-after:avoid;
|
354
|
+
mso-hyphenate:none;
|
355
|
+
tab-stops:20.15pt;
|
356
|
+
font-size:14.0pt;
|
357
|
+
mso-bidi-font-size:11.0pt;
|
358
|
+
font-family:$headerfont;
|
359
|
+
mso-fareast-font-family:$headerfont;
|
360
|
+
mso-bidi-font-family:$headerfont;
|
361
|
+
mso-ansi-language:EN-GB;
|
362
|
+
font-weight:bold;
|
363
|
+
mso-bidi-font-weight:normal;}
|
303
364
|
p.zzCopyright, li.zzCopyright
|
304
365
|
{mso-style-name:zzCopyright;
|
305
366
|
mso-style-noshow:yes;
|
@@ -274,7 +274,7 @@ module IsoDoc
|
|
274
274
|
out.table **recommend_table_attr(node) do |t|
|
275
275
|
t.tr do |tr|
|
276
276
|
tr.td **REQ_TBL_ATTR do |td|
|
277
|
-
|
277
|
+
recommendation_label(node, td)
|
278
278
|
end
|
279
279
|
tr.td **{ valign: "top", class: "recommend" } do |td|
|
280
280
|
recommend_name_parse(node, td)
|
@@ -284,17 +284,20 @@ module IsoDoc
|
|
284
284
|
end
|
285
285
|
end
|
286
286
|
|
287
|
-
|
287
|
+
def recommendation_label(node, out)
|
288
288
|
n = get_anchors[node["id"]]
|
289
|
-
|
290
|
-
|
289
|
+
label = (n.nil? || n[:label].empty?) ?
|
290
|
+
"Recommendation" : l10n("#{"Recommendation"} #{n[:label]}")
|
291
|
+
out.p **{class: "RecommendationTitle" } do |p|
|
292
|
+
p << label
|
293
|
+
end
|
291
294
|
end
|
292
295
|
|
293
296
|
def requirement_parse(node, out)
|
294
297
|
out.table **recommend_table_attr(node) do |t|
|
295
298
|
t.tr do |tr|
|
296
299
|
tr.td **REQ_TBL_ATTR do |td|
|
297
|
-
|
300
|
+
requirement_label(node, td)
|
298
301
|
end
|
299
302
|
tr.td **{ valign: "top", class: "recommend" } do |td|
|
300
303
|
recommend_name_parse(node, td)
|
@@ -304,17 +307,20 @@ module IsoDoc
|
|
304
307
|
end
|
305
308
|
end
|
306
309
|
|
307
|
-
def requirement_label(node)
|
310
|
+
def requirement_label(node, out)
|
308
311
|
n = get_anchors[node["id"]]
|
309
|
-
|
310
|
-
|
312
|
+
label = (n.nil? || n[:label].empty?) ?
|
313
|
+
"Requirement" : l10n("#{"Requirement"} #{n[:label]}")
|
314
|
+
out.p **{class: "RecommendationTitle" } do |p|
|
315
|
+
p << label
|
316
|
+
end
|
311
317
|
end
|
312
318
|
|
313
319
|
def permission_parse(node, out)
|
314
320
|
out.table **recommend_table_attr(node) do |t|
|
315
321
|
t.tr do |tr|
|
316
322
|
tr.td **REQ_TBL_ATTR do |td|
|
317
|
-
|
323
|
+
permission_label(node, td)
|
318
324
|
end
|
319
325
|
tr.td **{ valign: "top", class: "recommend" } do |td|
|
320
326
|
recommend_name_parse(node, td)
|
@@ -324,10 +330,13 @@ module IsoDoc
|
|
324
330
|
end
|
325
331
|
end
|
326
332
|
|
327
|
-
|
333
|
+
def permission_label(node, out)
|
328
334
|
n = get_anchors[node["id"]]
|
329
|
-
|
330
|
-
|
335
|
+
label = (n.nil? || n[:label].empty?) ?
|
336
|
+
"Permission" : l10n("#{"Permission"} #{n[:label]}")
|
337
|
+
out.p **{class: "RecommendationTitle" } do |p|
|
338
|
+
p << label
|
339
|
+
end
|
331
340
|
end
|
332
341
|
|
333
342
|
def initial_anchor_names(d)
|
@@ -273,7 +273,7 @@ module IsoDoc
|
|
273
273
|
out.table **recommend_table_attr(node) do |t|
|
274
274
|
t.tr do |tr|
|
275
275
|
tr.td **REQ_TBL_ATTR do |td|
|
276
|
-
|
276
|
+
recommendation_label(node, td)
|
277
277
|
end
|
278
278
|
tr.td **{ valign: "top", class: "recommend" } do |td|
|
279
279
|
recommend_name_parse(node, td)
|
@@ -283,17 +283,20 @@ module IsoDoc
|
|
283
283
|
end
|
284
284
|
end
|
285
285
|
|
286
|
-
|
286
|
+
def recommendation_label(node, out)
|
287
287
|
n = get_anchors[node["id"]]
|
288
|
-
|
289
|
-
|
288
|
+
label = (n.nil? || n[:label].empty?) ?
|
289
|
+
"Recommendation" : l10n("#{"Recommendation"} #{n[:label]}")
|
290
|
+
out.p **{class: "RecommendationTitle" } do |p|
|
291
|
+
p << label
|
292
|
+
end
|
290
293
|
end
|
291
294
|
|
292
295
|
def requirement_parse(node, out)
|
293
296
|
out.table **recommend_table_attr(node) do |t|
|
294
297
|
t.tr do |tr|
|
295
298
|
tr.td **REQ_TBL_ATTR do |td|
|
296
|
-
|
299
|
+
requirement_label(node, td)
|
297
300
|
end
|
298
301
|
tr.td **{ valign: "top", class: "recommend" } do |td|
|
299
302
|
recommend_name_parse(node, td)
|
@@ -303,17 +306,20 @@ module IsoDoc
|
|
303
306
|
end
|
304
307
|
end
|
305
308
|
|
306
|
-
|
309
|
+
def requirement_label(node, out)
|
307
310
|
n = get_anchors[node["id"]]
|
308
|
-
|
309
|
-
|
311
|
+
label = (n.nil? || n[:label].empty?) ?
|
312
|
+
"Requirement" : l10n("#{"Requirement"} #{n[:label]}")
|
313
|
+
out.p **{class: "RecommendationTitle" } do |p|
|
314
|
+
p << label
|
315
|
+
end
|
310
316
|
end
|
311
317
|
|
312
318
|
def permission_parse(node, out)
|
313
319
|
out.table **recommend_table_attr(node) do |t|
|
314
320
|
t.tr do |tr|
|
315
321
|
tr.td **REQ_TBL_ATTR do |td|
|
316
|
-
|
322
|
+
permission_label(node, td)
|
317
323
|
end
|
318
324
|
tr.td **{ valign: "top", class: "recommend" } do |td|
|
319
325
|
recommend_name_parse(node, td)
|
@@ -323,13 +329,15 @@ module IsoDoc
|
|
323
329
|
end
|
324
330
|
end
|
325
331
|
|
326
|
-
|
332
|
+
def permission_label(node, out)
|
327
333
|
n = get_anchors[node["id"]]
|
328
|
-
|
329
|
-
|
334
|
+
label = (n.nil? || n[:label].empty?) ?
|
335
|
+
"Permission" : l10n("#{"Permission"} #{n[:label]}")
|
336
|
+
out.p **{class: "RecommendationTitle" } do |p|
|
337
|
+
p << label
|
338
|
+
end
|
330
339
|
end
|
331
340
|
|
332
|
-
|
333
341
|
def initial_anchor_names(d)
|
334
342
|
@prefacenum = 0
|
335
343
|
preface_names(d.at(ns("//preface/abstract")))
|
@@ -58,6 +58,92 @@ module IsoDoc
|
|
58
58
|
end
|
59
59
|
=end
|
60
60
|
|
61
|
+
def insert_toc(intro, docxml)
|
62
|
+
toc = ""
|
63
|
+
toc += make_WordToC(docxml)
|
64
|
+
if docxml.at("//p[@class = 'TableTitle']")
|
65
|
+
toc += %{<p class="TOCTitle">List of Tables</p>}
|
66
|
+
toc += make_TableWordToC(docxml)
|
67
|
+
end
|
68
|
+
if docxml.at("//p[@class = 'FigureTitle']")
|
69
|
+
toc += %{<p class="TOCTitle">List of Figures</p>}
|
70
|
+
toc += make_FigureWordToC(docxml)
|
71
|
+
end
|
72
|
+
if docxml.at("//p[@class = 'RecommendationTitle']")
|
73
|
+
toc += %{<p class="TOCTitle">List of Recommendations</p>}
|
74
|
+
toc += make_RecommendationWordToC(docxml)
|
75
|
+
end
|
76
|
+
intro.sub(/WORDTOC/, toc)
|
77
|
+
end
|
78
|
+
|
79
|
+
WORD_TOC_RECOMMENDATION_PREFACE1 = <<~TOC.freeze
|
80
|
+
<span lang="EN-GB"><span
|
81
|
+
style='mso-element:field-begin'></span><span
|
82
|
+
style='mso-spacerun:yes'> </span>TOC
|
83
|
+
\\h \\z \\t "RecommendationTitle,1" <span
|
84
|
+
style='mso-element:field-separator'></span></span>
|
85
|
+
TOC
|
86
|
+
|
87
|
+
WORD_TOC_TABLE_PREFACE1 = <<~TOC.freeze
|
88
|
+
<span lang="EN-GB"><span
|
89
|
+
style='mso-element:field-begin'></span><span
|
90
|
+
style='mso-spacerun:yes'> </span>TOC
|
91
|
+
\\h \\z \\t "TableTitle,1" <span
|
92
|
+
style='mso-element:field-separator'></span></span>
|
93
|
+
TOC
|
94
|
+
|
95
|
+
WORD_TOC_FIGURE_PREFACE1 = <<~TOC.freeze
|
96
|
+
<span lang="EN-GB"><span
|
97
|
+
style='mso-element:field-begin'></span><span
|
98
|
+
style='mso-spacerun:yes'> </span>TOC
|
99
|
+
\\h \\z \\t "FigureTitle,1" <span
|
100
|
+
style='mso-element:field-separator'></span></span>
|
101
|
+
TOC
|
102
|
+
|
103
|
+
def header_strip(h)
|
104
|
+
h = h.to_s.gsub(/<\/?p[^>]*>/, "")
|
105
|
+
super
|
106
|
+
end
|
107
|
+
|
108
|
+
def make_TableWordToC(docxml)
|
109
|
+
toc = ""
|
110
|
+
docxml.xpath("//p[@class = 'TableTitle']").each do |h|
|
111
|
+
toc += word_toc_entry(1, header_strip(h))
|
112
|
+
end
|
113
|
+
toc.sub(/(<p class="MsoToc1">)/,
|
114
|
+
%{\\1#{WORD_TOC_TABLE_PREFACE1}}) + WORD_TOC_SUFFIX1
|
115
|
+
end
|
116
|
+
|
117
|
+
def make_FigureWordToC(docxml)
|
118
|
+
toc = ""
|
119
|
+
docxml.xpath("//p[@class = 'FigureTitle']").each do |h|
|
120
|
+
toc += word_toc_entry(1, header_strip(h))
|
121
|
+
end
|
122
|
+
toc.sub(/(<p class="MsoToc1">)/,
|
123
|
+
%{\\1#{WORD_TOC_FIGURE_PREFACE1}}) + WORD_TOC_SUFFIX1
|
124
|
+
end
|
125
|
+
|
126
|
+
def make_RecommendationWordToC(docxml)
|
127
|
+
toc = ""
|
128
|
+
docxml.xpath("//p[@class = 'RecommendationTitle']").each do |h|
|
129
|
+
toc += word_toc_entry(1, header_strip(h))
|
130
|
+
end
|
131
|
+
toc.sub(/(<p class="MsoToc1">)/,
|
132
|
+
%{\\1#{WORD_TOC_RECOMMENDATION_PREFACE1}}) + WORD_TOC_SUFFIX1
|
133
|
+
end
|
134
|
+
|
135
|
+
def make_WordToC(docxml)
|
136
|
+
toc = ""
|
137
|
+
docxml.xpath("//h1[not(ancestor::*[@class = 'WordSection2'])] |"\
|
138
|
+
"//h1[contains(., 'Executive Summary')] |"\
|
139
|
+
"//h2[not(ancestor::*[@class = 'WordSection2'])] |"\
|
140
|
+
"//h3[not(ancestor::*[@class = 'WordSection2'])]").each do |h|
|
141
|
+
toc += word_toc_entry(h.name[1].to_i, header_strip(h))
|
142
|
+
end
|
143
|
+
toc.sub(/(<p class="MsoToc1">)/,
|
144
|
+
%{\\1#{WORD_TOC_PREFACE1}}) + WORD_TOC_SUFFIX1
|
145
|
+
end
|
146
|
+
|
61
147
|
def annex_name(annex, name, div)
|
62
148
|
div.h1 **{ class: "Annex" } do |t|
|
63
149
|
t << "#{get_anchors[annex['id']][:label]} "
|
@@ -172,7 +258,7 @@ module IsoDoc
|
|
172
258
|
end
|
173
259
|
end
|
174
260
|
|
175
|
-
|
261
|
+
def abstract(isoxml, out)
|
176
262
|
f = isoxml.at(ns("//preface/abstract")) || return
|
177
263
|
@prefacenum += 1
|
178
264
|
page_break(out)
|
@@ -268,7 +354,7 @@ module IsoDoc
|
|
268
354
|
n = get_anchors[node["id"]]
|
269
355
|
label = (n.nil? || n[:label].empty?) ?
|
270
356
|
"Recommendation" : l10n("#{"Recommendation"} #{n[:label]}")
|
271
|
-
out.p **{class: "
|
357
|
+
out.p **{class: "RecommendationTitle" } do |p|
|
272
358
|
p << label
|
273
359
|
end
|
274
360
|
end
|
@@ -287,11 +373,11 @@ module IsoDoc
|
|
287
373
|
end
|
288
374
|
end
|
289
375
|
|
290
|
-
def requirement_label(node)
|
376
|
+
def requirement_label(node, out)
|
291
377
|
n = get_anchors[node["id"]]
|
292
378
|
label = (n.nil? || n[:label].empty?) ?
|
293
379
|
"Requirement" : l10n("#{"Requirement"} #{n[:label]}")
|
294
|
-
out.p **{class: "
|
380
|
+
out.p **{class: "RecommendationTitle" } do |p|
|
295
381
|
p << label
|
296
382
|
end
|
297
383
|
end
|
@@ -310,11 +396,11 @@ module IsoDoc
|
|
310
396
|
end
|
311
397
|
end
|
312
398
|
|
313
|
-
def permission_label(node)
|
399
|
+
def permission_label(node, out)
|
314
400
|
n = get_anchors[node["id"]]
|
315
401
|
label = (n.nil? || n[:label].empty?) ?
|
316
402
|
"Permission" : l10n("#{"Permission"} #{n[:label]}")
|
317
|
-
out.p **{class: "
|
403
|
+
out.p **{class: "RecommendationTitle" } do |p|
|
318
404
|
p << label
|
319
405
|
end
|
320
406
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-ogc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-02-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|