metanorma-ietf 2.2.4 → 2.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +27 -28
- data/README.adoc +9 -11
- data/lib/asciidoctor/ietf/isodoc.rng +13 -0
- data/lib/isodoc/ietf/front.rb +6 -6
- data/lib/isodoc/ietf/references.rb +20 -9
- data/lib/isodoc/ietf/section.rb +6 -12
- data/lib/metanorma/ietf/version.rb +1 -1
- data/metanorma-ietf.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3753bf3629ba6b3dbe10ef6f2dd1086eaff21428be99dcfd4d790cf300812b74
|
4
|
+
data.tar.gz: b6ea9b53ecf08906ae978fdad57e1cdc21c0f34c4e6891203fd7ac406cf83bcb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 842e23d7fc1f0f5bc2ad809b70b527531ef05ae17fbdacb20d43dae5e98bcb14b983c3120177b36d0c5709e04ee104cafc85b2eb350f93bc6a7d73ea6a243ab9
|
7
|
+
data.tar.gz: 03efa75db6f4e55dd3417d8cd651b9d52508dbc760314b763fc3f71d4acddb5a731ddc9097661ff94cdbd46b2fd8bc4ac4f52f9af6c69da7e2893df18cd63c5b
|
data/.github/workflows/rake.yml
CHANGED
@@ -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
|
-
-
|
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
|
-
-
|
49
|
-
|
50
|
-
bundle
|
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
|
-
-
|
53
|
-
|
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}
|
69
|
-
}
|
66
|
+
"Windows": f"{home}\\AppData\\Local\\pip\\Cache"
|
67
|
+
}[platform.system()]
|
70
68
|
|
71
|
-
|
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
|
-
-
|
80
|
-
|
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
|
-
-
|
84
|
-
if: matrix.os == 'windows-latest'
|
86
|
+
- if: matrix.os == 'windows-latest'
|
85
87
|
run: pip install python-magic-bin
|
86
88
|
|
87
|
-
-
|
88
|
-
run: pip install xml2rfc
|
89
|
+
- run: pip install xml2rfc
|
89
90
|
|
90
|
-
-
|
91
|
-
run: |
|
92
|
-
bundle exec rake
|
91
|
+
- run: bundle exec rake
|
data/README.adoc
CHANGED
@@ -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
|
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/
|
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
|
22
|
-
a template for generating IETF
|
15
|
+
This gem processes https://www.metanorma.com[Metanorma documents] following
|
16
|
+
a template for generating IETF deliverables.
|
23
17
|
|
24
|
-
|
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"/>
|
data/lib/isodoc/ietf/front.rb
CHANGED
@@ -135,12 +135,12 @@ module IsoDoc::Ietf
|
|
135
135
|
end
|
136
136
|
|
137
137
|
def postal(addr, out)
|
138
|
-
|
139
|
-
line.
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
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
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
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
|
|
data/lib/isodoc/ietf/section.rb
CHANGED
@@ -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
|
-
|
157
|
-
|
158
|
-
|
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
|
-
|
166
|
+
clause_parse(c, out)
|
173
167
|
end
|
174
168
|
end
|
175
169
|
end
|
data/metanorma-ietf.gemspec
CHANGED
@@ -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.
|
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
|
+
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-
|
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.
|
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.
|
40
|
+
version: 1.3.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: mathml2asciimath
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|