metanorma-ogc 2.5.14 → 2.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/lib/isodoc/ogc/html/htmlstyle.css +41 -1
  3. data/lib/isodoc/ogc/html/htmlstyle.scss +1 -1
  4. data/lib/isodoc/ogc/html/ogc.css +1 -1
  5. data/lib/isodoc/ogc/html/ogc.scss +1 -1
  6. data/lib/isodoc/ogc/html_convert.rb +19 -2
  7. data/lib/isodoc/ogc/i18n-en.yaml +15 -9
  8. data/lib/isodoc/ogc/metadata.rb +11 -0
  9. data/lib/isodoc/ogc/ogc.abstract-specification-topic.xsl +253 -76
  10. data/lib/isodoc/ogc/ogc.best-practice.xsl +253 -76
  11. data/lib/isodoc/ogc/ogc.change-request-supporting-document.xsl +253 -76
  12. data/lib/isodoc/ogc/ogc.community-practice.xsl +253 -76
  13. data/lib/isodoc/ogc/ogc.community-standard.xsl +253 -76
  14. data/lib/isodoc/ogc/ogc.discussion-paper.xsl +253 -76
  15. data/lib/isodoc/ogc/ogc.draft-standard.xsl +253 -76
  16. data/lib/isodoc/ogc/ogc.engineering-report.xsl +253 -76
  17. data/lib/isodoc/ogc/ogc.other.xsl +253 -76
  18. data/lib/isodoc/ogc/ogc.policy.xsl +253 -76
  19. data/lib/isodoc/ogc/ogc.reference-model.xsl +253 -76
  20. data/lib/isodoc/ogc/ogc.release-notes.xsl +253 -76
  21. data/lib/isodoc/ogc/ogc.standard.xsl +253 -76
  22. data/lib/isodoc/ogc/ogc.test-suite.xsl +253 -76
  23. data/lib/isodoc/ogc/ogc.user-guide.xsl +253 -76
  24. data/lib/isodoc/ogc/ogc.white-paper.xsl +108 -40
  25. data/lib/isodoc/ogc/presentation_xml_convert.rb +15 -1
  26. data/lib/isodoc/ogc/word_convert.rb +1 -1
  27. data/lib/isodoc/ogc/xref.rb +20 -0
  28. data/lib/metanorma/ogc/basicdoc.rng +71 -6
  29. data/lib/metanorma/ogc/biblio.rng +3 -1
  30. data/lib/metanorma/ogc/cleanup.rb +1 -1
  31. data/lib/metanorma/ogc/converter.rb +70 -0
  32. data/lib/metanorma/ogc/isodoc.rng +8 -5
  33. data/lib/metanorma/ogc/reqt.rng +3 -0
  34. data/lib/metanorma/ogc/version.rb +1 -1
  35. data/metanorma-ogc.gemspec +1 -1
  36. metadata +4 -4
@@ -23,12 +23,9 @@
23
23
  <xsl:variable name="selectedStyle" select="normalize-space($selectedStyle_)"/>
24
24
 
25
25
  <xsl:variable name="color">rgb(0, 51, 102)</xsl:variable>
26
- <xsl:variable name="color_design">
27
- <xsl:choose>
28
- <xsl:when test="$selectedStyle = '2'">rgb(0, 177, 255)</xsl:when>
29
- <xsl:otherwise>rgb(237, 193, 35)</xsl:otherwise>
30
- </xsl:choose>
31
- </xsl:variable>
26
+
27
+ <xsl:variable name="color_text_title" select="/ogc:ogc-standard/ogc:metanorma-extension/ogc:presentation-metadata[ogc:name = 'color-text-title']/ogc:value"/>
28
+ <xsl:variable name="color_table_header_row" select="/ogc:ogc-standard/ogc:metanorma-extension/ogc:presentation-metadata[ogc:name = 'color-background-table-header']/ogc:value"/>
32
29
 
33
30
  <xsl:attribute-set name="title-toc-style">
34
31
  <xsl:attribute name="font-size">26pt</xsl:attribute>
