metanorma-standoc 1.4.0 → 1.4.1

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.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/lib/asciidoctor/standoc/base.rb +2 -2
  3. data/lib/asciidoctor/standoc/biblio.rng +1 -1
  4. data/lib/asciidoctor/standoc/blocks.rb +25 -95
  5. data/lib/asciidoctor/standoc/blocks_notes.rb +89 -0
  6. data/lib/asciidoctor/standoc/cleanup.rb +10 -6
  7. data/lib/asciidoctor/standoc/cleanup_inline.rb +1 -1
  8. data/lib/asciidoctor/standoc/cleanup_ref.rb +45 -0
  9. data/lib/asciidoctor/standoc/isodoc.rng +427 -0
  10. data/lib/asciidoctor/standoc/lists.rb +12 -12
  11. data/lib/asciidoctor/standoc/macros_yaml2text.rb +32 -15
  12. data/lib/asciidoctor/standoc/ref.rb +71 -29
  13. data/lib/asciidoctor/standoc/reqt.rb +11 -6
  14. data/lib/asciidoctor/standoc/reqt.rng +23 -0
  15. data/lib/asciidoctor/standoc/table.rb +3 -2
  16. data/lib/asciidoctor/standoc/views/datamodel/model_representation.adoc.erb +1 -1
  17. data/lib/metanorma/standoc/version.rb +1 -1
  18. data/spec/asciidoctor-standoc/blocks_spec.rb +55 -26
  19. data/spec/asciidoctor-standoc/cleanup_spec.rb +1 -1
  20. data/spec/asciidoctor-standoc/datamodel/attributes_table_preprocessor_spec.rb +35 -0
  21. data/spec/asciidoctor-standoc/lists_spec.rb +7 -5
  22. data/spec/asciidoctor-standoc/macros_spec.rb +3 -2
  23. data/spec/asciidoctor-standoc/refs_spec.rb +250 -5
  24. data/spec/asciidoctor-standoc/table_spec.rb +2 -2
  25. data/spec/asciidoctor-standoc/validate_spec.rb +56 -0
  26. data/spec/assets/iso123.rxl +107 -0
  27. data/spec/examples/datamodel/blank_definition_profile.adoc +4 -0
  28. data/spec/examples/datamodel/models/models/{Signature copy.yml → SignatureBlankDefinition.yml} +2 -2
  29. data/spec/fixtures/macros_datamodel/blank_definition_profile.xml +51 -0
  30. metadata +7 -3
@@ -114,7 +114,7 @@ RSpec.describe Asciidoctor::Standoc do
114
114
  it "processes complex tables" do
115
115
  expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
116
116
  #{ASCIIDOC_BLANK_HDR}
117
- [cols="<,^,^,^,^",options="header,footer",headerrows=2,alt="An extensive summary, and illustration, of tables",subsequence="A",options="unnumbered",summary="This is an extremely long, convoluted summary",width=70%]
117
+ [cols="<,^,^,^,^",options="header,footer",headerrows=2,alt="An extensive summary, and illustration, of tables",subsequence="A",options="unnumbered",summary="This is an extremely long, convoluted summary",width=70%,number="3",keep-with-next=true,keep-lines-together=true]
118
118
  .Maximum _permissible_ mass fraction of defects
119
119
  |===
120
120
  .2+|Defect 4+^| Maximum permissible mass fraction of defects in husked rice +
@@ -144,7 +144,7 @@ RSpec.describe Asciidoctor::Standoc do
144
144
  INPUT
145
145
  #{BLANK_HDR}
146
146
  <sections>
147
- <table id="_" alt="An extensive summary, and illustration, of tables" unnumbered="true" subsequence="A" summary="This is an extremely long, convoluted summary" width="70%">
147
+ <table id="_" alt="An extensive summary, and illustration, of tables" unnumbered="true" subsequence="A" summary="This is an extremely long, convoluted summary" width="70%" number="3" keep-with-next="true" keep-lines-together="true">
148
148
  <name>Maximum <em>permissible</em> mass fraction of defects</name>
149
149
  <thead>
150
150
  <tr>
