metanorma-itu 2.0.2 → 2.0.3
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/itu/html/itu.css +8 -2
 - data/lib/isodoc/itu/html/itu.scss +7 -1
 - data/lib/isodoc/itu/html/word_itu_titlepage_sp.html +4 -3
 - data/lib/isodoc/itu/html/wordstyle.css +8 -8
 - data/lib/isodoc/itu/html/wordstyle.scss +8 -8
 - data/lib/isodoc/itu/itu.implementers-guide.xsl +614 -156
 - data/lib/isodoc/itu/itu.in-force.xsl +614 -156
 - data/lib/isodoc/itu/itu.recommendation-annex.xsl +614 -156
 - data/lib/isodoc/itu/itu.recommendation-supplement.xsl +614 -156
 - data/lib/isodoc/itu/itu.recommendation.xsl +614 -156
 - data/lib/isodoc/itu/itu.resolution.xsl +614 -156
 - data/lib/isodoc/itu/itu.service-publication.xsl +614 -156
 - data/lib/isodoc/itu/itu.technical-paper.xsl +614 -156
 - data/lib/isodoc/itu/itu.technical-report.xsl +614 -156
 - data/lib/isodoc/itu/metadata.rb +25 -24
 - data/lib/isodoc/itu/presentation_xml_convert.rb +13 -0
 - data/lib/isodoc/itu/ref.rb +28 -18
 - data/lib/metanorma/itu/basicdoc.rng +5 -3
 - data/lib/metanorma/itu/biblio.rng +5 -3
 - data/lib/metanorma/itu/version.rb +1 -1
 - metadata +2 -2
 
    
        data/lib/isodoc/itu/metadata.rb
    CHANGED
    
    | 
         @@ -11,6 +11,7 @@ module IsoDoc 
     | 
|
| 
       11 
11 
     | 
    
         
             
                    set(:logo_comb, fileloc("itu-document-comb.png"))
         
     | 
| 
       12 
12 
     | 
    
         
             
                    set(:logo_word, fileloc(n))
         
     | 
| 
       13 
13 
     | 
    
         
             
                    set(:logo_sp, fileloc("logo-sp.png"))
         
     | 
| 
      
 14 
     | 
    
         
            +
                    @isodoc = IsoDoc::ITU::HtmlConvert.new({})
         
     | 
| 
       14 
15 
     | 
    
         
             
                  end
         
     | 
| 
       15 
16 
     | 
    
         | 
| 
       16 
17 
     | 
    
         
             
                  def fileloc(file)
         
     | 
| 
         @@ -19,30 +20,30 @@ module IsoDoc 
     | 
|
| 
       19 
20 
     | 
    
         
             
                  end
         
     | 
| 
       20 
21 
     | 
    
         | 
| 
       21 
22 
     | 
    
         
             
                  def title(isoxml, _out)
         
     | 
| 
       22 
     | 
    
         
            -
                     
     | 
| 
       23 
     | 
    
         
            -
             
     | 
| 
       24 
     | 
    
         
            -
             
     | 
| 
       25 
     | 
    
         
            -
             
     | 
| 
       26 
     | 
    
         
            -
             
     | 
| 
       27 
     | 
    
         
            -
             
     | 
| 
       28 
     | 
    
         
            -
             
     | 
| 
       29 
     | 
    
         
            -
             
     | 
| 
       30 
     | 
    
         
            -
             
     | 
| 
       31 
     | 
    
         
            -
             
     | 
| 
       32 
     | 
    
         
            -
             
     | 
| 
       33 
     | 
    
         
            -
             
     | 
| 
       34 
     | 
    
         
            -
             
     | 
| 
       35 
     | 
    
         
            -
                     
     | 
| 
       36 
     | 
    
         
            -
             
     | 
| 
       37 
     | 
    
         
            -
             
     | 
| 
       38 
     | 
    
         
            -
             
     | 
| 
       39 
     | 
    
         
            -
                     
     | 
| 
       40 
     | 
    
         
            -
             
     | 
