metanorma-plateau 0.1.2 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6f8e1f42a81f5dd4e4bd6d068002e4499e15c467d1961331ff42555588b1c776
4
- data.tar.gz: e760543b322da439d2115e7600482c4b942896d428be685cbed845444a7c61c0
3
+ metadata.gz: f4834c2ee47e184721abe8ad6bac4d72ee1e1d80eebd1edd5bf67fdf8f640be6
4
+ data.tar.gz: cccbce71fa3b654e5183b814114f33490d56b9f738b9cf9db6d66eb9dc9f8881
5
5
  SHA512:
6
- metadata.gz: 574d4e9c2e8c9160a7ef8244d04faff7f8c2ea9d6280fc4ca3fdadc326ad859954361c7f21fdaf87e365fef58c4496d089b39650a78c1cb488a4288d672dace7
7
- data.tar.gz: b15a8dca0976d5a6360b15da39d33934eeca5dedcba5b36e19c224cd4b885b65eb96358fb346a39c40e46f3d0a0370fe03365da1e629b49675f6c55292312a08
6
+ metadata.gz: 5c6185e00e3629e97e8aaace04150b1f44971c66b29e31addb05cffb81669d26c7fd880bb09e395c9317a471b9ab1c190dcb4a978c3838405a1df65ea733d12c
7
+ data.tar.gz: a9fd04e142af38ff37848b710098e507652c0311bd6dc6d41392839ea1cb4c0ba4a4de583e977f2eca7542385e3d6a182a853e94eb2b424af112aae1e2f7e6ec
@@ -12,14 +12,19 @@ module IsoDoc
12
12
 
13
13
  def xref_init(lang, script, _klass, labels, options)
14
14
  @xrefs = Xref.new(lang, script,
15
- HtmlConvert.new(language: lang, script: script),
15
+ HtmlConvert.new(language: lang, script:),
16
16
  labels, options)
17
17
  end
18
18
 
19
19
  def i18n_init(lang, script, locale, i18nyaml = nil)
