metanorma 0.3.7 → 0.3.8
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/Gemfile.lock +8 -7
- data/README.adoc +7 -3
- data/lib/metanorma/compile.rb +5 -2
- data/lib/metanorma/input/asciidoc.rb +5 -0
- data/lib/metanorma/version.rb +1 -1
- data/metanorma.gemspec +1 -1
- metadata +4 -4
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 537c8c191cf1d55b37090f34b5cabd7f5332c0fc38f0378ef38499a2973d2666
         | 
| 4 | 
            +
              data.tar.gz: 2bcb82454d81c2bae64dd41e77bd6800f8557974cffa607a3cd709a6e15785c5
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 200991c8752ba12ba868a570f86254372e5a4ba35ce0b02c00102d25145ae91cc1e93c6bd81e62836129b8b537d058f67ce52e51b177e3c474366d03080b928a
         | 
| 7 | 
            +
              data.tar.gz: 8a94fee5cd05b87190ebecd89b387e63a773f7e6f0c6619d6dddb1fe800b8b05471ea3ec36f286971bc4b19c347aed05aa6a7feacf689ee079168dfea6755744
         | 
    
        data/Gemfile.lock
    CHANGED
    
    | @@ -1,19 +1,19 @@ | |
| 1 1 | 
             
            PATH
         | 
| 2 2 | 
             
              remote: .
         | 
| 3 3 | 
             
              specs:
         | 
