metanorma-ietf 2.4.4 → 3.0.0

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: 68f7c56e995bd19565266c00a76aa97a0e7a02e348d34f53d7d9288b63fb8663
4
- data.tar.gz: 83866142dd9d484e04f7f34b7df0a2a405d1aee18063d0c5d87612e5b336920c
3
+ metadata.gz: 6252e62c4528b954e8b212f8f4ecbd2743cf92ce0826851141e9bb5625a33b65
4
+ data.tar.gz: 54297c4b4d966720210747f55c42f67dbaf8154cb6c4638c7c8714aebf43d032
5
5
  SHA512:
6
- metadata.gz: 26bf8e60e859a2875c84c8ca90ad6f33e2100de0b381e51da5fb461a9cce3276e52b8a21d090d9639b9003ad2762aa69a3c5abd0154ecc489c56ab9e5660b240
7
- data.tar.gz: '0891c85154fc7fdc7b53d66307fe7c9179336f45cabecd1c902f772db770e356b17027ac4d16b17fa2270dace7ff7767460788de5706c45febf7be292a96a1d0'
6
+ metadata.gz: 3ba0e479fa11a65a1be98cdf6b18546fc4e633411e94ad8f23fc02492eb027018648abdef26ac81c4f5faed351c70d5871d3446017811c8621c33ba75a5899d8
7
+ data.tar.gz: 5381ff67f5acd1050032ee09a128e1e466fcae7624d8e3be8d1508ba401a158df4caadea2859f0cbb99ac46d32a41430f1d9f3c9ee145c0e8706cea799f307eb
@@ -8,75 +8,9 @@ on:
8
8
  tags: [ v* ]
9
9
  pull_request:
10
10
 
11
+
11
12
  jobs:
12
13
  rake:
13
- name: Test on Ruby ${{ matrix.ruby }} ${{ matrix.os }}
14
- runs-on: ${{ matrix.os }}
15
- continue-on-error: ${{ matrix.experimental }}
16
- strategy:
17
- fail-fast: false
18
- matrix:
19
- ruby: [ '3.0', '2.7', '2.6', '2.5' ]
20
- os: [ ubuntu-latest, windows-latest, macos-latest ]
21
- experimental: [ false ]
22
-
23
- steps:
24
- - uses: actions/checkout@master
25
-
26
- - uses: ruby/setup-ruby@v1
27
- with:
28
- ruby-version: ${{ matrix.ruby }}
29
- bundler-cache: true
30
-
31
- - uses: actions/setup-python@v1
32
- with:
33
- python-version: '3.6'
34
-
35
- - name: set PIP_DOWNLOAD_CACHE
36
- shell: python
37
- run: |
38
- import os
39
- import platform
40
- from os.path import expanduser
41
-
42
- home = expanduser("~")
43
- cache_path = {
44
- "Linux": f"{home}/.cache/pip",
45
- "Darwin": f"{home}Library/Caches/pip",
46
- "Windows": f"{home}\\AppData\\Local\\pip\\Cache"
47
- }[platform.system()]
48
-
49
- os.system(f"echo PIP_DOWNLOAD_CACHE={cache_path} >> {os.environ['GITHUB_ENV']}")
50
-
51
- - uses: actions/cache@v2
52
- with:
53
- path: ${{ env.PIP_DOWNLOAD_CACHE }}
54
- key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
55
- restore-keys: ${{ runner.os }}-pip-
56
-
57
- - uses: actions/cache@v2
58
- with:
59
- path: ~/.cache/xml2rfc
60
- key: xml2rfc
61
- restore-keys: xml2rfc
62
-
63
- - if: matrix.os == 'macos-latest'
64
- run: brew install libmagic
65
-
66
- - if: matrix.os == 'windows-latest'
67
- run: pip install python-magic-bin
68
-
69
- - run: pip install xml2rfc
70
-
71
- - run: bundle exec rake
72
-
73
- tests-passed:
74
- needs: rake
75
- runs-on: ubuntu-latest
76
- steps:
77
- - uses: peter-evans/repository-dispatch@v1
78
- with:
79
- token: ${{ secrets.METANORMA_CI_PAT_TOKEN || secrets.GITHUB_TOKEN }}
80
- repository: ${{ github.repository }}
81
- event-type: tests-passed
82
- client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'
14
+ uses: metanorma/metanorma-build-scripts/.github/workflows/xml2rfc-rake.yml@main
15
+ secrets:
16
+ pat_token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
data/.gitignore CHANGED
@@ -18,3 +18,8 @@
18
18
  **/.byebug_history
19
19
 
20
20
  .rubocop-https--*
21
+
22
+ /Gemfile.devel
23
+ /Gemfile.lock
24
+ /test.err
25
+ /test.rfc.xml.err
@@ -62,7 +62,7 @@ module IsoDoc
62
62
  def docidentifier_render(bib, out)
63
63
  docidentifiers = bib.xpath(ns("./docidentifier"))
64
64
  id = render_identifier(bibitem_ref_code(bib))
65
- !id[1].nil? && id[1] != "(NO ID)" and out.refcontent id[1]
65
+ !id[:sdo].nil? && id[:sdo] != "(NO ID)" and out.refcontent id[:sdo]
66
66
  docidentifiers&.each do |u|
67
67
  u["type"] == "DOI" and