20
- @i18n = I18n.new(lang, script, locale: locale,
20
+ @i18n = I18n.new(lang, script, locale:,
21
21
  i18nyaml: i18nyaml || @i18nyaml)
22
22
  end
23
+
24
+ def bibrenderer(options = {})
25
+ ::Relaton::Render::JIS::General.new(options.merge(language: @lang,
26
+ i18nhash: @i18n.get))
27
+ end
23
28
  end
24
29
  end
25
30
  end
@@ -6,6 +6,8 @@
6
6
 
7
7
  <xsl:variable name="debug">false</xsl:variable>
8
8
 
9
+ <xsl:variable name="isIgnoreComplexScripts">true</xsl:variable>
10
+
9
11
  <xsl:variable name="doctype" select="//plateau:plateau-standard[1]/plateau:bibdata/plateau:ext/plateau:doctype[@language = '' or not(@language)]"/>
10
12
 
11
13
  <xsl:variable name="i18n_doctype_dict_annex"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">doctype_dict.annex</xsl:with-param></xsl:call-template></xsl:variable>
@@ -1122,7 +1124,11 @@
1122
1124
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
1123
1125
  </xsl:if>
1124
1126
 
1125
- <xsl:if test="parent::plateau:clause">
1127
+ <xsl:if test="parent::plateau:note and not(following-sibling::*)">
1128
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
1129
+ </xsl:if>
1130
+
1131
+ <xsl:if test="parent::plateau:clause or (ancestor::plateau:note and not(ancestor::plateau:table))">
1126
1132
  <xsl:text> </xsl:text>
1127
1133
  </xsl:if>
1128
1134
 
@@ -1143,6 +1149,42 @@
1143
1149
  </xsl:choose>
1144
1150
  </xsl:template>
1145
1151
 
1152
+ <xsl:template match="*[local-name() = 'note'][not(ancestor::plateau:table)]" priority="2">
1153
+
1154
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
1155
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
1156
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1157
+
1158
+ <xsl:call-template name="setBlockSpanAll"/>
1159
+
1160
+ <xsl:call-template name="refine_note-style"/>
1161
+
1162
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
1163
+
1164
+ <fo:table table-layout="fixed" width="99%" border="1pt solid black">
1165
+ <fo:table-body>
1166
+ <fo:table-row>
1167
+ <fo:table-cell padding="2mm">
1168
+ <fo:block keep-with-next="always" margin-bottom="10pt" role="SKIP">
1169
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
1170
+ </fo:block>
1171
+ <fo:block>
1172
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
1173
+ </fo:block>
1174
+ </fo:table-cell>
1175
+ </fo:table-row>
1176
+ </fo:table-body>
1177
+ </fo:table>
1178
+ </fo:block-container>
1179
+ </fo:block-container>
1180
+ </xsl:template>
1181
+
1182
+ <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note']" priority="3"/>
1183
+
1184
+ <xsl:template match="*[local-name() = 'note'][not(ancestor::plateau:table)]/*[local-name() = 'p']" priority="2">
1185
+ <xsl:call-template name="paragraph"/>
1186
+ </xsl:template>
1187
+
1146
1188
  <xsl:template match="plateau:termnote" priority="2">
1147
1189
  <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
1148
1190
  <fo:list-block provisional-distance-between-starts="{14 + $text_indent}mm">
@@ -3521,13 +3563,35 @@
3521
3563
  </xsl:for-each>
3522
3564
  </xsl:element>
3523
3565
 
3524
- <xsl:call-template name="insertAnnexInSeparatePageSequences"/>
3566
+ <xsl:call-template name="insertAnnexAndBibliographyInSeparatePageSequences"/>
3525
3567
 
3526
- <xsl:call-template name="insertBibliographyInSeparatePageSequences"/>
3568
+ <!-- <xsl:call-template name="insertBibliographyInSeparatePageSequences"/> -->
3527
3569
 
3528
3570
  <!-- <xsl:call-template name="insertIndexInSeparatePageSequences"/> -->
3529
3571
  </xsl:template> <!-- END: insertMainSectionsInSeparatePageSequences -->
3530
3572
 
3573
+ <xsl:template name="insertAnnexAndBibliographyInSeparatePageSequences">
3574
+ <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']">
3575
+ <xsl:sort select="@displayorder" data-type="number"/>
3576
+ <xsl:choose>
3577
+ <xsl:when test="local-name() = 'annex' or local-name() = 'indexsect'">
3578
+ <xsl:element name="page_sequence" namespace="{$namespace_full}">
3579
+ <xsl:attribute name="main_page_sequence"/>
3580
+ <xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
3581
+ </xsl:element>
3582
+ </xsl:when>
3583
+ <xsl:otherwise> <!-- bibliography -->
3584
+ <xsl:element name="bibliography" namespace="{$namespace_full}"> <!-- save context element -->
3585
+ <xsl:element name="page_sequence" namespace="{$namespace_full}">
3586
+ <xsl:attribute name="main_page_sequence"/>
3587
+ <xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
3588
+ </xsl:element>
3589
+ </xsl:element>
3590
+ </xsl:otherwise>
3591
+ </xsl:choose>
3592
+ </xsl:for-each>
3593
+ </xsl:template>
3594
+
3531
3595
  <xsl:template name="insertAnnexInSeparatePageSequences">
3532
3596
  <xsl:for-each select="/*/*[local-name()='annex']">
3533
3597
  <xsl:sort select="@displayorder" data-type="number"/>
@@ -7718,6 +7782,12 @@
7718
7782
  <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
7719
7783
  <attachment filename="{@name}"/>
7720
7784
  </xsl:for-each>
7785
+ <xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
7786
+ <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
7787
+ <xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
7788
+ <attachment filename="{$attachment_path}"/>
7789
+ </xsl:for-each>
7790
+ </xsl:if>
7721
7791
  </xsl:variable>
7722
7792
  <xsl:variable name="pdfAttachmentsList" select="xalan:nodeset($pdfAttachmentsList_)"/>
7723
7793
 
@@ -7730,7 +7800,7 @@
7730
7800
  <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
7731
7801
  </xsl:when>
7732
7802
  <!-- link to the PDF attachment -->
7733
- <xsl:when test="$pdfAttachmentsList//attachment[@filename = current()/@target]">
7803
+ <xsl:when test="@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target]">
7734
7804
  <xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
7735
7805
  </xsl:when>
7736
7806
  <!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
@@ -8377,7 +8447,16 @@
8377
8447
  </xsl:variable>
8378
8448
  <xsl:variable name="img_src">
8379
8449
  <xsl:choose>
8380
- <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
8450
+ <xsl:when test="not(starts-with(@src, 'data:'))">
8451
+ <xsl:choose>
8452
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
8453
+ <xsl:value-of select="@src"/>
8454
+ </xsl:when>
8455
+ <xsl:otherwise>
8456
+ <xsl:value-of select="concat($basepath, @src)"/>
8457
+ </xsl:otherwise>
8458
+ </xsl:choose>
8459
+ </xsl:when>
8381
8460
  <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
8382
8461
  </xsl:choose>
8383
8462
  </xsl:variable>
@@ -8390,7 +8469,7 @@
8390
8469
  <!-- <xsl:message>width_effective=<xsl:value-of select="$width_effective"/></xsl:message>
8391
8470
  <xsl:message>indent_left=<xsl:value-of select="$indent_left"/></xsl:message>
8392
8471
  <xsl:message>image_width_effective=<xsl:value-of select="$image_width_effective"/> for <xsl:value-of select="ancestor::ogc:p[1]/@id"/></xsl:message> -->
8393
- <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
8472
+ <xsl:variable name="scale" select="java:org.metanorma.fop.utils.ImageUtils.getImageScale($img_src, $image_width_effective, $height_effective)"/>
8394
8473
  <xsl:value-of select="$scale"/>
8395
8474
  </xsl:template>
8396
8475
 
@@ -8409,7 +8488,14 @@
8409
8488
  <xsl:value-of select="concat('url(file:///',$basepath, $src_png, ')')"/>
8410
8489
  </xsl:when>
8411
8490
  <xsl:when test="not(starts-with(@src, 'data:'))">
8412
- <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
8491
+ <xsl:choose>
8492
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
8493
+ <xsl:value-of select="concat('url(file:///', @src, ')')"/>
8494
+ </xsl:when>
8495
+ <xsl:otherwise>
8496
+ <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
8497
+ </xsl:otherwise>
8498
+ </xsl:choose>
8413
8499
  </xsl:when>
8414
8500
  <xsl:otherwise>
8415
8501
  <xsl:value-of select="@src"/>
@@ -8431,7 +8517,14 @@
8431
8517
  </xsl:when>
8432
8518
  <xsl:when test="not(starts-with(@src, 'data:'))">
8433
8519
  <xsl:variable name="src">
8434
- <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
8520
+ <xsl:choose>
8521
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
8522
+ <xsl:value-of select="concat('url(file:///', @src, ')')"/>
8523
+ </xsl:when>
8524
+ <xsl:otherwise>
8525
+ <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
8526
+ </xsl:otherwise>
8527
+ </xsl:choose>
8435
8528
  </xsl:variable>
8436
8529
  <xsl:variable name="file" select="java:java.io.File.new(@src)"/>
8437
8530
  <xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
@@ -12335,10 +12428,12 @@
12335
12428
  <xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']" mode="update_xml_step1">
12336
12429
  <xsl:copy>
12337
12430
  <xsl:copy-of select="@*"/>
12338
- <xsl:variable name="name_filepath" select="concat($inputxml_basepath, @name)"/>
12339
- <xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($name_filepath)))"/>
12340
- <xsl:if test="$file_exists = 'false'"> <!-- copy attachment content only if file on disk doesnt exist -->
12341
- <xsl:value-of select="."/>
12431
+ <xsl:if test="1 = 2"> <!-- remove attachment/text(), because attachments added in the template 'addPDFUAmeta' before applying 'update_xml_step1' -->
12432
+ <xsl:variable name="name_filepath" select="concat($inputxml_basepath, @name)"/>
12433
+ <xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($name_filepath)))"/>
12434
+ <xsl:if test="$file_exists = 'false'"> <!-- copy attachment content only if file on disk doesnt exist -->
12435
+ <xsl:value-of select="normalize-space(.)"/>
12436
+ </xsl:if>
12342
12437
  </xsl:if>
