kramdown-rfc2629 0.13.8 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +148 -25
- data/kramdown-rfc2629.gemspec +3 -2
- data/lib/kramdown-rfc2629.rb +2 -2
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c680de5d2853a1c04df22f6a2e6d4104b1cd3bd
|
4
|
+
data.tar.gz: 8a701c320ac5848dd70273f2e1fb388881e82a72
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f4c78b68de442b178aaeefd99b2b1f601f90d37c21d302c21023df5c06afb51fdba4db8d52855f6d4e78bee5a882a9079e86c96d783b09a302aebf6c5f6b256
|
7
|
+
data.tar.gz: de7f426083a7db0573ee4d3353fa44a5f1b56f14721096905e1108928de12b173b93b79405315880167b52b77ebf3f42deec4eca5ea0da6025678a9e99822eb3
|
data/README.md
CHANGED
@@ -4,8 +4,8 @@
|
|
4
4
|
number of backends for generating HTML, Latex, and markdown again.
|
5
5
|
|
6
6
|
**kramdown-rfc2629** is an additional backend to that: It allows the
|
7
|
-
generation of [
|
8
|
-
markup).
|
7
|
+
generation of [XML2RFC][] XML markup (also known as [RFC 2629][]
|
8
|
+
compliant markup).
|
9
9
|
|
10
10
|
Who would care? Anybody who is writing Internet-Drafts and RFCs in
|
11
11
|
the [IETF][] and prefers (or has co-authors who prefer) to do part of
|
@@ -13,8 +13,8 @@ their work in markdown.
|
|
13
13
|
|
14
14
|
# Usage
|
15
15
|
|
16
|
-
Start by installing the kramdown-rfc2629 gem (this
|
17
|
-
|
16
|
+
Start by installing the kramdown-rfc2629 gem (this automatically
|
17
|
+
installs kramdown version 1.0.x as well):
|
18
18
|
|
19
19
|
sudo gem install kramdown-rfc2629
|
20
20
|
|
@@ -24,24 +24,23 @@ 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
|
28
|
-
|
29
|
-
|
30
|
-
your work.
|
27
|
+
To use kramdown-rfc2629, you'll need a Ruby 1.9 or 2.0, the command
|
28
|
+
"wget" (if you want to use the offline feature), and maybe [XML2RFC][]
|
29
|
+
if you want to see the fruits of your work.
|
31
30
|
|
32
31
|
kramdown-rfc2629 mydraft.mkd >mydraft.xml
|
33
32
|
xml2rfc mydraft.xml
|
34
33
|
|
35
34
|
# Examples
|
36
35
|
|
37
|
-
`stupid.mkd`
|
38
|
-
protocol called [STuPiD][] \[sic!]). This
|
39
|
-
all features of kramdown-rfc2629. Since markdown/kramdown
|
40
|
-
cater for all the structure of an RFC 2629 style document,
|
41
|
-
markup is in XML, and the example switches between XML and
|
42
|
-
using kramdown's `{::nomarkdown}` and `{:/nomarkdown}` (this
|
43
|
-
but works well enough). `stupid.xml` and `stupid.txt` show
|
44
|
-
kramdown-rfc2629 and xml2rfc make out of this.
|
36
|
+
`stupid.mkd` was an early markdown version of an actual Internet-Draft
|
37
|
+
(for a protocol called [STuPiD][] \[sic!]). This demonstrated some,
|
38
|
+
but not all features of kramdown-rfc2629. Since markdown/kramdown
|
39
|
+
does not cater for all the structure of an RFC 2629 style document,
|
40
|
+
some of the markup is in XML, and the example switches between XML and
|
41
|
+
markdown using kramdown's `{::nomarkdown}` and `{:/nomarkdown}` (this
|
42
|
+
is ugly, but works well enough). `stupid.xml` and `stupid.txt` show
|
43
|
+
what kramdown-rfc2629 and xml2rfc make out of this.
|
45
44
|
|
46
45
|
`stupid-s.mkd` is the same document in the new sectionized format
|
47
46
|
supported by kramdown-rfc2629. The document metadata are in a short
|
@@ -57,8 +56,133 @@ kramdown-rfc2629 and xml2rfc make out of this.
|
|
57
56
|
`draft-ietf-core-block-xx.mkd` is a real-world example of a current
|
58
57
|
Internet-Draft done this way. For RFC and Internet-Draft references,
|
59
58
|
it uses document prolog entities instead of caching the references in
|
60
|
-
the XML (this is easier to handle when
|
61
|
-
co-authors). See the `bibxml` metadata.
|
59
|
+
the XML (i.e., not standalone mode, this is easier to handle when
|
60
|
+
collaborating with XML-only co-authors). See the `bibxml` metadata.
|
61
|
+
|
62
|
+
# The YAML header
|
63
|
+
|
64
|
+
Please consult the examples for the structure of the YAML header, this should be mostly
|
65
|
+
obvious. The `standalone` attribute controls whether the RFC/I-D
|
66
|
+
references are inserted into the document (yes) or entity-referenced
|
67
|
+
(no), the latter leads to increased build time, but may be more
|
68
|
+
palatable for a final XML conversion.
|
69
|
+
The author entry can be a single hash or a list, as in:
|
70
|
+
|
71
|
+
author:
|
72
|
+
ins: C. Bormann
|
73
|
+
name: Carsten Bormann
|
74
|
+
org: Universität Bremen TZI
|
75
|
+
abbrev: TZI
|
76
|
+
street: Bibliothekstr. 1
|
77
|
+
city: Bremen
|
78
|
+
code: D-28359
|
79
|
+
country: Germany
|
80
|
+
phone: +49-421-218-63921
|
81
|
+
email: cabo@tzi.org
|
82
|
+
|
83
|
+
or
|
84
|
+
|
85
|
+
author:
|
86
|
+
-
|
87
|
+
ins: C. Bormann
|
88
|
+
name: Carsten Bormann
|
89
|
+
org: Universität Bremen TZI
|
90
|
+
email: cabo@tzi.org
|
91
|
+
-
|
92
|
+
ins: Z. Shelby
|
93
|
+
name: Zach Shelby
|
94
|
+
org: Sensinode
|
95
|
+
role: editor
|
96
|
+
street: Kidekuja 2
|
97
|
+
city: Vuokatti
|
98
|
+
code: 88600
|
99
|
+
country: Finland
|
100
|
+
phone: "+358407796297"
|
101
|
+
email: zach@sensinode.com
|
102
|
+
|
103
|
+
(the hash keys are the XML GIs from RFC 2629, with a flattened
|
104
|
+
structure. As RFC 2629 requires giving both the name and
|
105
|
+
surname/initials, we use `ins` as an abbreviation for
|
106
|
+
"initials/surname". Yes, the toolchain is Unicode-capable, even if
|
107
|
+
the final RFC output is still in ASCII.)
|
108
|
+
|
109
|
+
|
110
|
+
## References
|
111
|
+
|
112
|
+
The references section is built from the references listed in the YAML
|
113
|
+
header and from references made inline to RFCs and I-Ds in the
|
114
|
+
markdown text. Since kramdown-rfc2629 cannot know whether a reference
|
115
|
+
is normative or informative, no entry is generated by default in the
|
116
|
+
references section. By indicating a normative reference as in
|
117
|
+
`{{!RFC2119}}` or an informative one as in `{{?RFC1925}}`, you can
|
118
|
+
completely automate the referencing, without the need to write
|
119
|
+
anything in the header. Alternatively, you can write something like:
|
120
|
+
|
121
|
+
informative:
|
122
|
+
RFC1925:
|
123
|
+
normative:
|
124
|
+
RFC2119:
|
125
|
+
|
126
|
+
and then just write `{{RFC2119}}` or `{{RFC1925}}`. (Yes, there is a
|
127
|
+
colon in the YAML, because this is a hash that could provide other
|
128
|
+
information.)
|
129
|
+
|
130
|
+
If your references are not in the [XML2RFC][] databases, you need to
|
131
|
+
spell it out like this:
|
132
|
+
|
133
|
+
informative:
|
134
|
+
RFC1925:
|
135
|
+
WEI:
|
136
|
+
title: "6LoWPAN: the Wireless Embedded Internet"
|
137
|
+
author:
|
138
|
+
-
|
139
|
+
ins: Z. Shelby
|
140
|
+
name: Zach Shelby
|
141
|
+
-
|
142
|
+
ins: C. Bormann
|
143
|
+
name: Carsten Bormann
|
144
|
+
date: 2009
|
145
|
+
seriesinfo:
|
146
|
+
ISBN: 9780470747995
|
147
|
+
ann: This is a really good reference on 6LoWPAN.
|
148
|
+
ASN.1:
|
149
|
+
title: >
|
150
|
+
Information Technology — ASN.1 encoding rules:
|
151
|
+
Specification of Basic Encoding Rules (BER), Canonical Encoding
|
152
|
+
Rules (CER) and Distinguished Encoding Rules (DER)
|
153
|
+
author:
|
154
|
+
org: International Telecommunications Union
|
155
|
+
date: 1994
|
156
|
+
seriesinfo:
|
157
|
+
ITU-T: Recommendation X.690
|
158
|
+
REST:
|
159
|
+
target: http://www.ics.uci.edu/~fielding/pubs/dissertation/fielding_dissertation.pdf
|
160
|
+
title: Architectural Styles and the Design of Network-based Software Architectures
|
161
|
+
author:
|
162
|
+
ins: R. Fielding
|
163
|
+
name: Roy Thomas Fielding
|
164
|
+
org: University of California, Irvine
|
165
|
+
date: 2000
|
166
|
+
seriesinfo:
|
167
|
+
"Ph.D.": "Dissertation, University of California, Irvine"
|
168
|
+
format:
|
169
|
+
PDF: http://www.ics.uci.edu/~fielding/pubs/dissertation/fielding_dissertation.pdf
|
170
|
+
normative:
|
171
|
+
ECMA262:
|
172
|
+
author:
|
173
|
+
org: European Computer Manufacturers Association
|
174
|
+
title: ECMAScript Language Specification 5.1 Edition
|
175
|
+
date: 2011-06
|
176
|
+
target: http://www.ecma-international.org/publications/files/ecma-st/ECMA-262.pdf
|
177
|
+
seriesinfo:
|
178
|
+
ECMA: Standard ECMA-262
|
179
|
+
RFC2119:
|
180
|
+
RFC6690:
|
181
|
+
|
182
|
+
(as in the author list, `ins` is an abbreviation for
|
183
|
+
"initials/surname".) Then you can simply reference `{{ASN.1}}` and
|
184
|
+
`{{ECMA262}}` in the text. (Make sure the reference keys are valid XML
|
185
|
+
names, though.)
|
62
186
|
|
63
187
|
# Risks and Side-Effects
|
64
188
|
|
@@ -67,7 +191,7 @@ number of non-trivial Internet-Drafts. You probably still need to
|
|
67
191
|
skim [RFC 2629][] if you want to write an Internet-Draft, but you
|
68
192
|
don't really need to understand XML very much. Knowing the basics of
|
69
193
|
YAML helps with the metadata (but you'll understand it from the
|
70
|
-
examples.
|
194
|
+
examples).
|
71
195
|
|
72
196
|
# Related Work
|
73
197
|
|
@@ -85,16 +209,15 @@ verbose.
|
|
85
209
|
|
86
210
|
# License
|
87
211
|
|
88
|
-
|
89
|
-
is
|
90
|
-
|
91
|
-
stuck at GPLv3 does not make me happy, but it is just for this tool so
|
92
|
-
it's probably not going to kill any RFC author.)
|
212
|
+
With kramdown version 1.0, kramdown itself now is MIT licensed, so it
|
213
|
+
is finally possible to license kramdown-rfc2629 under the same
|
214
|
+
license.
|
93
215
|
|
94
216
|
[kramdown]: http://kramdown.rubyforge.org/
|
95
217
|
[stupid]: http://tools.ietf.org/id/draft-hartke-xmpp-stupid-00
|
96
|
-
[RFC 2629]: http://xml.resource.org
|
218
|
+
[RFC 2629]: http://xml.resource.org/public/rfc/html/rfc2629.html
|
97
219
|
[markdown]: http://en.wikipedia.org/wiki/Markdown
|
98
220
|
[IETF]: http://www.ietf.org
|
99
221
|
[Miek Gieben]: http://www.miek.nl/
|
100
222
|
[pandoc2rfc]: https://github.com/miekg/pandoc2rfc/
|
223
|
+
[XML2RFC]: http://xml.resource.org
|
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 = '0.
|
3
|
+
s.version = '1.0.0'
|
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.}
|
7
|
-
s.add_dependency('kramdown', '~> 0.
|
7
|
+
s.add_dependency('kramdown', '~> 1.0.0')
|
8
8
|
s.files = Dir['lib/**/*.rb'] + %w(README.md kramdown-rfc2629.gemspec bin/kramdown-rfc2629 data/kramdown-rfc2629.erb)
|
9
9
|
s.require_path = 'lib'
|
10
10
|
s.executables = ['kramdown-rfc2629']
|
@@ -15,4 +15,5 @@ spec = Gem::Specification.new do |s|
|
|
15
15
|
s.author = "Carsten Bormann"
|
16
16
|
s.email = "cabo@tzi.org"
|
17
17
|
s.homepage = "http://github.com/cabo/kramdown-rfc2629"
|
18
|
+
s.license = 'MIT'
|
18
19
|
end
|
data/lib/kramdown-rfc2629.rb
CHANGED
@@ -12,8 +12,8 @@
|
|
12
12
|
|
13
13
|
raise "sorry, 1.8 was last decade" unless RUBY_VERSION >= '1.9'
|
14
14
|
|
15
|
-
# this version
|
16
|
-
gem 'kramdown', '~> 0.
|
15
|
+
# this version also works with kramdown 0.12, 0.13, 0.14, but 1.0 has the right license
|
16
|
+
gem 'kramdown', '~> 1.0.0'
|
17
17
|
require 'kramdown'
|
18
18
|
|
19
19
|
require 'rexml/parsers/baseparser'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kramdown-rfc2629
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carsten Bormann
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 1.0.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:
|
26
|
+
version: 1.0.0
|
27
27
|
description: |-
|
28
28
|
An RFC2629 (XML2RFC) generating backend for Thomas Leitner's
|
29
29
|
"kramdown" markdown parser. Mostly useful for RFC writers.
|
@@ -39,7 +39,8 @@ files:
|
|
39
39
|
- bin/kramdown-rfc2629
|
40
40
|
- data/kramdown-rfc2629.erb
|
41
41
|
homepage: http://github.com/cabo/kramdown-rfc2629
|
42
|
-
licenses:
|
42
|
+
licenses:
|
43
|
+
- MIT
|
43
44
|
metadata: {}
|
44
45
|
post_install_message:
|
45
46
|
rdoc_options: []
|