kramdown-rfc2629 1.6.6 → 1.6.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/de-gfm +15 -7
- data/data/kramdown-rfc2629.erb +2 -2
- data/kramdown-rfc2629.gemspec +3 -3
- data/lib/kramdown-rfc/command.rb +1 -1
- data/lib/kramdown-rfc/parameterset.rb +6 -4
- data/lib/kramdown-rfc2629.rb +4 -4
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a5efefbd462f83ca8a6028732587b93cdcb325dced1d3517c431951a460935ba
|
4
|
+
data.tar.gz: 5e419a6c6450b96ef213aa875beb1ebd2a8fab50a7dfbbe3c75f551fd40fb160
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7f4b69d71d42913d164727465b4e998a58ef5df9378e563030ec9edea6028ea55908c41fca51aa6db760d806fa80372a71a83a5b3a134a294b90bc3ad99e5ae
|
7
|
+
data.tar.gz: a22265e02addd8fefcc79b40acd864df936147d9c0e3004916e8f0c5649d719970e4a19772f47a70d92051efa50f0dcde2771d7f8994c15536d8ed8d8143fd19
|
data/bin/de-gfm
CHANGED
@@ -5,19 +5,22 @@ Encoding.default_external = "UTF-8" # wake up, smell the coffee
|
|
5
5
|
require 'kramdown'
|
6
6
|
require 'kramdown-parser-gfm'
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
options = ''
|
9
|
+
while /\A-([4bck]+)\z/ === ARGV[0]
|
10
10
|
ARGV.shift
|
11
|
+
options << $1
|
12
|
+
end
|
13
|
+
|
14
|
+
if /k/ === options # kramdown
|
15
|
+
MARKDOWN_BR = "\\\\\n"
|
11
16
|
end
|
12
17
|
|
13
|
-
if
|
18
|
+
if /c/ === options # commonmark
|
14
19
|
MARKDOWN_BR = "\\\n"
|
15
|
-
ARGV.shift
|
16
20
|
end
|
17
21
|
|
18
|
-
if
|
22
|
+
if /b/ === options # universal HTML
|
19
23
|
MARKDOWN_BR = "<br/>\n"
|
20
|
-
ARGV.shift
|
21
24
|
end
|
22
25
|
|
23
26
|
MARKDOWN_BR ||= " \n" # original Gruber
|
@@ -37,4 +40,9 @@ module Kramdown
|
|
37
40
|
end
|
38
41
|
end
|
39
42
|
|
40
|
-
|
43
|
+
list_indent = 2
|
44
|
+
list_indent = 4 if /4/ === options
|
45
|
+
|
46
|
+
doc = Kramdown::Document.new(ARGF.read, input: 'GFM', gfm_quirks: 'paragraph_end',
|
47
|
+
list_indent: list_indent)
|
48
|
+
puts doc.to_kramdown
|
data/data/kramdown-rfc2629.erb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
<?xml version="1.0" encoding="<%=ps[:coding]||"UTF-8"%>"?>
|
2
2
|
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
|
3
|
-
<!-- generated by https://github.com/cabo/kramdown-
|
3
|
+
<!-- generated by https://github.com/cabo/kramdown-rfc version <%=
|
4
4
|
Gem.loaded_specs["kramdown-rfc2629"].version rescue nil
|
5
5
|
%> (Ruby <%= RUBY_VERSION %>) -->
|
6
6
|
|
@@ -29,7 +29,7 @@
|
|
29
29
|
ps["consensus"] = true if MUST_CONSENSUS[cat]
|
30
30
|
end
|
31
31
|
rfcattrs = ps.attrs("ipr", "docName=docname", "category=cat",
|
32
|
-
"consensus", "submissionType=submissiontype", "xml:lang=lang",
|
32
|
+
"consensus", "submissionType=submissiontype=stream", "xml:lang=lang",
|
33
33
|
"number", "obsoletes", "updates", "seriesNo=seriesno")
|
34
34
|
TRUE_FALSE = {nil => "true", false => "false", true => "true",
|
35
35
|
"yes" => "true", "no" => "false"}
|
data/kramdown-rfc2629.gemspec
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
spec = Gem::Specification.new do |s|
|
2
2
|
s.name = 'kramdown-rfc2629'
|
3
|
-
s.version = '1.6.
|
3
|
+
s.version = '1.6.9'
|
4
4
|
s.summary = "Kramdown extension for generating RFCXML (RFC 799x)."
|
5
5
|
s.description = %{An RFCXML (RFC 799x) generating backend for Thomas Leitner's
|
6
6
|
"kramdown" markdown parser. Mostly useful for RFC writers.}
|
7
|
-
s.add_dependency('kramdown', '~> 2.
|
7
|
+
s.add_dependency('kramdown', '~> 2.4.0')
|
8
8
|
s.add_dependency('kramdown-parser-gfm', '~> 1.1')
|
9
9
|
s.add_dependency('certified', '~> 1.0')
|
10
10
|
s.add_dependency('json_pure', '~> 2.0')
|
@@ -18,6 +18,6 @@ spec = Gem::Specification.new do |s|
|
|
18
18
|
# s.has_rdoc = true
|
19
19
|
s.author = "Carsten Bormann"
|
20
20
|
s.email = "cabo@tzi.org"
|
21
|
-
s.homepage = "http://github.com/cabo/kramdown-
|
21
|
+
s.homepage = "http://github.com/cabo/kramdown-rfc"
|
22
22
|
s.license = 'MIT'
|
23
23
|
end
|
data/lib/kramdown-rfc/command.rb
CHANGED
@@ -485,7 +485,7 @@ Usage: kramdown-rfc2629 [options] file.md|file.mkd > file.xml
|
|
485
485
|
Version: #{KDRFC_VERSION}
|
486
486
|
BANNER
|
487
487
|
opts.on("-V", "--version", "Show version and exit") do |v|
|
488
|
-
puts "kramdown-
|
488
|
+
puts "kramdown-rfc #{KDRFC_VERSION}"
|
489
489
|
exit
|
490
490
|
end
|
491
491
|
opts.on("-H", "--help", "Show option summary and exit") do |v|
|
@@ -27,13 +27,15 @@ module KramdownRFC
|
|
27
27
|
def has(pn)
|
28
28
|
@f[pn.to_s]
|
29
29
|
end
|
30
|
+
def has?(pn)
|
31
|
+
@f.key?(pn.to_s)
|
32
|
+
end
|
30
33
|
def escattr(str)
|
31
34
|
escape_html(str.to_s, :attribute)
|
32
35
|
end
|
33
|
-
def van(pn)
|
34
|
-
|
35
|
-
|
36
|
-
[self[pn] || self[an], an]
|
36
|
+
def van(pn) # pn is a parameter name, possibly with =aliases
|
37
|
+
names = pn.to_s.split("=")
|
38
|
+
[self[names.reverse.find{|nm| has?(nm)}], names.first]
|
37
39
|
end
|
38
40
|
def attr(pn)
|
39
41
|
val, an = van(pn)
|
data/lib/kramdown-rfc2629.rb
CHANGED
@@ -12,7 +12,7 @@ require 'shellwords'
|
|
12
12
|
|
13
13
|
raise "sorry, 1.8 was last decade" unless RUBY_VERSION >= '1.9'
|
14
14
|
|
15
|
-
gem 'kramdown', '~> 2.
|
15
|
+
gem 'kramdown', '~> 2.4.0'
|
16
16
|
require 'kramdown'
|
17
17
|
my_span_elements = %w{list figure xref eref iref cref spanx vspace}
|
18
18
|
Kramdown::Parser::Html::Constants::HTML_SPAN_ELEMENTS.concat my_span_elements
|
@@ -113,7 +113,7 @@ module Kramdown
|
|
113
113
|
end
|
114
114
|
end
|
115
115
|
|
116
|
-
XREF_START = /\{\{(?:(?:\{(
|
116
|
+
XREF_START = /\{\{(?:(?:\{(.*?\n??.*?)\}(?:\{(.*?\n??.*?)\})?)|(\X*?))((?:\}\})|\})/u
|
117
117
|
|
118
118
|
# Introduce new {{target}} syntax for empty xrefs, which would
|
119
119
|
# otherwise be an ugly ![!](target) or ![ ](target)
|
@@ -124,9 +124,9 @@ module Kramdown
|
|
124
124
|
warn "*** #{@src[0]}: unmatched braces #{@src[4].inspect}"
|
125
125
|
end
|
126
126
|
if contact_name = @src[1]
|
127
|
-
attr = {'fullname' => contact_name}
|
127
|
+
attr = {'fullname' => contact_name.gsub("\n", " ")}
|
128
128
|
if ascii_name = @src[2]
|
129
|
-
attr["asciiFullname"] = ascii_name
|
129
|
+
attr["asciiFullname"] = ascii_name.gsub("\n", " ")
|
130
130
|
end
|
131
131
|
el = Element.new(:contact, nil, attr)
|
132
132
|
else
|
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.6.
|
4
|
+
version: 1.6.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carsten Bormann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-05-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: kramdown
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.
|
19
|
+
version: 2.4.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.
|
26
|
+
version: 2.4.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: kramdown-parser-gfm
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -105,7 +105,7 @@ files:
|
|
105
105
|
- lib/kramdown-rfc/refxml.rb
|
106
106
|
- lib/kramdown-rfc/rfc8792.rb
|
107
107
|
- lib/kramdown-rfc2629.rb
|
108
|
-
homepage: http://github.com/cabo/kramdown-
|
108
|
+
homepage: http://github.com/cabo/kramdown-rfc
|
109
109
|
licenses:
|
110
110
|
- MIT
|
111
111
|
metadata: {}
|
@@ -124,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
124
124
|
- !ruby/object:Gem::Version
|
125
125
|
version: '0'
|
126
126
|
requirements: []
|
127
|
-
rubygems_version: 3.3.
|
127
|
+
rubygems_version: 3.3.11
|
128
128
|
signing_key:
|
129
129
|
specification_version: 4
|
130
130
|
summary: Kramdown extension for generating RFCXML (RFC 799x).
|