| 
       41 
     | 
    
         
            -
             
     | 
| 
       42 
     | 
    
         
            -
             
     | 
| 
       43 
     | 
    
         
            -
             
     | 
| 
       44 
     | 
    
         
            -
                     
     | 
| 
       45 
     | 
    
         
            -
                    set( 
     | 
| 
      
 23 
     | 
    
         
            +
                    { doctitle: "//bibdata/title[@language='#{@lang}'][@type = 'main']",
         
     | 
| 
      
 24 
     | 
    
         
            +
                      docsubtitle: "//bibdata/title[@language='#{@lang}']"\
         
     | 
| 
      
 25 
     | 
    
         
            +
                                   "[@type = 'subtitle']",
         
     | 
| 
      
 26 
     | 
    
         
            +
                      amendmenttitle: "//bibdata/title[@language='#{@lang}']"\
         
     | 
| 
      
 27 
     | 
    
         
            +
                                      "[@type = 'amendment']",
         
     | 
| 
      
 28 
     | 
    
         
            +
                      corrigendumtitle: "//bibdata/title[@language='#{@lang}']"\
         
     | 
| 
      
 29 
     | 
    
         
            +
                                        "[@type = 'corrigendum']",
         
     | 
| 
      
 30 
     | 
    
         
            +
                      series: "//bibdata/series[@type='main']/title",
         
     | 
| 
      
 31 
     | 
    
         
            +
                      series1: "//bibdata/series[@type='secondary']/title",
         
     | 
| 
      
 32 
     | 
    
         
            +
                      series2: "//bibdata/series[@type='tertiary']/title",
         
     | 
| 
      
 33 
     | 
    
         
            +
                      annextitle: "//bibdata/title[@type='annex']",
         
     | 
| 
      
 34 
     | 
    
         
            +
                      positiontitle: "//bibdata/title[@type='position-sp']" }.each do |k, v|
         
     | 
| 
      
 35 
     | 
    
         
            +
                      titleset(isoxml, k, v)
         
     | 
| 
      
 36 
     | 
    
         
            +
                    end
         
     | 
| 
      
 37 
     | 
    
         
            +
                  end
         
     | 
| 
      
 38 
     | 
    
         
            +
             
     | 
| 
      
 39 
     | 
    
         
            +
                  def titleset(isoxml, key, xpath)
         
     | 
| 
      
 40 
     | 
    
         
            +
                    value = isoxml.at(ns(xpath)) or return
         
     | 
| 
      
 41 
     | 
    
         
            +
                    out = @isodoc.noko do |xml|
         
     | 
| 
      
 42 
     | 
    
         
            +
                      xml.span do |s|
         
     | 
| 
      
 43 
     | 
    
         
            +
                        value.children.each { |c| @isodoc.parse(c, s) }
         
     | 
| 
      
 44 
     | 
    
         
            +
                      end
         
     | 
| 
      
 45 
     | 
    
         
            +
                    end.join
         
     | 
| 
      
 46 
     | 
    
         
            +
                    set(key, out.sub(%r{^<span>}, "").sub(%r{</span>$}, ""))
         
     | 
| 
       46 
47 
     | 
    
         
             
                  end
         
     | 
| 
       47 
48 
     | 
    
         | 
| 
       48 
49 
     | 
    
         
             
                  def subtitle(_isoxml, _out)
         
     | 
| 
         @@ -174,6 +174,19 @@ module IsoDoc 
     | 
|
| 
       174 
174 
     | 
    
         
             
                      t.children = "<strong>#{t.children.to_xml}</strong>"
         
     | 
| 
       175 
175 
     | 
    
         
             
                  end
         
     | 
| 
       176 
176 
     | 
    
         | 
| 
      
 177 
     | 
    
         
            +
                  def ol_depth(node)
         
     | 
| 
      
 178 
     | 
    
         
            +
                    return super unless node["class"] == "steps" ||
         
     | 
| 
      
 179 
     | 
    
         
            +
                      node.at(".//ancestor::xmlns:ol[@class = 'steps']")
         
     | 
| 
      
 180 
     | 
    
         
            +
             
     | 
| 
      
 181 
     | 
    
         
            +
                    depth = node.ancestors("ul, ol").size + 1
         
     | 
| 
      
 182 
     | 
    
         
            +
                    type = :arabic
         
     | 
| 
      
 183 
     | 
    
         
            +
                    type = :alphabet if [2, 7].include? depth
         
     | 
| 
      
 184 
     | 
    
         
            +
                    type = :roman if [3, 8].include? depth
         
     | 
| 
      
 185 
     | 
    
         
            +
                    type = :alphabet_upper if [4, 9].include? depth
         
     | 
| 
      
 186 
     | 
    
         
            +
                    type = :roman_upper if [5, 10].include? depth
         
     | 
| 
      
 187 
     | 
    
         
            +
                    type
         
     | 
| 
      
 188 
     | 
    
         
            +
                  end
         
     | 
| 
      
 189 
     | 
    
         
            +
             
     | 
| 
       177 
190 
     | 
    
         
             
                  include Init
         
     | 
| 
       178 
191 
     | 
    
         
             
                end
         
     | 
| 
       179 
192 
     | 
    
         
             
              end
         
     | 
    
        data/lib/isodoc/itu/ref.rb
    CHANGED
    
    | 
         @@ -44,24 +44,26 @@ module IsoDoc 
     | 
|
| 
       44 
44 
     | 
    
         
             
                    end
         
     | 
| 
       45 
45 
     | 
    
         
             
                  end
         
     | 
| 
       46 
46 
     | 
    
         | 
| 
       47 
     | 
    
         
            -
                  def bracket_if_num( 
     | 
| 
       48 
     | 
    
         
            -
                    return nil if  
     | 
| 
      
 47 
     | 
    
         
            +
                  def bracket_if_num(num)
         
     | 
| 
      
 48 
     | 
    
         
            +
                    return nil if num.nil?
         
     | 
| 
       49 
49 
     | 
    
         | 
| 
       50 
     | 
    
         
            -
                     
     | 
| 
       51 
     | 
    
         
            -
                    "[#{ 
     | 
| 
      
 50 
     | 
    
         
            +
                    num = num.text.sub(/^\[/, "").sub(/\]$/, "")
         
     | 
| 
      
 51 
     | 
    
         
            +
                    "[#{num}]"
         
     | 
| 
       52 
52 
     | 
    
         
             
                  end
         
     | 
| 
       53 
53 
     | 
    
         | 
| 
       54 
     | 
    
         
            -
                  def reference_format( 
     | 
| 
       55 
     | 
    
         
            -
                    reference_format_start( 
     | 
| 
       56 
     | 
    
         
            -
                    reference_format_title( 
     | 
| 
      
 54 
     | 
    
         
            +
                  def reference_format(biblio, ref)
         
     | 
| 
      
 55 
     | 
    
         
            +
                    reference_format_start(biblio, ref)
         
     | 
| 
      
 56 
     | 
    
         
            +
                    reference_format_title(biblio, ref)
         
     | 
| 
       57 
57 
     | 
    
         
             
                  end
         
     | 
| 
       58 
58 
     | 
    
         | 
| 
       59 
     | 
    
         
            -
                  def titlecase( 
     | 
| 
       60 
     | 
    
         
            -
                     
     | 
| 
      
 59 
     | 
    
         
            +
                  def titlecase(str)
         
     | 
| 
      
 60 
     | 
    
         
            +
                    str.gsub(/ |_|-/, " ").split(/ /).map(&:capitalize).join(" ")
         
     | 
| 
       61 
61 
     | 
    
         
             
                  end
         
     | 
| 
       62 
62 
     | 
    
         | 
| 
       63 
     | 
    
         
            -
                  def pref_ref_code( 
     | 
| 
       64 
     | 
    
         
            -
                     
     | 
| 
      
 63 
     | 
    
         
            +
                  def pref_ref_code(bibitem)
         
     | 
| 
      
 64 
     | 
    
         
            +
                    ret = bibitem.xpath(ns("./docidentifier[@type = 'ITU']")) 
         
     | 
| 
      
 65 
     | 
    
         
            +
                    ret.empty? and ret = super
         
     | 
| 
      
 66 
     | 
    
         
            +
                    ret
         
     | 
| 
       65 
67 
     | 
    
         
             
                  end
         
     | 
| 
       66 
68 
     | 
    
         | 
| 
       67 
69 
     | 
    
         
             
                  IGNORE_IDS = "@type = 'DOI' or @type = 'ISSN' or @type = 'ISBN' or "\
         
     | 
| 
         @@ -84,7 +86,7 @@ module IsoDoc 
     | 
|
| 
       84 
86 
     | 
    
         
             
                      else
         
     | 
| 
       85 
87 
     | 
    
         
             
                        docid_prefix(id["type"], id.text.sub(/^\[/, "").sub(/\]$/, ""))
         
     | 
| 
       86 
88 
     | 
    
         
             
                      end
         
     | 
| 
       87 
     | 
    
         
            -
                    end.join("  
     | 
| 
      
 89 
     | 
    
         
            +
                    end.join(" | ")
         
     | 
| 
       88 
90 
     | 
    
         
             
                  end
         
     | 
| 
       89 
91 
     | 
    
         | 
| 
       90 
92 
     | 
    
         
             
                  def doctype_title(id)
         
     | 
| 
         @@ -98,20 +100,28 @@ module IsoDoc 
     | 
|
| 
       98 
100 
     | 
    
         
             
                    end
         
     | 
| 
       99 
101 
     | 
    
         
             
                  end
         
     | 
| 
       100 
102 
     | 
    
         | 
| 
       101 
     | 
    
         
            -
                  def  
     | 
| 
       102 
     | 
    
         
            -
                     
     | 
| 
      
 103 
     | 
    
         
            +
                  def unbracket(ident)
         
     | 
| 
      
 104 
     | 
    
         
            +
                    if ident.respond_to?(:size)
         
     | 
| 
      
 105 
     | 
    
         
            +
                      ident.map { |x| unbracket1(x) }.join(" | ")
         
     | 
| 
      
 106 
     | 
    
         
            +
                    else
         
     | 
| 
      
 107 
     | 
    
         
            +
                      unbracket1(ident)
         
     | 
| 
      
 108 
     | 
    
         
            +
                    end
         
     | 
| 
      
 109 
     | 
    
         
            +
                  end
         
     | 
| 
      
 110 
     | 
    
         
            +
             
     | 
| 
      
 111 
     | 
    
         
            +
                  def reference_format_start(bib, r)
         
     | 
| 
      
 112 
     | 
    
         
            +
                    id = multi_bibitem_ref_code(bib)
         
     | 
| 
       103 
113 
     | 
    
         
             
                    id1 = render_multi_identifiers(id)
         
     | 
| 
       104 
114 
     | 
    
         
             
                    r << id1
         
     | 
| 
       105 
     | 
    
         
            -
                    date =  
     | 
| 
      
 115 
     | 
    
         
            +
                    date = bib.at(ns("./date[@type = 'published']")) and
         
     | 
| 
       106 
116 
     | 
    
         
             
                      r << " (#{date.text.sub(/-.*$/, '')})"
         
     | 
| 
       107 
117 
     | 
    
         
             
                    r << ", " if date || !id1.empty?
         
     | 
| 
       108 
118 
     | 
    
         
             
                  end
         
     | 
| 
       109 
119 
     | 
    
         | 
| 
       110 
     | 
    
         
            -
                  def reference_format_title( 
     | 
| 
       111 
     | 
    
         
            -
                    if ftitle =  
     | 
| 
      
 120 
     | 
    
         
            +
                  def reference_format_title(bib, r)
         
     | 
| 
      
 121 
     | 
    
         
            +
                    if ftitle = bib.at(ns("./formattedref"))
         
     | 
| 
       112 
122 
     | 
    
         
             
                      ftitle&.children&.each { |n| parse(n, r) }
         
     | 
| 
       113 
123 
     | 
    
         
             
                      /\.$/.match(ftitle&.text) or r << "."
         
     | 
| 
       114 
     | 
    
         
            -
                    elsif title = iso_title( 
     | 
| 
      
 124 
     | 
    
         
            +
                    elsif title = iso_title(bib)
         
     | 
| 
       115 
125 
     | 
    
         
             
                      r.i do |i|
         
     | 
| 
       116 
126 
     | 
    
         
             
                        title&.children&.each { |n| parse(n, i) }
         
     | 
| 
       117 
127 
     | 
    
         
             
                      end
         
     | 
| 
         @@ -173,9 +173,11 @@ 
     | 
|
| 
       173 
173 
     | 
    
         
             
                      <data type="dateTime"/>
         
     | 
| 
       174 
174 
     | 
    
         
             
                    </attribute>
         
     | 
| 
       175 
175 
     | 
    
         
             
                  </optional>
         
     | 
| 
       176 
     | 
    
         
            -
                  < 
     | 
| 
       177 
     | 
    
         
            -
                    < 
     | 
| 
       178 
     | 
    
         
            -
             
     | 
| 
      
 176 
     | 
    
         
            +
                  <optional>
         
     | 
| 
      
 177 
     | 
    
         
            +
                    <attribute name="from">
         
     | 
| 
      
 178 
     | 
    
         
            +
                      <data type="IDREF"/>
         
     | 
| 
      
 179 
     | 
    
         
            +
                    </attribute>
         
     | 
| 
      
 180 
     | 
    
         
            +
                  </optional>
         
     | 
| 
       179 
181 
     | 
    
         
             
                  <optional>
         
     | 
| 
       180 
182 
     | 
    
         
             
                    <attribute name="to">
         
     | 
| 
       181 
183 
     | 
    
         
             
                      <data type="IDREF"/>
         
     | 
| 
         @@ -209,9 +209,6 @@ 
     | 
|
| 
       209 
209 
     | 
    
         
             
                  <zeroOrMore>
         
     | 
| 
       210 
210 
     | 
    
         
             
                    <ref name="contact"/>
         
     | 
| 
       211 
211 
     | 
    
         
             
                  </zeroOrMore>
         
     | 
| 
       212 
     | 
    
         
            -
                  <zeroOrMore>
         
     | 
| 
       213 
     | 
    
         
            -
                    <ref name="uri"/>
         
     | 
| 
       214 
     | 
    
         
            -
                  </zeroOrMore>
         
     | 
| 
       215 
212 
     | 
    
         
             
                </element>
         
     | 
| 
       216 
213 
     | 
    
         
             
              </define>
         
     | 
| 
       217 
214 
     | 
    
         
             
              <define name="fullname">
         
     | 
| 
         @@ -828,6 +825,11 @@ 
     | 
|
| 
       828 
825 
     | 
    
         
             
                  <optional>
         
     | 
| 
       829 
826 
     | 
    
         
             
                    <attribute name="scope"/>
         
     | 
| 
       830 
827 
     | 
    
         
             
                  </optional>
         
     | 
| 
      
 828 
     | 
    
         
            +
                  <optional>
         
     | 
| 
      
 829 
     | 
    
         
            +
                    <attribute name="primary">
         
     | 
| 
      
 830 
     | 
    
         
            +
                      <data type="boolean"/>
         
     | 
| 
      
 831 
     | 
    
         
            +
                    </attribute>
         
     | 
| 
      
 832 
     | 
    
         
            +
                  </optional>
         
     | 
| 
       831 
833 
     | 
    
         
             
                  <text/>
         
     | 
| 
       832 
834 
     | 
    
         
             
                </element>
         
     | 
| 
       833 
835 
     | 
    
         
             
              </define>
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: metanorma-itu
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 2.0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 2.0.3
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Ribose Inc.
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire:
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: exe
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2022- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2022-02-07 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: htmlentities
         
     |