isodoc 1.5.0 → 1.5.1

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: 46206b47756f66c1927ca1810020fbe63141a27f6ad000e95b7938f5b2f8cdcc
4
- data.tar.gz: bbce350ccfa6c97bff0c45cccdc15febde0a2c17b1e415fb8132f205ba202d85
3
+ metadata.gz: 691e16d8f19de5c4008d22686af0f70594dea57d039e7d4e265763a02cc8eea3
4
+ data.tar.gz: 4aca2f6a4b06fa9c6dd3235ee8581e94060f47eb3fe8dc9de9a6b6aa5ee356f2
5
5
  SHA512:
6
- metadata.gz: 7679fe14d35c348ffc9fcda332f27bf39e898337ae5c0cd7a8638e74f1d26a77ca528cad7d210b82f546336b80e0115c4131c49d9cec1ae82a8174d34002ead3
7
- data.tar.gz: 20ca1c4d733511fa7f5dc5fe28295c754803b20167e3ae8d39209b1c2d3f63fc064308668a7c23cf834a6a1d93e46ec486931d2c189c0e47210507b32c0291a2
6
+ metadata.gz: 1ac28f83694610bab479de1bed5921c3d5807ab337dd2926555b66a7e5c1f5912c320a335089a4c7a617e816f1d8957bf923c986813e3374316ef472f825f7c2
7
+ data.tar.gz: d472986686451eab5674ce530a2a8fb2a82660d345280ae4ce57425c8920f135a789536ae4d0b05b952a8ea44efcaaf5122bc266cb6f17aee2fb6b4d79d1ca79
@@ -16,17 +16,17 @@ jobs:
16
16
  strategy:
17
17
  fail-fast: false
18
18
  matrix:
19
- ruby: [ '2.6', '2.5', '2.4' ]
19
+ ruby: [ '2.7', '2.6', '2.5', '2.4' ]
20
20
  os: [ ubuntu-latest, windows-latest, macos-latest ]
21
21
  experimental: [ false ]
22
22
  include:
23
- - ruby: '2.7'
23
+ - ruby: '3.0'
24
24
  os: 'ubuntu-latest'
25
25
  experimental: true
26
- - ruby: '2.7'
26
+ - ruby: '3.0'
27
27
  os: 'windows-latest'
28
28
  experimental: true
29
- - ruby: '2.7'
29
+ - ruby: '3.0'
30
30
  os: 'macos-latest'
31
31
  experimental: true
32
32
  steps:
@@ -35,49 +35,19 @@ jobs:
35
35
  - uses: ruby/setup-ruby@v1
36
36
  with:
37
37
  ruby-version: ${{ matrix.ruby }}
38
+ bundler-cache: true
38
39
 
39
- - uses: actions/cache@v2
40
- with:
41
- path: vendor/bundle
42
- key: bundle-${{ matrix.os }}-${{ matrix.ruby }}-${{ hashFiles('**/*.gemspec') }}
43
- restore-keys: bundle-${{ matrix.os }}-${{ matrix.ruby }}
44
-
45
- - run: bundle config set path 'vendor/bundle'
46
-
47
- - run: bundle install --jobs 4 --retry 3
48
-
49
- - name: Install Inkscape macOS
50
- if: matrix.os == 'macos-latest'
51
- run: |
52
- brew cask install inkscape
53
- inkscape --version
54
-
55
- - name: Install Inkscape Ubuntu
56
- if: matrix.os == 'ubuntu-latest'
57
- run: |
58
- sudo add-apt-repository ppa:inkscape.dev/stable
59
- sudo apt update
60
- sudo apt install inkscape
61
- inkscape --version
62
-
63
- - name: Install Inkscape Windows
64
- if: matrix.os == 'windows-latest'
65
- run: |
66
- choco install --no-progress -y inkscape
67
- inkscape --version
40
+ - uses: metanorma/metanorma-build-scripts/inkscape-setup-action@master
68
41
 
69
42
  - run: bundle exec rake
70
43
 
71
44
  tests-passed:
72
45
  needs: rake
73
46
  runs-on: ubuntu-latest
74
- continue-on-error: true
75
47
  steps:
76
- - name: Trigger tests passed event
77
- uses: Sibz/github-status-action@v1
48
+ - uses: peter-evans/repository-dispatch@v1
78
49
  with:
79
- authToken: ${{ secrets.METANORMA_CI_PAT_TOKEN || secrets.GITHUB_TOKEN }}
80
- context: 'tests-passed-successfully'
81
- description: 'Tests passed successfully'
82
- state: 'success'
83
- sha: ${{ github.event.pull_request.head.sha || github.sha }}
50
+ token: ${{ secrets.METANORMA_CI_PAT_TOKEN || secrets.GITHUB_TOKEN }}
51
+ repository: ${{ github.repository }}
52
+ event-type: notify
53
+ client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'
data/isodoc.gemspec CHANGED
@@ -50,4 +50,5 @@ Gem::Specification.new do |spec|
50
50
  spec.add_development_dependency "rubocop", "= 0.54.0"
51
51
  spec.add_development_dependency "simplecov", "~> 0.15"
52
52
  spec.add_development_dependency "timecop", "~> 0.9"
53
+ spec.add_development_dependency "rexml"
53
54
  end
@@ -39,7 +39,7 @@ module IsoDoc::Function
39
39
  "uri[@type = 'citation']"))
40
40
  return href unless url
41
41
  href = suffix_url(url.text)
