asciidoctor-rfc 0.9.0 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0a6bea3ae379ea8404bb2554c297ac8021f575dc09c5e11cb5ddb72802bed384
4
- data.tar.gz: c530c5f75c72755c9b78240dff2117a098d15d695854cfbcc3d77fd77eb305af
3
+ metadata.gz: 415bbddbd5dc25773291e4b534f831aca0b95095afde843bb5d042a798fab7dd
4
+ data.tar.gz: df38598b9f2fc70983b605b7ef003d4b90a76be28027092191b0a8ec52e57967
5
5
  SHA512:
6
- metadata.gz: 1aec907eef6a4f4ba30d58d182242217fa679348dba0e33b805efaca7f5a9fb95326a2b87c2a7a571b5548642bf0aba572f2972d012e01e421fa694af961cb10
7
- data.tar.gz: e601d621850627bb9899477f1488f75fd37fbea898cbcd17b8be45f25446d2405b649a25dfc733d5c3bcff948801d9127dc9fb8ba699c9ad1c41d9a6080eb68c
6
+ metadata.gz: 4db78b248939d8bcc55bcf95ff35c37295505c532f75056d9152b8d157da522a3219139620420b06daf02888f25fdb2e46f82b7f7bb90d789a9ffe383325692d
7
+ data.tar.gz: 1448366ea2283e1483a8279dc2e381784dfc94a6a77e8516a967de40303f0e03a77de05ecb35208fc56eb44cef8cc4285c83079727c0e41f4fb5ac0b0def9449
@@ -1,11 +1,23 @@
1
+ dist: trusty
1
2
  sudo: true
2
3
  language: ruby
4
+ python:
5
+ - 2.7
3
6
  rvm:
4
- - 2.4.0
5
- before_install:
6
- - gem install bundler -v 1.16.0
7
- - bundle install
8
- install:
9
- - sudo pip install xml2rfc
10
- script:
11
- - bundle exec rspec --color --format documentation --require spec_helper
7
+ - 2.5
8
+ - 2.4
9
+ - 2.3
10
+ - ruby-head
11
+ addons:
12
+ apt:
13
+ packages:
14
+ - python-lxml
15
+ - python-pip
16
+
17
+ before_install:
18
+ - gem install bundler -v 1.16.1
19
+ - unset _JAVA_OPTIONS
20
+ - pip install --user xml2rfc
21
+ matrix:
22
+ allow_failures:
23
+ - rvm: ruby-head
@@ -987,8 +987,8 @@ Quotation <3>
987
987
 
988
988
  ==== Asciidoctor comments
989
989
 
990
- Asciidoctor implements both inline comments (prefixed with `\\`)
991
- and block comments (prefixed with `\\\\`). Both are ignored by
990
+ Asciidoctor implements both inline comments (prefixed with `//`)
991
+ and block comments (prefixed with `////`). Both are ignored by
992
992
  the Asciidoctor processor, and are not rendered in any output,
993
993
  including RFC XML.
994
994
 
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
29
29
  DESCRIPTION
30
30
 
31
31
  spec.homepage = "https://github.com/riboseinc/asciidoctor-rfc"
32
- spec.license = "MIT"
32
+ spec.license = "BSD-2-Clause"
33
33
 
34
34
  spec.bindir = "bin"
35
35
  spec.require_paths = ["lib"]
@@ -0,0 +1,21 @@
1
+ ---
2
+ title: Installation
3
+ ---
4
+
5
+ Add this line to your application’s Gemfile:
6
+
7
+ ```
8
+ gem "asciidoctor-rfc"
9
+ ```
10
+
11
+ And then execute:
12
+
13
+ ```
14
+ $ bundle
15
+ ```
16
+
17
+ Or install it yourself as:
18
+
19
+ ```
20
+ $ gem install asciidoctor-rfc
21
+ ```
@@ -0,0 +1,10 @@
1
+ ---
2
+ sections:
3
+ - name: Introduction
4
+ items:
5
+ - overview
6
+ - installation
7
+ - name: Usage
8
+ items:
9
+ - basic
10
+ ---
@@ -0,0 +1,5 @@
1
+ ---
2
+ title: Overview
3
+ ---
4
+
5
+ asciidoctor-rfc lets you write Internet-Drafts and RFCs in AsciiDoc, the “asciidoctor-way”.
@@ -526,6 +526,15 @@ HERE
526
526
  end
527
527
  xmldoc
528
528
  end