@@ -86,12 +83,6 @@
86
83
  <xsl:template match="/">
87
84
  <xsl:call-template name="namespaceCheck"/>
88
85
 
89
- <xsl:variable name="updated_xml_step1">
90
- <xsl:apply-templates mode="update_xml_step1"/>
91
- </xsl:variable>
92
-
93
- <xsl:for-each select="xalan:nodeset($updated_xml_step1)">
94
-
95
86
  <fo:root xml:lang="{$lang}">
96
87
  <xsl:variable name="root-style">
97
88
  <root-style xsl:use-attribute-sets="root-style"/>
@@ -286,7 +277,6 @@
286
277
 
287
278
  </fo:root>
288
279
 
289
- </xsl:for-each>
290
280
  </xsl:template>
291
281
 
292
282
  <xsl:template name="processPrefaceAndMainSectionsOGC_items">
@@ -2642,13 +2632,35 @@
2642
2632
  </xsl:for-each>
2643
2633
  </xsl:element>
2644
2634
 
2645
- <xsl:call-template name="insertAnnexInSeparatePageSequences"/>
2635
+ <xsl:call-template name="insertAnnexAndBibliographyInSeparatePageSequences"/>
2646
2636
 
2647
- <xsl:call-template name="insertBibliographyInSeparatePageSequences"/>
2637
+ <!-- <xsl:call-template name="insertBibliographyInSeparatePageSequences"/> -->
2648
2638
 
2649
2639
  <!-- <xsl:call-template name="insertIndexInSeparatePageSequences"/> -->
2650
2640
  </xsl:template> <!-- END: insertMainSectionsInSeparatePageSequences -->
2651
2641
 
2642
+ <xsl:template name="insertAnnexAndBibliographyInSeparatePageSequences">
2643
+ <xsl:for-each select="/*/*[local-name()='annex'] | /*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]] | /*/*[local-name()='indexsect']">
2644
+ <xsl:sort select="@displayorder" data-type="number"/>
2645
+ <xsl:choose>
2646
+ <xsl:when test="local-name() = 'annex' or local-name() = 'indexsect'">
2647
+ <xsl:element name="page_sequence" namespace="{$namespace_full}">
2648
+ <xsl:attribute name="main_page_sequence"/>
2649
+ <xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
2650
+ </xsl:element>
2651
+ </xsl:when>
2652
+ <xsl:otherwise> <!-- bibliography -->
2653
+ <xsl:element name="bibliography" namespace="{$namespace_full}"> <!-- save context element -->
2654
+ <xsl:element name="page_sequence" namespace="{$namespace_full}">
2655
+ <xsl:attribute name="main_page_sequence"/>
2656
+ <xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
2657
+ </xsl:element>
2658
+ </xsl:element>
2659
+ </xsl:otherwise>
2660
+ </xsl:choose>
2661
+ </xsl:for-each>
2662
+ </xsl:template>
2663
+
2652
2664
  <xsl:template name="insertAnnexInSeparatePageSequences">
2653
2665
  <xsl:for-each select="/*/*[local-name()='annex']">
2654
2666
  <xsl:sort select="@displayorder" data-type="number"/>
@@ -6885,6 +6897,12 @@
6885
6897
  <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
6886
6898
  <attachment filename="{@name}"/>
6887
6899
  </xsl:for-each>
6900
+ <xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
6901
+ <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
6902
+ <xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
6903
+ <attachment filename="{$attachment_path}"/>
6904
+ </xsl:for-each>
6905
+ </xsl:if>
6888
6906
  </xsl:variable>
6889
6907
  <xsl:variable name="pdfAttachmentsList" select="xalan:nodeset($pdfAttachmentsList_)"/>
6890
6908
 
@@ -6897,7 +6915,7 @@
6897
6915
  <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
6898
6916
  </xsl:when>
6899
6917
  <!-- link to the PDF attachment -->
6900
- <xsl:when test="$pdfAttachmentsList//attachment[@filename = current()/@target]">
6918
+ <xsl:when test="@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target]">
6901
6919
  <xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