12343
12438
  </xsl:copy>
12344
12439
  </xsl:template>
@@ -13318,25 +13413,37 @@
13318
13413
  </x:xmpmeta>
13319
13414
  <!-- add attachments -->
13320
13415
  <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
13321
- <xsl:choose>
13322
- <xsl:when test="normalize-space() != ''">
13323
- <pdf:embedded-file src="{.}" filename="{@name}"/>
13324
- </xsl:when>
13325
- <xsl:otherwise>
13326
- <!-- _{filename}_attachments -->
13327
- <!-- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/> -->
13328
- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
13329
- <pdf:embedded-file src="{$url}" filename="{@name}"/>
13330
- </xsl:otherwise>
13331
- </xsl:choose>
13416
+ <xsl:variable name="description" select="normalize-space(//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]/*[local-name() = 'formattedref'])"/>
13417
+
13418
+ <pdf:embedded-file filename="{@name}">
13419
+ <xsl:attribute name="src">
13420
+ <xsl:choose>
13421
+ <xsl:when test="normalize-space() != ''">
13422
+ <xsl:variable name="src_attachment" select="java:replaceAll(java:java.lang.String.new(.),'(&#13;&#10;|&#13;|&#10;)', '')"/> <!-- remove line breaks -->
13423
+ <xsl:value-of select="$src_attachment"/>
13424
+ </xsl:when>
13425
+ <xsl:otherwise>
13426
+ <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
13427
+ <xsl:value-of select="$url"/>
13428
+ </xsl:otherwise>
13429
+ </xsl:choose>
13430
+ </xsl:attribute>
13431
+ <xsl:if test="$description != ''">
13432
+ <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
13433
+ </xsl:if>
13434
+ </pdf:embedded-file>
13332
13435
  </xsl:for-each>
