metanorma-ietf 2.1.0 → 2.1.1

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: 47adf288717bcbd4914d1a3d43fb8eeea4d18fbb6f9675846c9ec37a9664f142
4
- data.tar.gz: f0486d16c7a457465cce21790e3c76cb3422b0508d5ae57a150e15bf4e1059a7
3
+ metadata.gz: e247eb259866b4caae32725e9d508603a2ef5ede6d72fa9558366249f93fa45f
4
+ data.tar.gz: bfde54f8d5b35adbe3e9f4bfa6d915f49aeac78df5fc0d6bd189d242798d0871
5
5
  SHA512:
6
- metadata.gz: e22190786fb20f67dd85cc5e0bd3e831e32b5ee54c0de91d08780106a624e902c11108672469afdcf80451489fddc11472f0ee73910592c947550b3f243b4c0b
7
- data.tar.gz: 85c7688efec6428a459a6d6f7d182c092ad68a5ed6a6e971e379fab3d6c6c46f5e77e083aa11be20d7570691505d3b61da50e217c93643451d215387e747d486
6
+ metadata.gz: 2e863071188dfb05b1636eeb9a7307a453e65dfb61497a13e6a33b946e7c1d02c634210c8f2d5083c6f29702607989402cf874e83c92e59bd115142d3ee218f2
7
+ data.tar.gz: 15a0e135e9985c2a2995b85c8bea4b9bd84f9149874e4fc35a7c476684162a65018a54d73e073639bbea0cbae0b8846e54388b9695d8839bc0ad426699fa0d9f
@@ -72,7 +72,9 @@ module IsoDoc::Ietf
72
72
  end
73
73
 
74
74
  def note_label(node)
75
- l10n("#{super}: ")
75
+ n = @xrefs.get[node["id"]]
76
+ return l10n("#{@note_lbl}: ") if n.nil? || n[:label].nil? || n[:label].empty?
77
+ l10n("#{@note_lbl} #{n[:label]}: ")
76
78
  end
77
79
 
78
80
  def note_parse(node, out)
@@ -23,11 +23,16 @@ module IsoDoc::Ietf
23
23
  super
24
24
  end
25
25
 
26
+ def output_if_translit(text)
27
+ return nil if text.nil?
28
+ text.transliterate != text ? text.transliterate : nil
29
+ end
30
+
26
31
  def title(isoxml, front)
27
32
  title = @meta.get[:doctitle] or return
28
33
  front.title title, **attr_code(abbrev: @meta.get[:docabbrev],
29
- ascii: @meta.get[:docascii] ||
30
- title.transliterate)
34
+ ascii: (@meta.get[:docascii] ||
35
+ output_if_translit(title)))
31
36
  end
32
37
 
33
38
  def seriesinfo(isoxml, front)
@@ -37,7 +42,7 @@ module IsoDoc::Ietf
37
42
 
38
43
  def seriesinfo_attr(isoxml)
39
44
  attr_code(value: @meta.get[:docnumber] || "",
40
- asciiValue: @meta.get[:docnumber]&.transliterate,
45
+ asciiValue: output_if_translit(@meta.get[:docnumber]),
41
46
  status: @meta.get[:stage],
42
47
  stream: isoxml&.at(ns("//bibdata/series[@type = 'stream']/"\
43
48
  "title"))&.text)
@@ -82,9 +87,9 @@ module IsoDoc::Ietf
82
87
 
83
88
  def pers_author_attrs1(ret, full, init, c)
84
89
  full and ret.merge!(attr_code(
85
- asciiFullname: full&.transliterate,
86
- asciiInitials: init&.transliterate,
87
- asciiSurname: c&.at(ns("./surname"))&.text&.transliterate))
90
+ asciiFullname: output_if_translit(full),
91
+ asciiInitials: output_if_translit(init),
92
+ asciiSurname: output_if_translit(c&.at(ns("./surname")))))
88
93
  ret
89
94
  end
90
95
 
@@ -113,8 +118,8 @@ module IsoDoc::Ietf
113
118
  def organization(org, out, show)
114
119
  name = org.at(ns("./name"))&.text
115
120
  out.organization name, **attr_code(
116
- showOnFrontPage: show&.text, ascii: name&.transliterate,
117
- asciiAbbrev: org&.at(ns("./abbreviation"))&.transliterate,
121
+ showOnFrontPage: show&.text, ascii: output_if_translit(name),
122
+ asciiAbbrev: output_if_translit(org.at(ns("./abbreviation"))),
118
123
  abbrev: org.at(ns("./abbreviation")))
119
124
  end
120
125
 
@@ -1,5 +1,10 @@
1
1
  module IsoDoc::Ietf
2
2
  class RfcConvert < ::IsoDoc::Convert
3
+ def recommendation_labels(node)
4
+ [node.at(ns("./label")), node.at(ns("./title")),
5
+ @xrefs.anchor(node['id'], :label, false)]
6
+ end
7
+
3
8
  def recommendation_name(node, out, type)
4
9
  label, title, lbl = recommendation_labels(node)
5
10
  out.t **{ keepWithNext: "true" } do |b|
@@ -81,11 +81,11 @@ module IsoDoc::Ietf
81
81
 
82
82
  def series2category(series)
83
83
  case series&.downcase
84
- when "standard" then "std"
85
- when "informational" then "info"
86
- when "experimental" then "exp"
84
+ when "standard", "std" then "std"
85
+ when "informational", "info" then "info"
86
+ when "experimental", "exp" then "exp"
87
87
  when "bcp" then "bcp"
88
- when "fyi" then "info"
88
+ when "fyi", "info" then "info"
89
89
  when "full-standard" then "std"
90
90
  when "historic" then "historic"
91
91
  else
@@ -48,6 +48,10 @@ module Metanorma
48
48
  nil
49
49
  end
50
50
 
51
+ def use_presentation_xml(ext)
52
+ false
53
+ end
54
+
51
55
  def xml2rfc_present?
52
56
  !which("xml2rfc").nil?
53
57
  end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ietf
3
- VERSION = "2.1.0".freeze
3
+ VERSION = "2.1.1".freeze
4
4
  end
5
5
  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: 2.1.0
4
+ version: 2.1.1
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-06-26 00:00:00.000000000 Z
11
+ date: 2020-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-standoc