6902
6920
  </xsl:when>
6903
6921
  <!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
@@ -7546,7 +7564,16 @@
7546
7564
  </xsl:variable>
7547
7565
  <xsl:variable name="img_src">
7548
7566
  <xsl:choose>
7549
- <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
7567
+ <xsl:when test="not(starts-with(@src, 'data:'))">
7568
+ <xsl:choose>
7569
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
7570
+ <xsl:value-of select="@src"/>
7571
+ </xsl:when>
7572
+ <xsl:otherwise>
7573
+ <xsl:value-of select="concat($basepath, @src)"/>
7574
+ </xsl:otherwise>
7575
+ </xsl:choose>
7576
+ </xsl:when>
7550
7577
  <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
7551
7578
  </xsl:choose>
7552
7579
  </xsl:variable>
@@ -7559,7 +7586,7 @@
7559
7586
  <!-- <xsl:message>width_effective=<xsl:value-of select="$width_effective"/></xsl:message>
7560
7587
  <xsl:message>indent_left=<xsl:value-of select="$indent_left"/></xsl:message>
7561
7588
  <xsl:message>image_width_effective=<xsl:value-of select="$image_width_effective"/> for <xsl:value-of select="ancestor::ogc:p[1]/@id"/></xsl:message> -->
7562
- <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
7589
+ <xsl:variable name="scale" select="java:org.metanorma.fop.utils.ImageUtils.getImageScale($img_src, $image_width_effective, $height_effective)"/>
7563
7590
  <xsl:value-of select="$scale"/>
7564
7591
  </xsl:template>
7565
7592
 
@@ -7578,7 +7605,14 @@
7578
7605
  <xsl:value-of select="concat('url(file:///',$basepath, $src_png, ')')"/>
7579
7606
  </xsl:when>
7580
7607
  <xsl:when test="not(starts-with(@src, 'data:'))">
7581
- <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
7608
+ <xsl:choose>
7609
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
7610
+ <xsl:value-of select="concat('url(file:///', @src, ')')"/>
7611
+ </xsl:when>
7612
+ <xsl:otherwise>
7613
+ <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
7614
+ </xsl:otherwise>
7615
+ </xsl:choose>
7582
7616
  </xsl:when>
7583
7617
  <xsl:otherwise>
7584
7618
  <xsl:value-of select="@src"/>
@@ -7600,7 +7634,14 @@
7600
7634
  </xsl:when>
7601
7635
  <xsl:when test="not(starts-with(@src, 'data:'))">
7602
7636
  <xsl:variable name="src">
7603
- <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
7637
+ <xsl:choose>
7638
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
7639
+ <xsl:value-of select="concat('url(file:///', @src, ')')"/>
7640
+ </xsl:when>
7641
+ <xsl:otherwise>
7642
+ <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
7643
+ </xsl:otherwise>
7644
+ </xsl:choose>
7604
7645
  </xsl:variable>
7605
7646
  <xsl:variable name="file" select="java:java.io.File.new(@src)"/>
7606
7647
  <xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
@@ -9325,7 +9366,7 @@
9325
9366
 
9326
9367
  <xsl:attribute name="font-weight">normal</xsl:attribute>
