metanorma-iso 1.10.5 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +3 -33
  3. data/.gitignore +26 -0
  4. data/Makefile +1 -1
  5. data/lib/asciidoctor/iso/base.rb +2 -69
  6. data/lib/asciidoctor/iso/cleanup.rb +2 -175
  7. data/lib/asciidoctor/iso/converter.rb +2 -17
  8. data/lib/asciidoctor/iso/deprecated.rb +5 -0
  9. data/lib/asciidoctor/iso/front.rb +2 -169
  10. data/lib/asciidoctor/iso/front_id.rb +2 -224
  11. data/lib/asciidoctor/iso/section.rb +2 -48
  12. data/lib/asciidoctor/iso/validate.rb +2 -171
  13. data/lib/asciidoctor/iso/validate_image.rb +2 -96
  14. data/lib/asciidoctor/iso/validate_requirements.rb +2 -110
  15. data/lib/asciidoctor/iso/validate_section.rb +2 -246
  16. data/lib/asciidoctor/iso/validate_style.rb +2 -169
  17. data/lib/asciidoctor/iso/validate_title.rb +2 -104
  18. data/lib/isodoc/iso/html/style-human.css +19 -14
  19. data/lib/isodoc/iso/html/style-human.scss +8 -2
  20. data/lib/isodoc/iso/html/style-iso.css +21 -15
  21. data/lib/isodoc/iso/html/style-iso.scss +9 -2
  22. data/lib/isodoc/iso/html_convert.rb +6 -4
  23. data/lib/isodoc/iso/iso.amendment.xsl +1449 -1222
  24. data/lib/isodoc/iso/iso.international-standard.xsl +1449 -1222
  25. data/lib/isodoc/iso/word_convert.rb +2 -0
  26. data/lib/metanorma/iso/base.rb +70 -0
  27. data/lib/{asciidoctor → metanorma}/iso/basicdoc.rng +0 -0
  28. data/lib/{asciidoctor → metanorma}/iso/biblio.rng +2 -2
  29. data/lib/{asciidoctor → metanorma}/iso/boilerplate-fr.xml +0 -0
  30. data/lib/{asciidoctor → metanorma}/iso/boilerplate.xml +0 -0
  31. data/lib/metanorma/iso/cleanup.rb +176 -0
  32. data/lib/metanorma/iso/converter.rb +18 -0
  33. data/lib/metanorma/iso/front.rb +170 -0
  34. data/lib/metanorma/iso/front_id.rb +225 -0
  35. data/lib/{asciidoctor → metanorma}/iso/isodoc.rng +98 -1
  36. data/lib/{asciidoctor → metanorma}/iso/isostandard-amd.rng +0 -0
  37. data/lib/{asciidoctor → metanorma}/iso/isostandard.rnc +0 -0
  38. data/lib/{asciidoctor → metanorma}/iso/isostandard.rng +0 -0
  39. data/lib/{asciidoctor → metanorma}/iso/reqt.rng +0 -0
  40. data/lib/metanorma/iso/section.rb +49 -0
  41. data/lib/metanorma/iso/validate.rb +172 -0
  42. data/lib/metanorma/iso/validate_image.rb +97 -0
  43. data/lib/metanorma/iso/validate_requirements.rb +111 -0
  44. data/lib/metanorma/iso/validate_section.rb +247 -0
  45. data/lib/metanorma/iso/validate_style.rb +170 -0
  46. data/lib/metanorma/iso/validate_title.rb +105 -0
  47. data/lib/metanorma/iso/version.rb +1 -1
  48. data/lib/metanorma-iso.rb +1 -1
  49. data/metanorma-iso.gemspec +2 -2
  50. data/spec/isodoc/ref_spec.rb +4 -2
  51. data/spec/isodoc/section_spec.rb +1 -1
  52. data/spec/{asciidoctor → metanorma}/amd_spec.rb +1 -1
  53. data/spec/{asciidoctor → metanorma}/base_spec.rb +141 -130
  54. data/spec/{asciidoctor → metanorma}/blank_spec.rb +1 -1
  55. data/spec/{asciidoctor → metanorma}/blocks_spec.rb +1 -1
  56. data/spec/{asciidoctor → metanorma}/cleanup_spec.rb +1 -1
  57. data/spec/{asciidoctor → metanorma}/inline_spec.rb +1 -1
  58. data/spec/{asciidoctor → metanorma}/lists_spec.rb +1 -1
  59. data/spec/metanorma/processor_spec.rb +1 -1
  60. data/spec/{asciidoctor → metanorma}/refs_spec.rb +1 -1
  61. data/spec/{asciidoctor → metanorma}/section_spec.rb +1 -1
  62. data/spec/{asciidoctor → metanorma}/table_spec.rb +1 -1
  63. data/spec/{asciidoctor → metanorma}/validate_spec.rb +1 -1
  64. data/spec/spec_helper.rb +1 -1
  65. data/spec/vcr_cassettes/docrels.yml +21 -216
  66. metadata +39 -26
