metanorma-m3d 1.1.4 → 1.1.5

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: 54f988fbd702d2edf27e7fe8cbadf837ab117ceed4c09f2c6cce94078ebcb67f
4
- data.tar.gz: f3c5d31cf20bd1a1bcb5331f932abeda17085ee03ca92e3260cbe7dcee9f56b1
3
+ metadata.gz: 41e24693933de2a6ec176e4c61da0b2a89139544c8f3bb57fc6cf4be911cd812
4
+ data.tar.gz: 5986a9c10b9b4c9c74d6eae91b6ee380013986a1be0204345b531ac28b3187f9
5
5
  SHA512:
6
- metadata.gz: be1f1427bcd49a2af4fa817e14a7eced3f28331f50ccd9cbd239c1fb1dd33ea1a3e1b95ec870baa4d768485c1a5b931e89c89a6d51bf3c827c851d1a7b0097f7
7
- data.tar.gz: d339b404d41c021c546ce16c8e21b22c30d1a4338c2ccd5c3133fe5eb52440f0493b85e5dbe6af84f04c0885cc6a1d9d4b167e2e799a76b7e293a970d59021ed
6
+ metadata.gz: db2b4363d8d6310c3c5924b782b69cbbc15ed4995863bb96627e59c5e347a885a9dfaaaff063121ce9e52639c05f5b04bd975517c2209bab36c3a602a03b2756
7
+ data.tar.gz: c298f1510b6c7f1ad1620f57d5db05539499733572f5fb4cabde37e59a552115a6dde401fda5b944137a950849bf497dba887aa96538d324df202bf9dce1afc5
data/.travis.yml CHANGED
@@ -1,15 +1,16 @@
1
- dist: trusty
2
- sudo: false
3
1
  language: ruby
2
+ cache: bundler
3
+ os:
4
+ - linux
5
+ - osx
4
6
  rvm:
5
- - 2.5
6
- - 2.4
7
- - 2.3
8
- - ruby-head
7
+ - 2.5
8
+ - 2.4
9
+ - 2.3
10
+ - ruby-head
9
11
  before_install:
10
- - gem install bundler -v 2.0.1
11
- - travis_retry sudo apt-get update
12
- - sudo bash -c "curl -L https://raw.githubusercontent.com/metanorma/metanorma-linux-setup/master/ubuntu-install-puppeteer.sh | bash"
12
+ - gem install bundler -v 2.0.1
13
+ - bundle update
13
14
  matrix:
14
15
  allow_failures:
15
16
  - rvm: ruby-head
data/appveyor.yml CHANGED
@@ -1,5 +1,8 @@
1
1
  version: '{build}'
2
2
 
3
+ cache:
4
+ - vendor/bundle
5
+
3
6
  environment:
4
7
  matrix:
5
8
  - RUBY_VERSION: 25
@@ -17,6 +20,7 @@ install:
17
20
 
18
21
  build_script:
19
22
  - set PATH=C:\Ruby%RUBY_VERSION%\bin;%PATH%
23
+ - bundle config --local path vendor/bundle
20
24
  - bundle update
21
25
  - bundle install
22
26
 
@@ -26,5 +30,4 @@ before_test:
26
30
  - bundle -v
27
31
 
28
32
  test_script:
29
- - bundle exec rake
30
-
33
+ - bundle exec rake
@@ -636,22 +636,27 @@
636
636
  <ref name="ISO8601Date"/>
637
637
  </optional>
638
638
  </define>
639
+ <define name="BibliographicDateType">
640
+ <choice>
641
+ <value>published</value>
642
+ <value>accessed</value>
643
+ <value>created</value>
644
+ <value>implemented</value>
645
+ <value>obsoleted</value>
646
+ <value>confirmed</value>
647
+ <value>updated</value>
648
+ <value>issued</value>
649
+ <value>transmitted</value>
650
+ <value>copied</value>
651
+ <value>unchanged</value>
652
+ <value>circulated</value>
653
+ </choice>
654
+ </define>
639
655
  <define name="bdate">
