kramdown-rfc2629 1.2.8 → 1.2.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +54 -1
- data/bin/kramdown-rfc2629 +7 -3
- data/kramdown-rfc2629.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d72f5abee0d9218cd232396588b481b4188577ee7972f2e2b2b476f28cfc7a53
|
4
|
+
data.tar.gz: c745ac5a2ea1879cbc30dce943667c9cd0b8b5aaa3f9e24bbd9ec442db92c02d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98a41b09d6b12695bc41f0ecc6defd40f96815ff24e88ad92a63877b6130b1fd7bad3584b38d04f07c0a07fa7594a2d09c4caefde5e60f989c27a41b1b2fb3cf
|
7
|
+
data.tar.gz: 68b405cfca06b2bc8c12b1108889a70a752894f6323e86b44276317212dc07a3bc203487e5bd6d46bf6d532825561fdcf3b6eabd51da340ab862e606564347cf
|
data/README.md
CHANGED
@@ -28,7 +28,7 @@ structure provided by kramdown. `bin/kramdown-rfc2629` started out as
|
|
28
28
|
a simple command-line program showing how to use this, but can now do
|
29
29
|
much more (see below).
|
30
30
|
|
31
|
-
To use kramdown-rfc2629, you'll need a Ruby
|
31
|
+
To use kramdown-rfc2629, you'll need a Ruby 2.x, and maybe
|
32
32
|
[XML2RFC][] if you want to see the fruits of your work.
|
33
33
|
|
34
34
|
kramdown-rfc2629 mydraft.mkd >mydraft.xml
|
@@ -38,6 +38,15 @@ To use kramdown-rfc2629, you'll need a Ruby 1.9 or 2.x, and maybe
|
|
38
38
|
markdown is .md -- for those who tend to think about GNU machine
|
39
39
|
descriptions here, any extension such as .mkd will do, too.)
|
40
40
|
|
41
|
+
A more brief interface for both calling kramdown-rfc2629 and XML2RFC
|
42
|
+
is provided by `kdrfc`:
|
43
|
+
|
44
|
+
kdrfc mydraft.mkd
|
45
|
+
|
46
|
+
`kdrfc` can also use a remote installation of XML2RFC if needed:
|
47
|
+
|
48
|
+
kdrfc -r mydraft.mkd
|
49
|
+
|
41
50
|
# Examples
|
42
51
|
|
43
52
|
For historical interest
|
@@ -265,6 +274,36 @@ special support in XML2RFC), and HTML syntax of course.
|
|
265
274
|
A number of more esoteric features have recently been added.
|
266
275
|
(The minimum required version for each full feature is indicated.)
|
267
276
|
|
277
|
+
(1.2.9:)
|
278
|
+
The YAML header now allows specifying [kramdown_options][].
|
279
|
+
|
280
|
+
[kramdown_options]: https://kramdown.gettalong.org/options.html
|
281
|
+
|
282
|
+
This was added specifically to provide easier access to the kramdown
|
283
|
+
`auto_id_prefix` feature, which prefixes by some distinguishing string
|
284
|
+
the anchors that are auto-generated for sections, avoiding conflicts:
|
285
|
+
|
286
|
+
```yaml
|
287
|
+
kramdown_options:
|
288
|
+
auto_id_prefix: sec-
|
289
|
+
```
|
290
|
+
|
291
|
+
(1.2.8:)
|
292
|
+
An experimental feature was added to include [BCP 14] boilerplate:
|
293
|
+
|
294
|
+
```markdown
|
295
|
+
{::boilerplate bcp14}
|
296
|
+
```
|
297
|
+
|
298
|
+
which saves some typing. Saying "bcp14+" instead of "bcp14" adds some
|
299
|
+
random clarifications at the end of the [standard boilerplate text][] that
|
300
|
+
you may or may not want to have. (Do we need other boilerplate items
|
301
|
+
beyond BCP14?)
|
302
|
+
|
303
|
+
[BCP 14]: https://www.rfc-editor.org/info/bcp14
|
304
|
+
|
305
|
+
[standard boilerplate text]: https://tools.ietf.org/html/rfc8174#page-3
|
306
|
+
|
268
307
|
(1.0.35:)
|
269
308
|
An experimental command `doilit` has been added. It can be used to
|
270
309
|
convert DOIs given on the command line into references entries for
|
@@ -454,6 +493,20 @@ don't really need to understand XML very much. Knowing the basics of
|
|
454
493
|
YAML helps with the metadata (but you'll understand it from the
|
455
494
|
examples).
|
456
495
|
|
496
|
+
Occasionally, you do need to reach through to the XML arcana, e.g. by
|
497
|
+
setting attribute values using kramdown's ["IAL" syntax][IAL].
|
498
|
+
This can for instance be used to obtain unnumbered appendices:
|
499
|
+
|
500
|
+
```markdown
|
501
|
+
Acknowledgements
|
502
|
+
================
|
503
|
+
{: numbered="no"}
|
504
|
+
|
505
|
+
John Mattsson was nice enough to point out the need for this being documented.
|
506
|
+
```
|
507
|
+
|
508
|
+
[IAL]: https://kramdown.gettalong.org/syntax.html#inline-attribute-lists
|
509
|
+
|
457
510
|
# Upconversion
|
458
511
|
|
459
512
|
If you have an old RFC and want to convert it to markdown, try just
|
data/bin/kramdown-rfc2629
CHANGED
@@ -16,7 +16,7 @@ def boilerplate(key)
|
|
16
16
|
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
|
17
17
|
NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED",
|
18
18
|
"MAY", and "OPTIONAL" in this document are to be interpreted as
|
19
|
-
described in BCP
|
19
|
+
described in BCP 14 {{!RFC2119}} {{!RFC8174}} when, and only when, they
|
20
20
|
appear in all capitals, as shown here.
|
21
21
|
RFC8174
|
22
22
|
if $1
|
@@ -84,6 +84,7 @@ def xml_from_sections(input)
|
|
84
84
|
ps = KramdownRFC::ParameterSet.new(yaml_load(yaml_in, [Date], [], true))
|
85
85
|
coding_override = ps.has(:coding)
|
86
86
|
smart_quotes = ps[:smart_quotes]
|
87
|
+
kramdown_options = ps[:kramdown_options]
|
87
88
|
|
88
89
|
# all the other sections are put in a Hash, possibly concatenated from parts there
|
89
90
|
sechash = Hash.new{ |h,k| h[k] = ""}
|
@@ -233,7 +234,7 @@ def xml_from_sections(input)
|
|
233
234
|
warn "*** sections left #{sechash.keys.inspect}!"
|
234
235
|
end
|
235
236
|
|
236
|
-
[input, coding_override, link_defs, smart_quotes]
|
237
|
+
[input, coding_override, link_defs, smart_quotes, kramdown_options]
|
237
238
|
end
|
238
239
|
|
239
240
|
XML_RESOURCE_ORG_PREFIX = Kramdown::Converter::Rfc2629::XML_RESOURCE_ORG_PREFIX
|
@@ -304,7 +305,7 @@ end
|
|
304
305
|
link_defs = {}
|
305
306
|
if input =~ /\A---/ # this is a sectionized file
|
306
307
|
do_the_tls_dance unless ENV["KRAMDOWN_DONT_VERIFY_HTTPS"]
|
307
|
-
input, target_coding, link_defs, smart_quotes = xml_from_sections(input)
|
308
|
+
input, target_coding, link_defs, smart_quotes, kramdown_options = xml_from_sections(input)
|
308
309
|
end
|
309
310
|
if input =~ /\A<\?xml/ # if this is a whole XML file, protect it
|
310
311
|
input = "{::nomarkdown}\n#{input}\n{:/nomarkdown}\n"
|
@@ -324,6 +325,9 @@ when nil, true
|
|
324
325
|
else
|
325
326
|
warn "*** Can't deal with smart_quotes value #{smart_quotes.inspect}"
|
326
327
|
end
|
328
|
+
if kramdown_options
|
329
|
+
options.merge! kramdown_options
|
330
|
+
end
|
327
331
|
|
328
332
|
if target_coding
|
329
333
|
input = input.encode(Encoding.find(target_coding), fallback: FALLBACK)
|
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.2.
|
3
|
+
s.version = '1.2.9'
|
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.}
|
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.2.
|
4
|
+
version: 1.2.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: 2018-
|
11
|
+
date: 2018-04-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: kramdown
|
@@ -83,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
83
83
|
version: '0'
|
84
84
|
requirements: []
|
85
85
|
rubyforge_project:
|
86
|
-
rubygems_version: 2.7.
|
86
|
+
rubygems_version: 2.7.6
|
87
87
|
signing_key:
|
88
88
|
specification_version: 4
|
89
89
|
summary: Kramdown extension for generating RFC 7749 XML.
|