13333
13436
  <!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
13334
13437
  <xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
13335
13438
  <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
13336
13439
  <xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
13337
- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, $attachment_path, ')')"/>
13338
- <xsl:variable name="filename_embedded" select="substring-after($attachment_path, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
13339
- <pdf:embedded-file src="{$url}" filename="{$filename_embedded}"/>
13440
+ <xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
13441
+ <xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
13442
+ <pdf:embedded-file src="{$url}" filename="{$attachment_path}">
13443
+ <xsl:if test="$description != ''">
13444
+ <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
13445
+ </xsl:if>
13446
+ </pdf:embedded-file>
13340
13447
  </xsl:for-each>
13341
13448
  </xsl:if>
13342
13449
  </xsl:template> <!-- addPDFUAmeta -->
@@ -13712,7 +13819,14 @@
13712
13819
  <xsl:value-of select="$src"/>
13713
13820
  </xsl:when>
13714
13821
  <xsl:otherwise>
13715
- <xsl:value-of select="concat('url(file:///',$basepath, $src, ')')"/>
13822
+ <xsl:choose>
13823
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
13824
+ <xsl:value-of select="concat('url(file:///', @src, ')')"/>
13825
+ </xsl:when>
13826
+ <xsl:otherwise>
13827
+ <xsl:value-of select="concat('url(file:///',$basepath, $src, ')')"/>
13828
+ </xsl:otherwise>
13829
+ </xsl:choose>
13716
13830
  </xsl:otherwise>
13717
13831
  </xsl:choose>
13718
13832
  </xsl:template>
@@ -3,6 +3,11 @@ require_relative "init"
3
3
  module IsoDoc
4
4
  module Plateau
5
5
  class PresentationXMLConvert < IsoDoc::JIS::PresentationXMLConvert
6
+ def initialize(options)
7
+ @iso = ::IsoDoc::Iso::PresentationXMLConvert.new(options)
8
+ super
9
+ end
10
+
6
11
  def toc_title_insert_pt(docxml)
7
12
  i = preface_init_insert_pt(docxml) or return nil
8
13
  a = i.at(ns("./abstract[last()] | ./clause[@type = 'revhistory']")) and
@@ -70,6 +75,10 @@ module IsoDoc
70
75
  elem.previous = ret
71
76
  end
72
77
 
78
+ def ol_depth(node)
79
+ @iso.ol_depth(node)
80
+ end
81
+
73
82
  include Init
74
83
  end
75
84
  end
@@ -4,6 +4,11 @@ module IsoDoc
4
4
  end
5
5
 
6
6
  class Xref < IsoDoc::JIS::Xref
7
+ def initialize(lang, script, klass, i18n, options)
8
+ @iso = ::IsoDoc::Iso::Xref.new(lang, script, klass, i18n, options)
9
+ super
10
+ end
11
+
7
12
  def clause_order_main(_docxml)