640
656
  <element name="date">
641
657
  <attribute name="type">
642
658
  <choice>
643
- <value>published</value>
644
- <value>accessed</value>
645
- <value>created</value>
646
- <value>implemented</value>
647
- <value>obsoleted</value>
648
- <value>confirmed</value>
649
- <value>updated</value>
650
- <value>issued</value>
651
- <value>transmitted</value>
652
- <value>copied</value>
653
- <value>unchanged</value>
654
- <value>circulated</value>
659
+ <ref name="BibliographicDateType"/>
655
660
  <text/>
656
661
  </choice>
657
662
  </attribute>
@@ -1,7 +1,8 @@
1
1
  require "asciidoctor"
2
2
  require "metanorma/m3d/version"
3
- require "isodoc/m3d/m3dhtmlconvert"
4
- require "isodoc/m3d/m3dwordconvert"
3
+ require "isodoc/m3d/html_convert"
4
+ require "isodoc/m3d/word_convert"
5
+ require "isodoc/m3d/pdf_convert"
5
6
  require "asciidoctor/standoc/converter"
6
7
  require "fileutils"
7
8
 
@@ -735,6 +735,20 @@
735
735
  <ref name="bookmark"/>
736
736
  </choice>
737
737
  </define>
738
+ <define name="PureTextElement">
739
+ <choice>
740
+ <text/>
741
+ <ref name="em"/>
742
+ <ref name="strong"/>
743
+ <ref name="sub"/>
744
+ <ref name="sup"/>
745
+ <ref name="tt"/>
746
+ <ref name="keyword"/>
747
+ <ref name="strike"/>
748
+ <ref name="smallcap"/>
749
+ <ref name="br"/>
750
+ </choice>
751
+ </define>
738
752
  <define name="source">
739
753
  <element name="source">
740
754
  <ref name="TypedUri"/>
@@ -742,42 +756,58 @@
742
756
  </define>
743
757
  <define name="em">
744
758
  <element name="em">
745
- <text/>
759
+ <zeroOrMore>
760
+ <ref name="PureTextElement"/>
761
+ </zeroOrMore>
746
762
  </element>
747
763
  </define>
748
764
  <define name="strong">
749
765
  <element name="strong">
750
- <text/>
766
+ <zeroOrMore>
767
+ <ref name="PureTextElement"/>
768
+ </zeroOrMore>
751
769
  </element>
752
770
  </define>
753
771
  <define name="tt">
754
772
  <element name="tt">
755
- <text/>
773
+ <zeroOrMore>
774
+ <ref name="PureTextElement"/>
775
+ </zeroOrMore>
756
776
  </element>
757
777
  </define>
758
778
  <define name="keyword">
759
779
  <element name="keyword">
760
- <text/>
780
+ <zeroOrMore>
781
+ <ref name="PureTextElement"/>
782
+ </zeroOrMore>
761
783
  </element>
762
784
  </define>
763
785
  <define name="sub">
764
786
  <element name="sub">
765
- <text/>
787
+ <zeroOrMore>
788
+ <ref name="PureTextElement"/>
789
+ </zeroOrMore>
766
790
  </element>
767
791
  </define>
768
792
  <define name="sup">
769
793
  <element name="sup">
770
- <text/>
794
+ <zeroOrMore>
795
+ <ref name="PureTextElement"/>
796
+ </zeroOrMore>
771
797
  </element>
772
798
  </define>
773
799
  <define name="strike">
774
800
  <element name="strike">
775
- <text/>
801
+ <zeroOrMore>
802
+ <ref name="PureTextElement"/>
803
+ </zeroOrMore>
776
804
  </element>
777
805
  </define>
778
806
  <define name="smallcap">
779
807
  <element name="smallcap">