@@ -1,6 +1,6 @@
1
1
  require "spec_helper"
2
2
 
3
- RSpec.describe Asciidoctor::ISO do
3
+ RSpec.describe Metanorma::ISO do
4
4
  it "has a version number" do
5
5
  expect(Metanorma::ISO::VERSION).not_to be nil
6
6
  end
@@ -641,7 +641,7 @@ RSpec.describe Asciidoctor::ISO do
641
641
  <substage>60</substage>
642
642
  </status>
643
643
  <copyright>
644
- <from>2021</from>
644
+ <from>#{Time.new.year}</from>
645
645
  <owner>
646
646
  <organization>
647
647
  <name>International Organization for Standardization</name>
@@ -675,7 +675,7 @@ RSpec.describe Asciidoctor::ISO do
675
675
  :docfile: test.adoc
676
676
  :nodoc:
677
677
  :novalid:
678
- :amends: ISO 123;ISO 124
678
+ :amends: ISO 123;ISO 125
679
679
  :obsoletes: ABC 1
680
680
  :successor-of: ABC 2
681
681
  :manifestation-of: ABC 3
@@ -718,7 +718,7 @@ RSpec.describe Asciidoctor::ISO do
718
718
  <substage>60</substage>
719
719
  </status>
720
720
  <copyright>
721
- <from>2021</from>
721
+ <from>#{Time.new.year}</from>
722
722
  <owner>
723
723
  <organization>
724
724
  <name>International Organization for Standardization</name>
@@ -744,16 +744,16 @@ RSpec.describe Asciidoctor::ISO do
744
744
  <docidentifier>ABC 3</docidentifier>
745
745
  </bibitem>
746
746
  </relation>
747
- <relation type='annotationOf'>
747
+ <relation type='related'>
748
748
  <bibitem>
749
749
  <title>--</title>
750
- <docidentifier>ABC 3a</docidentifier>
750
+ <docidentifier>ABC 4</docidentifier>
751
751
  </bibitem>
752
752
  </relation>
753
- <relation type='related'>
753
+ <relation type='annotationOf'>
754
754
  <bibitem>
755
755
  <title>--</title>
756
- <docidentifier>ABC 4</docidentifier>
756
+ <docidentifier>ABC 3a</docidentifier>
757
757
  </bibitem>
758
758
  </relation>
759
759
  <relation type='updates'>
@@ -872,128 +872,139 @@ RSpec.describe Asciidoctor::ISO do
872
872
  <place>Geneva</place>
873
873
  </bibitem>
874
874
  </relation>
