metanorma-ieee 0.1.2 → 0.1.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/ieee/html/htmlstyle.css +6 -0
- data/lib/isodoc/ieee/html/wordstyle.css +17 -1
- data/lib/isodoc/ieee/html/wordstyle.scss +17 -1
- data/lib/isodoc/ieee/ieee.amendment.xsl +206 -56
- data/lib/isodoc/ieee/ieee.standard.xsl +206 -56
- data/lib/isodoc/ieee/init.rb +1 -1
- data/lib/isodoc/ieee/presentation_ref.rb +2 -0
- data/lib/isodoc/ieee/presentation_terms.rb +5 -11
- data/lib/isodoc/ieee/presentation_xml_convert.rb +1 -1
- data/lib/isodoc/ieee/word_cleanup.rb +8 -0
- data/lib/isodoc/ieee/xref.rb +9 -13
- data/lib/metanorma/ieee/converter.rb +2 -2
- data/lib/metanorma/ieee/isodoc.rng +1 -1
- data/lib/metanorma/ieee/term_lookup_cleanup.rb +3 -2
- data/lib/metanorma/ieee/validate.rb +1 -1
- data/lib/metanorma/ieee/validate_style.rb +9 -11
- data/lib/metanorma/ieee/version.rb +1 -1
- metadata +2 -2
| @@ -3,8 +3,9 @@ module Metanorma | |
| 3 3 | 
             
                class TermLookupCleanup < Metanorma::Standoc::TermLookupCleanup
         | 
| 4 4 | 
             
                  def remove_missing_ref_term(node, _target)
         | 
| 5 5 | 
             
                    node.at("../xrefrender")&.remove
         | 