529
+
530
+ def output_dtd
531
+ filename = File.join(File.dirname(__FILE__), "../../../../rfc2629.dtd")
532
+ system "cp #{filename} ."
533
+ filename = File.join(File.dirname(__FILE__), "../../../../rfc2629-other.ent")
534
+ system "cp #{filename} ."
535
+ filename = File.join(File.dirname(__FILE__), "../../../../rfc2629-xhtml.ent")
536
+ system "cp #{filename} ."
537
+ end
529
538
  end
530
539
  end
531
540
  end
@@ -89,12 +89,11 @@ module Asciidoctor
89
89
  ret = result * "\n"
90
90
  ret = cleanup(ret)
91
91
  ret1 = Nokogiri::XML(ret)
92
- # Validate::validate(ret1)
93
92
  ret1 = set_pis(node, ret1)
94
93
  ret1 = insert_biblio(node, ret1) unless node.attr("biblio-dir").nil? || node.attr("biblio-dir").empty?
94
+ output_dtd()
95
95
  Validate::validate(ret1)
96
96
  ret1 = resolve_references(node, ret1)
97
- # Validate::validate(ret1)
98
97
  ret1.to_xml
99
98
  end
100
99
 
@@ -232,6 +231,9 @@ module Asciidoctor
232
231
  $processing_reflist = false
233
232
  $seen_back_matter = true
234
233
  else
234
+ if $seen_back_matter && node.attr("style") != "appendix"
235
+ warn "Appendix not marked up with [appendix]!"
236
+ end
235
237
  if node.attr("style") == "appendix"
236
238
  result << "</middle><back>" unless $seen_back_matter
237
239
  $seen_back_matter = true
@@ -86,6 +86,7 @@ module Asciidoctor
86
86
  ret1 = Nokogiri::XML(ret)
87
87
  ret1 = set_pis(node, ret1)
88
88
  ret1 = insert_biblio(node, ret1) unless node.attr("biblio-dir").nil? || node.attr("biblio-dir").empty?
89
+ output_dtd()
89
90
  Validate::validate(ret1)
90
91
  ret1 = resolve_references(node, ret1)
91
92
  # Validate::validate(ret1)
@@ -130,7 +131,8 @@ module Asciidoctor
130
131
 
131
132
  BCP_KEYWORDS = [
132
133
  "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
133
- "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", "OPTIONAL"
134
+ "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED",
135
+ "MAY", "OPTIONAL"
134
136
  ].freeze
135
137
 
136
138
  def inline_quoted(node)
@@ -251,6 +253,9 @@ module Asciidoctor
251
253
  result = ref_section(node)
252
254
  else
253
255
  result = []
256
+ if $seen_back_matter && node.attr("style") != "appendix"
257
+ warn "Appendix not marked up with [appendix]!"
258
+ end
254
259
  if node.attr("style") == "appendix"
255
260
  result << "</middle><back>" unless $seen_back_matter
256
261
  $seen_back_matter = true
@@ -1,5 +1,5 @@
1
1
  module Asciidoctor
2
2
  module RFC
3
- VERSION = "0.9.0".freeze
3
+ VERSION = "0.9.1".freeze
4
4
  end
5
5
  end
@@ -16,6 +16,10 @@ module Metanorma
16
16
  }
17
17
  end
18
18
 
19
+ def version
20
+ "Asciidoctor::Rfc2 #{Asciidoctor::RFC::VERSION}"
21
+ end
22
+
19
23
  def input_to_isodoc(file)
20
24
  Asciidoctor.convert(
21
25
  file,
@@ -35,4 +39,4 @@ module Metanorma
35
39
 
36
40
  end
37
41
  end
38
- end
42
+ end
@@ -16,6 +16,10 @@ module Metanorma
16
16
  }
17
17
  end
18
18
 
19
+ def version
20
+ "Asciidoctor::Rfc3 #{Asciidoctor::RFC::VERSION}"
21
+ end
22
+
19
23
  def input_to_isodoc(file)