875
- <relation type='updates'>
876
- <description>amends</description>
877
- <bibitem type='standard'>
878
- <fetched/>
879
- <title type='title-intro' format='text/plain' language='en' script='Latn'>Latex, rubber</title>
880
- <title type='title-main' format='text/plain' language='en' script='Latn'>Determination of total solids content</title>
881
- <title type='main' format='text/plain' language='en' script='Latn'>Latex, rubber&#8201;&#8212;&#8201;Determination of total solids content</title>
882
- <title type='title-intro' format='text/plain' language='fr' script='Latn'>Latex de caoutchouc</title>
883
- <title type='title-main' format='text/plain' language='fr' script='Latn'>D&#233;termination des mati&#232;res solides totales</title>
884
- <title type='main' format='text/plain' language='fr' script='Latn'>
885
- Latex de caoutchouc&#8201;&#8212;&#8201;D&#233;termination des
886
- mati&#232;res solides totales
887
- </title>
888
- <uri type='src'>https://www.iso.org/standard/61884.html</uri>
889
- <uri type='obp'>https://www.iso.org/obp/ui/#!iso:std:61884:en</uri>
890
- <uri type='rss'>https://www.iso.org/contents/data/standard/06/18/61884.detail.rss</uri>
891
- <docidentifier type='ISO'>ISO 124</docidentifier>
892
- <docidentifier type='URN'>urn:iso:std:iso:124:stage-90.93:ed-7:en,fr</docidentifier>
893
- <docnumber>124</docnumber>
894
- <contributor>
895
- <role type='publisher'/>
896
- <organization>
897
- <name>International Organization for Standardization</name>
898
- <abbreviation>ISO</abbreviation>
899
- <uri>www.iso.org</uri>
900
- </organization>
901
- </contributor>
902
- <edition>7</edition>
903
- <language>en</language>
904
- <language>fr</language>
905
- <script>Latn</script>
906
- <status>
907
- <stage>90</stage>
908
- <substage>93</substage>
909
- </status>
910
- <copyright>
911
- <from>2014</from>
912
- <owner>
913
- <organization>
914
- <name>ISO</name>
915
- </organization>
916
- </owner>
917
- </copyright>
918
- <relation type='obsoletes'>
919
- <bibitem type='standard'>
920
- <formattedref format='text/plain'>ISO 124:2011</formattedref>
921
- </bibitem>
922
- </relation>
923
- <relation type='instance'>
924
- <bibitem type='standard'>
925
- <fetched/>
926
- <title type='title-intro' format='text/plain' language='en' script='Latn'>Latex, rubber</title>
927
- <title type='title-main' format='text/plain' language='en' script='Latn'>Determination of total solids content</title>
928
- <title type='main' format='text/plain' language='en' script='Latn'>Latex, rubber&#8201;&#8212;&#8201;Determination of total solids content</title>
929
- <title type='title-intro' format='text/plain' language='fr' script='Latn'>Latex de caoutchouc</title>
930
- <title type='title-main' format='text/plain' language='fr' script='Latn'>D&#233;termination des mati&#232;res solides totales</title>
931
- <title type='main' format='text/plain' language='fr' script='Latn'>
932
- Latex de caoutchouc&#8201;&#8212;&#8201;D&#233;termination des
933
- mati&#232;res solides totales
934
- </title>
935
- <uri type='src'>https://www.iso.org/standard/61884.html</uri>
936
- <uri type='obp'>https://www.iso.org/obp/ui/#!iso:std:61884:en</uri>
937
- <uri type='rss'>https://www.iso.org/contents/data/standard/06/18/61884.detail.rss</uri>
938
- <docidentifier type='ISO'>ISO 124:2014</docidentifier>
939
- <docidentifier type='URN'>urn:iso:std:iso:124:stage-90.93:ed-7:en,fr</docidentifier>
940
- <docnumber>124</docnumber>
941
- <date type='published'>
942
- <on>2014-03</on>
943
- </date>
944
- <contributor>
945
- <role type='publisher'/>
946
- <organization>
947
- <name>International Organization for Standardization</name>
948
- <abbreviation>ISO</abbreviation>
949
- <uri>www.iso.org</uri>
950
- </organization>
951
- </contributor>
952
- <edition>7</edition>
953
- <language>en</language>
954
- <language>fr</language>
955
- <script>Latn</script>
956
- <abstract format='text/plain' language='en' script='Latn'>
957
- ISO 124:2014 specifies methods for the determination of the total
958
- solids content of natural rubber field and concentrated latices
959
- and synthetic rubber latex. These methods are not necessarily
960
- suitable for latex from natural sources other than the Hevea
961
- brasiliensis, for vulcanized latex, for compounded latex, or for
962
- artificial dispersions of rubber.
963
- </abstract>
964
- <abstract format='text/plain' language='fr' script='Latn'>
965
- L&#8217;ISO 124:2014 sp&#233;cifie des m&#233;thodes pour la
966
- d&#233;termination des mati&#232;res solides totales dans le latex
967
- de plantation, le latex de concentr&#233; de caoutchouc naturel et
968
- le latex de caoutchouc synth&#233;tique. Ces m&#233;thodes ne
969
- conviennent pas n&#233;cessairement au latex d&#8217;origine
970
- naturelle autre que celui de l&#8217;Hevea brasiliensis, au latex
971
- vulcanis&#233;, aux m&#233;langes de latex, ou aux dispersions
972
- artificielles de caoutchouc.
973
- </abstract>
974
- <status>
975
- <stage>90</stage>
976
- <substage>93</substage>
977
- </status>
978
- <copyright>
979
- <from>2014</from>
980
- <owner>
981
- <organization>
982
- <name>ISO</name>
983
- </organization>
984
- </owner>
985
- </copyright>
986
- <relation type='obsoletes'>
987
- <bibitem type='standard'>
988
- <formattedref format='text/plain'>ISO 124:2011</formattedref>
989
- </bibitem>
990
- </relation>
991
- <place>Geneva</place>
992
- </bibitem>
993
- </relation>
994
- <place>Geneva</place>
995
- </bibitem>
996
- </relation>
875
+ <relation type='updates'>
876
+ <description>amends</description>
877
+ <bibitem type='standard'>
878
+ <fetched/>
879
+ <title type='title-intro' format='text/plain' language='en' script='Latn'>Natural rubber latex concentrate</title>
880
+ <title type='title-main' format='text/plain' language='en' script='Latn'>Determination of alkalinity</title>
881
+ <title type='main' format='text/plain' language='en' script='Latn'>
882
+ Natural rubber latex concentrate&#8201;&#8212;&#8201;Determination of
883
+ alkalinity
884
+ </title>
885
+ <title type='title-intro' format='text/plain' language='fr' script='Latn'>Latex concentr&#233; de caoutchouc naturel</title>
886
+ <title type='title-main' format='text/plain' language='fr' script='Latn'>D&#233;termination de l&#8217;alcalinit&#233;</title>
887
+ <title type='main' format='text/plain' language='fr' script='Latn'>
888
+ Latex concentr&#233; de caoutchouc
889
+ naturel&#8201;&#8212;&#8201;D&#233;termination de
890
+ l&#8217;alcalinit&#233;
891
+ </title>
892
+ <uri type='src'>https://www.iso.org/standard/72849.html</uri>
893
+ <uri type='obp'>https://www.iso.org/obp/ui/#!iso:std:72849:en</uri>
894
+ <uri type='rss'>https://www.iso.org/contents/data/standard/07/28/72849.detail.rss</uri>
895
+ <docidentifier type='ISO'>ISO 125</docidentifier>
896
+ <docidentifier type='URN'>urn:iso:std:iso:125:stage-60.60:ed-7:en,fr</docidentifier>
897
+ <docnumber>125</docnumber>
898
+ <contributor>
899
+ <role type='publisher'/>
900
+ <organization>
901
+ <name>International Organization for Standardization</name>
902
+ <abbreviation>ISO</abbreviation>
903
+ <uri>www.iso.org</uri>
904
+ </organization>
905
+ </contributor>
906
+ <edition>7</edition>
907
+ <language>en</language>
908
+ <language>fr</language>
909
+ <script>Latn</script>
910
+ <status>
911
+ <stage>60</stage>
912
+ <substage>60</substage>
913
+ </status>
914
+ <copyright>
915
+ <from>2020</from>
916
+ <owner>
917
+ <organization>
918
+ <name>ISO</name>
919
+ </organization>
920
+ </owner>
921
+ </copyright>
922
+ <relation type='obsoletes'>
923
+ <bibitem type='standard'>
924
+ <formattedref format='text/plain'>ISO 125:2011</formattedref>
925
+ </bibitem>
926
+ </relation>
927
+ <relation type='instance'>
928
+ <bibitem type='standard'>
929
+ <fetched/>
930
+ <title type='title-intro' format='text/plain' language='en' script='Latn'>Natural rubber latex concentrate</title>
931
+ <title type='title-main' format='text/plain' language='en' script='Latn'>Determination of alkalinity</title>
932
+ <title type='main' format='text/plain' language='en' script='Latn'>
933
+ Natural rubber latex concentrate&#8201;&#8212;&#8201;Determination
934
+ of alkalinity
935
+ </title>
936
+ <title type='title-intro' format='text/plain' language='fr' script='Latn'>Latex concentr&#233; de caoutchouc naturel</title>
937
+ <title type='title-main' format='text/plain' language='fr' script='Latn'>D&#233;termination de l&#8217;alcalinit&#233;</title>
938
+ <title type='main' format='text/plain' language='fr' script='Latn'>
939
+ Latex concentr&#233; de caoutchouc
940
+ naturel&#8201;&#8212;&#8201;D&#233;termination de
941
+ l&#8217;alcalinit&#233;
942
+ </title>
943
+ <uri type='src'>https://www.iso.org/standard/72849.html</uri>
944
+ <uri type='obp'>https://www.iso.org/obp/ui/#!iso:std:72849:en</uri>
945
+ <uri type='rss'>https://www.iso.org/contents/data/standard/07/28/72849.detail.rss</uri>
946
+ <docidentifier type='ISO'>ISO 125:2020</docidentifier>
947
+ <docidentifier type='URN'>urn:iso:std:iso:125:stage-60.60:ed-7:en,fr</docidentifier>
948
+ <docnumber>125</docnumber>
949
+ <date type='published'>
950
+ <on>2020-02</on>
951
+ </date>
952
+ <contributor>
953
+ <role type='publisher'/>
954
+ <organization>
955
+ <name>International Organization for Standardization</name>
956
+ <abbreviation>ISO</abbreviation>
957
+ <uri>www.iso.org</uri>
958
+ </organization>
959
+ </contributor>
960
+ <edition>7</edition>
961
+ <language>en</language>
962
+ <language>fr</language>
963
+ <script>Latn</script>
964
+ <abstract format='text/plain' language='en' script='Latn'>
965
+ This document specifies a method for the determination of the
966
+ alkalinity of natural rubber latex concentrate. The method is not
967
+ necessarily suitable for latices from natural sources other than
968
+ Hevea brasiliensis or for synthetic rubber latices, compounded
969
+ latex, vulcanized latex or artificial dispersions of rubber. NOTE
970
+ A method for the determination of the alkalinity of
971
+ polychloroprene latex is specified in ISO 13773.
972
+ </abstract>
973
+ <abstract format='text/plain' language='fr' script='Latn'>
974
+ Le pr&#233;sent document sp&#233;cifie une m&#233;thode de
975
+ d&#233;termination de l&#8217;alcalinit&#233; du latex
976
+ concentr&#233; de caoutchouc naturel. La m&#233;thode ne convient
977
+ pas n&#233;cessairement aux latex d&#8217;origine naturelle autres
978
+ que l&#8217;Hevea brasiliensis ou aux latex de caoutchouc de
979
+ synth&#232;se, aux latex formul&#233;s, aux latex vulcanis&#233;s
980
+ ou aux dispersions artificielles de caoutchouc. NOTE Une
981
+ m&#233;thode de d&#233;termination de l&#8217;alcalinit&#233; du
982
+ latex de polychloropr&#232;ne est sp&#233;cifi&#233;e dans
983
+ l&#8217;ISO 13773.
984
+ </abstract>
985
+ <status>
986
+ <stage>60</stage>
987
+ <substage>60</substage>
988
+ </status>
989
+ <copyright>
990
+ <from>2020</from>
991
+ <owner>
992
+ <organization>
993
+ <name>ISO</name>
994
+ </organization>
995
+ </owner>
996
+ </copyright>
997
+ <relation type='obsoletes'>
998
+ <bibitem type='standard'>
999
+ <formattedref format='text/plain'>ISO 125:2011</formattedref>
1000
+ </bibitem>
1001
+ </relation>
1002
+ <place>Geneva</place>
1003
+ </bibitem>
1004
+ </relation>
1005
+ <place>Geneva</place>
1006
+ </bibitem>
1007
+ </relation>
997
1008
  <relation type='obsoletes'>
