kramdown-rfc2629 1.0.17 → 1.0.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -7
- data/kramdown-rfc2629.gemspec +2 -2
- data/lib/kramdown-rfc2629.rb +26 -7
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b7cb03b26cc3280334da9e30264652850c904f4
|
4
|
+
data.tar.gz: 593ed4923195d254b3c27ace03e09a9e24a22f0e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6403e62c32307c3e66b93d7c130f6efe5b7ccc3587da9ba7f075a206820b476699ecf0dd1e83ae4bb815dbea94b7ada550a8f838ef6c395c08170df36a113352
|
7
|
+
data.tar.gz: 9698f63a545f44d08ddcd97aac1baf282b1171da5627e840a1be8a833ed8147e04f47b67d727feb1832786085670e9bf5e384ab253e89d9ea9f230cac7aa7c16
|
data/README.md
CHANGED
@@ -14,7 +14,7 @@ their work in markdown.
|
|
14
14
|
# Usage
|
15
15
|
|
16
16
|
Start by installing the kramdown-rfc2629 gem (this automatically
|
17
|
-
installs kramdown version 1.
|
17
|
+
installs kramdown version 1.4.x as well):
|
18
18
|
|
19
19
|
sudo gem install kramdown-rfc2629
|
20
20
|
|
@@ -24,9 +24,8 @@ structure provided by kramdown. `bin/kramdown-rfc2629` started out as
|
|
24
24
|
a simple command-line program showing how to use this, but can now do
|
25
25
|
much more (see below).
|
26
26
|
|
27
|
-
To use kramdown-rfc2629, you'll need a Ruby 1.9 or 2.
|
28
|
-
|
29
|
-
if you want to see the fruits of your work.
|
27
|
+
To use kramdown-rfc2629, you'll need a Ruby 1.9 or 2.x, and maybe
|
28
|
+
[XML2RFC][] if you want to see the fruits of your work.
|
30
29
|
|
31
30
|
kramdown-rfc2629 mydraft.mkd >mydraft.xml
|
32
31
|
xml2rfc mydraft.xml
|
@@ -180,7 +179,9 @@ spell it out like this:
|
|
180
179
|
RFC6690:
|
181
180
|
|
182
181
|
(as in the author list, `ins` is an abbreviation for
|
183
|
-
"initials/surname"
|
182
|
+
"initials/surname"; note that the first title had to be put in double
|
183
|
+
quotes as it contains a colon which is special syntax in YAML.)
|
184
|
+
Then you can simply reference `{{ASN.1}}` and
|
184
185
|
`{{ECMA262}}` in the text. (Make sure the reference keys are valid XML
|
185
186
|
names, though.)
|
186
187
|
|
@@ -199,13 +200,13 @@ Moving from XML to Markdown for RFC writing apparently is a
|
|
199
200
|
no-brainer, so I'm not the only one who has written code for this.
|
200
201
|
|
201
202
|
[Miek Gieben][] has done a [similar thing][pandoc2rfc] employing
|
202
|
-
pandoc
|
203
|
+
pandoc, now documented in [RFC 7328][]. He uses multiple input files instead of
|
203
204
|
kramdown-rfc2629's sectionized input format. He keeps the metadata in
|
204
205
|
a separate XML file, similar to the way the previous version of
|
205
206
|
kramdown-rfc2629 stored (and still can store) the metadata in XML in
|
206
207
|
the markdown document. He also uses a slightly different referencing
|
207
208
|
syntax, which is closer to what markdown does elsewhere but more
|
208
|
-
verbose.
|
209
|
+
verbose (this syntax is now also supported in kramdown-rfc2629).
|
209
210
|
|
210
211
|
# License
|
211
212
|
|
@@ -221,3 +222,4 @@ license.
|
|
221
222
|
[Miek Gieben]: http://www.miek.nl/
|
222
223
|
[pandoc2rfc]: https://github.com/miekg/pandoc2rfc/
|
223
224
|
[XML2RFC]: http://xml.resource.org
|
225
|
+
[RFC 7328]: http://tools.ietf.org/html/rfc7328
|
data/kramdown-rfc2629.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
spec = Gem::Specification.new do |s|
|
2
2
|
s.name = 'kramdown-rfc2629'
|
3
|
-
s.version = '1.0.
|
3
|
+
s.version = '1.0.18'
|
4
4
|
s.summary = "Kramdown extension for generating RFC 2629 XML."
|
5
5
|
s.description = %{An RFC2629 (XML2RFC) generating backend for Thomas Leitner's
|
6
6
|
"kramdown" markdown parser. Mostly useful for RFC writers.}
|
@@ -10,7 +10,7 @@ spec = Gem::Specification.new do |s|
|
|
10
10
|
s.executables = ['kramdown-rfc2629']
|
11
11
|
s.default_executable = 'kramdown-rfc2629'
|
12
12
|
s.required_ruby_version = '>= 1.9.2'
|
13
|
-
s.requirements = 'wget'
|
13
|
+
# s.requirements = 'wget'
|
14
14
|
# s.has_rdoc = true
|
15
15
|
s.author = "Carsten Bormann"
|
16
16
|
s.email = "cabo@tzi.org"
|
data/lib/kramdown-rfc2629.rb
CHANGED
@@ -356,15 +356,34 @@ module Kramdown
|
|
356
356
|
fn = "#{REFCACHEDIR}/#{File.basename(url)}"
|
357
357
|
f = File.stat(fn) rescue nil
|
358
358
|
if !f || tn - f.ctime >= tvalid
|
359
|
-
$stderr.puts "#{fn}: #{f && tn-f.ctime}"
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
359
|
+
$stderr.puts "#{fn}: #{f && "renewing (stale by #{"%.1f" % ((tn-f.ctime)/86400)} days)" || "fetching"}"
|
360
|
+
if ENV["HAVE_WGET"]
|
361
|
+
`cd #{REFCACHEDIR}; wget -t 3 -T 20 -Nnv "#{url}"` # ignore errors if offline (hack)
|
362
|
+
begin
|
363
|
+
File.utime nil, nil, fn
|
364
|
+
rescue Errno::ENOENT
|
365
|
+
warn "Can't fetch #{url} -- is wget in path?"
|
366
|
+
end
|
367
|
+
else
|
368
|
+
require 'open-uri'
|
369
|
+
require 'timeout'
|
370
|
+
begin
|
371
|
+
Timeout::timeout(f ? 10 : 30) do # give up quickly if just renewing
|
372
|
+
open(url) do |f|
|
373
|
+
s = f.read
|
374
|
+
if f.status[0] != "200"
|
375
|
+
warn "*** Status code #{status} while fetching #{url}"
|
376
|
+
else
|
377
|
+
File.write(fn, s)
|
378
|
+
end
|
379
|
+
end
|
380
|
+
end
|
381
|
+
rescue OpenURI::HTTPError, SocketError, Timeout::Error => e
|
382
|
+
warn "*** #{e} while fetching #{url}"
|
383
|
+
end
|
365
384
|
end
|
366
385
|
end
|
367
|
-
File.read(fn)
|
386
|
+
File.read(fn) # this blows up if no cache available after fetch attempt
|
368
387
|
end
|
369
388
|
|
370
389
|
XML_RESOURCE_ORG_MAP = {
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kramdown-rfc2629
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carsten Bormann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: kramdown
|
@@ -57,8 +57,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
57
57
|
- - ">="
|
58
58
|
- !ruby/object:Gem::Version
|
59
59
|
version: '0'
|
60
|
-
requirements:
|
61
|
-
- wget
|
60
|
+
requirements: []
|
62
61
|
rubyforge_project:
|
63
62
|
rubygems_version: 2.2.2
|
64
63
|
signing_key:
|