asciidoctor-rfc 0.8.5 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/asciidoctor-rfc.rb +6 -0
- data/lib/asciidoctor/rfc/version.rb +1 -1
- data/lib/metanorma/rfc.rb +8 -0
- data/lib/metanorma/rfc/processor_v2.rb +38 -0
- data/lib/metanorma/rfc/processor_v3.rb +38 -0
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 0a6bea3ae379ea8404bb2554c297ac8021f575dc09c5e11cb5ddb72802bed384
|
4
|
+
data.tar.gz: c530c5f75c72755c9b78240dff2117a098d15d695854cfbcc3d77fd77eb305af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1aec907eef6a4f4ba30d58d182242217fa679348dba0e33b805efaca7f5a9fb95326a2b87c2a7a571b5548642bf0aba572f2972d012e01e421fa694af961cb10
|
7
|
+
data.tar.gz: e601d621850627bb9899477f1488f75fd37fbea898cbcd17b8be45f25446d2405b649a25dfc733d5c3bcff948801d9127dc9fb8ba699c9ad1c41d9a6080eb68c
|
data/lib/asciidoctor-rfc.rb
CHANGED
@@ -2,3 +2,9 @@ require "asciidoctor" unless defined? Asciidoctor::Converter
|
|
2
2
|
require_relative "asciidoctor/rfc/v2/converter"
|
3
3
|
require_relative "asciidoctor/rfc/v3/converter"
|
4
4
|
require_relative "asciidoctor/rfc/version"
|
5
|
+
|
6
|
+
if defined? Metanorma
|
7
|
+
require_relative "metanorma/rfc"
|
8
|
+
Metanorma::Registry.instance.register(Metanorma::Rfc::ProcessorV2)
|
9
|
+
Metanorma::Registry.instance.register(Metanorma::Rfc::ProcessorV3)
|
10
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require "metanorma/processor"
|
2
|
+
|
3
|
+
module Metanorma
|
4
|
+
module Rfc
|
5
|
+
class ProcessorV2 < Metanorma::Processor
|
6
|
+
|
7
|
+
def initialize
|
8
|
+
@short = :rfc2
|
9
|
+
@input_format = :asciidoc
|
10
|
+
@asciidoctor_backend = :rfc2
|
11
|
+
end
|
12
|
+
|
13
|
+
def output_formats
|
14
|
+
{
|
15
|
+
xmlrfc: "v2.xml"
|
16
|
+
}
|
17
|
+
end
|
18
|
+
|
19
|
+
def input_to_isodoc(file)
|
20
|
+
Asciidoctor.convert(
|
21
|
+
file,
|
22
|
+
to_file: false,
|
23
|
+
safe: :safe,
|
24
|
+
backend: @asciidoctor_backend,
|
25
|
+
header_footer: true
|
26
|
+
)
|
27
|
+
end
|
28
|
+
|
29
|
+
def output(isodoc_node, outname, format, options={})
|
30
|
+
case format
|
31
|
+
when :xmlrfc
|
32
|
+
File.open(outname, 'w') { |file| file << isodoc_node }
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require "metanorma/processor"
|
2
|
+
|
3
|
+
module Metanorma
|
4
|
+
module Rfc
|
5
|
+
class ProcessorV3 < Metanorma::Processor
|
6
|
+
|
7
|
+
def initialize
|
8
|
+
@short = :rfc3
|
9
|
+
@input_format = :asciidoc
|
10
|
+
@asciidoctor_backend = :rfc3
|
11
|
+
end
|
12
|
+
|
13
|
+
def output_formats
|
14
|
+
{
|
15
|
+
xmlrfc: "v3.xml"
|
16
|
+
}
|
17
|
+
end
|
18
|
+
|
19
|
+
def input_to_isodoc(file)
|
20
|
+
Asciidoctor.convert(
|
21
|
+
file,
|
22
|
+
to_file: false,
|
23
|
+
safe: :safe,
|
24
|
+
backend: @asciidoctor_backend,
|
25
|
+
header_footer: true
|
26
|
+
)
|
27
|
+
end
|
28
|
+
|
29
|
+
def output(isodoc_node, outname, format, options={})
|
30
|
+
case format
|
31
|
+
when :xmlrfc
|
32
|
+
File.open(outname, 'w') { |file| file << isodoc_node }
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
end
|
38
|
+
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.
|
4
|
+
version: 0.9.0
|
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-06-
|
11
|
+
date: 2018-06-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|
@@ -283,6 +283,9 @@ files:
|
|
283
283
|
- lib/asciidoctor/rfc/v3/validate.rb
|
284
284
|
- lib/asciidoctor/rfc/v3/validate.rng
|
285
285
|
- lib/asciidoctor/rfc/version.rb
|
286
|
+
- lib/metanorma/rfc.rb
|
287
|
+
- lib/metanorma/rfc/processor_v2.rb
|
288
|
+
- lib/metanorma/rfc/processor_v3.rb
|
286
289
|
- rfc2629-other.ent
|
287
290
|
- rfc2629-xhtml.ent
|
288
291
|
- rfc2629.dtd
|
@@ -474,7 +477,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
474
477
|
version: '0'
|
475
478
|
requirements: []
|
476
479
|
rubyforge_project:
|
477
|
-
rubygems_version: 2.
|
480
|
+
rubygems_version: 2.7.7
|
478
481
|
signing_key:
|
479
482
|
specification_version: 4
|
480
483
|
summary: asciidoctor-rfc lets you write Internet-Drafts and RFCs in AsciiDoc.
|