998
1009
  <description>replaces</description>
999
1010
  <bibitem>
@@ -1,6 +1,6 @@
1
1
  require "spec_helper"
2
2
 
3
- RSpec.describe Asciidoctor::ISO do
3
+ RSpec.describe Metanorma::ISO do
4
4
  it "processes a blank document" do
5
5
  input = <<~INPUT
6
6
  #{ASCIIDOC_BLANK_HDR}
@@ -1,6 +1,6 @@
1
1
  require "spec_helper"
2
2
 
3
- RSpec.describe Asciidoctor::ISO do
3
+ RSpec.describe Metanorma::ISO do
4
4
  it "processes open blocks" do
5
5
  input = <<~INPUT
6
6
  #{ASCIIDOC_BLANK_HDR}
@@ -1,6 +1,6 @@
1
1
  require "spec_helper"
2
2
 
3
- RSpec.describe Asciidoctor::ISO do
3
+ RSpec.describe Metanorma::ISO do
4
4
  it "removes empty text elements" do
5
5
  input = <<~INPUT
6
6
  #{ASCIIDOC_BLANK_HDR}
@@ -1,6 +1,6 @@
1
1
  require "spec_helper"
2
2
 
3
- RSpec.describe Asciidoctor::ISO do
3
+ RSpec.describe Metanorma::ISO do
4
4
  it "processes inline_quoted formatting" do