@@ -9,6 +9,62 @@ RSpec.describe Asciidoctor::Standoc do
9
9
  expect(File.exist?("spec/assets/xref_error.err")).to be true
10
10
  end
11
11
 
12
+ it "warns about missing fields in asciibib" do
13
+ FileUtils.rm_f "test.err"
14
+ Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)
15
+ #{VALIDATING_BLANK_HDR}
16
+
17
+ [bibliography]
18
+ == Normative References
19
+
20
+ [%bibitem]
21
+ === Standard
22
+ id:: iso123
23
+ type:: standard
24
+ contributor::
25
+ role::: publisher
26
+ organization:::
27
+ name:::: ISO
28
+ contributor::
29
+ role::: author
30
+ person:::
31
+ name::::
32
+ +
33
+ --
34
+ completename::
35
+ language::: en
36
+ content::: Fred
37
+ --
38
+ contributor::
39
+ role::: author
40
+ person:::
41
+ name::::
42
+ completename::::: Jack
43
+
44
+ INPUT
45
+ errf = File.read("test.err")
46
+ expect(errf).to include "Reference iso123 is missing a document identifier (docid)"
47
+ end
48
+
49
+ it "warns about missing fields in asciibib" do
50
+ FileUtils.rm_f "test.err"
51
+ Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)
52
+ #{VALIDATING_BLANK_HDR}
53
+
54
+ [bibliography]
55
+ == Normative References
56
+
57
+ [%bibitem]
58
+ === Standard
59
+ type:: standard
60
+ contributor::
61
+ role::: publisher
62
+ organization:::
63
+ name:::: ISO
64
+ INPUT
65
+ errf = File.read("test.err")
66
+ expect(errf).to include "The following reference is missing an anchor"
67
+ end
12
68
  it "warns about malformed LaTeX" do
13
69
  FileUtils.rm_f "test.err"
14
70
  Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)