8
13
  [
9
14
  {
@@ -39,42 +44,6 @@ module IsoDoc
39
44
  end
40
45
  end
41
46
 
42
- def section_name_anchors(clause, num, level)
43
- super
44
- if level >= 4 && level <= 6
45
- label, xref = section_name_anchors_deep(num, level)
46
- @anchors[clause["id"]][:label] = label
47
- @anchors[clause["id"]][:xref] = l10n(xref)
48
- end
49
- end
50
-
51
- def section_name_anchors_deep(num, level)
52
- numparts = num.split(".")
53
- core = numparts[0..2].join(".")
54
- (4..level).each do |l|
55
- core += " #{section_name_label_deep(numparts[l - 1], l)}"
56
- end
57
- [section_name_label_deep(numparts[-1], level), l10n(core)]
58
- end
59
-
60
- def section_name_label_deep(num, level)
61
- case level
62
- when 4 then l10n("(#{num})")
63
- when 5 then l10n("#{num})")
64
- when 6
65
- ("" << (num.to_i + 0x245f))
66
- end
67
- end
68
-
69
- def annex_name_anchors1(clause, num, level)
70
- super
71
- if level >= 4 && level <= 6
72
- label, xref = section_name_anchors_deep(num, level)
73
- @anchors[clause["id"]][:label] = label
74
- @anchors[clause["id"]][:xref] = l10n(xref)
75
- end
76
- end
77
-
78
47
  def hierarchical_figure_names(clause, num)
79
48
  c = IsoDoc::XrefGen::Counter.new
80
49
  j = 0
@@ -102,6 +71,19 @@ module IsoDoc
102
71
  end
103
72
  end
104
73
 
74
+ def list_item_anchor_names(list, list_anchor, depth, prev_label,
75
+ refer_list)
76
+ @iso.anchors.merge!(@anchors)
77
+ @iso.list_item_anchor_names(list, list_anchor, depth, prev_label,
78
+ refer_list)
79
+ @anchors.merge!(@iso.anchors)
80
+ end
81
+
82
+ def list_item_value(entry, counter, depth, opts)
83
+ @iso.anchors.merge!(@anchors)
84
+ @iso.list_item_value(entry, counter, depth, opts)
85
+ @anchors.merge!(@iso.anchors)
86
+ end
105
87
  end
106
88
  end
107
89
  end
@@ -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>
@@ -28,13 +28,20 @@ module Metanorma
28
28
  super
29
29
  end
30
30
 
31
- def pub_class(bib)
32
- return 1 if bib.at("#{PUBLISHER}[name = '#{pub_hash['en']}']") ||
33
- bib.at("#{PUBLISHER}[name = '#{pub_hash['ja']}']") ||
34
- bib.at("#{PUBLISHER}[abbreviation = 'MLIT']")
35
- return 2 if bib["type"] == "standard"
31
+ # Abandoned in favour of JIS ordering
32
+ # def pub_class(bib)
33
+ # return 1 if bib.at("#{PUBLISHER}[name = '#{pub_hash['en']}']") ||
34
+ # bib.at("#{PUBLISHER}[name = '#{pub_hash['ja']}']") ||
35
+ # bib.at("#{PUBLISHER}[abbreviation = 'MLIT']")
36
+ # return 2 if bib["type"] == "standard"
37
+ #
38
+ # 3
39
+ # end
36
40
 
37
- 3
41
+ def biblio_reorder(xmldoc)
42
+ xmldoc.xpath("//references").each do |r|
43
+ biblio_reorder1(r)
44
+ end
38
45
  end
39
46
  end
40
47
  end
@@ -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 Plateau
3
- VERSION = "0.1.2".freeze
3
+ VERSION = "0.1.5".freeze
4
4
  end
5
5
  end
@@ -1,4 +1,4 @@
1
- irequire "asciidoctor" unless defined? Asciidoctor::Converter
1
+ require "asciidoctor" unless defined? Asciidoctor::Converter
2
2
  require_relative "metanorma/plateau/converter"
3
3
  require_relative "metanorma/plateau/version"
4
4
  require "isodoc/plateau/html_convert"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-plateau
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-05 00:00:00.000000000 Z
11
+ date: 2024-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-jis