9327
9368
  <xsl:if test="parent::*[local-name()='thead']"> <!-- and not(ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']) -->
9328
- <xsl:attribute name="background-color">rgb(33, 55, 92)</xsl:attribute>
9369
+ <xsl:attribute name="background-color"><xsl:value-of select="$color_table_header_row"/></xsl:attribute>
9329
9370
  </xsl:if>
9330
9371
  <xsl:if test="starts-with(*[local-name()='td'][1], 'Requirement ')">
9331
9372
  <xsl:attribute name="background-color">rgb(252, 246, 222)</xsl:attribute>
@@ -11257,6 +11298,12 @@
11257
11298
 
11258
11299
  <xsl:call-template name="setBlockSpanAll"/>
11259
11300
 
11301
+ <xsl:variable name="admonition_color" select="normalize-space(/ogc:ogc-standard/ogc:metanorma-extension/ogc:presentation-metadata[ogc:name = concat('color-admonition-', @type)]/ogc:value)"/>
11302
+ <xsl:if test="$admonition_color != ''">
11303
+ <xsl:attribute name="border">0.5pt solid <xsl:value-of select="$admonition_color"/></xsl:attribute>
11304
+ <xsl:attribute name="color"><xsl:value-of select="$admonition_color"/></xsl:attribute>
11305
+ </xsl:if>
11306
+
11260
11307
  <fo:block-container xsl:use-attribute-sets="admonition-container-style" role="SKIP">
11261
11308
 
11262
11309
  <fo:block xsl:use-attribute-sets="admonition-name-style">
@@ -11532,10 +11579,12 @@
11532
11579
  <xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']" mode="update_xml_step1">
11533
11580
  <xsl:copy>
11534
11581
  <xsl:copy-of select="@*"/>
11535
- <xsl:variable name="name_filepath" select="concat($inputxml_basepath, @name)"/>
11536
- <xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($name_filepath)))"/>
11537
- <xsl:if test="$file_exists = 'false'"> <!-- copy attachment content only if file on disk doesnt exist -->
11538
- <xsl:value-of select="."/>
11582
+ <xsl:if test="1 = 2"> <!-- remove attachment/text(), because attachments added in the template 'addPDFUAmeta' before applying 'update_xml_step1' -->
11583
+ <xsl:variable name="name_filepath" select="concat($inputxml_basepath, @name)"/>
11584
+ <xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($name_filepath)))"/>
11585
+ <xsl:if test="$file_exists = 'false'"> <!-- copy attachment content only if file on disk doesnt exist -->
11586
+ <xsl:value-of select="normalize-space(.)"/>
11587
+ </xsl:if>
11539
11588
  </xsl:if>
11540
11589
  </xsl:copy>
11541
11590
  </xsl:template>
@@ -12408,25 +12457,37 @@
12408
12457
  </x:xmpmeta>
12409
12458
  <!-- add attachments -->
12410
12459
  <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
12411
- <xsl:choose>
12412
- <xsl:when test="normalize-space() != ''">
12413
- <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{.}" filename="{@name}"/>
12414
- </xsl:when>
12415
- <xsl:otherwise>
12416
- <!-- _{filename}_attachments -->
12417
- <!-- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/> -->
12418
- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
12419
- <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{@name}"/>
12420
- </xsl:otherwise>
12421
- </xsl:choose>
12460
+ <xsl:variable name="description" select="normalize-space(//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]/*[local-name() = 'formattedref'])"/>
12461
+
12462
+ <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" filename="{@name}">
12463
+ <xsl:attribute name="src">
12464
+ <xsl:choose>
12465
+ <xsl:when test="normalize-space() != ''">
12466
+ <xsl:variable name="src_attachment" select="java:replaceAll(java:java.lang.String.new(.),'(&#13;&#10;|&#13;|&#10;)', '')"/> <!-- remove line breaks -->
12467
+ <xsl:value-of select="$src_attachment"/>
12468
+ </xsl:when>
12469
+ <xsl:otherwise>
12470
+ <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
12471
+ <xsl:value-of select="$url"/>
12472
+ </xsl:otherwise>
12473
+ </xsl:choose>
12474
+ </xsl:attribute>
12475
+ <xsl:if test="$description != ''">
12476
+ <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
12477
+ </xsl:if>
12478
+ </pdf:embedded-file>
12422
12479
  </xsl:for-each>
12423
12480
  <!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
12424
12481
  <xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
12425
12482
  <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
12426
12483
  <xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
12427
- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, $attachment_path, ')')"/>
12428
- <xsl:variable name="filename_embedded" select="substring-after($attachment_path, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
12429
- <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{$filename_embedded}"/>
12484
+ <xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
12485
+ <xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
12486
+ <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{$attachment_path}">
12487
+ <xsl:if test="$description != ''">
12488
+ <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
12489
+ </xsl:if>
12490
+ </pdf:embedded-file>
12430
12491
  </xsl:for-each>