@@ -0,0 +1,107 @@
1
+ <bibdata id='iso123' xmlns='http://www.example.com' type='standard'>
2
+ <fetched>2020-06-12</fetched>
3
+ <title type='title-intro' format='text/plain' language='en' script='Latn'>Rubber latex</title>
4
+ <title type='title-main' format='text/plain' language='en' script='Latn'>Sampling</title>
5
+ <title type='main' format='text/plain' language='en' script='Latn'>Rubber latex – Sampling</title>
6
+ <title type='title-intro' format='text/plain' language='fr' script='Latn'>Latex de caoutchouc</title>
7
+ <title type='title-main' format='text/plain' language='fr' script='Latn'>Échantillonnage</title>
8
+ <title type='main' format='text/plain' language='fr' script='Latn'>Latex de caoutchouc – Échantillonnage</title>
9
+ <uri type='src'>https://www.iso.org/standard/23281.html</uri>
10
+ <uri type='obp'>https://www.iso.org/obp/ui/#!iso:std:23281:en</uri>
11
+ <uri type='rss'>https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri>
12
+ <docidentifier type='ISO'>ISO 123 (all parts)</docidentifier>
13
+ <docnumber>123</docnumber>
14
+ <date type='published'>
15
+ <on>2001</on>
16
+ </date>
17
+ <contributor>
18
+ <role type='publisher'/>
19
+ <organization>
20
+ <name>International Organization for Standardization</name>
21
+ <abbreviation>ISO</abbreviation>
22
+ <uri>www.iso.org</uri>
23
+ </organization>
24
+ </contributor>
25
+ <edition>3</edition>
26
+ <language>en</language>
27
+ <language>fr</language>
28
+ <script>Latn</script>
29
+ <status>
30
+ <stage>90</stage>
31
+ <substage>93</substage>
32
+ </status>
33
+ <copyright>
34
+ <from>2001</from>
35
+ <owner>
36
+ <organization>
37
+ <name>ISO</name>
38
+ </organization>
39
+ </owner>
40
+ </copyright>
41
+ <relation type='obsoletes'>
42
+ <bibitem type='standard'>
43
+ <formattedref format='text/plain'>ISO 123:1985</formattedref>
44
+ </bibitem>
45
+ </relation>
46
+ <relation type='instance'>
47
+ <bibitem type='standard'>
48
+ <fetched>2020-06-12</fetched>
49
+ <title type='title-intro' format='text/plain' language='en' script='Latn'>Rubber latex</title>
50
+ <title type='title-main' format='text/plain' language='en' script='Latn'>Sampling</title>
51
+ <title type='main' format='text/plain' language='en' script='Latn'>Rubber latex – Sampling</title>
52
+ <title type='title-intro' format='text/plain' language='fr' script='Latn'>Latex de caoutchouc</title>
53
+ <title type='title-main' format='text/plain' language='fr' script='Latn'>Échantillonnage</title>
54
+ <title type='main' format='text/plain' language='fr' script='Latn'>Latex de caoutchouc – Échantillonnage</title>
55
+ <uri type='src'>https://www.iso.org/standard/23281.html</uri>
56
+ <uri type='obp'>https://www.iso.org/obp/ui/#!iso:std:23281:en</uri>
57
+ <uri type='rss'>https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri>
58
+ <docidentifier type='ISO'>ISO 123:2001</docidentifier>
59
+ <docnumber>123</docnumber>
60
+ <date type='published'>
61
+ <on>2001</on>
62
+ </date>
63
+ <contributor>
64
+ <role type='publisher'/>
65
+ <organization>
66
+ <name>International Organization for Standardization</name>
67
+ <abbreviation>ISO</abbreviation>
68
+ <uri>www.iso.org</uri>
69
+ </organization>
70
+ </contributor>
71
+ <edition>3</edition>
72
+ <language>en</language>
73
+ <language>fr</language>
74
+ <script>Latn</script>
75
+ <status>
76
+ <stage>90</stage>
77
+ <substage>93</substage>
78
+ </status>
79
+ <copyright>
80
+ <from>2001</from>
81
+ <owner>
82
+ <organization>
83
+ <name>ISO</name>
84
+ </organization>
85
+ </owner>
86
+ </copyright>
87
+ <relation type='obsoletes'>
88
+ <bibitem type='standard'>
89
+ <formattedref format='text/plain'>ISO 123:1985</formattedref>
90
+ </bibitem>
91
+ </relation>
92
+ <place>Geneva</place>
93
+ </bibitem>
94
+ </relation>
95
+ <relation type='instance'>
96
+ <bibitem type='standard'>
97
+ <formattedref format='text/plain'>ISO 123:1985</formattedref>
98
+ </bibitem>
99
+ </relation>
100
+ <relation type='instance'>
101
+ <bibitem type='standard'>
102
+ <formattedref format='text/plain'>ISO 123:1974</formattedref>
103
+ </bibitem>
104
+ </relation>
105
+ <place>Geneva</place>
106
+ </bibdata>
107
+
@@ -0,0 +1,4 @@
1
+ = Document title
2
+ Author
3
+
4
+ [datamodel_attributes_table,models/models/SignatureBlankDefinition.yml]
@@ -4,10 +4,10 @@ definition: |
4
4
  A cryptographic signature used to determine data integrity and validity of the object it belongs to.
5
5
  attributes:
6
6
  algorithm:
7
- definition: The public key cryptographic algorithm used for this digital signature.
7
+ definition:
8
8
  type: iso14888Oid
9
9
  publicKey:
10
- definition: A reference to the actual public key used to verify the digital signature, a URI where the public key of the signer used for this signature is found.
10
+ definition:
11
11
  type: Uri
12
12
  signature:
13
13
  definition: The actual digital signature value encoded in Base64 format.