780
- <text/>
808
+ <zeroOrMore>
809
+ <ref name="PureTextElement"/>
810
+ </zeroOrMore>
781
811
  </element>
782
812
  </define>
783
813
  <define name="br">
@@ -4,14 +4,6 @@
4
4
  <start>
5
5
  <ref name="iso-standard"/>
6
6
  </start>
7
- <define name="language">
8
- <element name="language">
9
- <choice>
10
- <value>en</value>
11
- <value>fr</value>
12
- </choice>
13
- </element>
14
- </define>
15
7
  <define name="script">
16
8
  <element name="script">
17
9
  <value>Latn</value>
@@ -9,11 +9,6 @@
9
9
  <start>
10
10
  <ref name="m3d-standard"/>
11
11
  </start>
12
- <define name="language">
13
- <element name="language">
14
- <value>en</value>
15
- </element>
16
- </define>
17
12
  <define name="docidentifier">
18
13
  <element name="docidentifier">
19
14
  <optional>
@@ -1,8 +1,20 @@
1
+ require_relative "metadata"
2
+ require "fileutils"
3
+
1
4
  module IsoDoc
2
5
  module M3d
3
- # A {Converter} implementation that generates CSAND output, and a document
4
- # schema encapsulation of the document for validation
5
- class PdfConvert < IsoDoc::PdfConvert
6
+ module BaseRender
7
+ def metadata_init(lang, script, labels)
8
+ @meta = Metadata.new(lang, script, labels)
9
+ end
10
+
11
+ def add_image(filenames)
12
+ filenames.each do |filename|
13
+ FileUtils.cp html_doc_path(filename), File.join(@localdir, filename)
14
+ @files_to_delete << File.join(@localdir, filename)
15
+ end
16
+ end
17
+
6
18
  def annex_name(annex, name, div)
7
19
  div.h1 **{ class: "Annex" } do |t|
8
20
  t << "#{get_anchors[annex['id']][:label]} "
@@ -1,20 +1,11 @@
1
1
  require "isodoc"
2
- require_relative "metadata"
3
- require_relative "m3dhtmlrender"
4
- require "fileutils"
2
+ require_relative "base_convert"
5
3
 
6
4
  module IsoDoc
7
5
  module M3d
8
6
  # A {Converter} implementation that generates CSAND output, and a document
9
7
  # schema encapsulation of the document for validation
10
8
  class HtmlConvert < IsoDoc::HtmlConvert
11
- def add_image(filenames)
12
- filenames.each do |filename|
13
- FileUtils.cp html_doc_path(filename), File.join(@localdir, filename)
14
- @files_to_delete << File.join(@localdir, filename)
15
- end
16
- end
17
-
18
9
  def initialize(options)
19
10
  @libdir = File.dirname(__FILE__)
20
11
  super
@@ -43,10 +34,6 @@ module IsoDoc
43
34
  }
44
35
  end
45
36
 
46
- def metadata_init(lang, script, labels)
47
- @meta = Metadata.new(lang, script, labels)
48
- end
49
-
50
37
  def colophon(body, docxml)
51
38
  body.div **{ class: "colophon" } do |div|
52
39
  div << <<~"COLOPHON"
@@ -77,6 +64,8 @@ module IsoDoc
77
64
  def html_toc(docxml)
78
65
  docxml
79
66
  end
67
+
68
+ include BaseRender
80
69
  end
81
70
  end
82
71
  end
@@ -1,20 +1,11 @@
1
1
  require "isodoc"
2
- require_relative "metadata"
3
- require_relative "m3dpdfrender"
4
- require "fileutils"
2
+ require_relative "base_convert"
5
3
 
6
4
  module IsoDoc
7
5
  module M3d
8
6
  # A {Converter} implementation that generates CSAND output, and a document
9
7
  # schema encapsulation of the document for validation
10
8
  class PdfConvert < IsoDoc::PdfConvert