12431
12492
  </xsl:if>
12432
12493
  </xsl:template> <!-- addPDFUAmeta -->
@@ -12804,7 +12865,14 @@
12804
12865
  <xsl:value-of select="$src"/>
12805
12866
  </xsl:when>
12806
12867
  <xsl:otherwise>
12807
- <xsl:value-of select="concat('url(file:///',$basepath, $src, ')')"/>
12868
+ <xsl:choose>
12869
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
12870
+ <xsl:value-of select="concat('url(file:///', @src, ')')"/>
12871
+ </xsl:when>
12872
+ <xsl:otherwise>
12873
+ <xsl:value-of select="concat('url(file:///',$basepath, $src, ')')"/>
12874
+ </xsl:otherwise>
12875
+ </xsl:choose>
12808
12876
  </xsl:otherwise>
12809
12877
  </xsl:choose>
12810
12878
  </xsl:template>
@@ -12,6 +12,7 @@ module IsoDoc
12
12
 
13
13
  def convert1(docxml, filename, dir)
14
14
  info docxml, nil
15
+ unnumber_biblio(docxml)
15
16
  super
16
17
  end
17
18
 
@@ -179,7 +180,7 @@ module IsoDoc
179
180
  end
180
181
 
181
182
  def deprecates(elem)
182
- elem << "&#xa0;<span class='AdmittedLabel'>#{@i18n.deprecated}</span>"
183
+ elem << "&#xa0;<span class='DeprecatedLabel'>#{@i18n.deprecated}</span>"
183
184
  end
184
185
 
185
186
  def admits(elem)
@@ -193,6 +194,19 @@ module IsoDoc
193
194
  l10n("#{lower2cap @i18n.sourcecode} #{lbl}"), "name")
194
195
  end
195
196
 
197
+ def references(docxml)
198
+ unnumber_biblio(docxml)
199
+ super
200
+ end
201
+
202
+ # prevent Eng Rept Biblio, which appears before Annexes, being numbered
203
+ # needs to happen before xrefs first invoked
204
+ def unnumber_biblio(docxml)
205
+ @doctype == "engineering-report" or return
206
+ b = docxml.at(ns(@xrefs.klass.bibliography_xpath)) or return
207
+ b["unnumbered"] = true
208
+ end
209
+
196
210
  include Init
197
211
  end
198
212
  end
@@ -64,7 +64,7 @@ module IsoDoc
64
64
  end
65
65
 
66
66
  def header_strip(hdr)
67
- hdr = hdr.to_s.gsub(/<\/?p[^>]*>/, "")
67
+ hdr = hdr.to_s.gsub(/<\/?p[^<>]*>/, "")
68
68
  super
69
69
  end
70
70
 
@@ -19,6 +19,26 @@ module IsoDoc
19
19
  end
20
20
  end
21
21
 
22
+ def clause_order_annex(_docxml)
23
+ if @doctype == "engineering-report"
24
+ [
25
+ { path: @klass.bibliography_xpath },
26
+ { path: "//annex", multi: true },
27
+ ]
28
+ else super
29
+ end
30
+ end
31
+
32
+ def clause_order_back(_docxml)
33
+ if @doctype == "engineering-report"
34
+ [
35
+ { path: "//indexsect", multi: true },
36
+ { path: "//colophon/*", multi: true },
37
+ ]
38
+ else super
39
+ end
40
+ end
41
+
22
42
  def middle_section_asset_names(doc)
23
43
  middle_sections =
24
44
  "//clause[@type = 'scope' or @type = 'conformance'] | //foreword | " \
@@ -1000,14 +1000,14 @@
1000
1000
  <define name="PureTextElement">
1001
1001
  <choice>
1002
1002
  <text/>
1003
- <ref name="em"/>
1004
- <ref name="strong"/>
1003
+ <ref name="pure_em"/>
1004
+ <ref name="pure_strong"/>
1005
1005
  <ref name="sub"/>
