metanorma-ietf 2.2.4 → 2.2.5

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f06324c3b9c916155d7de089ca675e524498efdcd6c07ff824f94b57ab6964c6
4
- data.tar.gz: 51bfdd81d038f103e94bc9d5be4f6954d6bc6fbc691972f4b7f3001cd7ca9a2d
3
+ metadata.gz: 3753bf3629ba6b3dbe10ef6f2dd1086eaff21428be99dcfd4d790cf300812b74
4
+ data.tar.gz: b6ea9b53ecf08906ae978fdad57e1cdc21c0f34c4e6891203fd7ac406cf83bcb
5
5
  SHA512:
6
- metadata.gz: 45fc197eeaeb201677a069bd7ce3037a8d0bb28aacb49678a723bf7628cde25792aca668ddcff291f5932194f906e4bcbe12af342891da9ec5e36963c0cde2e6
7
- data.tar.gz: a1752e87e7185ef20c56f58b1d1f568617bfecab5c7295a48e67b22d27afd5eb9b9de470edb0b712423991803887a714a834111af0ba03f1fabc62a6219e8c7c
6
+ metadata.gz: 842e23d7fc1f0f5bc2ad809b70b527531ef05ae17fbdacb20d43dae5e98bcb14b983c3120177b36d0c5709e04ee104cafc85b2eb350f93bc6a7d73ea6a243ab9
7
+ data.tar.gz: 03efa75db6f4e55dd3417d8cd651b9d52508dbc760314b763fc3f71d4acddb5a731ddc9097661ff94cdbd46b2fd8bc4ac4f52f9af6c69da7e2893df18cd63c5b
@@ -4,7 +4,8 @@ name: rake
4
4
 
5
5
  on:
6
6
  push:
7
- branches: [ master ]
7
+ branches: [ master, main ]
8
+ tags: [ v* ]
8
9
  pull_request:
9
10
 
10
11
  jobs:
@@ -31,26 +32,22 @@ jobs:
31
32
 
32
33
  steps:
33
34
  - uses: actions/checkout@master
34
- - name: Cache xml2rfc
35
- id: cache-xml2rfc
36
- uses: actions/cache@v1
37
- with:
38
- path: ~/.cache/xml2rfc
39
- key: xml2rfc
40
- restore-key: xml2rfc
41
35
 
42
- - name: Use Ruby
43
- uses: ruby/setup-ruby@v1
36
+ - uses: ruby/setup-ruby@v1
44
37
  with:
45
38
  ruby-version: ${{ matrix.ruby }}
46
- bundler-cache: true
47
39
 
48
- - name: Update gems
49
- run: |
50
- bundle install --jobs 4 --retry 3
40
+ - uses: actions/cache@v2
41
+ with:
42
+ path: vendor/bundle
43
+ key: bundle-${{ matrix.os }}-${{ matrix.ruby }}-${{ hashFiles('**/*.gemspec') }}
44
+ restore-keys: bundle-${{ matrix.os }}-${{ matrix.ruby }}
45
+
46
+ - run: bundle config set path 'vendor/bundle'
51
47
 
52
- - name: Use Python
53
- uses: actions/setup-python@v1
48
+ - run: bundle install --jobs 4 --retry 3
49
+
50
+ - uses: actions/setup-python@v1
54
51
  with:
55
52
  python-version: '3.6'
56
53
  architecture: 'x64'
@@ -58,6 +55,7 @@ jobs:
58
55
  - name: set PIP_DOWNLOAD_CACHE
59
56
  shell: python
60
57
  run: |
58
+ import os
61
59
  import platform
62
60
  from os.path import expanduser
63
61
 
@@ -65,10 +63,10 @@ jobs:
65
63
  cache_path = {
66
64
  "Linux": f"{home}/.cache/pip",
67
65
  "Darwin": f"{home}Library/Caches/pip",
68
- "Windows": f"{home}/AppData/Local/pip/Cache"
69
- }
66
+ "Windows": f"{home}\\AppData\\Local\\pip\\Cache"
67
+ }[platform.system()]
70
68
 
71
- print(f"::set-env name=PIP_DOWNLOAD_CACHE::{cache_path[platform.system()]}")
69
+ os.system(f"echo PIP_DOWNLOAD_CACHE={cache_path} >> {os.environ['GITHUB_ENV']}")
72
70
 
73
71
  - uses: actions/cache@v2
74
72
  with:
@@ -76,17 +74,18 @@ jobs:
76
74
  key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
77
75
  restore-keys: ${{ runner.os }}-pip-
78
76
 
79
- - name: Install xml2rfc's deps macOS
80
- if: matrix.os == 'macos-latest'
77
+ - uses: actions/cache@v2
78
+ with:
79
+ path: ~/.cache/xml2rfc
80
+ key: xml2rfc
81
+ restore-key: xml2rfc
82
+
83
+ - if: matrix.os == 'macos-latest'
81
84
  run: brew install libmagic