11
- def add_image(filenames)
12
- filenames.each do |filename|
13
- FileUtils.cp html_doc_path(filename), File.join(@localdir, filename)
14
- @files_to_delete << File.join(@localdir, filename)
15
- end
16
- end
17
-
18
9
  def initialize(options)
19
10
  @libdir = File.dirname(__FILE__)
20
11
  super
@@ -43,10 +34,6 @@ module IsoDoc
43
34
  }
44
35
  end
45
36
 
46
- def metadata_init(lang, script, labels)
47
- @meta = Metadata.new(lang, script, labels)
48
- end
49
-
50
37
  def colophon(body, docxml)
51
38
  body.div **{ class: "colophon" } do |div|
52
39
  div << <<~"COLOPHON"
@@ -77,6 +64,8 @@ module IsoDoc
77
64
  def html_toc(docxml)
78
65
  docxml
79
66
  end
67
+
68
+ include BaseRender
80
69
  end
81
70
  end
82
71
  end
@@ -1,6 +1,5 @@
1
1
  require "isodoc"
2
- require_relative "m3wordrender"
3
- require "fileutils"
2
+ require_relative "base_convert"
4
3
 
5
4
  module IsoDoc
6
5
  module M3d
@@ -41,10 +40,6 @@ module IsoDoc
41
40
  }
42
41
  end
43
42
 
44
- def metadata_init(lang, script, labels)
45
- @meta = Metadata.new(lang, script, labels)
46
- end
47
-
48
43
  def colophon(body, docxml)
49
44
  section_break(body)
50
45
  body.div **{ class: "colophon" } do |div|
@@ -64,6 +59,8 @@ module IsoDoc
64
59
  main = isoxml&.at(ns("//title[@language='en']"))&.text
65
60
  set_metadata(:doctitle, main)
66
61
  end
62
+
63
+ include BaseRender
67
64
  end
68
65
  end
69
66
  end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module M3d
3
- VERSION = "1.1.4"
3
+ VERSION = "1.1.5"
4
4
  end
5
5
  end
data/lib/metanorma-m3d.rb CHANGED
@@ -1,8 +1,8 @@
1
1
  require "asciidoctor" unless defined? Asciidoctor::Converter
2
2
  require_relative "asciidoctor/m3d/converter"
3
- require_relative "isodoc/m3d/m3dhtmlconvert"
4
- require_relative "isodoc/m3d/m3dpdfconvert"
5
- require_relative "isodoc/m3d/m3dwordconvert"
3
+ require_relative "isodoc/m3d/html_convert"
4
+ require_relative "isodoc/m3d/pdf_convert"
5
+ require_relative "isodoc/m3d/word_convert"
6
6
  require_relative "metanorma/m3d/version"
7
7
 
8
8
  if defined? Metanorma
@@ -34,7 +34,6 @@ Gem::Specification.new do |spec|
34
34
  spec.add_dependency "mime-types"
35
35
  spec.add_dependency "nokogiri"
36
36
  spec.add_dependency "ruby-jing"
37
- spec.add_dependency "ruby-xslt"
38
37
  spec.add_dependency "thread_safe"
39
38
  spec.add_dependency "uuidtools"
40
39
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-m3d
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4
4
+ version: 1.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-04-04 00:00:00.000000000 Z
11
+ date: 2019-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor
@@ -108,20 +108,6 @@ dependencies:
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
- - !ruby/object:Gem::Dependency
112
- name: ruby-xslt
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - ">="
116
- - !ruby/object:Gem::Version
117
- version: '0'
118
- type: :runtime
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - ">="
123
- - !ruby/object:Gem::Version
124
- version: '0'
125
111
  - !ruby/object:Gem::Dependency
126
112
  name: thread_safe
127
113
  requirement: !ruby/object:Gem::Requirement
@@ -354,7 +340,6 @@ files:
354
340
  - README.adoc
