metanorma-ogc 2.8.3 → 2.8.5
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.
- checksums.yaml +4 -4
- data/lib/isodoc/ogc/html/htmlstyle.css +25 -31
- data/lib/isodoc/ogc/init.rb +5 -3
- data/lib/isodoc/ogc/ogc.abstract-specification-topic.xsl +189 -147
- data/lib/isodoc/ogc/ogc.best-practice.xsl +189 -147
- data/lib/isodoc/ogc/ogc.change-request-supporting-document.xsl +189 -147
- data/lib/isodoc/ogc/ogc.community-practice.xsl +189 -147
- data/lib/isodoc/ogc/ogc.community-standard.xsl +189 -147
- data/lib/isodoc/ogc/ogc.discussion-paper.xsl +189 -147
- data/lib/isodoc/ogc/ogc.draft-standard.xsl +189 -147
- data/lib/isodoc/ogc/ogc.engineering-report.xsl +189 -147
- data/lib/isodoc/ogc/ogc.other.xsl +189 -147
- data/lib/isodoc/ogc/ogc.policy.xsl +189 -147
- data/lib/isodoc/ogc/ogc.reference-model.xsl +189 -147
- data/lib/isodoc/ogc/ogc.release-notes.xsl +189 -147
- data/lib/isodoc/ogc/ogc.standard.xsl +189 -147
- data/lib/isodoc/ogc/ogc.test-suite.xsl +189 -147
- data/lib/isodoc/ogc/ogc.user-guide.xsl +189 -147
- data/lib/isodoc/ogc/ogc.white-paper.xsl +89 -57
- data/lib/isodoc/ogc/presentation_sections.rb +1 -1
- data/lib/metanorma/ogc/cleanup.rb +17 -1
- data/lib/metanorma/ogc/converter.rb +31 -100
- data/lib/metanorma/ogc/front.rb +3 -4
- data/lib/metanorma/ogc/isodoc.rng +26 -19
- data/lib/metanorma/ogc/sections.rb +110 -0
- data/lib/metanorma/ogc/version.rb +1 -1
- metadata +3 -2
@@ -148,6 +148,8 @@
|
|
148
148
|
|
149
149
|
<xsl:call-template name="cover-page"/>
|
150
150
|
|
151
|
+
<xsl:call-template name="inner-cover-page"/>
|
152
|
+
|
151
153
|
<xsl:variable name="updated_xml">
|
152
154
|
<xsl:call-template name="updateXML"/>
|
153
155
|
<!-- <xsl:copy-of select="."/> -->
|
@@ -232,6 +234,8 @@
|
|
232
234
|
</xsl:for-each>
|
233
235
|
</xsl:for-each>
|
234
236
|
|
237
|
+
<xsl:call-template name="back-page"/>
|
238
|
+
|
235
239
|
</fo:root>
|
236
240
|
|
237
241
|
</xsl:template>
|
@@ -314,7 +318,13 @@
|
|
314
318
|
</fo:flow>
|
315
319
|
</fo:page-sequence>
|
316
320
|
<!-- End Cover Page -->
|
317
|
-
|
321
|
+
</xsl:template> <!-- END: cover-page -->
|
322
|
+
|
323
|
+
<xsl:template name="inner-cover-page">
|
324
|
+
</xsl:template>
|
325
|
+
|
326
|
+
<xsl:template name="back-page">
|
327
|
+
</xsl:template>
|
318
328
|
|
319
329
|
<xsl:template name="processPrefaceAndMainSectionsOGC_items">
|
320
330
|
<xsl:variable name="updated_xml_step_move_pagebreak">
|
@@ -373,7 +383,9 @@
|
|
373
383
|
|
374
384
|
<xsl:template match="mn:preface//mn:clause[@type = 'toc']" name="toc" priority="4">
|
375
385
|
<fo:block break-after="page"/>
|
376
|
-
<fo:block-container
|
386
|
+
<fo:block-container xsl:use-attribute-sets="toc-style">
|
387
|
+
|
388
|
+
<xsl:call-template name="refine_toc-style"/>
|
377
389
|
|
378
390
|
<xsl:apply-templates select="mn:fmt-title"/>
|
379
391
|
|
@@ -535,7 +547,7 @@
|
|
535
547
|
</xsl:template>
|
536
548
|
|
537
549
|
<xsl:template match="mn:feedback-statement" priority="2">
|
538
|
-
<fo:block
|
550
|
+
<fo:block xsl:use-attribute-sets="feedback-statement-style">
|
539
551
|
<xsl:apply-templates select="mn:clause[1]"/>
|
540
552
|
</fo:block>
|
541
553
|
</xsl:template>
|
@@ -986,6 +998,7 @@
|
|
986
998
|
<xsl:variable name="en_dash">–</xsl:variable>
|
987
999
|
<xsl:variable name="em_dash">—</xsl:variable>
|
988
1000
|
<xsl:variable name="nonbreak_space_em_dash_space"> — </xsl:variable>
|
1001
|
+
<xsl:variable name="nonbreak_space_em_dash"> —</xsl:variable>
|
989
1002
|
<xsl:variable name="cr"> </xsl:variable>
|
990
1003
|
<xsl:variable name="lf">
|
991
1004
|
</xsl:variable>
|
@@ -1528,6 +1541,7 @@
|
|
1528
1541
|
<xsl:template match="mn:title[following-sibling::*[1][self::mn:fmt-title]]" mode="update_xml_step1"/>
|
1529
1542
|
<xsl:template match="mn:name[following-sibling::*[1][self::mn:fmt-name]]" mode="update_xml_step1"/>
|
1530
1543
|
<xsl:template match="mn:section-title[following-sibling::*[1][self::mn:p][@type = 'section-title' or @type = 'floating-title']]" mode="update_xml_step1"/>
|
1544
|
+
<xsl:template match="mn:floating-title[following-sibling::*[1][self::mn:p][@type = 'section-title' or @type = 'floating-title']]" mode="update_xml_step1"/>
|
1531
1545
|
<!-- <xsl:template match="mn:preferred[following-sibling::*[not(local-name() = 'preferred')][1][local-name() = 'fmt-preferred']]" mode="update_xml_step1"/> -->
|
1532
1546
|
<xsl:template match="mn:preferred" mode="update_xml_step1"/>
|
1533
1547
|
<!-- <xsl:template match="mn:admitted[following-sibling::*[not(local-name() = 'admitted')][1][local-name() = 'fmt-admitted']]" mode="update_xml_step1"/> -->
|
@@ -1542,10 +1556,10 @@
|
|
1542
1556
|
|
1543
1557
|
<xsl:template match="mn:term[@unnumbered = 'true'][not(.//*[starts-with(local-name(), 'fmt-')])]" mode="update_xml_step1"/>
|
1544
1558
|
|
1545
|
-
<xsl:template match="mn:p[@type = 'section-title' or @type = 'floating-title'][preceding-sibling::*[1][self::mn:section-title]]" mode="update_xml_step1">
|
1559
|
+
<xsl:template match="mn:p[@type = 'section-title' or @type = 'floating-title'][preceding-sibling::*[1][self::mn:section-title or self::mn:floating-title]]" mode="update_xml_step1">
|
1546
1560
|
<xsl:copy>
|
1547
1561
|
<xsl:apply-templates select="@*" mode="update_xml_step1"/>
|
1548
|
-
<xsl:copy-of select="preceding-sibling::*[1][self::mn:section-title]/@depth"/>
|
1562
|
+
<xsl:copy-of select="preceding-sibling::*[1][self::mn:section-title or self::mn:floating-title]/@depth"/>
|
1549
1563
|
<xsl:apply-templates select="node()" mode="update_xml_step1"/>
|
1550
1564
|
</xsl:copy>
|
1551
1565
|
</xsl:template>
|
@@ -2397,6 +2411,8 @@
|
|
2397
2411
|
</xsl:template>
|
2398
2412
|
|
2399
2413
|
<xsl:attribute-set name="feedback-statement-style">
|
2414
|
+
<xsl:attribute name="margin-top">12pt</xsl:attribute>
|
2415
|
+
<xsl:attribute name="margin-bottom">12pt</xsl:attribute>
|
2400
2416
|
</xsl:attribute-set> <!-- feedback-statement-style -->
|
2401
2417
|
|
2402
2418
|
<xsl:template name="refine_feedback-statement-style">
|
@@ -2407,7 +2423,6 @@
|
|
2407
2423
|
</xsl:attribute-set> <!-- feedback-statement-title-style -->
|
2408
2424
|
|
2409
2425
|
<xsl:template name="refine_feedback-statement-title-style">
|
2410
|
-
|
2411
2426
|
</xsl:template>
|
2412
2427
|
|
2413
2428
|
<xsl:attribute-set name="feedback-statement-p-style">
|
@@ -2692,6 +2707,12 @@
|
|
2692
2707
|
<xsl:template name="refine_sourcecode-style">
|
2693
2708
|
</xsl:template> <!-- refine_sourcecode-style -->
|
2694
2709
|
|
2710
|
+
<xsl:attribute-set name="sourcecode-number-style">
|
2711
|
+
</xsl:attribute-set>
|
2712
|
+
|
2713
|
+
<xsl:template name="refine_sourcecode-number-style">
|
2714
|
+
</xsl:template>
|
2715
|
+
|
2695
2716
|
<xsl:attribute-set name="sourcecode-name-style">
|
2696
2717
|
<xsl:attribute name="font-size">11pt</xsl:attribute>
|
2697
2718
|
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
@@ -4132,6 +4153,12 @@
|
|
4132
4153
|
<xsl:template name="refine_term-name-style">
|
4133
4154
|
</xsl:template>
|
4134
4155
|
|
4156
|
+
<xsl:attribute-set name="preferred-style">
|
4157
|
+
</xsl:attribute-set> <!-- preferred-style -->
|
4158
|
+
|
4159
|
+
<xsl:template name="refine_preferred-style">
|
4160
|
+
</xsl:template>
|
4161
|
+
|
4135
4162
|
<xsl:attribute-set name="preferred-block-style">
|
4136
4163
|
</xsl:attribute-set> <!-- preferred-block-style -->
|
4137
4164
|
|
@@ -4775,6 +4802,12 @@
|
|
4775
4802
|
<xsl:call-template name="setBordersTableArray"/>
|
4776
4803
|
</xsl:template> <!-- refine_table-style -->
|
4777
4804
|
|
4805
|
+
<xsl:attribute-set name="table-number-style">
|
4806
|
+
</xsl:attribute-set>
|
4807
|
+
|
4808
|
+
<xsl:template name="refine_table-number-style">
|
4809
|
+
</xsl:template>
|
4810
|
+
|
4778
4811
|
<xsl:attribute-set name="table-name-style">
|
4779
4812
|
<xsl:attribute name="role">Caption</xsl:attribute>
|
4780
4813
|
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
@@ -5230,7 +5263,7 @@
|
|
5230
5263
|
|
5231
5264
|
</fo:block>
|
5232
5265
|
|
5233
|
-
<!-- <xsl:if test="$namespace = 'bsi' or $namespace = 'iec' or $namespace = 'iso'"> -->
|
5266
|
+
<!-- <xsl:if test="$namespace = 'bsi' or $namespace = 'pas' or $namespace = 'iec' or $namespace = 'iso'"> -->
|
5234
5267
|
<xsl:if test="$continued = 'true'">
|
5235
5268
|
|
5236
5269
|
<!-- to prevent the error 'THead element may contain only TR elements' -->
|
@@ -8273,16 +8306,23 @@
|
|
8273
8306
|
</xsl:attribute-set> <!-- quote-style -->
|
8274
8307
|
|
8275
8308
|
<xsl:template name="refine_quote-style">
|
8276
|
-
</xsl:template>
|
8309
|
+
</xsl:template> <!-- refine_quote-style -->
|
8277
8310
|
|
8278
8311
|
<xsl:attribute-set name="quote-source-style">
|
8279
8312
|
<xsl:attribute name="text-align">right</xsl:attribute>
|
8280
8313
|
<xsl:attribute name="margin-right">25mm</xsl:attribute>
|
8281
|
-
</xsl:attribute-set>
|
8314
|
+
</xsl:attribute-set> <!-- quote-source-style -->
|
8282
8315
|
|
8283
8316
|
<xsl:template name="refine_quote-source-style">
|
8284
8317
|
</xsl:template>
|
8285
8318
|
|
8319
|
+
<xsl:attribute-set name="source-style">
|
8320
|
+
</xsl:attribute-set> <!-- source-style -->
|
8321
|
+
|
8322
|
+
<xsl:template name="refine_source-style">
|
8323
|
+
|
8324
|
+
</xsl:template> <!-- refine_source-style -->
|
8325
|
+
|
8286
8326
|
<!-- ====== -->
|
8287
8327
|
<!-- quote -->
|
8288
8328
|
<!-- source -->
|
@@ -8330,7 +8370,9 @@
|
|
8330
8370
|
</xsl:if>
|
8331
8371
|
<xsl:choose>
|
8332
8372
|
<xsl:when test="not(parent::quote)">
|
8333
|
-
<fo:block>
|
8373
|
+
<fo:block xsl:use-attribute-sets="source-style">
|
8374
|
+
<xsl:call-template name="refine_source-style"/>
|
8375
|
+
|
8334
8376
|
<xsl:call-template name="insert_basic_link">
|
8335
8377
|
<xsl:with-param name="element">
|
8336
8378
|
<fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
|
@@ -8377,6 +8419,12 @@
|
|
8377
8419
|
<xsl:template name="refine_figure-style">
|
8378
8420
|
</xsl:template>
|
8379
8421
|
|
8422
|
+
<xsl:attribute-set name="figure-number-style">
|
8423
|
+
</xsl:attribute-set>
|
8424
|
+
|
8425
|
+
<xsl:template name="refine_figure-number-style">
|
8426
|
+
</xsl:template>
|
8427
|
+
|
8380
8428
|
<xsl:attribute-set name="figure-name-style">
|
8381
8429
|
<xsl:attribute name="role">Caption</xsl:attribute>
|
8382
8430
|
<xsl:attribute name="font-size">11pt</xsl:attribute>
|
@@ -10425,7 +10473,7 @@
|
|
10425
10473
|
|
10426
10474
|
<xsl:template name="refine_fn-reference-style">
|
10427
10475
|
<!-- https://github.com/metanorma/metanorma-ieee/issues/595 -->
|
10428
|
-
<xsl:if test="preceding-sibling::node()[normalize-space() != ''][1][self::mn:fn]"
|
10476
|
+
<xsl:if test="preceding-sibling::node()[normalize-space() != ''][1][self::mn:fn]">, </xsl:if><!-- <xsl:if test="$namespace = 'bsi' or $namespace = 'pas'"></xsl:if> -->
|
10429
10477
|
</xsl:template> <!-- refine_fn-reference-style -->
|
10430
10478
|
|
10431
10479
|
<xsl:attribute-set name="fn-style">
|
@@ -10436,6 +10484,7 @@
|
|
10436
10484
|
</xsl:template>
|
10437
10485
|
|
10438
10486
|
<xsl:attribute-set name="fn-num-style">
|
10487
|
+
<xsl:attribute name="role">Reference</xsl:attribute>
|
10439
10488
|
<xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
|
10440
10489
|
<xsl:attribute name="font-size">65%</xsl:attribute>
|
10441
10490
|
<xsl:attribute name="vertical-align">super</xsl:attribute>
|
@@ -10511,33 +10560,16 @@
|
|
10511
10560
|
<xsl:variable name="ref_id" select="@target"/>
|
10512
10561
|
|
10513
10562
|
<xsl:variable name="footnote_inline">
|
10514
|
-
<fo:inline
|
10563
|
+
<fo:inline xsl:use-attribute-sets="fn-num-style">
|
10515
10564
|
|
10516
|
-
<xsl:
|
10517
|
-
<xsl:choose>
|
10518
|
-
<xsl:when test="ancestor::mn:bibitem">
|
10519
|
-
<fn_styles xsl:use-attribute-sets="bibitem-note-fn-style">
|
10520
|
-
<xsl:call-template name="refine_bibitem-note-fn-style"/>
|
10521
|
-
</fn_styles>
|
10522
|
-
</xsl:when>
|
10523
|
-
<xsl:otherwise>
|
10524
|
-
<fn_styles xsl:use-attribute-sets="fn-num-style">
|
10525
|
-
<xsl:call-template name="refine_fn-num-style"/>
|
10526
|
-
</fn_styles>
|
10527
|
-
</xsl:otherwise>
|
10528
|
-
</xsl:choose>
|
10529
|
-
</xsl:variable>
|
10530
|
-
|
10531
|
-
<xsl:for-each select="xalan:nodeset($fn_styles)/fn_styles/@*">
|
10532
|
-
<xsl:copy-of select="."/>
|
10533
|
-
</xsl:for-each>
|
10565
|
+
<xsl:call-template name="refine_fn-num-style"/>
|
10534
10566
|
|
10535
10567
|
<!-- https://github.com/metanorma/metanorma-ieee/issues/595 -->
|
10536
10568
|
<!-- <xsl:if test="following-sibling::node()[normalize-space() != ''][1][self::mn:fn]">
|
10537
10569
|
<xsl:attribute name="padding-right">0.5mm</xsl:attribute>
|
10538
10570
|
</xsl:if> -->
|
10539
10571
|
|
10540
|
-
<xsl:if test="preceding-sibling::node()[normalize-space() != ''][1][self::mn:fn]"
|
10572
|
+
<xsl:if test="preceding-sibling::node()[normalize-space() != ''][1][self::mn:fn]">, </xsl:if>
|
10541
10573
|
|
10542
10574
|
<xsl:call-template name="insert_basic_link">
|
10543
10575
|
<xsl:with-param name="element">
|
@@ -10850,30 +10882,6 @@
|
|
10850
10882
|
<xsl:template name="refine_bibitem-non-normative-list-body-style">
|
10851
10883
|
</xsl:template>
|
10852
10884
|
|
10853
|
-
<!-- footnote reference number for bibitem, in the text -->
|
10854
|
-
<xsl:attribute-set name="bibitem-note-fn-style">
|
10855
|
-
<xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
|
10856
|
-
<xsl:attribute name="font-size">65%</xsl:attribute>
|
10857
|
-
<xsl:attribute name="vertical-align">super</xsl:attribute>
|
10858
|
-
</xsl:attribute-set> <!-- bibitem-note-fn-style -->
|
10859
|
-
|
10860
|
-
<xsl:template name="refine_bibitem-note-fn-style">
|
10861
|
-
</xsl:template>
|
10862
|
-
|
10863
|
-
<!-- footnote number on the page bottom -->
|
10864
|
-
<xsl:attribute-set name="bibitem-note-fn-number-style">
|
10865
|
-
<xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
|
10866
|
-
<xsl:attribute name="font-size">60%</xsl:attribute>
|
10867
|
-
<xsl:attribute name="vertical-align">super</xsl:attribute>
|
10868
|
-
</xsl:attribute-set> <!-- bibitem-note-fn-number-style -->
|
10869
|
-
|
10870
|
-
<!-- footnote body (text) on the page bottom -->
|
10871
|
-
<xsl:attribute-set name="bibitem-note-fn-body-style">
|
10872
|
-
<xsl:attribute name="font-size">10pt</xsl:attribute>
|
10873
|
-
<xsl:attribute name="margin-bottom">12pt</xsl:attribute>
|
10874
|
-
<xsl:attribute name="start-indent">0pt</xsl:attribute>
|
10875
|
-
</xsl:attribute-set> <!-- bibitem-note-fn-body-style -->
|
10876
|
-
|
10877
10885
|
<xsl:attribute-set name="references-non-normative-style">
|
10878
10886
|
<xsl:attribute name="line-height">120%</xsl:attribute>
|
10879
10887
|
</xsl:attribute-set> <!-- references-non-normative-style -->
|
@@ -10954,7 +10962,7 @@
|
|
10954
10962
|
|
10955
10963
|
<fo:list-item>
|
10956
10964
|
<fo:list-item-label end-indent="label-end()">
|
10957
|
-
<fo:block role="SKIP">
|
10965
|
+
<fo:block role="SKIP" id="__internal_layout__bibitem_{@id}_{generate-id()}">
|
10958
10966
|
<fo:inline role="SKIP">
|
10959
10967
|
<xsl:apply-templates select="mn:biblio-tag">
|
10960
10968
|
<xsl:with-param name="biblio_tag_part">first</xsl:with-param>
|
@@ -11607,6 +11615,8 @@
|
|
11607
11615
|
<!-- =================== -->
|
11608
11616
|
|
11609
11617
|
<xsl:attribute-set name="toc-style">
|
11618
|
+
<xsl:attribute name="line-height">1.08</xsl:attribute>
|
11619
|
+
<xsl:attribute name="font-family">Lato</xsl:attribute>
|
11610
11620
|
</xsl:attribute-set>
|
11611
11621
|
|
11612
11622
|
<xsl:template name="refine_toc-style">
|
@@ -13198,10 +13208,28 @@
|
|
13198
13208
|
</xsl:choose>
|
13199
13209
|
</xsl:template>
|
13200
13210
|
|
13211
|
+
<xsl:attribute-set name="clause-style">
|
13212
|
+
|
13213
|
+
</xsl:attribute-set>
|
13214
|
+
|
13215
|
+
<xsl:template name="refine_clause-style">
|
13216
|
+
<!-- commented for https://github.com/metanorma/metanorma-ribose/issues/421 -->
|
13217
|
+
<!-- <xsl:if test="$namespace = 'rsd'">
|
13218
|
+
<xsl:variable name="level">
|
13219
|
+
<xsl:call-template name="getLevel">
|
13220
|
+
<xsl:with-param name="depth" select="mn:fmt-title/@depth"/>
|
13221
|
+
</xsl:call-template>
|
13222
|
+
</xsl:variable>
|
13223
|
+
<xsl:if test="$level >= 4">
|
13224
|
+
<xsl:attribute name="margin-left">13mm</xsl:attribute>
|
13225
|
+
</xsl:if>
|
13226
|
+
</xsl:if> -->
|
13227
|
+
</xsl:template>
|
13228
|
+
|
13201
13229
|
<!-- main sections -->
|
13202
13230
|
<xsl:template match="/*/mn:sections/*" name="sections_node" priority="2">
|
13203
13231
|
<xsl:call-template name="setNamedDestination"/>
|
13204
|
-
<fo:block>
|
13232
|
+
<fo:block role="Sect">
|
13205
13233
|
<xsl:call-template name="setId"/>
|
13206
13234
|
|
13207
13235
|
<xsl:call-template name="sections_element_style"/>
|
@@ -13329,6 +13357,10 @@
|
|
13329
13357
|
<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
|
13330
13358
|
</xsl:template>
|
13331
13359
|
|
13360
|
+
<!-- for case when update_xml_step1 (common.updatexml.xsl) doesn't apply when $table_if = 'true' -->
|
13361
|
+
<xsl:template match="mn:title[following-sibling::*[1][self::mn:fmt-title]]"/>
|
13362
|
+
<xsl:template match="mn:name[following-sibling::*[1][self::mn:fmt-name]]"/>
|
13363
|
+
|
13332
13364
|
<!-- insert fo:basic-link, if external-destination or internal-destination is non-empty, otherwise insert fo:inline -->
|
13333
13365
|
<xsl:template name="insert_basic_link">
|
13334
13366
|
<xsl:param name="element"/>
|
@@ -139,7 +139,7 @@ module IsoDoc
|
|
139
139
|
end
|
140
140
|
|
141
141
|
def insert_submitting_orgs(docxml)
|
142
|
-
orgs = docxml.xpath(
|
142
|
+
orgs = docxml.xpath(submittingorgs_path)
|
143
143
|
.each_with_object([]) { |org, m| m << org.text }
|
144
144
|
orgs.empty? and return
|
145
145
|
if a = submit_orgs_append_pt(docxml)
|
@@ -72,7 +72,8 @@ module Metanorma
|
|
72
72
|
end
|
73
73
|
end
|
74
74
|
|
75
|
-
|
75
|
+
# KILL
|
76
|
+
def section_names_terms_cleanupx(xml)
|
76
77
|
@i18n or return
|
77
78
|
replace_title(xml, "//definitions[@type = 'symbols']", @i18n.symbols)
|
78
79
|
replace_title(xml, "//definitions[@type = 'abbreviated_terms']",
|
@@ -95,6 +96,21 @@ module Metanorma
|
|
95
96
|
@i18n.termsdef, true)
|
96
97
|
end
|
97
98
|
|
99
|
+
# as in standoc, but do not rename annex terms
|
100
|
+
def section_names_terms1_cleanup(xml)
|
101
|
+
auto_name_terms(xml) or return
|
102
|
+
replace_title(xml, "//sections/terms#{SYM_NO_ABBR} | //sections/clause[@type = 'terms']#{SYM_NO_ABBR}",
|
103
|
+
@i18n&.termsdefsymbols, true)
|
104
|
+
replace_title(xml, "//sections/terms#{ABBR_NO_SYM} | //sections/clause[@type = 'terms']#{ABBR_NO_SYM}",
|
105
|
+
@i18n&.termsdefabbrev, true)
|
106
|
+
replace_title(xml, "//sections/terms#{SYMABBR} | //sections/clause[@type = 'terms']#{SYMABBR}",
|
107
|
+
@i18n&.termsdefsymbolsabbrev, true)
|
108
|
+
replace_title(xml, "//sections/terms#{NO_SYMABBR} | //sections/clause[@type = 'terms']#{NO_SYMABBR}",
|
109
|
+
@i18n&.termsdefsymbolsabbrev, true)
|
110
|
+
replace_title(xml, "//sections/terms[not(.//definitions)] | //sections/clause[@type = 'terms'][not(.//definitions)]",
|
111
|
+
@i18n&.termsdef, true)
|
112
|
+
end
|
113
|
+
|
98
114
|
def termdef_cleanup(xmldoc)
|
99
115
|
super
|
100
116
|
termdef_subclause_cleanup(xmldoc)
|
@@ -1,9 +1,11 @@
|
|
1
1
|
require "asciidoctor"
|
2
2
|
require "metanorma/standoc/converter"
|
3
3
|
require "fileutils"
|
4
|
+
require "date"
|
4
5
|
require_relative "front"
|
5
6
|
require_relative "validate"
|
6
7
|
require_relative "cleanup"
|
8
|
+
require_relative "sections"
|
7
9
|
|
8
10
|
module Metanorma
|
9
11
|
module Ogc
|
@@ -17,9 +19,6 @@ module Metanorma
|
|
17
19
|
@tocrecommendations = true
|
18
20
|
end
|
19
21
|
|
20
|
-
# ignore, we generate ToC outside of asciidoctor
|
21
|
-
def toc(value); end
|
22
|
-
|
23
22
|
def default_requirement_model
|
24
23
|
"ogc"
|
25
24
|
end
|
@@ -45,44 +44,35 @@ module Metanorma
|
|
45
44
|
d
|
46
45
|
end
|
47
46
|
|
48
|
-
def
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
def section(node)
|
57
|
-
override_style(node)
|
58
|
-
super
|
59
|
-
end
|
60
|
-
|
61
|
-
def override_style(node)
|
62
|
-
s = node.attr("style")
|
63
|
-
if %w(overview future_outlook value_proposition contributors).include?(s)
|
64
|
-
node.set_attr("style", "preface")
|
65
|
-
node.set_attr("type", s)
|
66
|
-
end
|
67
|
-
if %w(aims objectives topics outlook security).include?(s)
|
68
|
-
node.set_attr("type", s)
|
47
|
+
def document_scheme(node)
|
48
|
+
if r = node.attr("document-scheme")
|
49
|
+
r == "2022" ? "current" : "2021"
|
50
|
+
elsif r = node.attr("published-date")
|
51
|
+
published_date_scheme(r)
|
52
|
+
elsif r = node.attr("copyright-year")
|
53
|
+
r.to_i >= 2022 ? "current" : "2021"
|
54
|
+
else "current"
|
69
55
|
end
|
70
56
|
end
|
71
57
|
|
72
|
-
def
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
else super
|
79
|
-
end
|
58
|
+
def published_date_scheme(date_str)
|
59
|
+
published_date = parse_flexible_date(date_str) or return nil
|
60
|
+
cutoff_date = Date.new(2021, 11, 8)
|
61
|
+
published_date >= cutoff_date ? "current" : "2021"
|
62
|
+
rescue Date::Error, ArgumentError
|
63
|
+
nil
|
80
64
|
end
|
81
65
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
66
|
+
def parse_flexible_date(date_str)
|
67
|
+
case date_str
|
68
|
+
when /^\d{4}$/
|
69
|
+
Date.new(date_str.to_i, 1, 1)
|
70
|
+
when /^\d{4}-\d{2}$/
|
71
|
+
year, month = date_str.split("-").map(&:to_i)
|
72
|
+
Date.new(year, month, 1)
|
73
|
+
else
|
74
|
+
Date.parse(date_str)
|
75
|
+
end
|
86
76
|
end
|
87
77
|
|
88
78
|
def outputs(node, ret)
|
@@ -96,75 +86,15 @@ module Metanorma
|
|
96
86
|
false, "#{@filename}.pdf")
|
97
87
|
end
|
98
88
|
|
99
|
-
def clause_parse(attrs, xml, node)
|
100
|
-
%w(overview future_outlook value_proposition
|
101
|
-
contributors aims objectives topics outlook security)
|
102
|
-
.include?(node.attr("type")) and
|
103
|
-
attrs = attrs.merge(type: node.attr("type"))
|
104
|
-
case node.attr("heading")&.downcase || node.title.downcase
|
105
|
-
when "submitters"
|
106
|
-
return submitters_parse(attrs.merge(type: "submitters"), xml, node)
|
107
|
-
when "contributors"
|
108
|
-
return submitters_parse(attrs.merge(type: "contributors"), xml, node)
|
109
|
-
when "conformance" then attrs = attrs.merge(type: "conformance")
|
110
|
-
when "security considerations"
|
111
|
-
attrs = attrs.merge(type: "security")
|
112
|
-
end
|
113
|
-
super
|
114
|
-
end
|
115
|
-
|
116
|
-
def submitters_parse(attrs, xml, node)
|
117
|
-
title = @i18n.submitters
|
118
|
-
doctype(node) == "engineering-report" ||
|
119
|
-
attrs[:type] == "contributors" and
|
120
|
-
title = @i18n.contributors_clause
|
121
|
-
xml.clause **attr_code(attrs) do |xml_section|
|
122
|
-
section_title(xml_section, title)
|
123
|
-
xml_section << node.content
|
124
|
-
end
|
125
|
-
end
|
126
|
-
|
127
89
|
def style(_node, _text)
|
128
90
|
nil
|
129
91
|
end
|
130
92
|
|
131
|
-
def term_def_parse(attrs, xml, node, _toplevel)
|
132
|
-
if node.attr("style") == "appendix" && node.level == 1
|
133
|
-
terms_annex_parse(attrs, xml, node)
|
134
|
-
else
|
135
|
-
super
|
136
|
-
end
|
137
|
-
end
|
138
|
-
|
139
93
|
def table_cell(node, xml_tr, tblsec)
|
140
94
|
node.set_attr("valign", "middle")
|
141
95
|
super
|
142
96
|
end
|
143
97
|
|
144
|
-
def terms_annex_parse(attrs, xml, node)
|
145
|
-
attrs1 = attrs.merge(id: "_#{UUIDTools::UUID.random_create}")
|
146
|
-
xml.annex **attr_code(attrs1) do |xml_section|
|
147
|
-
section_title(xml_section, node.title)
|
148
|
-
attrs.delete(:anchor)
|
149
|
-
xml_section.terms **attr_code(attrs) do |terms|
|
150
|
-
(s = node.attr("source")) && s.split(",").each do |s1|
|
151
|
-
terms.termdocsource(nil, **attr_code(bibitemid: s1))
|
152
|
-
end
|
153
|
-
terms << node.content
|
154
|
-
end
|
155
|
-
end
|
156
|
-
end
|
157
|
-
|
158
|
-
def set_obligation(attrs, node)
|
159
|
-
if node.attr("style") == "appendix" && node.level == 1
|
160
|
-
attrs[:obligation] = if node.attributes.has_key?("obligation")
|
161
|
-
node.attr("obligation")
|
162
|
-
else "informative"
|
163
|
-
end
|
164
|
-
else super
|
165
|
-
end
|
166
|
-
end
|
167
|
-
|
168
98
|
OGC_COLORS = {
|
169
99
|
"text": "rgb(88, 89, 91)",
|
170
100
|
"secondary-shade-1": "rgb(237, 193, 35)",
|
@@ -202,7 +132,7 @@ module Metanorma
|
|
202
132
|
|
203
133
|
def update_colors(node)
|
204
134
|
c = OGC_COLORS.dup
|
205
|
-
if document_scheme(node) == "
|
135
|
+
if document_scheme(node) == "current"
|
206
136
|
c[:"secondary-shade-1"] = "rgb(0, 177, 255)"
|
207
137
|
c[:"secondary-shade-2"] = "rgb(0, 177, 255)"
|
208
138
|
end
|
@@ -236,11 +166,12 @@ module Metanorma
|
|
236
166
|
# preempt subdoctype warning
|
237
167
|
def adoc2xml(text, flavour)
|
238
168
|
Nokogiri::XML(text).root and return text
|
239
|
-
c =
|
240
|
-
|
169
|
+
c = isolated_asciidoctor_convert(
|
170
|
+
"= X\nA\n:semantic-metadata-headless: true\n" \
|
241
171
|
":novalid:\n:docsubtype: implementation\n" \
|
242
172
|
":doctype: standard\n\n#{text}\n",
|
243
|
-
|
173
|
+
backend: flavour, header_footer: true,
|
174
|
+
)
|
244
175
|
Nokogiri::XML(c).at("//xmlns:sections")
|
245
176
|
end
|
246
177
|
end
|
data/lib/metanorma/ogc/front.rb
CHANGED
@@ -86,7 +86,7 @@ module Metanorma
|
|
86
86
|
{ "Open Geospatial Consortium" => "OGC" }
|
87
87
|
end
|
88
88
|
|
89
|
-
def metadata_committee_types(
|
89
|
+
def metadata_committee_types(_node)
|
90
90
|
%w(committee subcommittee workgroup)
|
91
91
|
end
|
92
92
|
|
@@ -184,9 +184,8 @@ module Metanorma
|
|
184
184
|
|
185
185
|
def title(node, xml)
|
186
186
|
super
|
187
|
-
|
188
|
-
|
189
|
-
xml.title a, **attr_code(at)
|
187
|
+
content = node.attr("abbrev") and
|
188
|
+
add_title_xml(xml, content, @lang, "abbrev")
|
190
189
|
end
|
191
190
|
end
|
192
191
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
2
|
<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">
|
3
|
-
<!-- VERSION v2.1.
|
3
|
+
<!-- VERSION v2.1.3 -->
|
4
4
|
|
5
5
|
<!--
|
6
6
|
ALERT: cannot have root comments, because of https://github.com/metanorma/metanorma/issues/437
|
@@ -455,14 +455,7 @@ normative or informative references, some split references into sections organiz
|
|
455
455
|
</ref>
|
456
456
|
</zeroOrMore>
|
457
457
|
<zeroOrMore>
|
458
|
-
<ref name="
|
459
|
-
<a:documentation>Bibliographic item cited in the document</a:documentation>
|
460
|
-
</ref>
|
461
|
-
<zeroOrMore>
|
462
|
-
<ref name="note">
|
463
|
-
<a:documentation>Annotation of the bibliographic item</a:documentation>
|
464
|
-
</ref>
|
465
|
-
</zeroOrMore>
|
458
|
+
<ref name="ReferenceEntry"/>
|
466
459
|
</zeroOrMore>
|
467
460
|
<zeroOrMore>
|
468
461
|
<ref name="references">
|
@@ -604,18 +597,21 @@ gives an explicit page orientation</a:documentation>
|
|
604
597
|
</element>
|
605
598
|
</optional>
|
606
599
|
</define>
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
<attribute name="hiddenref">
|
613
|
-
<a:documentation>If true, number the footnote as normal, but suppress display of the footnote reference in the document body.
|
600
|
+
<define name="FnAttributes">
|
601
|
+
<ref name="RequiredId"/>
|
602
|
+
<optional>
|
603
|
+
<attribute name="hiddenref">
|
604
|
+
<a:documentation>If true, number the footnote as normal, but suppress display of the footnote reference in the document body.
|
614
605
|
This is done if the footnote reference is already presented in some other form, e.g. within a figure image.</a:documentation>
|
615
|
-
|
606
|
+
<data type="boolean"/>
|
607
|
+
</attribute>
|
608
|
+
</optional>
|
609
|
+
<attribute name="reference">
|
610
|
+
<a:documentation>The number of the footnote, used to identify it visually</a:documentation>
|
616
611
|
</attribute>
|
617
|
-
</
|
618
|
-
</
|
612
|
+
</define>
|
613
|
+
</include>
|
614
|
+
<!-- end overrides -->
|
619
615
|
<define name="TdAttributes" combine="interleave">
|
620
616
|
<ref name="RequiredId"/>
|
621
617
|
<optional>
|
@@ -853,6 +849,17 @@ titlecase, or lowercase</a:documentation>
|
|
853
849
|
<value>informative</value>
|
854
850
|
</choice>
|
855
851
|
</define>
|
852
|
+
<define name="ReferenceEntry">
|
853
|
+
<a:documentation>Entry in bibliography</a:documentation>
|
854
|
+
<ref name="doc_bibitem">
|
855
|
+
<a:documentation>Bibliographic item cited in the document</a:documentation>
|
856
|
+
</ref>
|
857
|
+
<zeroOrMore>
|
858
|
+
<ref name="note">
|
859
|
+
<a:documentation>Annotation of the bibliographic item</a:documentation>
|
860
|
+
</ref>
|
861
|
+
</zeroOrMore>
|
862
|
+
</define>
|
856
863
|
<define name="doc_bibitem">
|
857
864
|
<a:documentation>Standardisation document representation of bibliographic entry</a:documentation>
|
858
865
|
<element name="bibitem">
|