metanorma-jis 0.3.5 → 0.3.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fd38af1784c6d7f4494cbf4203af167b130319d5d339c56dff97b0e42d1fb264
4
- data.tar.gz: a54d5df226904400904b7e907fbdb665e20096c3136c6aa4c37ccc98b6c9b3e3
3
+ metadata.gz: e0390d5e28376c6e536985c4f658e4e939eb12931602991a787b01fe832c6f8f
4
+ data.tar.gz: 599457fe99595bec1161f38217eca0ef96eab8ba1a401a4b6e6ba3ddda01f5db
5
5
  SHA512:
6
- metadata.gz: 3733abc0cc0b77fc8401adb1ae3430afc980384ae45a3a9f45739913ce8d963e29c354b7bdbe9a9149f1fef1bd7681c6d0f8167de9a44979c680383f2d6295d4
7
- data.tar.gz: 267bc08daa21eda8885b747ba70503441643a5dd99dca434878573045d477f4757991fe8f89e6a922f026272cf17f04128031d29d7f4cfbfb3d058533dbe97ff
6
+ metadata.gz: d24345a27eb6dde003eadf90254a267c86ca19bfbd16a9e94093e7389a5ffc843bc05db82389480a01d387456f7e23247efb34fc0c46a2f3095ff7bef1d289ce
7
+ data.tar.gz: bccf625290d0f44d49d024fe409b1d4e1c01849bef810ecbdd5571f3f6753691d5dc6b877327c781e6f10e9516f07c1f1739bca8eb2b658d264594524dad4a9e
@@ -1,5 +1,5 @@
1
1
  class Html2Doc
2
- class JIS < ::Html2Doc
2
+ class Jis < ::Html2Doc
3
3
  def list2para(list)
4
4
  return if list.xpath("./li").empty?
5
5
 
@@ -2,7 +2,7 @@ require "isodoc"
2
2
  require "metanorma-iso"
3
3
 
4
4
  module IsoDoc
5
- module JIS
5
+ module Jis
6
6
  module BaseConvert
7
7
  def termnote_parse(node, out)
8
8
  name = node.at(ns("./name"))&.remove
@@ -1,5 +1,5 @@
1
1
  module IsoDoc
2
- module JIS
2
+ module Jis
3
3
  class WordConvert < IsoDoc::Iso::WordConvert
4
4
  def figure_attrs(node)
5
5
  attr_code(id: node["id"], class: "MsoTableGrid",
@@ -4,7 +4,7 @@ require_relative "base_convert"
4
4
  require_relative "init"
5
5
 
6
6
  module IsoDoc
7
- module JIS
7
+ module Jis
8
8
  class HtmlConvert < IsoDoc::Iso::HtmlConvert
9
9
  def initialize(options)
10
10
  super
@@ -2,7 +2,7 @@ require "japanese_calendar"
2
2
  require "twitter_cldr"
3
3
 
4
4
  module IsoDoc
5
- module JIS
5
+ module Jis
6
6
  class I18n < IsoDoc::Iso::I18n
7
7
  def jis_load_file(fname)
8
8
  f = File.join(File.dirname(__FILE__), fname)
@@ -3,7 +3,7 @@ require_relative "metadata"
3
3
  require_relative "i18n"
4
4
 
5
5
  module IsoDoc
6
- module JIS
6
+ module Jis
7
7
  module Init
8
8
  def metadata_init(lang, script, locale, labels)
9
9
  @meta = Metadata.new(lang, script, locale, labels)
@@ -21,7 +21,7 @@ module IsoDoc
21
21
  end
22
22
 
23
23
  def bibrenderer(options = {})
24
- ::Relaton::Render::JIS::General.new(options.merge(language: @lang,
24
+ ::Relaton::Render::Jis::General.new(options.merge(language: @lang,
25
25
  i18nhash: @i18n.get))
26
26
  end
27
27
 
@@ -5096,7 +5096,8 @@
5096
5096
  </xsl:choose>
5097
5097
  </xsl:variable>
5098
5098
  <xsl:variable name="current_fn_number_text">
5099
- <xsl:value-of select="$current_fn_number"/>
5099
+
5100
+ <xsl:value-of select="$current_fn_number"/>
5100
5101
 
5101
5102
  <fo:inline font-weight="normal">)</fo:inline>
5102
5103
 
@@ -5134,8 +5135,10 @@
5134
5135
 
5135
5136
  <xsl:call-template name="insert_basic_link">
5136
5137
  <xsl:with-param name="element">
5137
- <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}" role="Lbl">
5138
- <xsl:copy-of select="$current_fn_number_text"/>
5138
+ <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}"> <!-- note: role="Lbl" removed in https://github.com/metanorma/mn2pdf/issues/291 -->
5139
+ <fo:inline role="Lbl"> <!-- need for https://github.com/metanorma/metanorma-iso/issues/1003 -->
5140
+ <xsl:copy-of select="$current_fn_number_text"/>
5141
+ </fo:inline>
5139
5142
  </fo:basic-link>