82
85
 
83
- - name: Install xml2rfc's deps Windows
84
- if: matrix.os == 'windows-latest'
86
+ - if: matrix.os == 'windows-latest'
85
87
  run: pip install python-magic-bin
86
88
 
87
- - name: Install xml2rfc
88
- run: pip install xml2rfc
89
+ - run: pip install xml2rfc
89
90
 
90
- - name: Run specs
91
- run: |
92
- bundle exec rake
91
+ - run: bundle exec rake
@@ -2,26 +2,21 @@
2
2
  :source-highlighter: coderay
3
3
  :icons: font
4
4
 
5
- `metanorma-ietf` lets you write Internet-Drafts and RFCs in AsciiDoc, the
6
- "`http://asciidoctor.org/[asciidoctor]-way`".
5
+ `metanorma-ietf` lets you write IETF Internet-Drafts and RFCs via Metanorma.
7
6
 
8
7
  image:https://img.shields.io/gem/v/metanorma-ietf.svg["Gem Version", link="https://rubygems.org/gems/metanorma-ietf"]
9
- image:https://github.com/metanorma/metanorma-ietf/workflows/macos/badge.svg["Build Status (macOS)", link="https://github.com/metanorma/metanorma-ietf/actions?workflow=macos"]
10
- image:https://github.com/metanorma/metanorma-ietf/workflows/ubuntu/badge.svg["Build Status (ubuntu)", link="https://github.com/metanorma/metanorma-ietf/actions?workflow=ubuntu"]
11
- image:https://github.com/metanorma/metanorma-ietf/workflows/windows/badge.svg["Build Status (Windows)", link="https://github.com/metanorma/metanorma-ietf/actions?workflow=windows"]
8
+ image:https://github.com/metanorma/metanorma-ietf/workflows/rake/badge.svg["Build Status", link="https://github.com/metanorma/metanorma-ietf/actions?workflow=rake"]
12
9
  image:https://codeclimate.com/github/metanorma/metanorma-ietf/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/metanorma/metanorma-ietf"]
13
10
  image:https://img.shields.io/github/issues-pr-raw/metanorma/metanorma-ietf.svg["Pull Requests", link="https://github.com/metanorma/metanorma-ietf/pulls"]
14
11
  image:https://img.shields.io/github/commits-since/metanorma/metanorma-ietf/latest.svg["Commits since latest",link="https://github.com/metanorma/metanorma-ietf/releases"]
15
12
 
16
- _Formerly known as_ `asciidoctor-rfc`.
17
-
18
-
19
13
  == Functionality
20
14
 
21
- This gem processes http://asciidoctor.org/[Asciidoctor] documents following
22
- a template for generating IETF International Standards.
15
+ This gem processes https://www.metanorma.com[Metanorma documents] following
16
+ a template for generating IETF deliverables.
23
17
 
24
- This AsciiDoc syntax for writing IETF standards is called "`AsciiRFC`".
18
+ Metanorma-IETF adheres to AsciiRFC syntax, an AsciiDoc syntax for writing IETF documents
19
+ developed by the Metanorma team.
25
20
 
26
21
  The gem currently inherits from the https://github.com/metanorma/metanorma-standoc
27
22
  gem, and aligns closely to it.
@@ -221,3 +216,6 @@ This gem is developed, maintained and funded by https://www.ribose.com[Ribose In
221
216
 
222
217
  * Document templates are available at the https://github.com/metanorma/mn-templates-ietf[mn-templates-ietf] repository.
223
218
 
219
+ == Notes
220
+
221
+ Metanorma-IETF was formerly published as the `asciidoctor-rfc` gem.
@@ -24,6 +24,14 @@
24
24
  <start>
25
25
  <ref name="standard-document"/>
26
26
  </start>
27
+ <define name="doctype">
28
+ <element name="doctype">
29
+ <optional>
30
+ <attribute name="abbreviation"/>
31
+ </optional>
32
+ <ref name="DocumentType"/>
33
+ </element>
34
+ </define>
27
35
  <define name="hyperlink">
28
36
  <element name="link">
29
37
  <attribute name="target">
@@ -141,6 +149,11 @@
141
149
  <data type="boolean"/>
142
150
  </attribute>
143
151
  </optional>
152
+ <optional>
153
+ <attribute name="key">
154
+ <data type="boolean"/>
155
+ </attribute>
156
+ </optional>
144
157
  <oneOrMore>
145
158
  <ref name="dt"/>
146
159
  <ref name="dd"/>
@@ -135,12 +135,12 @@ module IsoDoc::Ietf
135
135
  end
136
136
 
137
137
  def postal(addr, out)