| 4 | 
            -
                metanorma (0.3. | 
| 4 | 
            +
                metanorma (0.3.8)
         | 
| 5 5 | 
             
                  asciidoctor
         | 
| 6 6 |  | 
| 7 7 | 
             
            GEM
         | 
| 8 8 | 
             
              remote: https://rubygems.org/
         | 
| 9 9 | 
             
              specs:
         | 
| 10 | 
            -
                addressable (2. | 
| 10 | 
            +
                addressable (2.6.0)
         | 
| 11 11 | 
             
                  public_suffix (>= 2.0.2, < 4.0)
         | 
| 12 12 | 
             
                algoliasearch (1.25.2)
         | 
| 13 13 | 
             
                  httpclient (~> 2.8, >= 2.8.3)
         | 
| 14 14 | 
             
                  json (>= 1.5.1)
         | 
| 15 15 | 
             
                asciidoctor (1.5.8)
         | 
| 16 | 
            -
                asciimath (1.0. | 
| 16 | 
            +
                asciimath (1.0.8)
         | 
| 17 17 | 
             
                byebug (10.0.2)
         | 
| 18 18 | 
             
                cnccs (0.1.3)
         | 
| 19 19 | 
             
                concurrent-ruby (1.1.4)
         | 
| @@ -26,7 +26,7 @@ GEM | |
| 26 26 | 
             
                  cnccs (~> 0.1.1)
         | 
| 27 27 | 
             
                  gb-agencies (~> 0.0.1)
         | 
| 28 28 | 
             
                  iso-bib-item (~> 0.4.2)
         | 
| 29 | 
            -
                html2doc (0.8. | 
| 29 | 
            +
                html2doc (0.8.9)
         | 
| 30 30 | 
             
                  asciimath (~> 1.0.7)
         | 
| 31 31 | 
             
                  htmlentities (~> 4.3.4)
         | 
| 32 32 | 
             
                  image_size
         | 
| @@ -69,15 +69,16 @@ GEM | |
| 69 69 | 
             
                isoics (0.1.7)
         | 
| 70 70 | 
             
                json (2.1.0)
         | 
| 71 71 | 
             
                liquid (4.0.1)
         | 
| 72 | 
            -
                metanorma-iso (1. | 
| 72 | 
            +
                metanorma-iso (1.1.1)
         | 
| 73 73 | 
             
                  asciidoctor (~> 1.5.7)
         | 
| 74 74 | 
             
                  iev (~> 0.2.0)
         | 
| 75 75 | 
             
                  isodoc (~> 0.9.8)
         | 
| 76 76 | 
             
                  metanorma-standoc (~> 1.1.0)
         | 
| 77 77 | 
             
                  ruby-jing
         | 
| 78 | 
            -
                metanorma-standoc (1.1. | 
| 78 | 
            +
                metanorma-standoc (1.1.2)
         | 
| 79 79 | 
             
                  asciidoctor (~> 1.5.7)
         | 
| 80 80 | 
             
                  concurrent-ruby
         | 
| 81 | 
            +
                  html2doc (~> 0.8.0)
         | 
| 81 82 | 
             
                  iev (~> 0.2.0)
         | 
| 82 83 | 
             
                  isodoc (~> 0.9.0)
         | 
| 83 84 | 
             
                  relaton (~> 0.3.1)
         | 
| @@ -150,7 +151,7 @@ DEPENDENCIES | |
| 150 151 | 
             
              equivalent-xml (~> 0.6)
         | 
| 151 152 | 
             
              isodoc (= 0.9.13)
         | 
| 152 153 | 
             
              metanorma!
         | 
| 153 | 
            -
              metanorma-iso (~> 1.0 | 
| 154 | 
            +
              metanorma-iso (~> 1.1.0)
         | 
| 154 155 | 
             
              metanorma-standoc (~> 1.1.0)
         | 
| 155 156 | 
             
              rake (~> 12.0)
         | 
| 156 157 | 
             
              rspec (~> 3.0)
         | 
    
        data/README.adoc
    CHANGED
    
    | @@ -141,6 +141,7 @@ Usage: metanorma [options] <file> | |
| 141 141 | 
             
              -r, --require LIBRARY            Require LIBRARY prior to execution
         | 
| 142 142 | 
             
              -w, --wrapper                    Create wrapper folder for HTML output
         | 
| 143 143 | 
             
              -d, --data-uri-image             Encode HTML output images as data URIs
         | 
| 144 | 
            +
              -a, --asciimath                  Preserve AsciiMath in Metanorma XML, instead of transforming it into MathML
         | 
| 144 145 | 
             
              -R, --relaton FILENAME           Export Relaton XML (bibdata) for this document to FILENAME
         | 
| 145 146 | 
             
                  (Also triggered through -x rxl)
         | 
| 146 147 | 
             
              -h, --help                       Show this message
         | 
| @@ -198,13 +199,15 @@ $ metanorma -t mpfd mpfd-bpn.adoc | |
| 198 199 | 
             
            $ metanorma -t mpfd -r metanorma-mpfd mpfd-bpn.adoc
         | 
| 199 200 | 
             
            ----
         | 
| 200 201 |  | 
| 201 | 
            -
            The `type`, `extension` and `relaton` options can be omitted if the corresponding metanorma directives
         | 
| 202 | 
            +
            The `asciimath`, `type`, `extension` and `relaton` options can be omitted if the corresponding metanorma directives
         | 
| 202 203 | 
             
            are included in the document as Metanorma directives; for Asciidoctor input, these take the form
         | 
| 203 | 
            -
            of document attributes `mn-document-class:`, `:mn-output-extensions:`  | 
| 204 | 
            +
            of document attributes `mn-keep-asciimath:`, `mn-document-class:`, `:mn-output-extensions:` 
         | 
| 205 | 
            +
            and `:mn-relaton-output-file:`, e.g.
         | 
| 204 206 |  | 
| 205 207 | 
             
            [source,asciidoctor]
         | 
| 206 208 | 
             
            ----
         | 
| 207 209 | 
             
            = My ISO document
         | 
| 210 | 
            +
            :mn-keep-asciimath:
         | 
| 208 211 | 
             
            :mn-document-class: iso
         | 
| 209 212 | 
             
            :mn-output-extensions: html,xml,pdf
         | 
| 210 213 | 
             
            :mn-relaton-output-file: test.xml
         | 
| @@ -227,7 +230,8 @@ The options hash has the same structure it does when invoked in metanorma-cli: | |
| 227 230 | 
             
            `:format`:: `:asciidoc` is only value currently allowed
         | 
| 228 231 | 
             
            `:extension_keys`:: array of symbols: `:all`, `:xml`:, `:doc` etc.
         | 
| 229 232 | 
             
            `:wrapper`: true/false
         | 
| 230 | 
            -
            `: | 
| 233 | 
            +
            `:datauriimage`: true/false
         | 
| 234 | 
            +
            `:asciimath`: true/false
         | 
| 231 235 | 
             
            `:require`: array of libraries to require
         | 
| 232 236 | 
             
            `:relaton`: exports the bibdata Relaton XML description of the document (which is part of its Metanorma XML)
         | 
| 233 237 | 
             
            to the nominated directory
         | 
    
        data/lib/metanorma/compile.rb
    CHANGED
    
    | @@ -13,7 +13,7 @@ module Metanorma | |
| 13 13 | 
             
                  require_libraries(options)
         | 
| 14 14 | 
             
                  @processor = @registry.find_processor(options[:type].to_sym)
         | 
| 15 15 | 
             
                  extensions = get_extensions(options) or return nil
         | 
| 16 | 
            -
                  (file, isodoc = process_input(filename)) or return nil
         | 
| 16 | 
            +
                  (file, isodoc = process_input(filename, options)) or return nil
         | 
| 17 17 | 
             
                  relaton_export(isodoc, options)
         | 
| 18 18 | 
             
                  process_extensions(extensions, file, isodoc, options)
         | 
| 19 19 | 
             
                end
         | 
| @@ -86,11 +86,14 @@ module Metanorma | |
| 86 86 | 
             
                  extensions
         | 
| 87 87 | 
             
                end
         | 
| 88 88 |  | 
| 89 | 
            -
                def process_input(filename)
         | 
| 89 | 
            +
                def process_input(filename, options)
         | 
| 90 90 | 
             
                  case extname = File.extname(filename)
         | 
| 91 91 | 
             
                  when ".adoc"
         | 
| 92 92 | 
             
                    puts "[metanorma] Processing: Asciidoctor input."
         | 
| 93 93 | 
             
                    file = File.read(filename, encoding: "utf-8")
         | 
| 94 | 
            +
                    if options[:asciimath]
         | 
| 95 | 
            +
                      file.sub!(/^(=[^\n]+\n)/, "\\1:mn-keep-asciimath:\n")
         | 
| 96 | 
            +
                    end
         | 
| 94 97 | 
             
                    [file, @processor.input_to_isodoc(file, filename)]
         | 
| 95 98 | 
             
                  when ".xml"
         | 
| 96 99 | 
             
                    puts "[metanorma] Processing: Metanorma XML input."
         | 
| @@ -20,10 +20,15 @@ module Metanorma | |
| 20 20 | 
             
                    /\n:mn-document-class: (?<type>[^\n]+)\n/ =~ headerextract
         | 
| 21 21 | 
             
                    /\n:mn-output-extensions: (?<extensions>[^\n]+)\n/ =~ headerextract
         | 
| 22 22 | 
             
                    /\n:mn-relaton-output-file: (?<relaton>[^\n]+)\n/ =~ headerextract
         | 
| 23 | 
            +
                    /\n(?<asciimath>:mn-keep-asciimath:[^\n]*)\n/ =~ headerextract
         | 
| 24 | 
            +
                    asciimath = defined?(asciimath) ?
         | 
| 25 | 
            +
                      (!asciimath.nil? && asciimath != ":mn-keep-asciimath: false") : nil
         | 
| 26 | 
            +
                    asciimath = nil if asciimath == false
         | 
| 23 27 | 
             
                    {
         | 
| 24 28 | 
             
                      type: defined?(type) ? type : nil,
         | 
| 25 29 | 
             
                      extensions: defined?(extensions) ? extensions : nil,
         | 
| 26 30 | 
             
                      relaton: defined?(relaton) ? relaton : nil,
         | 
| 31 | 
            +
                      asciimath: asciimath,
         | 
| 27 32 | 
             
                    }.reject { |_, val| val.nil? }
         | 
| 28 33 | 
             
                  end
         | 
| 29 34 |  | 
    
        data/lib/metanorma/version.rb
    CHANGED
    
    
    
        data/metanorma.gemspec
    CHANGED
    
    | @@ -32,7 +32,7 @@ Gem::Specification.new do |spec| | |
| 32 32 | 
             
              spec.add_development_dependency "byebug", "~> 10.0"
         | 
| 33 33 | 
             
              spec.add_development_dependency "rspec-command", "~> 1.0.3"
         | 
| 34 34 | 
             
              spec.add_development_dependency "equivalent-xml", "~> 0.6"
         | 
| 35 | 
            -
              spec.add_development_dependency "metanorma-iso", "~> 1.0 | 
| 35 | 
            +
              spec.add_development_dependency "metanorma-iso", "~> 1.1.0"
         | 
| 36 36 | 
             
              spec.add_development_dependency "metanorma-standoc", "~> 1.1.0"
         | 
| 37 37 | 
             
              spec.add_development_dependency "isodoc", "0.9.13"
         | 
| 38 38 | 
             
            end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: metanorma
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.3. | 
| 4 | 
            +
              version: 0.3.8
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Ribose Inc.
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2019-01- | 
| 11 | 
            +
            date: 2019-01-31 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: asciidoctor
         | 
| @@ -114,14 +114,14 @@ dependencies: | |
| 114 114 | 
             
                requirements:
         | 
| 115 115 | 
             
                - - "~>"
         | 
| 116 116 | 
             
                  - !ruby/object:Gem::Version
         | 
| 117 | 
            -
                    version: 1.0 | 
| 117 | 
            +
                    version: 1.1.0
         | 
| 118 118 | 
             
              type: :development
         | 
| 119 119 | 
             
              prerelease: false
         | 
| 120 120 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 121 121 | 
             
                requirements:
         | 
| 122 122 | 
             
                - - "~>"
         | 
| 123 123 | 
             
                  - !ruby/object:Gem::Version
         | 
| 124 | 
            -
                    version: 1.0 | 
| 124 | 
            +
                    version: 1.1.0
         | 
| 125 125 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 126 126 | 
             
              name: metanorma-standoc
         | 
| 127 127 | 
             
              requirement: !ruby/object:Gem::Requirement
         |