5140
5143
  </xsl:with-param>
5141
5144
  </xsl:call-template>
@@ -5427,7 +5430,7 @@
5427
5430
 
5428
5431
  <xsl:call-template name="refine_fn-reference-style"/>
5429
5432
 
5430
- <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
5433
+ <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="footnote {@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
5431
5434
  <xsl:if test="ancestor::*[local-name()='table'][1]/@id"> <!-- for footnotes in tables -->
5432
5435
  <xsl:attribute name="internal-destination">
5433
5436
  <xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
@@ -6436,9 +6439,19 @@
6436
6439
  </fo:inline>
6437
6440
  </xsl:template>
6438
6441
 
6439
- <xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
6442
+ <xsl:template match="text()[ancestor::*[local-name()='smallcap']]" name="smallcaps">
6443
+ <xsl:param name="txt"/>
6440
6444
  <!-- <xsl:variable name="text" select="normalize-space(.)"/> --> <!-- https://github.com/metanorma/metanorma-iso/issues/1115 -->
6441
- <xsl:variable name="text" select="."/>
6445
+ <xsl:variable name="text">
6446
+ <xsl:choose>
6447
+ <xsl:when test="$txt != ''">
6448
+ <xsl:value-of select="$txt"/>
6449
+ </xsl:when>
6450
+ <xsl:otherwise>
6451
+ <xsl:value-of select="."/>
6452
+ </xsl:otherwise>
6453
+ </xsl:choose>
6454
+ </xsl:variable>
6442
6455
  <xsl:variable name="ratio_">
6443
6456
  0.75
6444
6457
  </xsl:variable>
@@ -7888,9 +7901,12 @@
7888
7901
  <xsl:apply-templates/>
7889
7902
  </xsl:when>
7890
7903
  <xsl:otherwise>
7904
+ <xsl:variable name="alt_text">
7905
+ <xsl:call-template name="getAltText"/>
7906
+ </xsl:variable>
7891
7907
  <xsl:call-template name="insert_basic_link">
7892
7908
  <xsl:with-param name="element">
7893
- <fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
7909
+ <fo:basic-link external-destination="{$target}" fox:alt-text="{$alt_text}">
7894
7910
  <xsl:if test="$isLinkToEmbeddedFile = 'true'">
7895
7911
  <xsl:attribute name="role">Annot</xsl:attribute>
7896
7912
  </xsl:if>
@@ -7917,6 +7933,14 @@
7917
7933
  </fo:inline>
7918
7934
  </xsl:template> <!-- link -->
7919
7935
 
7936
+ <xsl:template name="getAltText">
7937
+ <xsl:choose>
7938
+ <xsl:when test="normalize-space(.) = ''"><xsl:value-of select="@target"/></xsl:when>
7939
+ <xsl:otherwise><xsl:value-of select="normalize-space(translate(normalize-space(), ' —', ' -'))"/></xsl:otherwise>
7940
+ <!-- <xsl:otherwise><xsl:value-of select="@target"/></xsl:otherwise> -->
7941
+ </xsl:choose>
7942
+ </xsl:template>
7943
+
7920
7944
  <!-- ======================== -->
7921
7945
  <!-- Appendix processing -->
7922
7946
  <!-- ======================== -->
@@ -7947,7 +7971,7 @@
7947
7971
  <xsl:template match="*[local-name() = 'callout']">
7948
7972
  <xsl:choose>
7949
7973
  <xsl:when test="normalize-space(@target) = ''">&lt;<xsl:apply-templates/>&gt;</xsl:when>
