kramdown-rfc2629 1.4.18 → 1.4.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/bin/kdrfc +25 -5
- data/bin/kramdown-rfc-cache-subseries-bibxml +1 -1
- data/kramdown-rfc2629.gemspec +1 -1
- data/lib/kramdown-rfc2629.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: e9d0ef4b91bf819df60d48b12c30be152eab6a987ba2d88a3572bde42e180925
|
4
|
+
data.tar.gz: '09603840027889929894dfc79170f6f7d16a0e932cfe7b6dfc4d2d2501eb7f7d'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 35f806b212b3f6e321614752853dc73ed351f1119c208b7fd83cbd471e3d64e40145b3af19a999a2e2e403a1ff780c5b12baef21c6b44e7e4f4ed8e434610e17
|
7
|
+
data.tar.gz: cb0ddd23e2ced4bda22a095d08926dbbaf6f12a8605faf53289a422c8e1bd2b9d5a9a01a350d88c5843c12ff0a0be4098425403507771d5ba526126bc130bb7d
|
data/README.md
CHANGED
@@ -562,7 +562,7 @@ remaining 20 % some more, but that hasn't been done.
|
|
562
562
|
|
563
563
|
If you have XML, there is an experimental upconverter that does 99 %
|
564
564
|
of the work. Please [contact the
|
565
|
-
author](mailto:cabo@tzi.org?subject=Markdown
|
565
|
+
author](mailto:cabo@tzi.org?subject=Markdown%20for%20RFCXML) if you want
|
566
566
|
to try it.
|
567
567
|
|
568
568
|
Actually, if the XML was generated by kramdown-rfc2629, you can simply
|
data/bin/kdrfc
CHANGED
@@ -6,13 +6,15 @@ require 'open3'
|
|
6
6
|
# try to get this from gemspec.
|
7
7
|
KDRFC_VERSION=Gem.loaded_specs["kramdown-rfc2629"].version rescue "unknown-version"
|
8
8
|
|
9
|
+
KDRFC_PREPEND = [ENV["KDRFC_PREPEND"]].compact
|
10
|
+
|
9
11
|
def v3_flag?
|
10
12
|
$options.v3 ? ["--v3"] : []
|
11
13
|
end
|
12
14
|
|
13
15
|
def process_mkd(input, output)
|
14
16
|
warn "* converting locally from markdown #{input} to xml #{output}" if $options.verbose
|
15
|
-
o, s = Open3.capture2("kramdown-rfc2629", *v3_flag?, input)
|
17
|
+
o, s = Open3.capture2(*KDRFC_PREPEND, "kramdown-rfc2629", *v3_flag?, input)
|
16
18
|
if s.success?
|
17
19
|
File.open(output, "w") do |fo|
|
18
20
|
fo.print(o)
|
@@ -41,7 +43,7 @@ end
|
|
41
43
|
def process_xml_locally(input, output, *flags)
|
42
44
|
warn "* converting locally from xml #{input} to txt #{output}" if $options.verbose
|
43
45
|
begin
|
44
|
-
o, s = Open3.capture2("xml2rfc", *v3_flag?, *flags, input)
|
46
|
+
o, s = Open3.capture2(*KDRFC_PREPEND, "xml2rfc", *v3_flag?, *flags, input)
|
45
47
|
puts o
|
46
48
|
if s.success?
|
47
49
|
warn "* #{output} written" if $options.verbose
|
@@ -51,19 +53,37 @@ def process_xml_locally(input, output, *flags)
|
|
51
53
|
end
|
52
54
|
rescue Errno::ENOENT
|
53
55
|
warn "*** falling back to remote processing" if $options.verbose
|
54
|
-
process_xml_remotely(input, output)
|
56
|
+
process_xml_remotely(input, output, *flags)
|
55
57
|
end
|
56
58
|
end
|
57
59
|
|
58
60
|
XML2RFC_WEBSERVICE = ENV["KRAMDOWN_XML2RFC_WEBSERVICE"] ||
|
59
61
|
'http://xml2rfc.tools.ietf.org/cgi-bin/xml2rfc-dev.cgi'
|
60
62
|
|
63
|
+
MODE_AS_FORMAT = {
|
64
|
+
nil => { # v2
|
65
|
+
"--text" => "txt/ascii",
|
66
|
+
"--html" => "html/ascii",
|
67
|
+
},
|
68
|
+
true => { # v3
|
69
|
+
"--text" => "txt/v3ascii",
|
70
|
+
"--html" => "html/v3ascii",
|
71
|
+
"--v2v3" => "v3xml/ascii",
|
72
|
+
}
|
73
|
+
}
|
61
74
|
|
62
|
-
def process_xml_remotely(input, output)
|
75
|
+
def process_xml_remotely(input, output, *flags)
|
63
76
|
warn "* converting remotely from xml #{input} to txt #{output}" if $options.verbose
|
77
|
+
format = flags[0] || "--text"
|
78
|
+
# warn [:V3, $options.v3].inspect
|
79
|
+
maf = MODE_AS_FORMAT[$options.v3][format]
|
80
|
+
unless maf
|
81
|
+
warn "*** don't know how to convert remotely from xml #{input} to txt #{output}"
|
82
|
+
exit(1)
|
83
|
+
end
|
64
84
|
url = URI(XML2RFC_WEBSERVICE)
|
65
85
|
req = Net::HTTP::Post.new(url)
|
66
|
-
form = [["modeAsFormat",
|
86
|
+
form = [["modeAsFormat", maf],
|
67
87
|
["type", "binary"],
|
68
88
|
["input", File.open(input),
|
69
89
|
{filename: "input.xml",
|
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.4.
|
3
|
+
s.version = '1.4.19'
|
4
4
|
s.summary = "Kramdown extension for generating RFC 7749 XML."
|
5
5
|
s.description = %{An RFC7749 (XML2RFC) generating backend for Thomas Leitner's
|
6
6
|
"kramdown" markdown parser. Mostly useful for RFC writers.}
|
data/lib/kramdown-rfc2629.rb
CHANGED
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.4.
|
4
|
+
version: 1.4.19
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carsten Bormann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-07-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: kramdown
|