1006
1006
  <ref name="sup"/>
1007
- <ref name="tt"/>
1008
- <ref name="underline"/>
1009
- <ref name="strike"/>
1010
- <ref name="smallcap"/>
1007
+ <ref name="pure_tt"/>
1008
+ <ref name="pure_underline"/>
1009
+ <ref name="pure_strike"/>
1010
+ <ref name="pure_smallcap"/>
1011
1011
  <ref name="br"/>
1012
1012
  </choice>
1013
1013
  </define>
@@ -1031,6 +1031,13 @@
1031
1031
  </zeroOrMore>
1032
1032
  </element>
1033
1033
  </define>
1034
+ <define name="pure_em">
1035
+ <element name="em">
1036
+ <zeroOrMore>
1037
+ <ref name="PureTextElement"/>
1038
+ </zeroOrMore>
1039
+ </element>
1040
+ </define>
1034
1041
  <define name="strong">
1035
1042
  <element name="strong">
1036
1043
  <zeroOrMore>
@@ -1046,6 +1053,13 @@
1046
1053
  </zeroOrMore>
1047
1054
  </element>
1048
1055
  </define>
1056
+ <define name="pure_strong">
1057
+ <element name="strong">
1058
+ <zeroOrMore>
1059
+ <ref name="PureTextElement"/>
1060
+ </zeroOrMore>
1061
+ </element>
1062
+ </define>
1049
1063
  <define name="tt">
1050
1064
  <element name="tt">
1051
1065
  <zeroOrMore>
@@ -1060,6 +1074,13 @@
1060
1074
  </zeroOrMore>
1061
1075
  </element>
1062
1076
  </define>
1077
+ <define name="pure_tt">
1078
+ <element name="tt">
1079
+ <zeroOrMore>
1080
+ <ref name="PureTextElement"/>
1081
+ </zeroOrMore>
1082
+ </element>
1083
+ </define>
1063
1084
  <define name="keyword">
1064
1085
  <element name="keyword">
1065
1086
  <zeroOrMore>
@@ -1090,13 +1111,42 @@
1090
1111
  <zeroOrMore>
1091
1112
  <choice>
1092
1113
  <ref name="PureTextElement"/>
1114
+ <ref name="stem"/>
1115
+ <ref name="eref"/>
1116
+ <ref name="xref"/>
1117
+ <ref name="hyperlink"/>
1093
1118
  <ref name="index"/>
1094
1119
  <ref name="index-xref"/>
1095
1120
  </choice>
1096
1121
  </zeroOrMore>
1097
1122
  </element>
1098
1123
  </define>
1124
+ <define name="pure_strike">
1125
+ <element name="strike">
1126
+ <zeroOrMore>
1127
+ <ref name="PureTextElement"/>
1128
+ </zeroOrMore>
1129
+ </element>
1130
+ </define>
1099
1131
  <define name="underline">
1132
+ <element name="underline">
1133
+ <optional>
1134
+ <attribute name="style"/>
1135
+ </optional>
1136
+ <zeroOrMore>
1137
+ <choice>
1138
+ <ref name="PureTextElement"/>
1139
+ <ref name="stem"/>
1140
+ <ref name="eref"/>
1141
+ <ref name="xref"/>
1142
+ <ref name="hyperlink"/>
1143
+ <ref name="index"/>
1144
+ <ref name="index-xref"/>
1145
+ </choice>
1146
+ </zeroOrMore>
1147
+ </element>
1148
+ </define>
1149
+ <define name="pure_underline">
1100
1150
  <element name="underline">
1101
1151
  <optional>
1102
1152
  <attribute name="style"/>
@@ -1107,6 +1157,21 @@
1107
1157
  </element>
1108
1158
  </define>
1109
1159
  <define name="smallcap">