| 6 | 
            -
                    node.replace("<preferred><expression><name>#{node.children.to_xml}"\
         | 
| 7 | 
            -
             | 
| 6 | 
            +
                    #node.replace("<preferred><expression><name>#{node.children.to_xml}"\
         | 
| 7 | 
            +
                    #             "</name></expression></preferred>")
         | 
| 8 | 
            +
                    node.replace("<refterm>#{node.children.to_xml}</refterm>")
         | 
| 8 9 | 
             
                  end
         | 
| 9 10 | 
             
                end
         | 
| 10 11 | 
             
              end
         | 
| @@ -131,7 +131,7 @@ module Metanorma | |
| 131 131 | 
             
                    klass = IsoDoc::IEEE::HtmlConvert.new(language: @lang, script: @script)
         | 
| 132 132 | 
             
                    xrefs = IsoDoc::IEEE::Xref
         | 
| 133 133 | 
             
                      .new(@lang, @script, klass, IsoDoc::IEEE::I18n.new(@lang, @script),
         | 
| 134 | 
            -
                           {  | 
| 134 | 
            +
                           { hierarchicalassets: @hierarchical_assets })
         | 
| 135 135 | 
             
                    xrefs.parse(Nokogiri::XML(xmldoc.to_xml))
         | 
| 136 136 | 
             
                    xrefs
         | 
| 137 137 | 
             
                  end
         | 
| @@ -2,9 +2,9 @@ module Metanorma | |
| 2 2 | 
             
              module IEEE
         | 
| 3 3 | 
             
                class Converter < Standoc::Converter
         | 
| 4 4 | 
             
                  ASSETS_TO_STYLE =
         | 
| 5 | 
            -
                    "//termsource | //formula | //termnote | "\
         | 
| 6 | 
            -
                    "//p[not(ancestor::boilerplate)] | //li[not(p)] | //dt | "\
         | 
| 7 | 
            -
                    "//dd[not(p)] | //td[not(p)][not(ancestor::boilerplate)] | "\
         | 
| 5 | 
            +
                    "//termsource | //formula | //termnote | " \
         | 
| 6 | 
            +
                    "//p[not(ancestor::boilerplate)] | //li[not(p)] | //dt | " \
         | 
| 7 | 
            +
                    "//dd[not(p)] | //td[not(p)][not(ancestor::boilerplate)] | " \
         | 
| 8 8 | 
             
                    "//th[not(p)][not(ancestor::boilerplate)] | //example".freeze
         | 
| 9 9 |  | 
| 10 10 | 
             
                  def extract_text(node)
         | 
| @@ -56,8 +56,8 @@ module Metanorma | |
| 56 56 | 
             
                  end
         | 
| 57 57 |  | 
| 58 58 | 
             
                  # leaving out as problematic: N J K C S T H h d B o E
         | 
| 59 | 
            -
                  SI_UNIT = "(m|cm|mm|km|μm|nm|g|kg|mgmol|cd|rad|sr|Hz|Hz|MHz|Pa|hPa|kJ|"\
         | 
| 60 | 
            -
                            "V|kV|W|MW|kW|F|μF|Ω|Wb|°C|lm|lx|Bq|Gy|Sv|kat|l|t|eV|u|Np|Bd|"\
         | 
| 59 | 
            +
                  SI_UNIT = "(m|cm|mm|km|μm|nm|g|kg|mgmol|cd|rad|sr|Hz|Hz|MHz|Pa|hPa|kJ|" \
         | 
| 60 | 
            +
                            "V|kV|W|MW|kW|F|μF|Ω|Wb|°C|lm|lx|Bq|Gy|Sv|kat|l|t|eV|u|Np|Bd|" \
         | 
| 61 61 | 
             
                            "bit|kB|MB|Hart|nat|Sh|var)".freeze
         | 
| 62 62 |  | 
| 63 63 | 
             
                  # Style manual 14.2
         | 
| @@ -84,15 +84,15 @@ module Metanorma | |
| 84 84 | 
             
                  # deliberately doing naive, ignoring rowspan
         | 
| 85 85 | 
             
                  def table_style_columns(table)
         | 
| 86 86 | 
             
                    table_extract_columns(table).each do |col|
         | 
| 87 | 
            -
                       | 
| 87 | 
            +
                      col.any? do |x|
         | 
| 88 88 | 
             
                        /^[0-9. ]+$/.match?(x) &&
         | 
| 89 89 | 
             
                          (/\d{3} \d/.match?(x) || /\d \d{3}/.match?(x))
         | 
| 90 | 
            -
                      end
         | 
| 90 | 
            +
                      end or next
         | 
| 91 91 |  | 
| 92 92 | 
             
                      col.each do |x|
         | 
| 93 93 | 
             
                        /^[0-9. ]+$/.match?(x) && /\d{4}/.match?(x) and
         | 
| 94 94 | 
             
                          @log.add("Style", table,
         | 
| 95 | 
            -
                                   "#{x} is a 4-digit number in a table column with "\
         | 
| 95 | 
            +
                                   "#{x} is a 4-digit number in a table column with " \
         | 
| 96 96 | 
             
                                   "numbers broken up in threes")
         | 
| 97 97 | 
             
                      end
         | 
| 98 98 | 
             
                    end
         | 
| @@ -108,7 +108,7 @@ module Metanorma | |
| 108 108 | 
             
                    ret.map { |x| x.is_a?(Array) ? x : [] }
         | 
| 109 109 | 
             
                  end
         | 
| 110 110 |  | 
| 111 | 
            -
             | 
| 111 | 
            +
                  def title_validate(xml)
         | 
| 112 112 | 
             
                    title_validate_type(xml)
         | 
| 113 113 | 
             
                    title_validate_capitalisation(xml)
         | 
| 114 114 | 
             
                  end
         | 
| @@ -118,8 +118,6 @@ module Metanorma | |
| 118 118 | 
             
                    title = xml.at("//bibdata/title") or return
         | 
| 119 119 | 
             
                    draft = xml.at("//bibdata//draft")
         | 
| 120 120 | 
             
                    type = xml.at("//bibdata/ext/doctype")
         | 
| 121 | 
            -
                    subtype = xml.at("//bibdata/ext/subdoctype")
         | 
| 122 | 
            -
                    subtype = "" if subtype == "document"
         | 
| 123 121 | 
             
                    trial = xml.at("//bibdata/ext/trial-use[text() = 'true']")
         | 
| 124 122 | 
             
                    target = draft ? "Draft " : ""
         | 
| 125 123 | 
             
                    target += trial ? "Trial-Use " : ""
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: metanorma-ieee
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.1. | 
| 4 | 
            +
              version: 0.1.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- | 
| 11 | 
            +
            date: 2022-11-21 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: metanorma-standoc
         |