7950
- <xsl:otherwise><fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link></xsl:otherwise>
7974
+ <xsl:otherwise><fo:basic-link internal-destination="{@target}" fox:alt-text="{normalize-space()}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link></xsl:otherwise>
7951
7975
  </xsl:choose>
7952
7976
  </xsl:template>
7953
7977
 
@@ -7976,7 +8000,10 @@
7976
8000
  <xsl:template match="*[local-name() = 'xref']">
7977
8001
  <xsl:call-template name="insert_basic_link">
7978
8002
  <xsl:with-param name="element">
7979
- <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
8003
+ <xsl:variable name="alt_text">
8004
+ <xsl:call-template name="getAltText"/>
8005
+ </xsl:variable>
8006
+ <fo:basic-link internal-destination="{@target}" fox:alt-text="{$alt_text}" xsl:use-attribute-sets="xref-style">
7980
8007
  <xsl:if test="string-length(normalize-space()) &lt; 30 and not(contains(normalize-space(), 'http://')) and not(contains(normalize-space(), 'https://')) and not(ancestor::*[local-name() = 'table' or local-name() = 'dl'])">
7981
8008
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
7982
8009
  </xsl:if>
@@ -10449,12 +10476,14 @@
10449
10476
 
10450
10477
  <xsl:when test="contains(normalize-space($fo_element), 'list')">
10451
10478
 
10452
- <xsl:variable name="provisional_distance_between_starts">
10479
+ <xsl:variable name="provisional_distance_between_starts_">
10453
10480
  <xsl:value-of select="10 + $text_indent"/>
10454
10481
  </xsl:variable>
10455
- <xsl:variable name="indent">
10482
+ <xsl:variable name="provisional_distance_between_starts" select="normalize-space($provisional_distance_between_starts_)"/>
10483
+ <xsl:variable name="indent_">
10456
10484
  <xsl:value-of select="$text_indent"/>
10457
10485
  </xsl:variable>
10486
+ <xsl:variable name="indent" select="normalize-space($indent_)"/>
10458
10487
 
10459
10488
  <fo:list-block provisional-distance-between-starts="{$provisional_distance_between_starts}mm">
10460
10489
  <fo:list-item>
@@ -11171,14 +11200,17 @@
11171
11200
  </xsl:when>
11172
11201
  <xsl:when test="local-name(..) = 'ol' and @label"> <!-- for ordered lists 'ol', and if there is @label, for instance label="1.1.2" -->
11173
11202
 
11174
- <xsl:variable name="label">
11203
+ <xsl:variable name="type" select="../@type"/>
11175
11204
 
11176
- <xsl:variable name="type" select="../@type"/>
11205
+ <xsl:variable name="label">
11177
11206
 
11178
11207
  <xsl:variable name="style_prefix_">
11179
11208
  <xsl:if test="$type = 'roman'">
11180
11209
  <!-- Example: (i) -->
11181
11210
  </xsl:if>
11211
+ <xsl:if test="$type = 'alphabet'">
11212
+
11213
+ </xsl:if>
11182
11214
  </xsl:variable>
11183
11215
  <xsl:variable name="style_prefix" select="normalize-space($style_prefix_)"/>
11184
11216
 
@@ -11204,13 +11236,15 @@
11204
11236
  <xsl:if test="$style_prefix != '' and not(starts-with(@label, $style_prefix))">
11205
11237
  <xsl:value-of select="$style_prefix"/>
11206
11238
  </xsl:if>
11239
+
11207
11240
  <xsl:value-of select="@label"/>
11241
+
11208
11242
  <xsl:if test="not(java:endsWith(java:java.lang.String.new(@label),$style_suffix))">
11209
11243
  <xsl:value-of select="$style_suffix"/>
11210
11244
  </xsl:if>
11211
11245
  </xsl:variable>
11212
11246
 
11213
- <xsl:value-of select="normalize-space($label)"/>
11247
+ <xsl:value-of select="normalize-space($label)"/>
11214
11248
 
11215
11249
  </xsl:when>
11216
11250
  <xsl:otherwise> <!-- for ordered lists 'ol' -->
@@ -13533,7 +13567,8 @@
13533
13567
  <xsl:variable name="description" select="normalize-space($bibitem_attachment/*[local-name() = 'formattedref'])"/>