20
24
  Asciidoctor.convert(
21
25
  file,
@@ -35,4 +39,4 @@ module Metanorma
35
39
 
36
40
  end
37
41
  end
38
- end
42
+ end
@@ -0,0 +1,448 @@
1
+
2
+
3
+
4
+
5
+ Internet Engineering Task Force E. Davies, Ed.
6
+ Internet-Draft Folly Consulting
7
+ Intended status: Informational April 1, 2010
8
+ Expires: October 3, 2010
9
+
10
+
11
+ Put Your Internet Draft Title Here
12
+ draft-ietf-xml2rfc-template-06
13
+
14
+ Abstract
15
+
16
+ Insert an abstract: MANDATORY. This template is for creating an
17
+ Internet Draft.
18
+
19
+ Status of This Memo
20
+
21
+ This Internet-Draft is submitted in full conformance with the
22
+ provisions of BCP 78 and BCP 79.
23
+
24
+ Internet-Drafts are working documents of the Internet Engineering
25
+ Task Force (IETF). Note that other groups may also distribute
26
+ working documents as Internet-Drafts. The list of current Internet-
27
+ Drafts is at http://datatracker.ietf.org/drafts/current/.
28
+
29
+ Internet-Drafts are draft documents valid for a maximum of six months
30
+ and may be updated, replaced, or obsoleted by other documents at any
31
+ time. It is inappropriate to use Internet-Drafts as reference
32
+ material or to cite them other than as "work in progress."
33
+
34
+ This Internet-Draft will expire on October 3, 2010.
35
+
36
+ Copyright Notice
37
+
38
+ Copyright (c) 2010 IETF Trust and the persons identified as the
39
+ document authors. All rights reserved.
40
+
41
+ This document is subject to BCP 78 and the IETF Trust's Legal
42
+ Provisions Relating to IETF Documents
43
+ (http://trustee.ietf.org/license-info) in effect on the date of
44
+ publication of this document. Please review these documents
45
+ carefully, as they describe your rights and restrictions with respect
46
+ to this document. Code Components extracted from this document must
47
+ include Simplified BSD License text as described in Section 4.e of
48
+ the Trust Legal Provisions and are provided without warranty as
49
+ described in the Simplified BSD License.
50
+
51
+
52
+
53
+
54
+
55
+
56
+ Davies Expires October 3, 2010 [Page 1]
57
+
58
+ Internet-Draft Abbreviated Title April 2010
59
+
60
+
61
+ Table of Contents
62
+
63
+ 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2
64
+ 1.1. Requirements Language . . . . . . . . . . . . . . . . . . 2
65
+ 2. Simple List . . . . . . . . . . . . . . . . . . . . . . . . . 2
66
+ 3. Figures . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
67
+ 4. Subsections and Tables . . . . . . . . . . . . . . . . . . . 3
68
+ 4.1. A Subsection . . . . . . . . . . . . . . . . . . . . . . 3
69
+ 4.2. Tables . . . . . . . . . . . . . . . . . . . . . . . . . 3
70
+ 5. More about Lists . . . . . . . . . . . . . . . . . . . . . . 4
71
+ 5.1. Numbering Lists across Lists and Sections . . . . . . . . 4
72
+ 5.2. Where the List Numbering Continues . . . . . . . . . . . 5
73
+ 6. Example of Code or MIB Module To Be Extracted . . . . . . . . 5
74
+ 7. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 6
75
+ 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 6
76
+ 9. Security Considerations . . . . . . . . . . . . . . . . . . . 7
77
+ 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 7
78
+ 10.1. Normative References . . . . . . . . . . . . . . . . . . 7
79
+ 10.2. Informative References . . . . . . . . . . . . . . . . . 7
80
+ Appendix A. Additional Stuff . . . . . . . . . . . . . . . . . . 7
81
+ Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 8
82
+
83
+ 1. Introduction
84
+
85
+ The original specification of xml2rfc format is in RFC 2629
86
+ [RFC2629].
87
+
88
+ 1.1. Requirements Language
89
+
90
+ The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
91
+ "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
92
+ document are to be interpreted as described in RFC 2119 [RFC2119].
93
+
94
+ 2. Simple List
95
+
96
+ List styles: 'empty', 'symbols', 'letters', 'numbers', 'hanging',
97
+ 'format'.
98
+
99
+ o First bullet
100
+
101
+ o Second bullet
102
+
103
+ You can write text here as well.
104
+
105
+
106
+
107
+
108
+
109
+
110
+
111
+
112
+ Davies Expires October 3, 2010 [Page 2]
113
+
114
+ Internet-Draft Abbreviated Title April 2010
115
+
116
+
117
+ 3. Figures
118
+
119
+ Figures should not exceed 69 characters wide to allow for the indent
120
+ of sections.
121
+
122
+ Preamble text - can be omitted or empty.
123
+
124
+ +-----------------------+
125
+ | Use XML, be Happy :-) |
126
+ |_______________________|
127
+
128
+ Cross-references allowed in pre- and postamble. [min_ref].
129
+
130
+ Figure 1
131
+
132
+ The CDATA means you don't need to escape meta-characters (especially
133
+ < (&lt;) and & (&amp;)) but is not essential. Figures may also have
134
+ a title attribute but it won't be displayed unless there is also an
135
+ anchor. White space, both horizontal and vertical, is significant in
136
+ figures even if you don't use CDATA.
137
+
138
+ 4. Subsections and Tables
139
+
140
+ 4.1. A Subsection
141
+
142
+ By default 3 levels of nesting show in table of contents but that can
143
+ be adjusted with the value of the "tocdepth" processing instruction.
144
+
145
+ 4.2. Tables
146
+
147
+ .. are very similar to figures:
148
+
149
+ Tables use ttcol to define column headers and widths. Every cell
150
+ then has a "c" element for its content.
151
+
152
+ +----------+----------+
153
+ | ttcol #1 | ttcol #2 |
154
+ +----------+----------+
155
+ | c #1 | c #2 |
156
+ | c #3 | c #4 |
157
+ | c #5 | c #6 |
158
+ +----------+----------+
159
+
160
+ which is a very simple example.
161
+
162
+ Table 1: A Very Simple Table
163
+
164
+
165
+
166
+
167
+
168
+ Davies Expires October 3, 2010 [Page 3]
169
+
170
+ Internet-Draft Abbreviated Title April 2010
171
+
172
+
173
+ 5. More about Lists
174
+
175
+ Lists with 'hanging labels': the list item is indented the amount of
176
+ the hangIndent:
177
+
178
+ short With a label shorter than the hangIndent.
179
+
180
+ fantastically long label With a label longer than the hangIndent.
181
+
182
+ vspace_trick
183
+ Forces the new item to start on a new line.
184
+
185
+ Simulating more than one paragraph in a list item using <vspace>:
186
+
187
+ a. First, a short item.
188
+
189
+ b. Second, a longer list item.
190
+
191
+ And something that looks like a separate pararaph..
192
+
193
+ Simple indented paragraph using the "empty" style:
194
+
195
+ The quick, brown fox jumped over the lazy dog and lived to fool
196
+ many another hunter in the great wood in the west.
197
+
198
+ 5.1. Numbering Lists across Lists and Sections
199
+
200
+ Numbering items continuously although they are in separate <list>
201
+ elements, maybe in separate sections using the "format" style and a
202
+ "counter" variable.
203
+
204
+ First list:
205
+
206
+ R1 #1
207
+
208
+ R2 #2
209
+
210
+ R3 #3
211
+
212
+ Specify the indent explicitly so that all the items line up nicely.
213
+
214
+ Second list:
215
+
216
+ R4 #4
217
+
218
+ R5 #5
219
+
220
+ R6 #6
221
+
222
+
223
+
224
+ Davies Expires October 3, 2010 [Page 4]
225
+
226
+ Internet-Draft Abbreviated Title April 2010
227
+
228
+
229
+ 5.2. Where the List Numbering Continues
230
+
231
+ List continues here.
232
+
233
+ Third list:
234
+
235
+ R7 #7
236
+
237
+ R8 #8
238
+
239
+ R9 #9
240
+
241
+ R10 #10
242
+
243
+ The end of the list.
244
+
245
+ 6. Example of Code or MIB Module To Be Extracted
246
+
247
+
248
+
249
+
250
+
251
+
252
+
253
+
254
+
255
+
256
+
257
+
258
+
259
+
260
+
261
+
262
+
263
+
264
+
265
+
266
+
267
+
268
+
269
+
270
+
271
+
272
+
273
+
274
+
275
+
276
+
277
+
278
+
279
+
280
+ Davies Expires October 3, 2010 [Page 5]
281
+
282
+ Internet-Draft Abbreviated Title April 2010
283
+
284
+
285
+ The <artwork> element has a number of extra attributes that can be
286
+ used to substitute a more aesthetically pleasing rendition into HTML
287
+ output while continuing to use the ASCII art version in the text and
288
+ nroff outputs (see the xml2rfc README for details). It also has a
289
+ "type" attribute. This is currently ignored except in the case
290
+ 'type="abnf"'. In this case the "artwork" is expected to contain a
291
+ piece of valid Augmented Backus-Naur Format (ABNF) grammar. This
292
+ will be syntax checked by xml2rfc and any errors will cause a fatal
293
+ error if the "strict" processing instruction is set to "yes". The
294
+ ABNF will also be colorized in HTML output to highlight the syntactic
295
+ components. Checking of additional "types" may be provided in future
296
+ versions of xml2rfc.
297
+
298
+
299
+ /**** an example C program */
300
+
301
+ #include <stdio.h>
302
+
303
+ void
304
+ main(int argc, char *argv[])
305
+ {
306
+ int i;
307
+
308
+ printf("program arguments are:\n");
309
+ for (i = 0; i < argc; i++) {
310
+ printf("%d: \"%s\"\n", i, argv[i]);
311
+ }
312
+
313
+ exit(0);
314
+ } /* main */
315
+
316
+ /* end of file */
317
+
318
+
319
+ 7. Acknowledgements
320
+
321
+ This template was derived from an initial version written by Pekka
322
+ Savola and contributed by him to the xml2rfc project.
323
+
324
+ This document is part of a plan to make xml2rfc indispensable
325
+ [DOMINATION].
326
+
327
+ 8. IANA Considerations
328
+
329
+ This memo includes no request to IANA.
330
+
331
+ All drafts are required to have an IANA considerations section (see
332
+ Guidelines for Writing an IANA Considerations Section in RFCs
333
+
334
+
335
+
336
+ Davies Expires October 3, 2010 [Page 6]
337
+
338
+ Internet-Draft Abbreviated Title April 2010
339
+
340
+
341
+ [RFC5226] for a guide). If the draft does not require IANA to do
342
+ anything, the section contains an explicit statement that this is the
343
+ case (as above). If there are no requirements for IANA, the section
344
+ will be removed during conversion into an RFC by the RFC Editor.
345
+
346
+ 9. Security Considerations
347
+
348
+ All drafts are required to have a security considerations section.
349
+ See RFC 3552 [RFC3552] for a guide.
350
+
351
+ 10. References
352
+
353
+ 10.1. Normative References
354
+
355
+ [min_ref] authSurName, authInitials., "Minimal Reference", 2006.
356
+
357
+ [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
358
+ Requirement Levels", BCP 14, RFC 2119,
359
+ DOI 10.17487/RFC2119, March 1997,
360
+ <https://www.rfc-editor.org/info/rfc2119>.
361
+
362
+ 10.2. Informative References
363
+
364
+ [DOMINATION]
365
+ Mad Dominators, Inc., "Ultimate Plan for Taking Over the
366
+ World", 1984, <http://www.example.com/dominator.html>.
367
+
368
+ [RFC2629] Rose, M., "Writing I-Ds and RFCs using XML", RFC 2629,
369
+ DOI 10.17487/RFC2629, June 1999,
370
+ <https://www.rfc-editor.org/info/rfc2629>.
371
+
372
+ [RFC3552] Rescorla, E. and B. Korver, "Guidelines for Writing RFC
373
+ Text on Security Considerations", BCP 72, RFC 3552,
374
+ DOI 10.17487/RFC3552, July 2003,
375
+ <https://www.rfc-editor.org/info/rfc3552>.
376
+
377
+ [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an
378
+ IANA Considerations Section in RFCs", RFC 5226,
379
+ DOI 10.17487/RFC5226, May 2008,
380
+ <https://www.rfc-editor.org/info/rfc5226>.
381
+
382
+ Appendix A. Additional Stuff
383
+
384
+ This becomes an Appendix.
385
+
386
+
387
+
388
+
389
+
390
+
391
+
392
+ Davies Expires October 3, 2010 [Page 7]
393
+
394
+ Internet-Draft Abbreviated Title April 2010
395
+
396
+
397
+ Author's Address
398
+
399
+ Elwyn Davies (editor)
400
+ Folly Consulting
401
+ Soham
402
+ UK
403
+
404
+ Phone: +44 7889 488 335
405
+ Email: elwynd@dial.pipex.com
406
+
407
+
408
+
409
+
410
+
411
+
412
+
413
+
414
+
415
+
416
+
417
+
418
+
419
+
420
+
421
+
422
+
423
+
424
+
425
+
426
+
427
+
428
+
429
+
430
+
431
+
432
+
433
+
434
+
435
+
436
+
437
+
438
+
439
+
440
+
441
+
442
+
443
+
444
+
445
+
446
+
447
+
448
+ Davies Expires October 3, 2010 [Page 8]