355
341
  - Rakefile
356
342
  - appveyor.yml
357
- - asciidoctor-m3d.gemspec.old
358
343
  - bin/console
359
344
  - bin/rspec
360
345
  - bin/setup
@@ -365,6 +350,7 @@ files:
365
350
  - lib/asciidoctor/m3d/isostandard.rng
366
351
  - lib/asciidoctor/m3d/m3d.rng
367
352
  - lib/asciidoctor/m3d/reqt.rng
353
+ - lib/isodoc/m3d/base_convert.rb
368
354
  - lib/isodoc/m3d/html/dots-w@2x.png
369
355
  - lib/isodoc/m3d/html/dots@2x.png
370
356
  - lib/isodoc/m3d/html/header.html
@@ -379,13 +365,10 @@ files:
379
365
  - lib/isodoc/m3d/html/word_m3d_intro.html
380
366
  - lib/isodoc/m3d/html/word_m3d_titlepage.html
381
367
  - lib/isodoc/m3d/html/wordstyle.scss
382
- - lib/isodoc/m3d/m3dhtmlconvert.rb
383
- - lib/isodoc/m3d/m3dhtmlrender.rb
384
- - lib/isodoc/m3d/m3dpdfconvert.rb
385
- - lib/isodoc/m3d/m3dpdfrender.rb
386
- - lib/isodoc/m3d/m3dwordconvert.rb
387
- - lib/isodoc/m3d/m3wordrender.rb
368
+ - lib/isodoc/m3d/html_convert.rb
388
369
  - lib/isodoc/m3d/metadata.rb
370
+ - lib/isodoc/m3d/pdf_convert.rb
371
+ - lib/isodoc/m3d/word_convert.rb
389
372
  - lib/metanorma-m3d.rb
390
373
  - lib/metanorma/m3d.rb
391
374
  - lib/metanorma/m3d/processor.rb
