metanorma-ietf 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +12 -15
- data/README.adoc +11 -1460
- data/appveyor.yml +35 -0
- data/bin/asciidoctor-rfc2.bat +2 -0
- data/lib/asciidoctor/rfc/common/base.rb +11 -4
- data/lib/asciidoctor/rfc/v2/blocks.rb +35 -14
- data/lib/asciidoctor/rfc/v2/table.rb +4 -2
- data/lib/metanorma/ietf/version.rb +1 -1
- data/metanorma-ietf.gemspec +1 -1
- metadata +5 -3
data/appveyor.yml
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
version: '{build}'
|
2
|
+
|
3
|
+
cache:
|
4
|
+
- vendor/bundle
|
5
|
+
|
6
|
+
environment:
|
7
|
+
matrix:
|
8
|
+
- RUBY_VERSION: 25
|
9
|
+
- RUBY_VERSION: 24
|
10
|
+
- RUBY_VERSION: _trunk
|
11
|
+
|
12
|
+
matrix:
|
13
|
+
allow_failures:
|
14
|
+
- RUBY_VERSION: _trunk
|
15
|
+
|
16
|
+
install:
|
17
|
+
- ps: . { iwr -useb https://raw.githubusercontent.com/metanorma/metanorma-build-scripts/master/appveyor.ps1 } | iex
|
18
|
+
- refreshenv
|
19
|
+
|
20
|
+
build_script:
|
21
|
+
- set PYTHON_VERSION=37
|
22
|
+
- set PATH=C:\Ruby%RUBY_VERSION%\bin;%USERPROFILE%\AppData\Roaming\Python\Python%PYTHON_VERSION%\Scripts;C:\Python%PYTHON_VERSION%\Scripts;C:\Python%PYTHON_VERSION%;%PATH%
|
23
|
+
- pip3 install --user --upgrade pip
|
24
|
+
- pip3 install --user xml2rfc
|
25
|
+
- bundle config --local path vendor/bundle
|
26
|
+
- bundle update
|
27
|
+
- bundle install
|
28
|
+
|
29
|
+
before_test:
|
30
|
+
- ruby -v
|
31
|
+
- gem -v
|
32
|
+
- bundle -v
|
33
|
+
|
34
|
+
test_script:
|
35
|
+
- bundle exec rake
|
@@ -377,15 +377,22 @@ HERE
|
|
377
377
|
wgcache_name = "#{Dir.home}/.asciidoc-rfc-workgroup-cache.json"
|
378
378
|
# If we are required to, clear the wg cache
|
379
379
|
if node.attr("flush-caches") == "true"
|
380
|
-
|
380
|
+
FileUtils.rm wgcache_name, :force => true
|
381
381
|
end
|
382
382
|
# Is there already a wg cache? If not, create it.
|
383
383
|
wg = []
|
384
|
+
|
384
385
|
if Pathname.new(wgcache_name).file?
|
385
|
-
|
386
|
-
|
386
|
+
begin
|
387
|
+
File.open(wgcache_name, "r") do |f|
|
388
|
+
wg = JSON.parse(f.read)
|
389
|
+
end
|
390
|
+
rescue Exception => e
|
391
|
+
STDERR.puts "Cache #{wgcache_name} is invalid, drop it"
|
387
392
|
end
|
388
|
-
|
393
|
+
end
|
394
|
+
|
395
|
+
if wg.empty?
|
389
396
|
File.open(wgcache_name, "w") do |b|
|
390
397
|
STDERR.puts "Reading workgroups from https://tools.ietf.org/wg/..."
|
391
398
|
Kernel.open("https://tools.ietf.org/wg/") do |f|
|
@@ -154,6 +154,18 @@ module Asciidoctor
|
|
154
154
|
result
|
155
155
|
end
|
156
156
|
|
157
|
+
# is this a text-only example? if so, mark it up as paragraphs
|
158
|
+
def text_only_example(node)
|
159
|
+
seen_artwork = false
|
160
|
+
node.blocks.each do |b|
|
161
|
+
case b.context
|
162
|
+
when :listing, :image, :literal, :stem
|
163
|
+
seen_artwork = true
|
164
|
+
end
|
165
|
+
end
|
166
|
+
!seen_artwork
|
167
|
+
end
|
168
|
+
|
157
169
|
# Syntax:
|
158
170
|
# [[id]]
|
159
171
|
# .Title
|
@@ -172,22 +184,31 @@ module Asciidoctor
|
|
172
184
|
}
|
173
185
|
# TODO iref
|
174
186
|
seen_artwork = false
|
175
|
-
|
176
|
-
|
187
|
+
|
188
|
+
if text_only_example(node)
|
189
|
+
noko do |xml|
|
177
190
|
node.blocks.each do |b|
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
191
|
+
xml << node.content
|
192
|
+
end
|
193
|
+
end
|
194
|
+
else
|
195
|
+
noko do |xml|
|
196
|
+
xml.figure **attr_code(figure_attributes) do |xml_figure|
|
197
|
+
node.blocks.each do |b|
|
198
|
+
case b.context
|
199
|
+
when :listing, :image, :literal, :stem
|
200
|
+
xml_figure << send(b.context, b).join("\n")
|
201
|
+
seen_artwork = true
|
188
202
|
else
|
189
|
-
|
190
|
-
|
203
|
+
# we want to see the para text, not its <t> container
|
204
|
+
if seen_artwork
|
205
|
+
xml_figure.postamble do |postamble|
|
206
|
+
postamble << b.content
|
207
|
+
end
|
208
|
+
else
|
209
|
+
xml_figure.preamble do |preamble|
|
210
|
+
preamble << b.content
|
211
|
+
end
|
191
212
|
end
|
192
213
|
end
|
193
214
|
end
|
@@ -72,8 +72,9 @@ module Asciidoctor
|
|
72
72
|
|
73
73
|
rowlength += cell.text.size
|
74
74
|
xml.ttcol **attr_code(ttcol_attributes) do |ttcol|
|
75
|
-
ttcol << cell.text
|
75
|
+
#ttcol << cell.text
|
76
76
|
# NOT cell.content: v2 does not permit blocks in cells
|
77
|
+
ttcol << Array(cell.content).join("").gsub(%r{<t>}, "").gsub(%r{</t>}, "")
|
77
78
|
end
|
78
79
|
end
|
79
80
|
warn "asciidoctor: WARNING (#{current_location(node)}): header row of table is longer than 72 ascii characters" if rowlength > 72
|
@@ -101,8 +102,9 @@ module Asciidoctor
|
|
101
102
|
row.each do |cell|
|
102
103
|
rowlength += cell.text.size
|
103
104
|
xml.c do |c|
|
104
|
-
c << cell.text
|
105
|
+
#c << cell.text
|
105
106
|
# NOT cell.content: v2 does not permit blocks in cells
|
107
|
+
c << Array(cell.content).join("").gsub(%r{<t>}, "").gsub(%r{</t>}, "")
|
106
108
|
end
|
107
109
|
end
|
108
110
|
warn "asciidoctor: WARNING (#{current_location(node)}): row #{i} of table is longer than 72 ascii characters" if rowlength > 72
|
data/metanorma-ietf.gemspec
CHANGED
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
|
|
24
24
|
Formerly known as asciidoctor-ietf.
|
25
25
|
DESCRIPTION
|
26
26
|
|
27
|
-
spec.homepage = "https://github.com/
|
27
|
+
spec.homepage = "https://github.com/metanorma/metanorma-ietf"
|
28
28
|
spec.license = "BSD-2-Clause"
|
29
29
|
|
30
30
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
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: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-05-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: metanorma-standoc
|
@@ -223,7 +223,9 @@ files:
|
|
223
223
|
- LICENSE
|
224
224
|
- README.adoc
|
225
225
|
- Rakefile
|
226
|
+
- appveyor.yml
|
226
227
|
- bin/asciidoctor-rfc2
|
228
|
+
- bin/asciidoctor-rfc2.bat
|
227
229
|
- bin/asciidoctor-rfc3
|
228
230
|
- bin/console
|
229
231
|
- bin/rspec
|
@@ -261,7 +263,7 @@ files:
|
|
261
263
|
- rfc2629-other.ent
|
262
264
|
- rfc2629-xhtml.ent
|
263
265
|
- rfc2629.dtd
|
264
|
-
homepage: https://github.com/
|
266
|
+
homepage: https://github.com/metanorma/metanorma-ietf
|
265
267
|
licenses:
|
266
268
|
- BSD-2-Clause
|
267
269
|
metadata: {}
|