13534
13568
  <xsl:variable name="filename" select="java:org.metanorma.fop.Util.getFilenameFromPath(@name)"/>
13535
13569
  <!-- Todo: need update -->
13536
- <xsl:variable name="afrelationship" select="normalize-space($bibitem_attachment//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
13570
+ <xsl:variable name="afrelationship" select="normalize-space($bibitem_attachment//*[local-name() = 'classification'][@type = 'pdf-AFRelationship'])"/>
13571
+ <xsl:variable name="volatile" select="normalize-space($bibitem_attachment//*[local-name() = 'classification'][@type = 'pdf-volatile'])"/>
13537
13572
 
13538
13573
  <pdf:embedded-file filename="{$filename}" link-as-file-annotation="true">
13539
13574
  <xsl:attribute name="src">
@@ -13554,6 +13589,9 @@
13554
13589
  <xsl:if test="$afrelationship != ''">
13555
13590
  <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
13556
13591
  </xsl:if>
13592
+ <xsl:if test="$volatile != ''">
13593
+ <xsl:attribute name="volatile"><xsl:value-of select="$volatile"/></xsl:attribute>
13594
+ </xsl:if>
13557
13595
  </pdf:embedded-file>
13558
13596
  </xsl:for-each>
13559
13597
  <!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
@@ -13564,14 +13602,18 @@
13564
13602
  <xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
13565
13603
  <xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
13566
13604
  <!-- Todo: need update -->
13567
- <xsl:variable name="afrelationship" select="normalize-space(.//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
13605
+ <xsl:variable name="afrelationship" select="normalize-space(.//*[local-name() = 'classification'][@type = 'pdf-AFRelationship'])"/>
13606
+ <xsl:variable name="volatile" select="normalize-space(.//*[local-name() = 'classification'][@type = 'pdf-volatile'])"/>
13568
13607
  <pdf:embedded-file src="{$url}" filename="{$attachment_name}" link-as-file-annotation="true">
13569
13608
  <xsl:if test="$description != ''">
13570
13609
  <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
13571
13610
  </xsl:if>
13572
13611
  <xsl:if test="$afrelationship != ''">
13573
- <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
13574
- </xsl:if>
13612
+ <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
13613
+ </xsl:if>
13614
+ <xsl:if test="$volatile != ''">
13615
+ <xsl:attribute name="volatile"><xsl:value-of select="$volatile"/></xsl:attribute>
13616
+ </xsl:if>
13575
13617
  </pdf:embedded-file>
13576
13618
  </xsl:for-each>
13577
13619
  </xsl:if>
@@ -13618,10 +13660,31 @@
13618
13660
  <xsl:value-of select="$level_total - 2"/>
13619
13661
  </xsl:when>
13620
13662
  <xsl:when test="ancestor::*[local-name() = 'sections'] and self::*[local-name() = 'title']">
13621
- <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/>
13663
+ <!-- determine 'depth' depends on upper clause with title/@depth -->
13664
+ <!-- <xsl:message>title=<xsl:value-of select="."/></xsl:message> -->
13665
+ <xsl:variable name="clause_with_depth_depth" select="ancestor::*[local-name() = 'clause'][*[local-name() = 'title']/@depth][1]/*[local-name() = 'title']/@depth"/>
13666
+ <!-- <xsl:message>clause_with_depth_depth=<xsl:value-of select="$clause_with_depth_depth"/></xsl:message> -->
13667
+ <xsl:variable name="clause_with_depth_level" select="count(ancestor::*[local-name() = 'clause'][*[local-name() = 'title']/@depth][1]/ancestor::*)"/>
13668
+ <!-- <xsl:message>clause_with_depth_level=<xsl:value-of select="$clause_with_depth_level"/></xsl:message> -->
13669
+ <xsl:variable name="curr_level" select="count(ancestor::*) - 1"/>
13670
+ <!-- <xsl:message>curr_level=<xsl:value-of select="$curr_level"/></xsl:message> -->
13671
+ <!-- <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/> -->
13672
+ <xsl:variable name="curr_clause_depth" select="number($clause_with_depth_depth) + (number($curr_level) - number($clause_with_depth_level)) "/>
13673
+ <!-- <xsl:message>curr_clause_depth=<xsl:value-of select="$curr_clause_depth"/></xsl:message> -->
13622
13674
  <xsl:choose>