42
- anchor = node&.at(ns(".//locality[@type = 'anchor']"))&.text
42
+ anchor = node&.at(ns(".//locality[@type = 'anchor']"))&.text&.strip
43
43
  anchor and href += "##{anchor}"
44
44
  href
45
45
  end
@@ -9,6 +9,12 @@ module IsoDoc
9
9
  docxml.xpath(ns("//figure")).each do |f|
10
10
  figure1(f)
11
11
  end
12
+ docxml.xpath(ns("//svgmap")).each do |s|
13
+ if f = s.at(ns("./figure")) then s.replace(f)
14
+ else
15
+ s.remove
16
+ end
17
+ end
12
18
  end
13
19
 
14
20
  def figure1(f)
@@ -1,3 +1,3 @@
1
1
  module IsoDoc
2
- VERSION = "1.5.0".freeze
2
+ VERSION = "1.5.1".freeze
3
3
  end
@@ -2687,7 +2687,7 @@ expect(( File.read("test.html").gsub(%r{^.*<h1 class="ForewordTitle">Foreword</h
2687
2687
  expect(File.exist?("test.html.err")).to be true
2688
2688
  end
2689
2689
 
2690
- it "ignore passthrough with incompatible format" do
2690
+ it "ignores passthrough with incompatible format" do
2691
2691
  expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
2692
2692
  <iso-standard xmlns="http://riboseinc.com/isoxml">
2693
2693
  <preface><foreword>
@@ -2707,6 +2707,62 @@ expect(( File.read("test.html").gsub(%r{^.*<h1 class="ForewordTitle">Foreword</h
2707
2707
  OUTPUT
2708
2708
  end
2709
2709
 
2710
+ it "processes svgmap" do
2711
+ expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~INPUT, true)).sub(%r{<localized-strings>.*</localized-strings>}m, "")).to be_equivalent_to xmlpp(<<~OUTPUT)
2712
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
2713
+ <sections>
2714
+ <svgmap id='_'>
2715
+ <target href='http://www.example.com'>
2716
+ <xref target='ref1'>Computer</xref>
2717
+ </target>
2718
+ </svgmap>
2719
+ <figure id='_'>
2720
+ <image src='action_schemaexpg1.svg' id='_' mimetype='image/svg+xml' height='auto' width='auto'/>
2721
+ </figure>
2722
+ <svgmap id='_'>
2723
+ <figure id='_'>
2724
+ <image src='action_schemaexpg2.svg' id='_' mimetype='image/svg+xml' height='auto' width='auto' alt='Workmap'/>
2725
+ </figure>
2726
+ <target href='mn://support_resource_schema'>
2727
+ <eref bibitemid='express_action_schema' citeas=''>
2728
+ <localityStack>
2729
+ <locality type='anchor'>
2730
+ <referenceFrom>action_schema.basic</referenceFrom>
2731
+ </locality>
2732
+ </localityStack>
2733
+ Coffee
2734
+ </eref>
2735
+ </target>
2736
+ </svgmap>
2737
+ </sections>
2738
+ <bibliography>
2739
+ <references hidden='true' normative='false'>
2740
+ <bibitem id='express_action_schema' type='internal'>
2741
+ <docidentifier type='repository'>express/action_schema</docidentifier>
2742
+ </bibitem>
2743
+ </references>
2744
+ </bibliography>
2745
+ </iso-standard>
2746
+ INPUT
2747
+ <iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
2748
+ <sections>
2749
+ <figure id='_'>
2750
+ <image src='action_schemaexpg1.svg' id='_' mimetype='image/svg+xml' height='auto' width='auto'/>
2751
+ </figure>
2752
+ <figure id='_'>
2753
+ <image src='action_schemaexpg2.svg' id='_' mimetype='image/svg+xml' height='auto' width='auto' alt='Workmap'/>
2754
+ </figure>
2755
+ </sections>
2756
+ <bibliography>
2757
+ <references hidden='true' normative='false'>
2758
+ <bibitem id='express_action_schema' type='internal'>
2759
+ <docidentifier type='repository'>express/action_schema</docidentifier>
2760
+ </bibitem>
2761
+ </references>
2762
+ </bibliography>
2763
+ </iso-standard>
2764
+ OUTPUT
2710
2765
 
2766
+ end
2711
2767
 
2712
2768
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isodoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-25 00:00:00.000000000 Z
11
+ date: 2021-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciimath
@@ -304,6 +304,20 @@ dependencies:
304
304
  - - "~>"
305
305
  - !ruby/object:Gem::Version
306
306
  version: '0.9'
307
+ - !ruby/object:Gem::Dependency
308
+ name: rexml
309
+ requirement: !ruby/object:Gem::Requirement
310
+ requirements:
311
+ - - ">="
312
+ - !ruby/object:Gem::Version
313
+ version: '0'
314
+ type: :development
315
+ prerelease: false
316
+ version_requirements: !ruby/object:Gem::Requirement
317
+ requirements:
318
+ - - ">="
319
+ - !ruby/object:Gem::Version
320
+ version: '0'
307
321
  description: |
308
322
  isodoc converts documents in the IsoDoc document model into
309
323
  Microsoft Word and HTML.
@@ -454,7 +468,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
454
468
  - !ruby/object:Gem::Version
455
469
  version: '0'
456
470
  requirements: []
457
- rubygems_version: 3.0.3
471
+ rubygems_version: 3.1.4
458
472
  signing_key:
459
473
  specification_version: 4
460
474
  summary: Convert documents in IsoDoc into Word and HTML in AsciiDoc.