asciidoctor-rfc 0.8.3 → 0.8.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.tb.yml +20 -10
- data/Gemfile +1 -1
- data/README.adoc +28 -0
- data/asciidoctor-rfc.gemspec +1 -1
- data/lib/asciidoctor/rfc/v2/converter.rb +1 -0
- data/lib/asciidoctor/rfc/v3/converter.rb +2 -0
- data/lib/asciidoctor/rfc/version.rb +1 -1
- data/spec/asciidoctor/rfc/v2/paragraph_spec.rb +2 -2
- data/spec/asciidoctor/rfc/v2/section_spec.rb +52 -0
- data/spec/asciidoctor/rfc/v3/paragraph_spec.rb +2 -2
- data/spec/asciidoctor/rfc/v3/section_spec.rb +53 -0
- metadata +4 -5
- data/REQUIREMENTS.adoc +0 -36
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0870e860045d4a8c9d597097567e671c1fa5a6c9'
|
4
|
+
data.tar.gz: 7583fa0df0d6ba3c320d4eae8aadcd5e7abdd5bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ed53a096a521ef2424673d95c71e96b4c8256b9863e4517d72201d4f5b669547e5b9b10a066dbf91f5f57dae76d7a7c173eea03f514ad6a74b223aa132ba744
|
7
|
+
data.tar.gz: fe916106d9dba4a87c2bc88bcdbe0c2af403cc34873dce7e2c877d85cd228764f7fac4651bf9ebf77085853197b1bc05f24fea82b399e719ae435700be79028c
|
data/.rubocop.tb.yml
CHANGED
@@ -352,8 +352,18 @@ Style/TrailingCommaInArguments:
|
|
352
352
|
- no_comma
|
353
353
|
Enabled: true
|
354
354
|
|
355
|
-
Style/
|
356
|
-
Description: 'Checks for trailing comma in array
|
355
|
+
Style/TrailingCommaInArrayLiteral:
|
356
|
+
Description: 'Checks for trailing comma in array literals.'
|
357
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
|
358
|
+
EnforcedStyleForMultiline: comma
|
359
|
+
SupportedStylesForMultiline:
|
360
|
+
- comma
|
361
|
+
- consistent_comma
|
362
|
+
- no_comma
|
363
|
+
Enabled: true
|
364
|
+
|
365
|
+
Style/TrailingCommaInHashLiteral:
|
366
|
+
Description: 'Checks for trailing comma in hash literals.'
|
357
367
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
|
358
368
|
EnforcedStyleForMultiline: comma
|
359
369
|
SupportedStylesForMultiline:
|
@@ -398,6 +408,13 @@ Layout/AlignParameters:
|
|
398
408
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-double-indent'
|
399
409
|
Enabled: false
|
400
410
|
|
411
|
+
Layout/ConditionPosition:
|
412
|
+
Description: >-
|
413
|
+
Checks for condition placed in a confusing position relative to
|
414
|
+
the keyword.
|
415
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#same-line-condition'
|
416
|
+
Enabled: false
|
417
|
+
|
401
418
|
Layout/DotPosition:
|
402
419
|
Description: 'Checks the position of the dot in multi-line method calls.'
|
403
420
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains'
|
@@ -450,13 +467,6 @@ Lint/CircularArgumentReference:
|
|
450
467
|
Description: "Don't refer to the keyword argument in the default value."
|
451
468
|
Enabled: false
|
452
469
|
|
453
|
-
Lint/ConditionPosition:
|
454
|
-
Description: >-
|
455
|
-
Checks for condition placed in a confusing position relative to
|
456
|
-
the keyword.
|
457
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#same-line-condition'
|
458
|
-
Enabled: false
|
459
|
-
|
460
470
|
Lint/DeprecatedClassMethods:
|
461
471
|
Description: 'Check for deprecated class method calls.'
|
462
472
|
Enabled: false
|
@@ -523,7 +533,7 @@ Lint/UnderscorePrefixedVariableName:
|
|
523
533
|
Description: 'Do not use prefix `_` for a variable that is used.'
|
524
534
|
Enabled: false
|
525
535
|
|
526
|
-
Lint/
|
536
|
+
Lint/UnneededCopDisableDirective:
|
527
537
|
Description: >-
|
528
538
|
Checks for rubocop:disable comments that can be removed.
|
529
539
|
Note: this cop is not disabled when disabling all cops.
|
data/Gemfile
CHANGED
data/README.adoc
CHANGED
@@ -884,6 +884,34 @@ Note that fragments (e.g. `crossreference#fragment`) are not supported on the `x
|
|
884
884
|
in either v2 or v3: the RFC XML specification requires that the `xref@target` attribute equals
|
885
885
|
the value of an anchor attribute elsewhere in the document.
|
886
886
|
|
887
|
+
Internal crossreferences and bibliographic references are marked up in the same way; but
|
888
|
+
bibliographic references are marked up separately from the main flow of Asciidoctor, and are
|
889
|
+
processed later.
|
890
|
+
|
891
|
+
NOTE: Normally, Asciidoctor attempts to match a crossreference to a section title, if it does not find
|
892
|
+
a matching anchor ID. This behaviour has become optional as of Asciidoctor 1.5.7, and is suppressed in
|
893
|
+
this gem. If you have a citation of a bibliographic item which is identical to a section title (e.g. you have a
|
894
|
+
bibliographic citation with the anchor "WHIRLPOOL", and a section with the title "WHIRLPOOL"),
|
895
|
+
this gem will correctly pick the former as the target of the reference, so long as that section
|
896
|
+
has a different anchor ID:
|
897
|
+
|
898
|
+
[source,asciidoc]
|
899
|
+
----
|
900
|
+
[[hash_whirlpool]]
|
901
|
+
=== WHIRLPOOL
|
902
|
+
|
903
|
+
The WHIRLPOOL hash function is defined in <<WHIRLPOOL>>.
|
904
|
+
|
905
|
+
This section should actually be referenced as <<hash_whirlpool>>.
|
906
|
+
...
|
907
|
+
|
908
|
+
[bibliography]
|
909
|
+
== Informative References
|
910
|
+
++++
|
911
|
+
<reference anchor='WHIRLPOOL' target='http://www.larc.usp.br/~pbarreto/WhirlpoolPage.html'>
|
912
|
+
...
|
913
|
+
++++
|
914
|
+
----
|
887
915
|
|
888
916
|
=== Indexing
|
889
917
|
|
data/asciidoctor-rfc.gemspec
CHANGED
@@ -37,7 +37,7 @@ Gem::Specification.new do |spec|
|
|
37
37
|
spec.test_files = `git ls-files -- {spec}/*`.split("\n")
|
38
38
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
|
39
39
|
|
40
|
-
spec.add_dependency "asciidoctor", "~> 1.5.
|
40
|
+
spec.add_dependency "asciidoctor", "~> 1.5.7"
|
41
41
|
spec.add_dependency "htmlentities", "~> 4.3.4"
|
42
42
|
spec.add_dependency "nokogiri"
|
43
43
|
spec.add_dependency "ruby-jing"
|
@@ -43,7 +43,7 @@ describe Asciidoctor::RFC::V2::Converter do
|
|
43
43
|
<author fullname="Author"/>
|
44
44
|
<date day="1" month="January" year="2000"/>
|
45
45
|
</front><middle>
|
46
|
-
<section anchor="
|
46
|
+
<section anchor="_dantes_revenge" title="Dante's Revenge">
|
47
47
|
<t>Don't panic!</t>
|
48
48
|
</section>
|
49
49
|
</rfc>
|
@@ -60,7 +60,7 @@ describe Asciidoctor::RFC::V2::Converter do
|
|
60
60
|
== Dante's Revenge
|
61
61
|
Don't panic!
|
62
62
|
INPUT
|
63
|
-
<section anchor="
|
63
|
+
<section anchor="_dantes_revenge" title="Dante’s Revenge">
|
64
64
|
<t>Don’t panic!</t>
|
65
65
|
</section>
|
66
66
|
OUTPUT
|
@@ -290,4 +290,56 @@ describe Asciidoctor::RFC::V2::Converter do
|
|
290
290
|
</rfc>
|
291
291
|
OUTPUT
|
292
292
|
end
|
293
|
+
|
294
|
+
it "supresses natural cross-references" do
|
295
|
+
expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc2, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
|
296
|
+
= Document title
|
297
|
+
:abbrev: abbrev_value
|
298
|
+
:docName:
|
299
|
+
Author
|
300
|
+
|
301
|
+
[[hash_whirlpool]]
|
302
|
+
=== WHIRLPOOL
|
303
|
+
|
304
|
+
The WHIRLPOOL hash function is defined in <<WHIRLPOOL>>.
|
305
|
+
|
306
|
+
This section should actually be referenced as <<hash_whirlpool>>.
|
307
|
+
...
|
308
|
+
|
309
|
+
[bibliography]
|
310
|
+
== Informative References
|
311
|
+
++++
|
312
|
+
<reference anchor='WHIRLPOOL' target='http://www.larc.usp.br/~pbarreto/WhirlpoolPage.html'>
|
313
|
+
...
|
314
|
+
++++
|
315
|
+
INPUT
|
316
|
+
<?xml version="1.0" encoding="US-ASCII"?>
|
317
|
+
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt"?>
|
318
|
+
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
|
319
|
+
<?rfc strict="yes"?>
|
320
|
+
<?rfc compact="yes"?>
|
321
|
+
<?rfc subcompact="no"?>
|
322
|
+
<?rfc toc="yes"?>
|
323
|
+
<?rfc tocdepth="4"?>
|
324
|
+
<?rfc symrefs="yes"?>
|
325
|
+
<?rfc sortrefs="yes"?>
|
326
|
+
<rfc submissionType="IETF">
|
327
|
+
<front>
|
328
|
+
<title abbrev="abbrev_value">Document title</title>
|
329
|
+
<author fullname="Author"/>
|
330
|
+
<date day="1" month="January" year="2000"/>
|
331
|
+
|
332
|
+
</front><middle>
|
333
|
+
<section anchor="hash_whirlpool" title="WHIRLPOOL"><t>The WHIRLPOOL hash function is defined in <xref target="WHIRLPOOL"/>.</t>
|
334
|
+
<t>This section should actually be referenced as <xref target="hash_whirlpool"/>.
|
335
|
+
…​</t></section>
|
336
|
+
</middle><back>
|
337
|
+
<references title="Informative References">
|
338
|
+
<reference anchor="WHIRLPOOL" target="http://www.larc.usp.br/~pbarreto/WhirlpoolPage.html">
|
339
|
+
...</reference>
|
340
|
+
</references>
|
341
|
+
</back>
|
342
|
+
</rfc>
|
343
|
+
OUTPUT
|
344
|
+
end
|
293
345
|
end
|
@@ -46,7 +46,7 @@ describe Asciidoctor::RFC::V3::Converter do
|
|
46
46
|
<date day="1" month="January" year="2000"/>
|
47
47
|
|
48
48
|
</front><middle>
|
49
|
-
<section anchor="
|
49
|
+
<section anchor="_dantes_revenge" numbered="false">
|
50
50
|
<name>Dante's Revenge</name>
|
51
51
|
<t>Don't panic!</t>
|
52
52
|
</section>
|
@@ -64,7 +64,7 @@ describe Asciidoctor::RFC::V3::Converter do
|
|
64
64
|
== Dante's Revenge
|
65
65
|
Don't panic!
|
66
66
|
INPUT
|
67
|
-
<section anchor="
|
67
|
+
<section anchor="_dantes_revenge" numbered="false">
|
68
68
|
<name>Dante’s Revenge</name>
|
69
69
|
<t>Don’t panic!</t>
|
70
70
|
</section>
|
@@ -195,4 +195,57 @@ describe Asciidoctor::RFC::V3::Converter do
|
|
195
195
|
</rfc>
|
196
196
|
OUTPUT
|
197
197
|
end
|
198
|
+
|
199
|
+
it "supresses natural cross-references" do
|
200
|
+
expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc3, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
|
201
|
+
= Document title
|
202
|
+
:abbrev: abbrev_value
|
203
|
+
:docName:
|
204
|
+
Author
|
205
|
+
|
206
|
+
[[hash_whirlpool]]
|
207
|
+
=== WHIRLPOOL
|
208
|
+
|
209
|
+
The WHIRLPOOL hash function is defined in <<WHIRLPOOL>>.
|
210
|
+
|
211
|
+
This section should actually be referenced as <<hash_whirlpool>>.
|
212
|
+
...
|
213
|
+
|
214
|
+
[bibliography]
|
215
|
+
== Informative References
|
216
|
+
++++
|
217
|
+
<reference anchor='WHIRLPOOL' target='http://www.larc.usp.br/~pbarreto/WhirlpoolPage.html'>
|
218
|
+
...
|
219
|
+
++++
|
220
|
+
INPUT
|
221
|
+
<?xml version="1.0" encoding="US-ASCII"?>
|
222
|
+
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt"?>
|
223
|
+
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
|
224
|
+
<?rfc strict="yes"?>
|
225
|
+
<?rfc compact="yes"?>
|
226
|
+
<?rfc subcompact="no"?>
|
227
|
+
<?rfc toc="yes"?>
|
228
|
+
<?rfc tocdepth="4"?>
|
229
|
+
<?rfc symrefs="yes"?>
|
230
|
+
<?rfc sortrefs="yes"?>
|
231
|
+
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" submissionType="IETF" prepTime="2000-01-01T05:00:00Z" version="3">
|
232
|
+
<front>
|
233
|
+
<title abbrev="abbrev_value">Document title</title>
|
234
|
+
<author fullname="Author"/>
|
235
|
+
<date day="1" month="January" year="2000"/>
|
236
|
+
|
237
|
+
</front><middle>
|
238
|
+
<section anchor="hash_whirlpool" numbered="false"><name>WHIRLPOOL</name><t>The WHIRLPOOL hash function is defined in <xref target="WHIRLPOOL"/>.</t>
|
239
|
+
<t>This section should actually be referenced as <xref target="hash_whirlpool"/>.
|
240
|
+
…​</t></section>
|
241
|
+
</middle><back>
|
242
|
+
<references anchor="_informative_references">
|
243
|
+
<name>Informative References</name>
|
244
|
+
<reference anchor="WHIRLPOOL" target="http://www.larc.usp.br/~pbarreto/WhirlpoolPage.html">
|
245
|
+
...</reference>
|
246
|
+
</references>
|
247
|
+
</back>
|
248
|
+
</rfc>
|
249
|
+
OUTPUT
|
250
|
+
end
|
198
251
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asciidoctor-rfc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.5.
|
19
|
+
version: 1.5.7
|
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: 1.5.
|
26
|
+
version: 1.5.7
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: htmlentities
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -254,7 +254,6 @@ files:
|
|
254
254
|
- Guardfile
|
255
255
|
- LICENSE
|
256
256
|
- README.adoc
|
257
|
-
- REQUIREMENTS.adoc
|
258
257
|
- Rakefile
|
259
258
|
- asciidoctor-rfc.gemspec
|
260
259
|
- bin/asciidoctor-rfc2
|
data/REQUIREMENTS.adoc
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
= Requirements
|
2
|
-
|
3
|
-
The aim is to create a new Ruby gem called asciidoctor-rfc that outputs an RFC XML document, as an asciidoctor backend.
|
4
|
-
|
5
|
-
RFC XML is defined in these two documents:
|
6
|
-
|
7
|
-
* https://tools.ietf.org/html/rfc7749[RFC 7749]
|
8
|
-
* https://tools.ietf.org/html/rfc7991[RFC 7991]
|
9
|
-
|
10
|
-
This new gem should allow the following work flow:
|
11
|
-
|
12
|
-
1. RFC-XML-enabled AsciiDoc (we can call this "`AsciiDoc-RFC`")
|
13
|
-
2. Converts to RFC XML via asciidoctor-rfc
|
14
|
-
3. RFC XML can convert to TXT or HTML via the tool https://xml2rfc.tools.ietf.org/[`xml2rfc` (v2)]
|
15
|
-
4. Round-tripping:
|
16
|
-
** from AsciiDoc-RFC to RFC XML, then back to AsciiDoc using https://github.com/riboseinc/rfc2md[`rfc2adoc`]
|
17
|
-
|
18
|
-
There are other tools that create XML RFCs, such as https://github.com/miekg/mmark[MMark] which uses Markdown
|
19
|
-
(conversely https://github.com/riboseinc/rfc2md[`rfc2md`]).
|
20
|
-
|
21
|
-
You will need to define and implement some new asciidoctor commands specifically pertaining to the RFC XML format, such as to support the header fields (author, license, etc.), RFC / Internet Draft citations, etc.
|
22
|
-
|
23
|
-
Work needed:
|
24
|
-
|
25
|
-
1. Creation of the asciidoctor-rfc gem:
|
26
|
-
|
27
|
-
** contains necessary commands to create the RFC XML in v2 and v3 formats
|
28
|
-
** output must be acceptable to the `xml2rfc` tool to create TXT and HTML from there
|
29
|
-
|
30
|
-
2 Recreate RFC 6350 and RFC 5545 in the new AsciiDoc format
|
31
|
-
|
32
|
-
** that can be generated into the same RFC through AsciiDoc-RFC -> RFC XML -> RFC HTML
|
33
|
-
|
34
|
-
3. Any bugfixes or minor enhancements on asciidoctor and asciidoctor-pdf:
|
35
|
-
|
36
|
-
** Should be done through our GitHub account, submit PR to main repo, follow-up and ensure acceptance to the mainline. Code and PR must be attributed to Ribose Inc.
|