5
5
  expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
6
6
  #{ASCIIDOC_BLANK_HDR}
@@ -1,6 +1,6 @@
1
1
  require "spec_helper"
2
2
 
3
- RSpec.describe Asciidoctor::ISO do
3
+ RSpec.describe Metanorma::ISO do
4
4
  it "processes simple lists" do
5
5
  output = Asciidoctor.convert(<<~"INPUT", *OPTIONS)
6
6
  #{ASCIIDOC_BLANK_HDR}
@@ -38,7 +38,7 @@ RSpec.describe Metanorma::Iso::Processor do
38
38
  <substage>60</substage>
39
39
  </status>
40
40
  <copyright>
41
- <from>2021</from>
41
+ <from>#{Time.new.year}</from>
42
42
  <owner>
43
43
  <organization>
44
44
  <name>International Organization for Standardization</name>
@@ -2,7 +2,7 @@ require "spec_helper"
2
2
  require "relaton_iso"
3
3
  require "relaton_ietf"
4
4
 
5
- RSpec.describe Asciidoctor::ISO do
5
+ RSpec.describe Metanorma::ISO do
6
6
  it "processes draft ISO reference" do
7
7
  mock_fdis
8
8
  input = <<~INPUT
@@ -1,6 +1,6 @@
1
1
  require "spec_helper"