1160
+ <element name="smallcap">
1161
+ <zeroOrMore>
1162
+ <choice>
1163
+ <ref name="PureTextElement"/>
1164
+ <ref name="stem"/>
1165
+ <ref name="eref"/>
1166
+ <ref name="xref"/>
1167
+ <ref name="hyperlink"/>
1168
+ <ref name="index"/>
1169
+ <ref name="index-xref"/>
1170
+ </choice>
1171
+ </zeroOrMore>
1172
+ </element>
1173
+ </define>
1174
+ <define name="pure_smallcap">
1110
1175
  <element name="smallcap">
1111
1176
  <zeroOrMore>
1112
1177
  <ref name="PureTextElement"/>
@@ -1204,7 +1204,9 @@
1204
1204
  <optional>
1205
1205
  <ref name="formattedref"/>
1206
1206
  </optional>
1207
- <ref name="btitle"/>
1207
+ <oneOrMore>
1208
+ <ref name="btitle"/>
1209
+ </oneOrMore>
1208
1210
  <optional>
1209
1211
  <ref name="bplace"/>
1210
1212
  </optional>
@@ -231,7 +231,7 @@ module Metanorma
231
231
  def symbol_key(sym)
232
232
  @c.decode(asciimath_key(sym).text)
233
233
  .gsub(/[\[\]{}<>()]/, "").gsub(/\s/m, "")
234
- .gsub(/[[:punct:]]|[_^]/, ":\\0").gsub("`", "")
234
+ .gsub(/[[:punct:]]|[_^]/, ":\\0").delete("`")
235
235
  end
236
236
 
237
237
  def symbols_cleanup(docxml)
@@ -64,6 +64,24 @@ module Metanorma
64
64
  super
65
65
  end
66
66
 
67
+ def section(node)
68
+ override_style(node)
69
+ super
70
+ end
71
+
72
+ def override_style(node)
73
+ s = node.attr("style")
74
+ if %w(executive_summary overview future_outlook value_proposition
75
+ contributors).include?(s)
76
+ node.set_attr("style", "preface")
77
+ s == "executive_summary" and s = "executivesummary"
78
+ node.set_attr("type", s)
79
+ end
80
+ if %w(aims objectives topics outlook security).include?(s)
81
+ node.set_attr("type", s)
82
+ end
83
+ end
84
+
67
85
  def sectiontype_streamline(ret)
68
86
  case ret
69
87
  when "preface" then "foreword"
@@ -87,6 +105,10 @@ module Metanorma
87
105
  end
88
106
 
89
107
  def clause_parse(attrs, xml, node)
108
+ %w(executivesummary overview future_outlook value_proposition
109
+ contributors aims objectives topics outlook security)
110
+ .include?(node.attr("type")) and
111
+ attrs = attrs.merge(type: node.attr("type"))
90
112
  case node.attr("heading")&.downcase || node.title.downcase
91
113
  when "submitters"
92
114
  return submitters_parse(attrs, xml, node)
@@ -156,6 +178,54 @@ module Metanorma
156
178
  end
157
179
  end
158
180
 