13623
- <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
13624
- <xsl:value-of select="number($upper_clause_depth + 1)"/>
13675
+ <xsl:when test="string(number($curr_clause_depth)) != 'NaN'">
13676
+ <xsl:value-of select="number($curr_clause_depth)"/>
13677
+ </xsl:when>
13678
+ <xsl:otherwise>
13679
+ <xsl:value-of select="$level_total - 2"/>
13680
+ </xsl:otherwise>
13681
+ </xsl:choose>
13682
+ </xsl:when>
13683
+ <xsl:when test="ancestor::*[local-name() = 'sections'] and self::*[local-name() = 'name'] and parent::*[local-name() = 'term']">
13684
+ <xsl:variable name="upper_terms_depth" select="normalize-space(ancestor::*[local-name() = 'terms'][1]/*[local-name() = 'title']/@depth)"/>
13685
+ <xsl:choose>
13686
+ <xsl:when test="string(number($upper_terms_depth)) != 'NaN'">
13687
+ <xsl:value-of select="number($upper_terms_depth + 1)"/>
13625
13688
  </xsl:when>
13626
13689
  <xsl:otherwise>
13627
13690
  <xsl:value-of select="$level_total - 2"/>
@@ -13629,7 +13692,7 @@
13629
13692
  </xsl:choose>
13630
13693
  </xsl:when>
13631
13694
  <xsl:when test="ancestor::*[local-name() = 'sections']">
