metanorma-ietf 2.5.1 → 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: c2d4894fa5f829d7b49228514a64317990ec1747c1f3f327545a919b714aa054
4
- data.tar.gz: 7058f5103647d0917da435023afef57236c803413e59b6dab3382e5ab8a84d0f
3
+ metadata.gz: 6252e62c4528b954e8b212f8f4ecbd2743cf92ce0826851141e9bb5625a33b65
4
+ data.tar.gz: 54297c4b4d966720210747f55c42f67dbaf8154cb6c4638c7c8714aebf43d032
5
5
  SHA512:
6
- metadata.gz: cd64d4822df68c4df3338ac56abe2159991ed4065c8eacfb5eb1474a1900410ab732a186883486492538538b8344d60fb2b9090008c673fcae1ac1120c1c3e18
7
- data.tar.gz: 73051c3782f02ae2d4ad8f2592f534eb3d2f1abd34620c1bc15c3d8034d51ad1aac2e3d552d11c489ea0f81b940844ea7198d0b598d9a9f1a4a30a4dd2b304b2
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 /, ""),
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
@@ -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>
@@ -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>
@@ -1959,7 +1989,11 @@
1959
1989
  </optional>
1960
1990
  <element name="name">
1961
1991
  <zeroOrMore>
1962
- <ref name="PureTextElement"/>
1992
+ <choice>
1993
+ <ref name="PureTextElement"/>
1994
+ <ref name="stem"/>
1995
+ <ref name="index"/>
1996
+ </choice>
1963
1997
  </zeroOrMore>
1964
1998
  </element>
1965
1999
  <optional>
@@ -1973,7 +2007,7 @@
1973
2007
  </element>
1974
2008
  </optional>
1975
2009
  <optional>
1976
- <element name="grammar-info">
2010
+ <element name="grammar">
1977
2011
  <ref name="Grammar"/>
1978
2012
  </element>
1979
2013
  </optional>
@@ -2516,4 +2550,17 @@
2516
2550
  </oneOrMore>
2517
2551
  </element>
2518
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>
2519
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.5.1".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,7 +28,7 @@ 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) }
@@ -37,7 +37,7 @@ Gem::Specification.new do |spec|
37
37
 
38
38
  spec.add_dependency "mathml2asciimath"
39
39
  spec.add_dependency "metanorma-ietf-data"
40
- spec.add_dependency "metanorma-standoc", "~> 1.11.0"
40
+ spec.add_dependency "metanorma-standoc", "~> 2.0.0"
41
41
 
42
42
  spec.add_development_dependency "debug"
43
43
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-ietf
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.1
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-11-29 00:00:00.000000000 Z
11
+ date: 2022-01-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mathml2asciimath
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 1.11.0
47
+ version: 2.0.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 1.11.0
54
+ version: 2.0.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: debug
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -235,26 +235,9 @@ files:
235
235
  - LICENSE
236
236
  - README.adoc
237
237
  - Rakefile
238
- - bin/asciidoctor-rfc2
239
- - bin/asciidoctor-rfc2.bat
240
- - bin/asciidoctor-rfc3
241
- - bin/console
242
- - bin/rspec
243
- - bin/setup
244
238
  - docs/installation.md
245
239
  - docs/navigation.md
246
240
  - docs/overview.md
247
- - lib/asciidoctor/ietf/basicdoc.rng
248
- - lib/asciidoctor/ietf/biblio.rng
249
- - lib/asciidoctor/ietf/blocks.rb
250
- - lib/asciidoctor/ietf/cleanup.rb
251
- - lib/asciidoctor/ietf/converter.rb
252
- - lib/asciidoctor/ietf/front.rb
253
- - lib/asciidoctor/ietf/ietf.rng
254
- - lib/asciidoctor/ietf/isodoc.rng
255
- - lib/asciidoctor/ietf/macros.rb
256
- - lib/asciidoctor/ietf/reqt.rng
257
- - lib/asciidoctor/ietf/validate.rb
258
241
  - lib/isodoc/ietf/SVG-1.2-RFC.rng
259
242
  - lib/isodoc/ietf/blocks.rb
260
243
  - lib/isodoc/ietf/cleanup.rb
@@ -277,7 +260,18 @@ files:
277
260
  - lib/isodoc/ietf/xref.rb
278
261
  - lib/metanorma-ietf.rb
279
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
280
272
  - lib/metanorma/ietf/processor.rb
273
+ - lib/metanorma/ietf/reqt.rng
274
+ - lib/metanorma/ietf/validate.rb
281
275
  - lib/metanorma/ietf/version.rb
282
276
  - metanorma-ietf.gemspec
283
277
  - rfc2629-other.ent
@@ -302,7 +296,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
302
296
  - !ruby/object:Gem::Version
303
297
  version: '0'
304
298
  requirements: []
305
- rubygems_version: 3.2.22
299
+ rubygems_version: 3.2.32
306
300
  signing_key:
307
301
  specification_version: 4
308
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