metanorma-ietf 3.0.9 → 3.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isodoc/ietf/reqt.rb +13 -60
- data/lib/isodoc/ietf/rfc_convert.rb +15 -2
- data/lib/metanorma/ietf/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c10eeb240c73eb23dc86cb68f2a74f8931b3e350f68ee763a23256a56795bae
|
4
|
+
data.tar.gz: ee6a1934c755a258adef52e1689eb462297fa34be3a8deb5923ed1da34b945b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89f9bc46f9a5d31116b36402279e8e41db7a23a012368d11acab85c9f87d6e71eb200a327a3f54b3e88e0df2efb997324462eea853996d9a46dc7e78861f09c6
|
7
|
+
data.tar.gz: fa040fe15ba9e856a3fdb5645c7d06773f288a2dd36414772e04f087ccb2acfc52dc13dfc2564025b7b4e9bc3ad0f8eba3b62c1d8a66fef699b186fd3d1e18fd
|
data/lib/isodoc/ietf/reqt.rb
CHANGED
@@ -1,81 +1,34 @@
|
|
1
1
|
module IsoDoc
|
2
2
|
module Ietf
|
3
3
|
class RfcConvert < ::IsoDoc::Convert
|
4
|
-
def
|
5
|
-
|
6
|
-
|
7
|
-
end
|
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
|
4
|
+
def recommendation_name(node, out)
|
5
|
+
out.t **{ keepWithNext: "true" } do |p|
|
6
|
+
node.children.each { |n| parse(n, p) }
|
20
7
|
end
|
21
8
|
end
|
22
9
|
|
23
|
-
def
|
24
|
-
|
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
|
32
|
-
end
|
33
|
-
end
|
10
|
+
def recommendation_parse(node, out)
|
11
|
+
recommendation_parse1(node, out)
|
34
12
|
end
|
35
13
|
|
36
|
-
def
|
37
|
-
recommendation_name(node, out
|
38
|
-
recommendation_attributes(node, out)
|
14
|
+
def recommendation_parse1(node, out)
|
15
|
+
recommendation_name(node.at(ns("./name")), out)
|
39
16
|
node.children.each do |n|
|
40
|
-
parse(n, out) unless
|
17
|
+
parse(n, out) unless n.name == "name"
|
41
18
|
end
|
42
19
|
end
|
43
20
|
|
44
21
|
def requirement_parse(node, out)
|
45
|
-
|
46
|
-
recommendation_attributes(node, out)
|
47
|
-
node.children.each do |n|
|
48
|
-
parse(n, out) unless %w(identifier title).include? n.name
|
49
|
-
end
|
22
|
+
recommendation_parse1(node, out)
|
50
23
|
end
|
51
24
|
|
52
25
|
def permission_parse(node, out)
|
53
|
-
|
54
|
-
recommendation_attributes(node, out)
|
55
|
-
node.children.each do |n|
|
56
|
-
parse(n, out) unless %w(identifier title).include? n.name
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
def inline?(node)
|
61
|
-
return true if node.first_element_child.nil?
|
62
|
-
|
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
|
26
|
+
recommendation_parse1(node, out)
|
67
27
|
end
|
68
28
|
|
69
|
-
def
|
70
|
-
|
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) }
|
29
|
+
def div_parse(node, out)
|
30
|
+
node.children.each do |n|
|
31
|
+
parse(n, out)
|
79
32
|
end
|
80
33
|
end
|
81
34
|
end
|
@@ -17,8 +17,7 @@ module IsoDoc
|
|
17
17
|
module Ietf
|
18
18
|
class RfcConvert < ::IsoDoc::Convert
|
19
19
|
def convert1(docxml, _filename, _dir)
|
20
|
-
|
21
|
-
info docxml, nil
|
20
|
+
document_preprocess(docxml)
|
22
21
|
ret = noko do |xml|
|
23
22
|
xml.rfc **attr_code(rfc_attributes(docxml)) do |html|
|
24
23
|
make_link(html, docxml)
|
@@ -30,6 +29,20 @@ module IsoDoc
|
|
30
29
|
set_pis(docxml, Nokogiri::XML(ret))
|
31
30
|
end
|
32
31
|
|
32
|
+
def document_preprocess(docxml)
|
33
|
+
@isodoc.reqt_models = Metanorma::Requirements
|
34
|
+
.new({ default: "default", lang: @lang, script: @script,
|
35
|
+
labels: @i18n.get })
|
36
|
+
info docxml, nil
|
37
|
+
@xrefs.parse docxml
|
38
|
+
@isodoc.xrefs = @xrefs
|
39
|
+
@isodoc.permission(docxml)
|
40
|
+
@isodoc.requirement(docxml)
|
41
|
+
@isodoc.recommendation(docxml)
|
42
|
+
@isodoc.requirement_render(docxml)
|
43
|
+
@xrefs.parse docxml
|
44
|
+
end
|
45
|
+
|
33
46
|
def metadata_init(lang, script, i18n)
|
34
47
|
@meta = Metadata.new(lang, script, i18n)
|
35
48
|
end
|
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: 3.0.
|
4
|
+
version: 3.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-08-
|
11
|
+
date: 2022-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mathml2asciimath
|