metanorma-ietf 3.3.9 → 3.4.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: e0fffd5668b2c2e63c87b719317dd6350c2c31ef1de14b6ddf36bdf0aa9458e6
4
- data.tar.gz: 8c50f16816e6f1a7f7406e557e7aa8bcfaff0da1fb9d78b36b452d2484850d0d
3
+ metadata.gz: 002c1dbf3082b89ae330b047a9a044f6cea91437c49f1524b495c0c44117910e
4
+ data.tar.gz: 3cecbf7bcba03f86289b7edfbfa8c34b2645b739d7bd70785a0cac17b91650ba
5
5
  SHA512:
6
- metadata.gz: 929f791db9271527d5a93783efb634b2d6baed93b287628550334422abc5f76ac486e0d214512d180ff22162bb10da7bf0bf15a703d05d968edcb572e7fcd9b6
7
- data.tar.gz: 3296b7954e7d90756604d3e939a890a52e15275b6acc02e1d0f8912b314d76eca884c6475ff71b6d48119f4becad569cedd8075d01a6969809d89b21f5ec149e
6
+ metadata.gz: 6c1193cb258edcae562cbfe66023db98a438c4ad70a1dc8f1f0c71577cdf6d335fed24ed39e223f190098168fd3c3147d6d6bbebc60352473b9341da78cca621
7
+ data.tar.gz: b944d99efa37b7616c35d624753da963a344f534c822baa0acacd3f1365c14a1b70e8dd1308e9dff89225008bfd99e8d6077e13a99c30ff6cd1ead676f5d3cf4
@@ -23,6 +23,10 @@ module IsoDoc
23
23
  i18nhash: @i18n.get)
24
24
  end
25
25
 
26
+ def implicit_reference(bib)
27
+ bib["hidden"] == "true"
28
+ end
29
+
26
30
  def bibliography1(node, out)
27
31
  out.references **attr_code(anchor: node["id"]) do |div|
28
32
  title = node.at(ns("./title")) and div.name do |name|
@@ -1,6 +1,10 @@
1
1
  module IsoDoc
2
2
  module Ietf
3
3
  class RfcConvert < ::IsoDoc::Convert
4
+ def set_termdomain(termdomain)
5
+ @termdomain = termdomain
6
+ end
7
+
4
8
  def definition_parse(node, out)
5
9
  node.children.each { |n| parse(n, out) }
6
10
  end
@@ -27,6 +31,10 @@ module IsoDoc
27
31
  end
28
32
 
29
33
  def term_parse(node, out)
34
+ if domain = node.at(ns("./domain"))
35
+ set_termdomain(domain.text)
36
+ domain["hidden"] = "true"
37
+ end
30
38
  name = node.at(ns(".//name"))
31
39
  out.name do |p|
32
40
  name.children.each { |n| parse(n, p) }
@@ -38,7 +46,12 @@ module IsoDoc
38
46
  end
39
47
 
40
48
  def termdef_parse(node, out)
41
- set_termdomain("")
49
+ if domain = node.at(ns("./domain"))
50
+ set_termdomain(domain.text)
51
+ domain["hidden"] = "true"
52
+ else
53
+ set_termdomain("")
54
+ end
42
55
  node.xpath(ns("./definition")).size > 1 and
43
56
  @isodoc.multidef(node)
44
57
  clause_parse(node, out)
@@ -47,15 +60,25 @@ module IsoDoc
47
60
  def termdocsource_parse(_node, _out); end
48
61
 
49
62
  def concept_parse(node, out)
50
- if d = node.at(ns("./renderterm"))
51
- out.em do |em|
52
- d.children.each { |n| parse(n, em) }
53
- end
54
- out << " "
63
+ ref = node.at(ns("./xref | ./eref | ./termref"))
64
+ render = node.at(ns("./renderterm"))
65
+ !ref && !render and return node.children.each { |n| parse(n, out) }
66
+ !render or concept_render(render, ref, out)
67
+ ref or return
68
+ concept_ref(ref, out)
69
+ end
70
+
71
+ def concept_render(render, ref, out)
72
+ out.em do |em|
73
+ render.children.each { |n| parse(n, em) }
55
74
  end
75
+ ref and out << " "
76
+ end
77
+
78
+ def concept_ref(ref, out)
79
+ ref or return
56
80
  out << "[term defined in "
57
- r = node.at(ns("./xref | ./eref | ./termref"))
58
- parse(r, out)
81
+ parse(ref, out)
59
82
  out << "]"
60
83
  end
61
84