13632
- <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][1]/*[local-name() = 'title']/@depth)"/>
13695
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause' or local-name() = 'terms'][1]/*[local-name() = 'title']/@depth)"/>
13633
13696
  <xsl:choose>
13634
13697
  <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
13635
13698
  <xsl:value-of select="number($upper_clause_depth + 1)"/>
@@ -2,7 +2,7 @@ require "isodoc"
2
2
  require "metanorma-iso"
3
3
 
4
4
  module IsoDoc
5
- module JIS
5
+ module Jis
6
6
  class Metadata < IsoDoc::Iso::Metadata
7
7
  def title(isoxml, _out)
8
8
  lang = @lang
@@ -2,7 +2,7 @@ require_relative "base_convert"
2
2
  require "isodoc"
3
3
 
4
4
  module IsoDoc
5
- module JIS
5
+ module Jis
6
6
  class PdfConvert < IsoDoc::XslfoPdfConvert
7
7
  def initialize(options)
8
8
  @libdir = File.dirname(__FILE__)
@@ -2,7 +2,7 @@ require_relative "init"
2
2
  require "isodoc"
3
3
 
4
4
  module IsoDoc
5
- module JIS
5
+ module Jis
6
6
  class PresentationXMLConvert < IsoDoc::Iso::PresentationXMLConvert
7
7
  def annex1(elem)
8
8
  elem["commentary"] == "true" and return commentary(elem)
@@ -4,7 +4,7 @@ require_relative "presentation_section"
4
4
  require_relative "../../relaton/render-jis/general"
5
5
 
6
6
  module IsoDoc
7
- module JIS
7
+ module Jis
8
8
  class PresentationXMLConvert < IsoDoc::Iso::PresentationXMLConvert
9
9
  def inline(docxml)
10
10
  super
@@ -1,5 +1,5 @@
1
1
  module IsoDoc
2
- module JIS
2
+ module Jis
3
3
  class WordConvert < IsoDoc::Iso::WordConvert
4
4
  def make_table_footnote_target(out, fnid, fnref)
5
5
  attrs = { id: fnid, class: "TableFootnoteRef" }
@@ -1,7 +1,7 @@
1
1
  require_relative "../../html2doc/lists"
2
2
 
3
3
  module IsoDoc
4
- module JIS
4
+ module Jis
5
5
  class WordConvert < IsoDoc::Iso::WordConvert
6
6
  def word_cleanup(docxml)
7
7
  word_note_cleanup(docxml)
@@ -65,7 +65,7 @@ module IsoDoc
65
65
  def to_word1(result, filename, dir, header)
66
66
  result or return
67
67
  result = from_xhtml(result).gsub(/-DOUBLE_HYPHEN_ESCAPE-/, "--")
68
- ::Html2Doc::JIS.new(
68
+ ::Html2Doc::Jis.new(
69
69
  filename: filename, imagedir: @localdir,
70
70
  stylesheet: @wordstylesheet&.path,
71
71
  header_file: header&.path, dir: dir,
@@ -6,7 +6,7 @@ require_relative "figure"
6
6
  require_relative "table"
7
7
 
8
8
  module IsoDoc
9
- module JIS
9
+ module Jis
10
10
  class WordConvert < IsoDoc::Iso::WordConvert
11
11
  def initialize(options)
12
12
  @libdir = File.dirname(__FILE__)
@@ -1,5 +1,5 @@
1
1
  module IsoDoc
2
- module JIS
2
+ module Jis
3
3
  class Counter < IsoDoc::XrefGen::Counter
4
4
  def ol_type(list, depth)
5
5
  return list["type"].to_sym if list["type"]
@@ -72,6 +72,9 @@ standards defining organization, and that is rendered in a distinct manner</a:do
72
72
  from other documents in the same doctype</a:documentation>
73
73
  </ref>
74
74
  </optional>
75
+ <ref name="flavor">
76
+ <a:documentation>Flavour of Metanorma used to process this document</a:documentation>
77
+ </ref>
75
78
  <optional>
76
79
  <ref name="editorialgroup">
77
80
  <a:documentation>Groups associated with the production of the standards document, typically within
@@ -113,6 +116,16 @@ a standards definition organization</a:documentation>
113
116
  <define name="DocumentSubtype">
114
117
  <text/>
115
118
  </define>
119
+ <define name="flavor">
120
+ <element name="flavor">
121
+ <ref name="MetanormaFlavor"/>
122
+ </element>
123
+ </define>
124
+ <define name="MetanormaFlavor">
125
+ <a:documentation>This is in fact an enum, as of this writing: standoc iso generic ietf ieee itu nist ogc csa cc iho ribose jis iec bsi bipm plateau.
126
+ However we prefer not to hardcode it, given ongoing extension.</a:documentation>
127
+ <text/>
128
+ </define>
116
129
  <define name="editorialgroup">
117
130
  <a:documentation>A group associated with the production of the standards document, typically within
118
131
  a standards definition organization</a:documentation>
@@ -1382,18 +1382,7 @@ Applies whether the resource has already been created or not, and whether it is
1382
1382
  <define name="bdate">
1383
1383
  <a:documentation>Significant date in the lifecycle of the bibliographic item, including its production and its access</a:documentation>
1384
1384
  <element name="date">
1385
- <attribute name="type">
1386
- <a:documentation>The phase of the production of or access to a bibliographic item</a:documentation>
1387
- <choice>
1388
- <ref name="BibliographicDateType"/>
1389
- <text/>
1390
- </choice>
1391
- </attribute>
1392
- <optional>
1393
- <attribute name="text">
1394
- <a:documentation>An optional textual description of the date, especially when a Gregorian date is not applicable</a:documentation>
1395
- </attribute>
1396
- </optional>
1385
+ <ref name="bDateAttributes"/>
1397
1386
  <optional>
1398
1387
  <choice>
1399
1388
  <group>
@@ -1416,6 +1405,20 @@ Applies whether the resource has already been created or not, and whether it is
1416
1405
  </optional>
1417
1406
  </element>
1418
1407
  </define>
1408
+ <define name="bDateAttributes">
1409
+ <attribute name="type">
1410
+ <a:documentation>The phase of the production of or access to a bibliographic item</a:documentation>
1411
+ <choice>
1412
+ <ref name="BibliographicDateType"/>
1413
+ <text/>
1414
+ </choice>
1415
+ </attribute>
1416
+ <optional>
1417
+ <attribute name="text">
1418
+ <a:documentation>An optional textual description of the date, especially when a Gregorian date is not applicable</a:documentation>
1419
+ </attribute>
1420
+ </optional>
1421
+ </define>
1419
1422
  <define name="docidentifier">
1420
1423
  <a:documentation>An identifier of a bibliographic item in an international standard scheme</a:documentation>
1421
1424
  <element name="docidentifier">
@@ -1884,6 +1887,10 @@ Detailed in https://www.relaton.org/model/relations/</a:documentation>
1884
1887
  <value>hasAnnotation</value>
1885
1888
  <value>draftOf</value>
1886
1889
  <value>hasDraft</value>
1890
+ <value>preliminaryDraftOf</value>
1891
+ <value>hasPreliminaryDraft</value>
1892
+ <value>revisionDraftOf</value>
1893
+ <value>hasRevisionDraft</value>
1887
1894
  <value>editionOf</value>
1888
1895
  <value>hasEdition</value>
1889
1896
  <value>updates</value>
@@ -1,6 +1,6 @@
1
1
  module Metanorma
2
- module JIS
3
- class Converter < ISO::Converter
2
+ module Jis
3
+ class Converter < Iso::Converter
4
4
  def norm_ref_preface(ref)
5
5
  if ref.at("./note[@type = 'boilerplate']")
6
6
  unwrap_boilerplate_clauses(ref, ".")
@@ -5,8 +5,8 @@ require_relative "validate"
5
5
  require_relative "cleanup"
6
6
 
7
7
  module Metanorma
8
- module JIS
9
- class Converter < ISO::Converter
8
+ module Jis
9
+ class Converter < Iso::Converter
10
10
  XML_ROOT_TAG = "jis-standard".freeze
11
11
  XML_NAMESPACE = "https://www.metanorma.org/ns/jis".freeze
12
12
 
@@ -48,17 +48,17 @@ module Metanorma
48
48
 
49
49
  def html_converter(node)
50
50
  if node.nil?
51
- IsoDoc::JIS::HtmlConvert.new({})
51
+ IsoDoc::Jis::HtmlConvert.new({})
52
52
  else
53
- IsoDoc::JIS::HtmlConvert.new(html_extract_attributes(node))
53
+ IsoDoc::Jis::HtmlConvert.new(html_extract_attributes(node))
54
54
  end
55
55
  end
56
56
 
57
57
  def doc_converter(node)
58
58
  if node.nil?
59
- IsoDoc::JIS::WordConvert.new({})
59
+ IsoDoc::Jis::WordConvert.new({})
60
60
  else
61
- IsoDoc::JIS::WordConvert.new(doc_extract_attributes(node))
61
+ IsoDoc::Jis::WordConvert.new(doc_extract_attributes(node))
62
62
  end
63
63
  end
64
64
 
@@ -66,19 +66,19 @@ module Metanorma
66
66
  return if node.attr("no-pdf")
67
67
 
68
68
  if node.nil?
69
- IsoDoc::JIS::PdfConvert.new({})
69
+ IsoDoc::Jis::PdfConvert.new({})
70
70
  else
71
- IsoDoc::JIS::PdfConvert.new(pdf_extract_attributes(node))
71
+ IsoDoc::Jis::PdfConvert.new(pdf_extract_attributes(node))
72
72
  end
73
73
  end
74
74
 
75
75
  def presentation_xml_converter(node)
76
76
  if node.nil?
77
- IsoDoc::JIS::PresentationXMLConvert.new({})
77
+ IsoDoc::Jis::PresentationXMLConvert.new({})
78
78
  else
79
- IsoDoc::JIS::PresentationXMLConvert
79
+ IsoDoc::Jis::PresentationXMLConvert
80
80
  .new(doc_extract_attributes(node)
81
- .merge(output_formats: ::Metanorma::JIS::Processor.new
81
+ .merge(output_formats: ::Metanorma::Jis::Processor.new
82
82
  .output_formats))
83
83
  end
84
84
  end
@@ -1,8 +1,8 @@
1
1
  require "pubid-jis"
2
2
 
3
3
  module Metanorma
4
- module JIS
5
- class Converter < ISO::Converter
4
+ module Jis
5
+ class Converter < Iso::Converter
6
6
  def org_abbrev
7
7
  super.merge("Japanese Industrial Standards" => "JIS")
8
8
  end
@@ -1,7 +1,7 @@
1
1
  require "metanorma/processor"
2
2
 
3
3
  module Metanorma
4
- module JIS
4
+ module Jis
5
5
  class Processor < Metanorma::Processor
6
6
 
7
7
  def initialize # rubocop:disable Lint/MissingSuper
@@ -31,20 +31,20 @@ module Metanorma
31
31
  end
32
32
 
33
33
  def version
34
- "Metanorma::JIS #{Metanorma::JIS::VERSION}"
34
+ "Metanorma::Jis #{Metanorma::Jis::VERSION}"
35
35
  end
36
36
 
37
37
  def output(xml, inname, outname, format, options = {})
38
38
  options_preprocess(options)
39
39
  case format
40
40
  when :html
41
- IsoDoc::JIS::HtmlConvert.new(options).convert(inname, xml, nil, outname)
41
+ IsoDoc::Jis::HtmlConvert.new(options).convert(inname, xml, nil, outname)
42
42
  when :doc
43
- IsoDoc::JIS::WordConvert.new(options).convert(inname, xml, nil, outname)
43
+ IsoDoc::Jis::WordConvert.new(options).convert(inname, xml, nil, outname)
44
44
  when :pdf
45
- IsoDoc::JIS::PdfConvert.new(options).convert(inname, xml, nil, outname)
45
+ IsoDoc::Jis::PdfConvert.new(options).convert(inname, xml, nil, outname)
46
46
  when :presentation
47
- IsoDoc::JIS::PresentationXMLConvert.new(options).convert(inname, xml, nil, outname)
47
+ IsoDoc::Jis::PresentationXMLConvert.new(options).convert(inname, xml, nil, outname)
48
48
  else
49
49
  super
50
50
  end
@@ -7,6 +7,7 @@
7
7
  </optional>
8
8
  <ref name="doctype"/>
9
9
  <ref name="editorialgroup"/>
10
+ <ref name="flavor"/>
10
11
  <zeroOrMore>
11
12
  <ref name="ics"/>
12
13
  </zeroOrMore>
@@ -1,6 +1,6 @@
1
1
  module Metanorma
2
- module JIS
3
- class Converter < ISO::Converter
2
+ module Jis
3
+ class Converter < Iso::Converter
4
4
  def doctype_validate(_xmldoc)
5
5
  %w(japanese-industrial-standard technical-report
6
6
  technical-specification amendment).include? @doctype or
@@ -1,6 +1,6 @@
1
1
  module Metanorma
2
- module JIS
3
- VERSION = "0.3.5".freeze
2
+ module Jis
3
+ VERSION = "0.3.6".freeze
4
4
  end
5
5
  end
6
6
 
data/lib/metanorma/jis.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require_relative "./jis/processor"
2
2
 
3
3
  module Metanorma
4
- module JIS
4
+ module Jis
5
5
  end
6
6
  end
data/lib/metanorma-jis.rb CHANGED
@@ -11,6 +11,6 @@ require "metanorma"
11
11
 
12
12
  if defined? Metanorma::Registry
13
13
  require_relative "metanorma/jis"
14
- Metanorma::Registry.instance.register(Metanorma::JIS::Processor)
14
+ Metanorma::Registry.instance.register(Metanorma::Jis::Processor)
15
15
  end
16
16
 
@@ -5,7 +5,7 @@ require_relative "parse"
5
5
 
6
6
  module Relaton
7
7
  module Render
8
- module JIS
8
+ module Jis
9
9
  class General < ::Relaton::Render::Iso::General
10
10
  def config_loc
11
11
  YAML.load_file(File.join(File.dirname(__FILE__), "config.yml"))
@@ -13,7 +13,7 @@ module Relaton
13
13
 
14
14
  def klass_initialize(_options)
15
15
  super
16
- @parseklass = Relaton::Render::JIS::Parse
16
+ @parseklass = Relaton::Render::Jis::Parse
17
17
  end
18
18
 
19
19
  def render1(doc)
@@ -2,7 +2,7 @@ require "metanorma-iso"
2
2
 
3
3
  module Relaton
4
4
  module Render
5
- module JIS
5
+ module Jis
6
6
  class Parse < ::Relaton::Render::Iso::Parse
7
7
  def simple_or_host_xml2hash(doc, host)
8
8
  ret = super
@@ -6,7 +6,7 @@ require "metanorma/jis/version"
6
6
 
7
7
  Gem::Specification.new do |spec|
8
8
  spec.name = "metanorma-jis"
9
- spec.version = Metanorma::JIS::VERSION
9
+ spec.version = Metanorma::Jis::VERSION
10
10
  spec.authors = ["Ribose Inc."]
11
11
  spec.email = ["open.source@ribose.com"]
12
12
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-jis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
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-09-30 00:00:00.000000000 Z
11
+ date: 2024-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: japanese_calendar