@@ -0,0 +1,51 @@
1
+ <sections>
2
+ <clause id='_' inline-header='false' obligation='normative'>
3
+ <title>Signature</title>
4
+ <p id='_'>
5
+ A cryptographic signature used to determine data integrity and validity
6
+ of the object it belongs to.
7
+ </p>
8
+ <table id='_'>
9
+ <name>Signature attributes</name>
10
+ <thead>
11
+ <tr>
12
+ <th align='left'>Name</th>
13
+ <th align='left'>Definition</th>
14
+ <th align='left'>Mandatory/ Optional/ Conditional</th>
15
+ <th align='left'>Max Occur</th>
16
+ <th align='left'>Data Type</th>
17
+ </tr>
18
+ </thead>
19
+ <tbody>
20
+ <tr>
21
+ <td align='left'>algorithm</td>
22
+ <td align='left'>TODO: enum algorithm’s definition</td>
23
+ <td align='left'>M</td>
24
+ <td align='left'>1</td>
25
+ <td align='left'>
26
+ <tt>iso14888Oid</tt>
27
+ </td>
28
+ </tr>
29
+ <tr>
30
+ <td align='left'>publicKey</td>
31
+ <td align='left'>TODO: enum publicKey’s definition</td>
32
+ <td align='left'>M</td>
33
+ <td align='left'>1</td>
34
+ <td align='left'>
35
+ <tt>Uri</tt>
36
+ </td>
37
+ </tr>
38
+ <tr>
39
+ <td align='left'>signature</td>
40
+ <td align='left'>The actual digital signature value encoded in Base64 format.</td>
41
+ <td align='left'>M</td>
42
+ <td align='left'>1</td>
43
+ <td align='left'>
44
+ <tt>CharacterString</tt>
45
+ </td>
46
+ </tr>
47
+ </tbody>
48
+ </table>
49
+ </clause>
50
+ </sections>
51
+ </standard-document>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-standoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.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: 2020-06-08 00:00:00.000000000 Z
11
+ date: 2020-06-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor
@@ -354,6 +354,7 @@ files:
354
354
  - lib/asciidoctor/standoc/basicdoc.rng
355
355
  - lib/asciidoctor/standoc/biblio.rng
356
356
  - lib/asciidoctor/standoc/blocks.rb
357
+ - lib/asciidoctor/standoc/blocks_notes.rb
357
358
  - lib/asciidoctor/standoc/cleanup.rb
358
359
  - lib/asciidoctor/standoc/cleanup_block.rb
359
360
  - lib/asciidoctor/standoc/cleanup_boilerplate.rb
@@ -418,6 +419,7 @@ files:
418
419
  - spec/assets/i18n.yaml
419
420
  - spec/assets/iso.headless.html
420
421
  - spec/assets/iso.xml
422
+ - spec/assets/iso123.rxl
421
423
  - spec/assets/rice_image1.png
422
424
  - spec/assets/scripts.html
423
425
  - spec/assets/std.css
@@ -429,6 +431,7 @@ files:
429
431
  - spec/examples/codes_table.html
430
432
  - spec/examples/datamodel/address_class_profile.adoc
431
433
  - spec/examples/datamodel/address_component_profile.adoc
434
+ - spec/examples/datamodel/blank_definition_profile.adoc
432
435
  - spec/examples/datamodel/common_models_diagram.adoc
433
436
  - spec/examples/datamodel/models/models/AddressClassProfile.yml
434
437
  - spec/examples/datamodel/models/models/AddressComponentProfile.yml
@@ -440,8 +443,8 @@ files:
440
443
  - spec/examples/datamodel/models/models/Localization.yml
441
444
  - spec/examples/datamodel/models/models/ProfileCompliantAddress.yml
442
445
  - spec/examples/datamodel/models/models/ProfileCompliantAddressComponent.yml
443
- - spec/examples/datamodel/models/models/Signature copy.yml
444
446
  - spec/examples/datamodel/models/models/Signature.yml
447
+ - spec/examples/datamodel/models/models/SignatureBlankDefinition.yml
445
448
  - spec/examples/datamodel/models/models/TextDirectionCode copy.yml
446
449
  - spec/examples/datamodel/models/models/TextDirectionCode.yml
447
450
  - spec/examples/datamodel/models/models/Validity.yml
@@ -468,6 +471,7 @@ files:
468
471
  - spec/examples/rice_images/rice_image3_3.png
469
472
  - spec/fixtures/macros_datamodel/address_class_profile.xml
470
473
  - spec/fixtures/macros_datamodel/address_component_profile.xml
474
+ - spec/fixtures/macros_datamodel/blank_definition_profile.xml
471
475
  - spec/fixtures/macros_datamodel/common_models_diagram.xml
472
476
  - spec/fixtures/macros_datamodel/top_down_diagram.xml
473
477
  - spec/metanorma/processor_spec.rb