138
- if line = addr.at(ns("./formattedAddress"))
139
- line.text.split(/\n/).each do |l|
140
- out.postalLine l, **attr_code(ascii: l.transliterate)
141
- end
142
- else
143
- out.postal do |p|
138
+ out.postal do |p|
139
+ if line = addr.at(ns("./formattedAddress"))
140
+ line.text.split(/\n/).each do |l|
141
+ p.postalLine l, **attr_code(ascii: l.transliterate)
142
+ end
143
+ else
144
144
  postal_detailed(addr, p)
145
145
  end
146
146
  end
@@ -3,16 +3,27 @@ module IsoDoc::Ietf
3
3
  # TODO displayreference will be implemented as combination of autofetch and user-provided citations
4
4
 
5
5
  def bibliography(isoxml, out)
6
- isoxml.xpath(ns("//references")).each do |f|
7
- out.references **attr_code(anchor: f["id"]) do |div|
8
- title = f.at(ns("./title")) and div.name do |name|
9
- title.children.each { |n| parse(n, name) }
10
- end
11
- f.elements.reject do |e|
12
- %w(reference title bibitem note).include? e.name
13
- end.each { |e| parse(e, div) }
14
- biblio_list(f, div, true)
6
+ isoxml.xpath(ns("//bibliography/references | "\
7
+ "//bibliography/clause[.//references] | "\
8
+ "//annex/clause[.//references] | "\
9
+ "//annex/references | "\
10
+ "//sections/clause[.//references]")).each do |f|
11
+ bibliography1(f, out)
12
+ end
13
+ end
14
+
15
+ def bibliography1(f, out)
16
+ out.references **attr_code(anchor: f["id"]) do |div|
17
+ title = f.at(ns("./title")) and div.name do |name|
18
+ title.children.each { |n| parse(n, name) }
15
19
  end
20
+ f.elements.select do |e|
21
+ %w(references clause).include? e.name
22
+ end.each { |e| bibliography1(e, out) }
23
+ f.elements.reject do |e|
24
+ %w(references title bibitem note).include? e.name
25
+ end.each { |e| parse(e, div) }
26
+ biblio_list(f, div, true)
16
27
  end
17
28
  end
18
29
 
@@ -141,6 +141,7 @@ module IsoDoc::Ietf
141
141
  end
142
142
 
143
143
  def clause_parse(node, out)
144
+ return if node.at(ns(".//references"))
144
145
  out.section **attr_code( anchor: node["id"], numbered: node["numbered"],
145
146
  removeInRFC: node["removeInRFC"], toc: node["toc"]) do |div|
146
147
  clause_parse_title(node, div, node.at(ns("./title")), out)
@@ -153,23 +154,16 @@ module IsoDoc::Ietf
153
154
  def clause(isoxml, out)
154
155
  isoxml.xpath("//xmlns:preface/child::*[not(name() = 'abstract' or name() = 'foreword')] "\
155
156
  "| //xmlns:sections/child::*").each do |c|
156
- clause1(c, out)
157
- end
158
- end
159
-
160
- def clause1(c, out)
161
- out.section **attr_code( anchor: c["id"], numbered: c["numbered"],
162
- removeInRFC: c["removeInRFC"], toc: c["toc"]) do |div|
163
- clause_parse_title(c, div, c.at(ns("./title")), out)
164
- c.elements.reject { |c1| c1.name == "title" }.each do |c1|
165
- parse(c1, div)
166
- end
157
+ #cdup = c.dup
158
+ #cdup.xpath(ns(".//references")).each { |r| r.remove }
159
+ #cdup.at("./*[local-name() != 'title'][normalize-space(text()) != '']") or next
160
+ clause_parse(c, out)
167
161
  end
168
162
  end
169
163
 
170
164
  def annex(isoxml, out)
171
165
  isoxml.xpath(ns("//annex")).each do |c|
172
- clause1(c, out)
166
+ clause_parse(c, out)
173
167
  end
174
168
  end
175
169
  end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ietf
3
- VERSION = "2.2.4".freeze
3
+ VERSION = "2.2.5".freeze
4
4
  end
5
5
  end
@@ -36,7 +36,7 @@ Gem::Specification.new do |spec|
36
36
  spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
37
37
 
38
38
  spec.add_dependency "metanorma-standoc", "~> 1.6.0"
39
- spec.add_dependency "isodoc", "~> 1.2.0"
39
+ spec.add_dependency "isodoc", "~> 1.3.0"
40
40
  spec.add_dependency "mathml2asciimath"
41
41
 
42
42
  spec.add_development_dependency "byebug"
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.2.4
4
+ version: 2.2.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: 2020-10-25 00:00:00.000000000 Z
11
+ date: 2020-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-standoc
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.2.0
33
+ version: 1.3.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 1.2.0
40
+ version: 1.3.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: mathml2asciimath
43
43
  requirement: !ruby/object:Gem::Requirement