@@ -1,54 +0,0 @@
1
- lib = File.expand_path("../lib", __FILE__)
2
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
- require "asciidoctor/m3d/version"
4
-
5
- Gem::Specification.new do |spec|
6
- spec.name = "asciidoctor-m3d"
7
- spec.version = Asciidoctor::M3d::VERSION
8
- spec.authors = ["Ribose Inc."]
9
- spec.email = ["open.source@ribose.com"]
10
-
11
- spec.summary = "asciidoctor-m3d lets you write M3AAWG Documents (M3D) in AsciiDoc."
12
- spec.description = <<~DESCRIPTION
13
- asciidoctor-m3d lets you write M3AAWG Documents (M3D) in AsciiDoc syntax.
14
-
15
- This gem is in active development.
16
- DESCRIPTION
17
-
18
- spec.homepage = "https://github.com/riboseinc/asciidoctor-m3d"
19
- spec.license = "BSD-2-Clause"
20
- spec.post_install_message = "The asciidoctor-csd gem has been deprecated and has been replaced by metanorma-csd"
21
-
22
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
23
- f.match(%r{^(test|spec|features)/})
24
- end
25
- spec.bindir = "exe"
26
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
27
- spec.require_paths = ["lib"]
28
-
29
- spec.add_dependency "asciidoctor", "~> 1.5.7"
30
- spec.add_dependency "asciimath"
31
- spec.add_dependency "htmlentities", "~> 4.3.4"
32
- spec.add_dependency "image_size"
33
- spec.add_dependency "mime-types"
34
- spec.add_dependency "nokogiri"
35
- spec.add_dependency "ruby-jing"
36
- spec.add_dependency "ruby-xslt"
37
- spec.add_dependency "thread_safe"
38
- spec.add_dependency "uuidtools"
39
-
40
- spec.add_dependency "asciidoctor-iso", "~> 0.10.2"
41
- spec.add_dependency "isodoc", "~> 0.8.8"
42
-
43
- spec.add_development_dependency "bundler", "~> 1.15"
44
- spec.add_development_dependency "byebug", "~> 9.1"
45
- spec.add_development_dependency "equivalent-xml", "~> 0.6"
46
- spec.add_development_dependency "guard", "~> 2.14"
47
- spec.add_development_dependency "guard-rspec", "~> 4.7"
48
- spec.add_development_dependency "rake", "~> 12.0"
49
- spec.add_development_dependency "rspec", "~> 3.6"
50
- spec.add_development_dependency "rubocop", "~> 0.50"
51
- spec.add_development_dependency "simplecov", "~> 0.15"
52
- spec.add_development_dependency "timecop", "~> 0.9"
53
- spec.add_development_dependency "metanorma", "~> 0.2.5"
54
- end
@@ -1,49 +0,0 @@
1
- module IsoDoc
2
- module M3d
3
- # A {Converter} implementation that generates CSAND output, and a document
4
- # schema encapsulation of the document for validation
5
- class HtmlConvert < IsoDoc::HtmlConvert
6
- def annex_name(annex, name, div)
7
- div.h1 **{ class: "Annex" } do |t|
8
- t << "#{get_anchors[annex['id']][:label]} "
9
- t.br
10
- t.b do |b|
11
- name&.children&.each { |c2| parse(c2, b) }
12
- end
13
- end
14
- end
15
-
16
- def term_defs_boilerplate(div, source, term, preface)
17
- if source.empty? && term.nil?
18
- div << @no_terms_boilerplate
19
- else
20
- div << term_defs_boilerplate_cont(source, term)
21
- end
22
- end
23
-
24
- def i18n_init(lang, script)
25
- super
26
- @annex_lbl = "Appendix"
27
- end
28
-
29
- def fileloc(loc)
30
- File.join(File.dirname(__FILE__), loc)
31
- end
32
-
33
- def cleanup(docxml)
34
- super
35
- term_cleanup(docxml)
36
- end
37
-
38
- def term_cleanup(docxml)
39
- docxml.xpath("//p[@class = 'Terms']").each do |d|
40
- h2 = d.at("./preceding-sibling::*[@class = 'TermNum'][1]")
41
- h2.add_child("&nbsp;")
42
- h2.add_child(d.remove)
43
- end
44
- docxml
45
- end
46
- end
47
- end
48
- end
49
-
@@ -1,49 +0,0 @@
1
- module IsoDoc
2
- module M3d
3
- # A {Converter} implementation that generates CSAND output, and a document
4
- # schema encapsulation of the document for validation
5
- class WordConvert < IsoDoc::WordConvert
6
- def annex_name(annex, name, div)
7
- div.h1 **{ class: "Annex" } do |t|
8
- t << "#{get_anchors[annex['id']][:label]} "
9
- t.br
10
- t.b do |b|
11
- name&.children&.each { |c2| parse(c2, b) }
12
- end
13
- end
14
- end
15
-
16
- def term_defs_boilerplate(div, source, term, preface)
17
- if source.empty? && term.nil?
18
- div << @no_terms_boilerplate
19
- else
20
- div << term_defs_boilerplate_cont(source, term)
21
- end
22
- end
23
-
24
- def i18n_init(lang, script)
25
- super
26
- @annex_lbl = "Appendix"
27
- end
28
-
29
- def fileloc(loc)
30
- File.join(File.dirname(__FILE__), loc)
31
- end
32
-
33
- def cleanup(docxml)
34
- super
35
- term_cleanup(docxml)
36
- end
37
-
38
- def term_cleanup(docxml)
39
- docxml.xpath("//p[@class = 'Terms']").each do |d|
40
- h2 = d.at("./preceding-sibling::*[@class = 'TermNum'][1]")
41
- h2.add_child("&nbsp;")
42
- h2.add_child(d.remove)
43
- end
44
- docxml
45
- end
46
- end
47
- end
48
- end
49
-