2
2
 
3
- RSpec.describe Asciidoctor::ISO do
3
+ RSpec.describe Metanorma::ISO do
4
4
  it "processes sections" do
5
5
  input = <<~INPUT
6
6
  #{ASCIIDOC_BLANK_HDR}
@@ -1,6 +1,6 @@
1
1
  require "spec_helper"
2
2
 
3
- RSpec.describe Asciidoctor::ISO do
3
+ RSpec.describe Metanorma::ISO do
4
4
  it "processes basic tables" do
5
5
  expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
6
6
  #{ASCIIDOC_BLANK_HDR}
@@ -1,7 +1,7 @@
1
1
  require "spec_helper"
2
2
  require "fileutils"
3
3
 
4
- RSpec.describe Asciidoctor::ISO do
4
+ RSpec.describe Metanorma::ISO do
5
5
  context "when xref_error.adoc compilation" do
6
6
  it "generates error file" do
7
7
  FileUtils.rm_f "xref_error.err"
data/spec/spec_helper.rb CHANGED
@@ -132,7 +132,7 @@ VALIDATING_BLANK_HDR = <<~"HDR".freeze
132
132
  HDR
133
133
 
134
134
  ASCIIDOCTOR_ISO_DIR = Pathname
135
- .new(File.dirname(__FILE__)) / "../lib/asciidoctor/iso"
135
+ .new(File.dirname(__FILE__)) / "../lib/metanorma/iso"
136
136
 
137
137
  BOILERPLATE =
138
138
  HTMLEntities.new.decode(