181
+ OGC_COLORS = {
182
+ "text": "rgb(88, 89, 91)",
183
+ "secondary-shade-1": "rgb(237, 193, 35)",
184
+ "secondary-shade-2": "rgb(246, 223, 140)",
185
+ "background-definition-term": "rgb(215, 243, 255)",
186
+ "background-definition-description": "rgb(242, 251, 255)",
187
+ "text-title": "rgb(33, 55, 92)",
188
+ "background-page": "rgb(33, 55, 92)",
189
+ "background-text-label-legacy": "rgb(33, 60, 107)",
190
+ "background-term-preferred-label": "rgb(249, 235, 187)",
191
+ "background-term-deprecated-label": "rgb(237, 237, 238)",
192
+ "background-term-admitted-label": "rgb(223, 236, 249)",
193
+ "background-table-header": "rgb(33, 55, 92)",
194
+ "background-table-row-even": "rgb(252, 246, 222)",
195
+ "background-table-row-odd": "rgb(254, 252, 245)",
196
+ "admonition-note": "rgb(79, 129, 189)",
197
+ "admonition-tip": "rgb(79, 129, 189)",
198
+ "admonition-editor": "rgb(79, 129, 189)",
199
+ "admonition-important": "rgb(79, 129, 189)",
200
+ "admonition-warning": "rgb(79, 129, 189)",
201
+ "admonition-caution": "rgb(79, 129, 189)",
202
+ "admonition-todo": "rgb(79, 129, 189)",
203
+ "admonition-safety-precaution": "rgb(79, 129, 189)",
204
+ }.freeze
205
+
206
+ def metadata_attrs(node)
207
+ c = update_colors(node)
208
+ ret = super
209
+ c.keys.sort.each do |k|
210
+ ret += "<presentation-metadata><name>color-#{k}</name>" \
211
+ "<value>#{c[k]}</value></presentation-metadata>"
212
+ end
213
+ ret
214
+ end
215
+
216
+ def update_colors(node)
217
+ c = OGC_COLORS.dup
218
+ if document_scheme(node) == "2022"
219
+ c[:"secondary-shade-1"] = "rgb(0, 177, 255)"
220
+ c[:"secondary-shade-2"] = "rgb(0, 177, 255)"
221
+ end
222
+ if node.attr("doctype") == "white-paper"
223
+ c[:"text-title"] = "rgb(68, 84, 106)"
224
+ c[:"background-page"] = "rgb(68, 84, 106)"
225
+ end
226
+ c
227
+ end
228
+
159
229
  def presentation_xml_converter(node)
160
230
  IsoDoc::Ogc::PresentationXMLConvert
161
231
  .new(html_extract_attributes(node)
@@ -17,7 +17,7 @@
17
17
  these elements; we just want one namespace for any child grammars
18
18
  of this.
19
19
  -->
20
- <!-- VERSION v1.3.2 -->
20
+ <!-- VERSION v1.3.3 -->
21
21
  <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">
22
22
  <include href="reqt.rng"/>
23
23
  <include href="basicdoc.rng">
@@ -331,9 +331,9 @@
331
331
  <zeroOrMore>
332
332
  <ref name="table-note"/>
333
333
  </zeroOrMore>
334
- <optional>
334
+ <zeroOrMore>
335
335
  <ref name="source"/>
336
- </optional>
336
+ </zeroOrMore>
337
337
  </define>
338
338
  <define name="FigureAttr">
339
339
  <optional>
@@ -380,9 +380,9 @@
380
380
  <zeroOrMore>
381
381
  <ref name="note"/>
382
382
  </zeroOrMore>
383
- <optional>
383
+ <zeroOrMore>
384
384
  <ref name="source"/>
385
- </optional>
385
+ </zeroOrMore>
386
386
  </define>
387
387
  <define name="source">
388
388
  <element name="source">
@@ -662,6 +662,9 @@
662
662
  <value>LatexMath</value>
663
663
  </choice>
664
664
  </attribute>
665
+ <optional>
666
+ <attribute name="number-format"/>
667
+ </optional>
665
668
  <attribute name="block">
666
669
  <data type="boolean"/>
667
670
  </attribute>
@@ -66,6 +66,9 @@
66
66
  <ref name="MultilingualRenderingType"/>
67
67
  </attribute>
68
68
  </optional>
69
+ <optional>
70
+ <attribute name="class"/>
71
+ </optional>
69
72
  <optional>
70
73
  <ref name="reqtitle"/>
71
74
  </optional>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ogc
3
- VERSION = "2.5.14".freeze
3
+ VERSION = "2.6.1".freeze
4
4
  end
5
5
  end
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
26
26
  spec.required_ruby_version = Gem::Requirement.new(">= 3.1.0")
27
27
 
28
28
  spec.add_dependency "iso-639"
29
- spec.add_dependency "metanorma-standoc", "~> 2.9.0"
29
+ spec.add_dependency "metanorma-standoc", "~> 2.9.3"
30
30
 
31
31
  spec.add_development_dependency "debug"
32
32
  spec.add_development_dependency "equivalent-xml", "~> 0.6"