68
68
  out.seriesInfo nil, **attr_code(value: u.text.sub(/^DOI /, ""),
@@ -1,79 +1,83 @@
1
- module IsoDoc::Ietf
2
- class RfcConvert < ::IsoDoc::Convert
3
- def recommendation_labels(node)
4
- [node.at(ns("./label")), node.at(ns("./title")),
5
- @xrefs.anchor(node['id'], :label, false)]
6
- end
7
-
8
- def recommendation_name(node, out, type)
9
- label, title, lbl = recommendation_labels(node)
10
- out.t **{ keepWithNext: "true" } do |b|
11
- b << (lbl.nil? ? l10n("#{type}:") : l10n("#{type} #{lbl}:"))
1
+ module IsoDoc
2
+ module Ietf
3
+ class RfcConvert < ::IsoDoc::Convert
4
+ def recommendation_labels(node)
5
+ [node.at(ns("./label")), node.at(ns("./title")),
6
+ @xrefs.anchor(node["id"], :label, false)]
12
7
  end
13
- if label || title
14
- out.t **{ keepWithNext: "true" } do |b|
15
- label and label.children.each { |n| parse(n,b) }
16
- b << "#{clausedelim} " if label && title
17
- title and title.children.each { |n| parse(n,b) }
8
+
9
+ def recommendation_name(node, out, type)
10
+ label, title, lbl = recommendation_labels(node)
11
+ out.t **{ keepWithNext: "true" } do |b|
12
+ b << (lbl.nil? ? l10n("#{type}:") : l10n("#{type} #{lbl}:"))
13
+ end
14
+ if label || title
15
+ out.t **{ keepWithNext: "true" } do |b|
16
+ label and label.children.each { |n| parse(n, b) }
17
+ b << "#{clausedelim} " if label && title
18
+ title and title.children.each { |n| parse(n, b) }
19
+ end
18
20
  end
19
21
  end
20
- end
21
22
 
22
- def recommendation_attributes(node, out)
23
- ret = recommendation_attributes1(node)
24
- return if ret.empty?
25
- out.ul do |p|
26
- ret.each do |l|
27
- p.li do |i|
28
- i.em { |e| i << l }
23
+ def recommendation_attributes(node, out)
24
+ ret = recommendation_attributes1(node)
25
+ return if ret.empty?
26
+
27
+ out.ul do |p|
28
+ ret.each do |l|
29
+ p.li do |i|
30
+ i.em { |_e| i << l }
31
+ end
29
32
  end
30
33
  end
31
34
  end
32
- end
33
35
 
34
- def recommendation_parse(node, out)
35
- recommendation_name(node, out, @i18n.recommendation)
36
- recommendation_attributes(node, out)
37
- node.children.each do |n|
38
- parse(n, out) unless %w(label title).include? n.name
36
+ def recommendation_parse(node, out)
37
+ recommendation_name(node, out, @i18n.recommendation)
38
+ recommendation_attributes(node, out)
39
+ node.children.each do |n|
40
+ parse(n, out) unless %w(label title).include? n.name
41
+ end
39
42
  end
40
- end
41
43
 
42
- def requirement_parse(node, out)
43
- recommendation_name(node, out, @i18n.requirement)
44
- recommendation_attributes(node, out)
45
- node.children.each do |n|
46
- parse(n, out) unless %w(label title).include? n.name
44
+ def requirement_parse(node, out)
45
+ recommendation_name(node, out, @i18n.requirement)
46
+ recommendation_attributes(node, out)
47
+ node.children.each do |n|
48
+ parse(n, out) unless %w(label title).include? n.name
49
+ end
47
50
  end
48
- end
49
51
 
50
- def permission_parse(node, out)
51
- recommendation_name(node, out, @i18n.permission)
52
- recommendation_attributes(node, out)
53
- node.children.each do |n|
54
- parse(n, out) unless %w(label title).include? n.name
52
+ def permission_parse(node, out)
53
+ recommendation_name(node, out, @i18n.permission)
54
+ recommendation_attributes(node, out)
55
+ node.children.each do |n|
56
+ parse(n, out) unless %w(label title).include? n.name
57
+ end
55
58
  end
56
- end
57
59
 
58
- def inline?(node)
59
- return true if node.first_element_child.nil?
60
- %w(em link eref xref strong tt sup sub strike keyword smallcap
61
- br hr bookmark pagebreak stem origin term preferred admitted
62
- deprecates domain termsource modification).include? node.first_element_child.name
63
- end
60
+ def inline?(node)
61
+ return true if node.first_element_child.nil?
64
62
 
65
- def requirement_component_parse(node, out)
66
- return if node["exclude"] == "true"
67
- out1 = out
68
- if inline?(node)
69
- out.t do |p|
70
- p << "INHERIT: " if node.name == "inherit"
71
- node.children.each { |n| parse(n, p) }
63
+ %w(em link eref xref strong tt sup sub strike keyword smallcap
64
+ br hr bookmark pagebreak stem origin term preferred admitted
65
+ deprecates domain termsource modification)
66
+ .include? node.first_element_child.name
67
+ end
68
+
69
+ def requirement_component_parse(node, out)
70
+ return if node["exclude"] == "true"
71
+
72
+ if inline?(node)
73
+ out.t do |p|
74
+ p << "INHERIT: " if node.name == "inherit"
75
+ node.children.each { |n| parse(n, p) }
76
+ end
77
+ else
78
+ node.children.each { |n| parse(n, out) }
72
79
  end
73
- else
74
- node.children.each { |n| parse(n, out) }
75
80
  end
76
81
  end
77
82
  end
78
83
  end
79
-
@@ -52,6 +52,8 @@ module IsoDoc::Ietf
52
52
  case node.name
53
53
  when "bcp14" then bcp14_parse(node, out)
54
54
  when "concept" then concept_parse(node, out)
55
+ when "verbal-definition", "non-verbal-representation"
56
+ node.elements.each { |n| parse(n, out) }
55
57
  else
56
58
  text = node.to_xml.gsub(/</, "&lt;").gsub(/>/, "&gt;")
57
59
  out.t { |p| p << text }
@@ -1,63 +1,70 @@
1
- module IsoDoc::Ietf
2
- class RfcConvert < ::IsoDoc::Convert
3
- def definition_parse(node, out)
4
- node.children.each { |n| parse(n, out) }
5
- end
1
+ module IsoDoc
2
+ module Ietf
3
+ class RfcConvert < ::IsoDoc::Convert
4
+ def definition_parse(node, out)
5
+ node.children.each { |n| parse(n, out) }
6
+ end
6
7
 
7
- def modification_parse(node, out)
8
- para = node.at(ns("./p"))
9
- out << " -- "
10
- para.children.each { |n| parse(n, out) }
11
- end
8
+ def modification_parse(node, out)
9
+ para = node.at(ns("./p"))
10
+ out << " -- "
11
+ para.children.each { |n| parse(n, out) }
12
+ end
12
13
 
13
- def deprecated_term_parse(node, out)
14
- out.t do |p|
15
- p << l10n("#{@i18n.deprecated}: ")
16
- node.children.each { |c| parse(c, p) }
14
+ def deprecated_term_parse(node, out)
15
+ name = node.at(ns(".//name"))
16
+ out.t do |p|
17
+ p << l10n("#{@i18n.deprecated}: ")
18
+ name.children.each { |c| parse(c, p) }
19
+ end
17
20
  end
18
- end
19
21
 
20
- def admitted_term_parse(node, out)
21
- out.t do |p|
22
- node.children.each { |c| parse(c, p) }
22
+ def admitted_term_parse(node, out)
23
+ name = node.at(ns(".//name"))
24
+ out.t do |p|
25
+ name.children.each { |c| parse(c, p) }
26
+ end
23
27
  end
24
- end
25
28
 
26
- def term_parse(node, out)
27
- out.name do |p|
28
- node.children.each { |n| parse(n, p) }
29
+ def term_parse(node, out)
30
+ name = node.at(ns(".//name"))
31
+ out.name do |p|
32
+ name.children.each { |n| parse(n, p) }
33
+ end
29
34
  end
30
- end
31
35
 
32
- def termnote_parse(node, out)
33
- note_parse(node, out)
34
- end
36
+ def termnote_parse(node, out)
37
+ note_parse(node, out)
38
+ end
35
39
 
36
- def termref_parse(node, out)
37
- out.t do |p|
38
- p << "SOURCE: "
39
- node.children.each { |n| parse(n, p) }
40
+ def termref_parse(node, out)
41
+ out.t do |p|
42
+ p << "SOURCE: "
43
+ node.children.each { |n| parse(n, p) }
44
+ end
40
45
  end
41
- end
42
46
 
43
- def termdef_parse(node, out)
44
- set_termdomain("")
45
- clause_parse(node, out)
46
- end
47
+ def termdef_parse(node, out)
48
+ set_termdomain("")
49
+ node.xpath(ns("./definition")).size > 1 and
50
+ IsoDoc::PresentationXMLConvert.new({}).multidef(node)
51
+ clause_parse(node, out)
52
+ end
47
53
 
48
- def termdocsource_parse(_node, _out); end
54
+ def termdocsource_parse(_node, _out); end
49
55
 
50
- def concept_parse(node, out)
51
- if d = node.at(ns("./renderterm"))
52
- out.em do |em|
53
- d.children.each { |n| parse(n, em) }
56
+ def concept_parse(node, out)
57
+ if d = node.at(ns("./renderterm"))
58
+ out.em do |em|
59
+ d.children.each { |n| parse(n, em) }
60
+ end
61
+ out << " "
54
62
  end
55
- out << " "
63
+ out << "[term defined in "
64
+ r = node.at(ns("./xref | ./eref | ./termref"))
65
+ parse(r, out)
66
+ out << "]"
56
67
  end
57
- out << "[term defined in "
58
- r = node.at(ns("./xref | ./eref | ./termref"))
59
- parse(r, out)
60
- out << "]"
61
68
  end
62
69
  end
63
70
  end
File without changes
File without changes
@@ -1,6 +1,6 @@
1
- module Asciidoctor
1
+ module Metanorma
2
2
  module Ietf
3
- class Converter < ::Asciidoctor::Standoc::Converter
3
+ class Converter < ::Metanorma::Standoc::Converter
4
4
  def para_attrs(node)
5
5
  attr_code( "keep-with-next": node.attr("keepWithNext") ||
6
6
  node.attr("keep-with-next"),
@@ -1,6 +1,6 @@
1
- module Asciidoctor
1
+ module Metanorma
2
2
  module Ietf
3
- class Converter < ::Asciidoctor::Standoc::Converter
3
+ class Converter < ::Metanorma::Standoc::Converter
4
4
  def cleanup(xmldoc)
5
5
  bcp14_cleanup(xmldoc)
6
6
  abstract_cleanup(xmldoc)
@@ -42,19 +42,19 @@ module Asciidoctor
42
42
  end
43
43
  end
44
44
 
45
- def rfc_anchor_cleanup(xmldoc)
46
- map = xmldoc.xpath("//bibitem[docidentifier/@type = 'rfc-anchor']")
47
- .each_with_object({}) do |b, m|
45
+ def rfc_anchor_cleanup(xml)
46
+ map = xml.xpath("//bibitem[docidentifier[@type = 'IETF']"\
47
+ "[@scope = 'anchor']]").each_with_object({}) do |b, m|
48
48
  next if b.at("./ancestor::bibdata | ./ancestor::bibitem")
49
49
 
50
- id = b.at("./docidentifier[@type = 'rfc-anchor']").text
50
+ id = b.at("./docidentifier[@type = 'IETF'][@scope = 'anchor']").text
51
51
  m[b["id"]] = id
52
52
  b["id"] = id
53
53
  end
54
- xmldoc.xpath("//eref | //origin").each do |x|
54
+ xml.xpath("//eref | //origin").each do |x|
55
55
  map[x["bibitemid"]] and x["bibitemid"] = map[x["bibitemid"]]
56
56
  end
57
- xmldoc
57
+ xml
58
58
  end
59
59
 
60
60
  def smartquotes_cleanup(xmldoc)
@@ -1,5 +1,5 @@
1
1
  require "asciidoctor"
2
- require "asciidoctor/standoc/converter"
2
+ require "metanorma/standoc/converter"
3
3
  require "isodoc/ietf/rfc_convert"
4
4
  require_relative "./front"
5
5
  require_relative "./blocks"
@@ -7,11 +7,11 @@ require_relative "./validate"
7
7
  require_relative "./cleanup"
8
8
  require_relative "./macros"
9
9
 
10
- module Asciidoctor
10
+ module Metanorma
11
11
  module Ietf
12
- class Converter < ::Asciidoctor::Standoc::Converter
12
+ class Converter < ::Metanorma::Standoc::Converter
13
13
  Asciidoctor::Extensions.register do
14
- inline_macro Asciidoctor::Ietf::InlineCrefMacro
14
+ inline_macro Metanorma::Ietf::InlineCrefMacro
15
15
  end
16
16
 
17
17
  XML_ROOT_TAG = "ietf-standard".freeze
@@ -1,6 +1,6 @@
1
- module Asciidoctor
1
+ module Metanorma
2
2
  module Ietf
3
- class Converter < ::Asciidoctor::Standoc::Converter
3
+ class Converter < ::Metanorma::Standoc::Converter
4
4
  def relaton_relations
5
5
  %w(included-in described-by derived-from instance obsoletes updates)
6
6
  end
File without changes
@@ -17,7 +17,7 @@
17
17
  these elements; we just want one namespace for any child grammars
18
18
  of this.
19
19
  -->
20
- <grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
20
+ <grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
21
21
  <include href="reqt.rng"/>
22
22
  <!-- include "biblio.rnc" { } -->
23
23
  <include href="basicdoc.rng">
@@ -32,6 +32,19 @@
32
32
  <ref name="DocumentType"/>
33
33
  </element>
34
34
  </define>
35
+ <define name="bibitem">
36
+ <element name="bibitem">
37
+ <attribute name="id">
38
+ <data type="ID"/>
39
+ </attribute>
40
+ <optional>
41
+ <attribute name="hidden">
42
+ <data type="boolean"/>
43
+ </attribute>
44
+ </optional>
45
+ <ref name="BibliographicItem"/>
46
+ </element>
47
+ </define>
35
48
  <define name="section-title">
36
49
  <element name="title">
37
50
  <zeroOrMore>
@@ -58,7 +71,7 @@
58
71
  <attribute name="alt"/>
59
72
  </optional>
60
73
  <optional>
61
- <attribute name="updatetype">
74
+ <attribute name="update-type">
62
75
  <data type="boolean"/>
63
76
  </attribute>
64
77
  </optional>
@@ -690,6 +703,7 @@
690
703
  <ref name="terms"/>
691
704
  <ref name="term-clause"/>
692
705
  <ref name="definitions"/>
706
+ <ref name="floating-title"/>
693
707
  </choice>
694
708
  </oneOrMore>
695
709
  </element>
@@ -1680,6 +1694,7 @@
1680
1694
  <ref name="clause-subsection"/>
1681
1695
  <ref name="terms"/>
1682
1696
  <ref name="definitions"/>
1697
+ <ref name="floating-title"/>
1683
1698
  </choice>
1684
1699
  </oneOrMore>
1685
1700
  </choice>
@@ -1722,6 +1737,7 @@
1722
1737
  <ref name="terms"/>
1723
1738
  <ref name="definitions"/>
1724
1739
  <ref name="references"/>
1740
+ <ref name="floating-title"/>
1725
1741
  </choice>
1726
1742
  </zeroOrMore>
1727
1743
  </group>
@@ -1796,6 +1812,20 @@
1796
1812
  <data type="ID"/>
1797
1813
  </attribute>
1798
1814
  </optional>
1815
+ <optional>
1816
+ <attribute name="language"/>
1817
+ </optional>
1818
+ <optional>
1819
+ <attribute name="script"/>
1820
+ </optional>
1821
+ <optional>
1822
+ <attribute name="tag"/>
1823
+ </optional>
1824
+ <optional>
1825
+ <attribute name="multilingual-rendering">
1826
+ <ref name="MultilingualRenderingType"/>
1827
+ </attribute>
1828
+ </optional>
1799
1829
  <oneOrMore>
1800
1830
  <ref name="preferred"/>
1801
1831
  </oneOrMore>
@@ -1803,17 +1833,17 @@
1803
1833
  <ref name="admitted"/>
1804
1834
  </zeroOrMore>
1805
1835
  <zeroOrMore>
1806
- <ref name="related"/>
1836
+ <ref name="deprecates"/>
1807
1837
  </zeroOrMore>
1808
1838
  <zeroOrMore>
1809
- <ref name="deprecates"/>
1839
+ <ref name="related"/>
1810
1840
  </zeroOrMore>
1811
1841
  <optional>
1812
1842
  <ref name="termdomain"/>
1813
1843
  </optional>
1814
- <zeroOrMore>
1815
- <ref name="termgrammar"/>
1816
- </zeroOrMore>
1844
+ <optional>
1845
+ <ref name="termsubject"/>
1846
+ </optional>
1817
1847
  <oneOrMore>
1818
1848
  <ref name="termdefinition"/>
1819
1849
  </oneOrMore>
@@ -1830,41 +1860,236 @@
1830
1860
  </define>
1831
1861
  <define name="preferred">
1832
1862
  <element name="preferred">
1833
- <oneOrMore>
1834
- <ref name="TextElement"/>
1835
- </oneOrMore>
1863
+ <ref name="Designation"/>
1836
1864
  </element>
1837
1865
  </define>
1838
1866
  <define name="admitted">
1839
1867
  <element name="admitted">
1840
- <oneOrMore>
1841
- <ref name="TextElement"/>
1842
- </oneOrMore>
1868
+ <ref name="Designation"/>
1843
1869
  </element>
1844
1870
  </define>
1845
1871
  <define name="related">
1846
1872
  <element name="related">
1873
+ <attribute name="type">
1874
+ <ref name="RelatedTermType"/>
1875
+ </attribute>
1876
+ <element name="preferred">
1877
+ <ref name="Designation"/>
1878
+ </element>
1879
+ <choice>
1880
+ <ref name="eref"/>
1881
+ <ref name="xref"/>
1882
+ <ref name="termref"/>
1883
+ </choice>
1884
+ </element>
1885
+ </define>
1886
+ <define name="RelatedTermType">
1887
+ <choice>
1888
+ <value>deprecates</value>
1889
+ <value>supersedes</value>
1890
+ <value>narrower</value>
1891
+ <value>broader</value>
1892
+ <value>equivalent</value>
1893
+ <value>compare</value>
1894
+ <value>contrast</value>
1895
+ <value>see</value>
1896
+ </choice>
1897
+ </define>
1898
+ <define name="deprecates">
1899
+ <element name="deprecates">
1900
+ <ref name="Designation"/>
1901
+ </element>
1902
+ </define>
1903
+ <define name="Designation">
1904
+ <optional>
1905
+ <attribute name="absent">
1906
+ <data type="boolean"/>
1907
+ </attribute>
1908
+ </optional>
1909
+ <optional>
1910
+ <attribute name="geographic-area"/>
1911
+ </optional>
1912
+ <choice>
1913
+ <ref name="expression_designation"/>
1914
+ <ref name="letter_symbol_designation"/>
1915
+ <ref name="graphical_symbol_designation"/>
1916
+ </choice>
1917
+ <optional>
1918
+ <ref name="fieldofapplication"/>
1919
+ </optional>
1920
+ <optional>
1921
+ <ref name="usageinfo"/>
1922
+ </optional>
1923
+ <zeroOrMore>
1924
+ <ref name="termsource"/>
1925
+ </zeroOrMore>
1926
+ </define>
1927
+ <define name="fieldofapplication">
1928
+ <element name="field-of-application">
1929
+ <oneOrMore>
1930
+ <ref name="PureTextElement"/>
1931
+ </oneOrMore>
1932
+ </element>
1933
+ </define>
1934
+ <define name="usageinfo">
1935
+ <element name="usage-info">
1936
+ <oneOrMore>
1937
+ <ref name="PureTextElement"/>
1938
+ </oneOrMore>
1939
+ </element>
1940
+ </define>
1941
+ <define name="letter_symbol_designation">
1942
+ <element name="letter-symbol">
1847
1943
  <optional>
1848
- <attribute name="type">
1944
+ <attribute name="isInternational">
1945
+ <data type="boolean"/>
1946
+ </attribute>
1947
+ </optional>
1948
+ <element name="name">
1949
+ <oneOrMore>
1849
1950
  <choice>
1850
- <value>compare</value>
1851
- <value>contrast</value>
1852
- <value>see</value>
1951
+ <ref name="PureTextElement"/>
1952
+ <ref name="stem"/>
1853
1953
  </choice>
1954
+ </oneOrMore>
1955
+ </element>
1956
+ </element>
1957
+ </define>
1958
+ <define name="graphical_symbol_designation">
1959
+ <element name="graphical-symbol">
1960
+ <optional>
1961
+ <attribute name="isInternational">
1962
+ <data type="boolean"/>
1854
1963
  </attribute>
1855
1964
  </optional>
1856
- <oneOrMore>
1857
- <ref name="TextElement"/>
1858
- </oneOrMore>
1965
+ <ref name="figure"/>
1859
1966
  </element>
1860
1967
  </define>
1861
- <define name="deprecates">
1862
- <element name="deprecates">
1863
- <oneOrMore>
1864
- <ref name="TextElement"/>
1865
- </oneOrMore>
1968
+ <define name="expression_designation">
1969
+ <element name="expression">
1970
+ <optional>
1971
+ <attribute name="language">
1972
+ <a:documentation>ISO-639</a:documentation>
1973
+ </attribute>
1974
+ </optional>
1975
+ <optional>
1976
+ <attribute name="script">
1977
+ <a:documentation>ISO-15924</a:documentation>
1978
+ </attribute>
1979
+ </optional>
1980
+ <optional>
1981
+ <attribute name="type">
1982
+ <ref name="ExpressionDesignationType"/>
1983
+ </attribute>
1984
+ </optional>
1985
+ <optional>
1986
+ <attribute name="isInternational">
1987
+ <data type="boolean"/>
1988
+ </attribute>
1989
+ </optional>
1990
+ <element name="name">
1991
+ <zeroOrMore>
1992
+ <choice>
1993
+ <ref name="PureTextElement"/>
1994
+ <ref name="stem"/>
1995
+ <ref name="index"/>
1996
+ </choice>
1997
+ </zeroOrMore>
1998
+ </element>
1999
+ <optional>
2000
+ <element name="abbreviation-type">
2001
+ <ref name="AbbreviationType"/>
2002
+ </element>
2003
+ </optional>
2004
+ <optional>
2005
+ <element name="pronunciation">
2006
+ <ref name="LocalizedString"/>
2007
+ </element>
2008
+ </optional>
2009
+ <optional>
2010
+ <element name="grammar">
2011
+ <ref name="Grammar"/>
2012
+ </element>
2013
+ </optional>
1866
2014
  </element>
1867
2015
  </define>
2016
+ <define name="ExpressionDesignationType">
2017
+ <choice>
2018
+ <value>prefix</value>
2019
+ <value>suffix</value>
2020
+ <value>abbreviation</value>
2021
+ <value>full</value>
2022
+ </choice>
2023
+ </define>
2024
+ <define name="AbbreviationType">
2025
+ <choice>
2026
+ <value>truncation</value>
2027
+ <value>acronym</value>
2028
+ <value>initialism</value>
2029
+ </choice>
2030
+ </define>
2031
+ <define name="Grammar">
2032
+ <zeroOrMore>
2033
+ <element name="gender">
2034
+ <ref name="GrammarGender"/>
2035
+ </element>
2036
+ </zeroOrMore>
2037
+ <zeroOrMore>
2038
+ <element name="number">
2039
+ <ref name="GrammarNumber"/>
2040
+ </element>
2041
+ </zeroOrMore>
2042
+ <optional>
2043
+ <element name="isPreposition">
2044
+ <data type="boolean"/>
2045
+ </element>
2046
+ </optional>
2047
+ <optional>
2048
+ <element name="isParticiple">
2049
+ <data type="boolean"/>
2050
+ </element>
2051
+ </optional>
2052
+ <optional>
2053
+ <element name="isAdjective">
2054
+ <data type="boolean"/>
2055
+ </element>
2056
+ </optional>
2057
+ <optional>
2058
+ <element name="isVerb">
2059
+ <data type="boolean"/>
2060
+ </element>
2061
+ </optional>
2062
+ <optional>
2063
+ <element name="isAdverb">
2064
+ <data type="boolean"/>
2065
+ </element>
2066
+ </optional>
2067
+ <optional>
2068
+ <element name="isNoun">
2069
+ <data type="boolean"/>
2070
+ </element>
2071
+ </optional>
2072
+ <zeroOrMore>
2073
+ <element name="grammar-value">
2074
+ <text/>
2075
+ </element>
2076
+ </zeroOrMore>
2077
+ </define>
2078
+ <define name="GrammarGender">
2079
+ <choice>
2080
+ <value>masculine</value>
2081
+ <value>feminine</value>
2082
+ <value>neuter</value>
2083
+ <value>common</value>
2084
+ </choice>
2085
+ </define>
2086
+ <define name="GrammarNumber">
2087
+ <choice>
2088
+ <value>singular</value>
2089
+ <value>dual</value>
2090
+ <value>plural</value>
2091
+ </choice>
2092
+ </define>
1868
2093
  <define name="termdomain">
1869
2094
  <element name="domain">
1870
2095
  <oneOrMore>
@@ -1872,8 +2097,8 @@
1872
2097
  </oneOrMore>
1873
2098
  </element>
1874
2099
  </define>
1875
- <define name="termgrammar">
1876
- <element name="grammar">
2100
+ <define name="termsubject">
2101
+ <element name="subject">
1877
2102
  <oneOrMore>
1878
2103
  <ref name="TextElement"/>
1879
2104
  </oneOrMore>
@@ -1881,9 +2106,39 @@
1881
2106
  </define>
1882
2107
  <define name="termdefinition">
1883
2108
  <element name="definition">
2109
+ <choice>
2110
+ <ref name="verbaldefinition"/>
2111
+ <ref name="nonverbalrep"/>
2112
+ <group>
2113
+ <ref name="verbaldefinition"/>
2114
+ <ref name="nonverbalrep"/>
2115
+ </group>
2116
+ </choice>
2117
+ </element>
2118
+ </define>
2119
+ <define name="verbaldefinition">
2120
+ <element name="verbal-definition">
1884
2121
  <oneOrMore>
1885
2122
  <choice>
1886
2123
  <ref name="paragraph"/>
2124
+ <ref name="dl"/>
2125
+ <ref name="ol"/>
2126
+ <ref name="ul"/>
2127
+ <ref name="table"/>
2128
+ <ref name="figure"/>
2129
+ <ref name="formula"/>
2130
+ </choice>
2131
+ </oneOrMore>
2132
+ <zeroOrMore>
2133
+ <ref name="termsource"/>
2134
+ </zeroOrMore>
2135
+ </element>
2136
+ </define>
2137
+ <define name="nonverbalrep">
2138
+ <element name="non-verbal-representation">
2139
+ <oneOrMore>
2140
+ <choice>
2141
+ <ref name="table"/>
1887
2142
  <ref name="figure"/>
1888
2143
  <ref name="formula"/>
1889
2144
  </choice>
@@ -1972,6 +2227,12 @@
1972
2227
  <value>modified</value>
1973
2228
  </choice>
1974
2229
  </attribute>
2230
+ <attribute name="type">
2231
+ <choice>
2232
+ <value>authoritative</value>
2233
+ <value>lineage</value>
2234
+ </choice>
2235
+ </attribute>
1975
2236
  <ref name="origin"/>
1976
2237
  <optional>
1977
2238
  <ref name="modification"/>
@@ -2289,4 +2550,17 @@
2289
2550
  </oneOrMore>
2290
2551
  </element>
2291
2552
  </define>
2553
+ <define name="floating-title">
2554
+ <element name="floating-title">
2555
+ <attribute name="id">
2556
+ <data type="ID"/>
2557
+ </attribute>
2558
+ <attribute name="depth">
2559
+ <data type="int"/>
2560
+ </attribute>
2561
+ <zeroOrMore>
2562
+ <ref name="TextElement"/>
2563
+ </zeroOrMore>
2564
+ </element>
2565
+ </define>
2292
2566
  </grammar>
@@ -1,6 +1,6 @@
1
1
  require "asciidoctor/extensions"
2
2
 
3
- module Asciidoctor
3
+ module Metanorma
4
4
  module Ietf
5
5
  class InlineCrefMacro < Asciidoctor::Extensions::InlineMacroProcessor
6
6
  use_dsl
File without changes
@@ -1,8 +1,8 @@
1
1
  require "metanorma/ietf/data/workgroups"
2
2
 
3
- module Asciidoctor
3
+ module Metanorma
4
4
  module Ietf
5
- class Converter < ::Asciidoctor::Standoc::Converter
5
+ class Converter < ::Metanorma::Standoc::Converter
6
6
  def content_validate(doc)
7
7
  super
8
8
  image_validate(doc)
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ietf
3
- VERSION = "2.4.4".freeze
3
+ VERSION = "3.0.0".freeze
4
4
  end
5
5
  end
@@ -2,7 +2,7 @@ require "asciidoctor" unless defined? Asciidoctor::Converter
2
2
  require "metanorma"
3
3
 
4
4
  require_relative "metanorma/ietf"
5
- require_relative "asciidoctor/ietf/converter"
5
+ require_relative "metanorma/ietf/converter"
6
6
  require_relative "isodoc/ietf/rfc_convert"
7
7
 
8
8
  Metanorma::Registry.instance.register(Metanorma::Ietf::Processor)
@@ -28,20 +28,18 @@ Gem::Specification.new do |spec|
28
28
  spec.license = "BSD-2-Clause"
29
29
 
30
30
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
31
- f.match(%r{^(test|spec|features)/})
31
+ f.match(%r{^(bin|test|spec|features)/})
32
32
  end
33
33
  spec.bindir = "exe"
34
34
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
35
35
  spec.require_paths = ["lib"]
36
36
  spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
37
37
 
38
- spec.add_dependency "isodoc", "~> 1.7.0"
39
38
  spec.add_dependency "mathml2asciimath"
40
39
  spec.add_dependency "metanorma-ietf-data"
41
- spec.add_dependency "metanorma-standoc", "~> 1.10.0"
42
- spec.add_dependency "open-uri"
40
+ spec.add_dependency "metanorma-standoc", "~> 2.0.0"
43
41
 
44
- spec.add_development_dependency "byebug"
42
+ spec.add_development_dependency "debug"
45
43
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
46
44
  spec.add_development_dependency "guard", "~> 2.14"
47
45
  spec.add_development_dependency "guard-rspec", "~> 4.7"
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-ietf
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.4
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-10-11 00:00:00.000000000 Z
11
+ date: 2022-01-10 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: isodoc
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: 1.7.0
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: 1.7.0
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: mathml2asciimath
29
15
  requirement: !ruby/object:Gem::Requirement
@@ -58,30 +44,16 @@ dependencies:
58
44
  requirements:
59
45
  - - "~>"
60
46
  - !ruby/object:Gem::Version
61
- version: 1.10.0
47
+ version: 2.0.0
62
48
  type: :runtime
63
49
  prerelease: false
64
50
  version_requirements: !ruby/object:Gem::Requirement
65
51
  requirements:
66
52
  - - "~>"
67
53
  - !ruby/object:Gem::Version
68
- version: 1.10.0
69
- - !ruby/object:Gem::Dependency
70
- name: open-uri
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: '0'
76
- type: :runtime
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: '0'
54
+ version: 2.0.0
83
55
  - !ruby/object:Gem::Dependency
84
- name: byebug
56
+ name: debug
85
57
  requirement: !ruby/object:Gem::Requirement
86
58
  requirements:
87
59
  - - ">="
@@ -263,26 +235,9 @@ files:
263
235
  - LICENSE
264
236
  - README.adoc
265
237
  - Rakefile
266
- - bin/asciidoctor-rfc2
267
- - bin/asciidoctor-rfc2.bat
268
- - bin/asciidoctor-rfc3
269
- - bin/console
270
- - bin/rspec
271
- - bin/setup
272
238
  - docs/installation.md
273
239
  - docs/navigation.md
274
240
  - docs/overview.md
275
- - lib/asciidoctor/ietf/basicdoc.rng
276
- - lib/asciidoctor/ietf/biblio.rng
277
- - lib/asciidoctor/ietf/blocks.rb
278
- - lib/asciidoctor/ietf/cleanup.rb
279
- - lib/asciidoctor/ietf/converter.rb
280
- - lib/asciidoctor/ietf/front.rb
281
- - lib/asciidoctor/ietf/ietf.rng
282
- - lib/asciidoctor/ietf/isodoc.rng
283
- - lib/asciidoctor/ietf/macros.rb
284
- - lib/asciidoctor/ietf/reqt.rng
285
- - lib/asciidoctor/ietf/validate.rb
286
241
  - lib/isodoc/ietf/SVG-1.2-RFC.rng
287
242
  - lib/isodoc/ietf/blocks.rb
288
243
  - lib/isodoc/ietf/cleanup.rb
@@ -305,7 +260,18 @@ files:
305
260
  - lib/isodoc/ietf/xref.rb
306
261
  - lib/metanorma-ietf.rb
307
262
  - lib/metanorma/ietf.rb
263
+ - lib/metanorma/ietf/basicdoc.rng
264
+ - lib/metanorma/ietf/biblio.rng
265
+ - lib/metanorma/ietf/blocks.rb
266
+ - lib/metanorma/ietf/cleanup.rb
267
+ - lib/metanorma/ietf/converter.rb
268
+ - lib/metanorma/ietf/front.rb
269
+ - lib/metanorma/ietf/ietf.rng
270
+ - lib/metanorma/ietf/isodoc.rng
271
+ - lib/metanorma/ietf/macros.rb
308
272
  - lib/metanorma/ietf/processor.rb
273
+ - lib/metanorma/ietf/reqt.rng
274
+ - lib/metanorma/ietf/validate.rb
309
275
  - lib/metanorma/ietf/version.rb
310
276
  - metanorma-ietf.gemspec
311
277
  - rfc2629-other.ent
@@ -330,7 +296,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
330
296
  - !ruby/object:Gem::Version
331
297
  version: '0'
332
298
  requirements: []
333
- rubygems_version: 3.1.4
299
+ rubygems_version: 3.2.32
334
300
  signing_key:
335
301
  specification_version: 4
336
302
  summary: metanorma-ietf lets you write IETF documents, such as Internet-Drafts and
data/bin/asciidoctor-rfc2 DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "metanorma-ietf"
4
- require "asciidoctor/cli"
5
-
6
- options = Asciidoctor::Cli::Options.new backend: "rfc2", header_footer: true
7
- # FIXME This is a really bizarre API. Please make me simpler.
8
-
9
- exit 0 if options.parse!(ARGV) == 0
10
-
11
- invoker = Asciidoctor::Cli::Invoker.new options
12
- GC.start
13
- invoker.invoke!
14
- exit invoker.code
@@ -1,2 +0,0 @@
1
- @echo off
2
- ruby %~dp0\asciidoctor-rfc2 %*
data/bin/asciidoctor-rfc3 DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "metanorma-ietf"
4
- require "asciidoctor/cli"
5
-
6
- options = Asciidoctor::Cli::Options.new backend: "rfc3", header_footer: true
7
- # FIXME This is a really bizarre API. Please make me simpler.
8
-
9
- exit 0 if options.parse!(ARGV) == 0
10
-
11
- invoker = Asciidoctor::Cli::Invoker.new options
12
- GC.start
13
- invoker.invoke!
14
- exit invoker.code
data/bin/console DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "metanorma-ietf"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start(__FILE__)
data/bin/rspec DELETED
@@ -1,17 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- # This file was generated by Bundler.
4
- #
5
- # The application 'rspec' is installed as part of a gem, and
6
- # this file is here to facilitate running it.
7
- #
8
-
9
- require "pathname"
10
- ENV["BUNDLE_GEMFILE"] ||= File.expand_path(
11
- "../../Gemfile", Pathname.new(__FILE__).realpath
12
- )
13
-
14
- require "rubygems"
15
- require "bundler/setup"
16
-
17
- load Gem.bin_path("rspec-core", "rspec")
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here