rfcxml 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.github/workflows/rake.yml +18 -0
- data/.github/workflows/release.yml +25 -0
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/.rubocop.yml +11 -0
- data/.rubocop_todo.yml +20 -0
- data/CODE_OF_CONDUCT.md +84 -0
- data/Gemfile +12 -0
- data/README.adoc +75 -0
- data/Rakefile +12 -0
- data/bin/console +11 -0
- data/bin/setup +8 -0
- data/lib/rfcxml/v3/abstract.rb +32 -0
- data/lib/rfcxml/v3/address.rb +31 -0
- data/lib/rfcxml/v3/annotation.rb +57 -0
- data/lib/rfcxml/v3/area.rb +17 -0
- data/lib/rfcxml/v3/artset.rb +23 -0
- data/lib/rfcxml/v3/artwork.rb +37 -0
- data/lib/rfcxml/v3/aside.rb +50 -0
- data/lib/rfcxml/v3/author.rb +38 -0
- data/lib/rfcxml/v3/back.rb +25 -0
- data/lib/rfcxml/v3/bcp14.rb +17 -0
- data/lib/rfcxml/v3/blockquote.rb +92 -0
- data/lib/rfcxml/v3/boilerplate.rb +19 -0
- data/lib/rfcxml/v3/br.rb +13 -0
- data/lib/rfcxml/v3/c.rb +33 -0
- data/lib/rfcxml/v3/city.rb +19 -0
- data/lib/rfcxml/v3/cityarea.rb +19 -0
- data/lib/rfcxml/v3/code.rb +19 -0
- data/lib/rfcxml/v3/contact.rb +36 -0
- data/lib/rfcxml/v3/country.rb +19 -0
- data/lib/rfcxml/v3/cref.rb +51 -0
- data/lib/rfcxml/v3/date.rb +23 -0
- data/lib/rfcxml/v3/dd.rb +92 -0
- data/lib/rfcxml/v3/displayreference.rb +19 -0
- data/lib/rfcxml/v3/dl.rb +35 -0
- data/lib/rfcxml/v3/dt.rb +58 -0
- data/lib/rfcxml/v3/em.rb +14 -0
- data/lib/rfcxml/v3/email.rb +19 -0
- data/lib/rfcxml/v3/eref.rb +21 -0
- data/lib/rfcxml/v3/extaddr.rb +19 -0
- data/lib/rfcxml/v3/facsimile.rb +17 -0
- data/lib/rfcxml/v3/figure.rb +57 -0
- data/lib/rfcxml/v3/format.rb +21 -0
- data/lib/rfcxml/v3/front.rb +49 -0
- data/lib/rfcxml/v3/iref.rb +23 -0
- data/lib/rfcxml/v3/keyword.rb +17 -0
- data/lib/rfcxml/v3/li.rb +97 -0
- data/lib/rfcxml/v3/link.rb +19 -0
- data/lib/rfcxml/v3/list.rb +27 -0
- data/lib/rfcxml/v3/middle.rb +19 -0
- data/lib/rfcxml/v3/name.rb +56 -0
- data/lib/rfcxml/v3/note.rb +37 -0
- data/lib/rfcxml/v3/ol.rb +33 -0
- data/lib/rfcxml/v3/organization.rb +25 -0
- data/lib/rfcxml/v3/phone.rb +17 -0
- data/lib/rfcxml/v3/pobox.rb +19 -0
- data/lib/rfcxml/v3/postal.rb +46 -0
- data/lib/rfcxml/v3/postal_line.rb +19 -0
- data/lib/rfcxml/v3/postamble.rb +33 -0
- data/lib/rfcxml/v3/preamble.rb +57 -0
- data/lib/rfcxml/v3/refcontent.rb +28 -0
- data/lib/rfcxml/v3/reference.rb +43 -0
- data/lib/rfcxml/v3/referencegroup.rb +25 -0
- data/lib/rfcxml/v3/references.rb +33 -0
- data/lib/rfcxml/v3/region.rb +19 -0
- data/lib/rfcxml/v3/relref.rb +29 -0
- data/lib/rfcxml/v3/rfc.rb +70 -0
- data/lib/rfcxml/v3/section.rb +78 -0
- data/lib/rfcxml/v3/series_info.rb +27 -0
- data/lib/rfcxml/v3/sortingcode.rb +19 -0
- data/lib/rfcxml/v3/sourcecode.rb +31 -0
- data/lib/rfcxml/v3/spanx.rb +19 -0
- data/lib/rfcxml/v3/street.rb +19 -0
- data/lib/rfcxml/v3/strong.rb +43 -0
- data/lib/rfcxml/v3/sub.rb +49 -0
- data/lib/rfcxml/v3/sup.rb +28 -0
- data/lib/rfcxml/v3/table.rb +37 -0
- data/lib/rfcxml/v3/tbody.rb +21 -0
- data/lib/rfcxml/v3/td.rb +89 -0
- data/lib/rfcxml/v3/text.rb +82 -0
- data/lib/rfcxml/v3/texttable.rb +41 -0
- data/lib/rfcxml/v3/tfoot.rb +21 -0
- data/lib/rfcxml/v3/th.rb +14 -0
- data/lib/rfcxml/v3/thead.rb +21 -0
- data/lib/rfcxml/v3/title.rb +25 -0
- data/lib/rfcxml/v3/toc.rb +19 -0
- data/lib/rfcxml/v3/tr.rb +24 -0
- data/lib/rfcxml/v3/tt.rb +53 -0
- data/lib/rfcxml/v3/ttcol.rb +34 -0
- data/lib/rfcxml/v3/u.rb +25 -0
- data/lib/rfcxml/v3/ul.rb +31 -0
- data/lib/rfcxml/v3/uri.rb +17 -0
- data/lib/rfcxml/v3/vspace.rb +17 -0
- data/lib/rfcxml/v3/workgroup.rb +17 -0
- data/lib/rfcxml/v3/xref.rb +41 -0
- data/lib/rfcxml/v3/xref_text.rb +30 -0
- data/lib/rfcxml/v3.rb +8 -0
- data/lib/rfcxml/version.rb +5 -0
- data/lib/rfcxml.rb +17 -0
- data/reference-docs/v3-modified.rnc +1145 -0
- data/reference-docs/v3.rnc +1145 -0
- data/reference-docs/v3.xsd +1410 -0
- data/reference-docs/xml.xsd +19 -0
- data/rfcxml.gemspec +47 -0
- data/sig/xml2rfc.rbs +4 -0
- metadata +264 -0
data/lib/rfcxml/v3/td.rb
ADDED
@@ -0,0 +1,89 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "lutaml/model"
|
4
|
+
|
5
|
+
require_relative "artset"
|
6
|
+
require_relative "artwork"
|
7
|
+
require_relative "bcp14"
|
8
|
+
require_relative "br"
|
9
|
+
require_relative "cref"
|
10
|
+
require_relative "dl"
|
11
|
+
require_relative "em"
|
12
|
+
require_relative "eref"
|
13
|
+
require_relative "figure"
|
14
|
+
require_relative "iref"
|
15
|
+
require_relative "ol"
|
16
|
+
require_relative "relref"
|
17
|
+
require_relative "sourcecode"
|
18
|
+
require_relative "strong"
|
19
|
+
require_relative "sub"
|
20
|
+
require_relative "sup"
|
21
|
+
require_relative "text"
|
22
|
+
require_relative "tt"
|
23
|
+
require_relative "u"
|
24
|
+
require_relative "ul"
|
25
|
+
require_relative "xref"
|
26
|
+
|
27
|
+
module Rfcxml
|
28
|
+
module V3
|
29
|
+
class Td < Lutaml::Model::Serializable
|
30
|
+
attribute :content, :string
|
31
|
+
attribute :anchor, :string
|
32
|
+
attribute :colspan, :string, default: -> { "1" }
|
33
|
+
attribute :rowspan, :string, default: -> { "1" }
|
34
|
+
attribute :align, :string, default: -> { "left" }
|
35
|
+
attribute :artset, Artset, collection: true
|
36
|
+
attribute :artwork, Artwork, collection: true
|
37
|
+
attribute :dl, Dl, collection: true
|
38
|
+
attribute :figure, Figure, collection: true
|
39
|
+
attribute :ol, Ol, collection: true
|
40
|
+
attribute :sourcecode, Sourcecode, collection: true
|
41
|
+
attribute :t, Text, collection: true
|
42
|
+
attribute :ul, Ul, collection: true
|
43
|
+
attribute :bcp14, Bcp14, collection: true
|
44
|
+
attribute :br, Br, collection: true
|
45
|
+
attribute :cref, Cref, collection: true
|
46
|
+
attribute :em, Em, collection: true
|
47
|
+
attribute :eref, Eref, collection: true
|
48
|
+
attribute :iref, Iref, collection: true
|
49
|
+
attribute :relref, Relref, collection: true
|
50
|
+
attribute :strong, Strong, collection: true
|
51
|
+
attribute :sub, Sub, collection: true
|
52
|
+
attribute :sup, Sup, collection: true
|
53
|
+
attribute :tt, Tt, collection: true
|
54
|
+
attribute :u, U, collection: true
|
55
|
+
attribute :xref, Xref, collection: true
|
56
|
+
|
57
|
+
xml do
|
58
|
+
root "td"
|
59
|
+
|
60
|
+
map_content to: :content
|
61
|
+
map_attribute "anchor", to: :anchor
|
62
|
+
map_attribute "colspan", to: :colspan
|
63
|
+
map_attribute "rowspan", to: :rowspan
|
64
|
+
map_attribute "align", to: :align
|
65
|
+
map_element "artset", to: :artset
|
66
|
+
map_element "artwork", to: :artwork
|
67
|
+
map_element "dl", to: :dl
|
68
|
+
map_element "figure", to: :figure
|
69
|
+
map_element "ol", to: :ol
|
70
|
+
map_element "sourcecode", to: :sourcecode
|
71
|
+
map_element "t", to: :t
|
72
|
+
map_element "ul", to: :ul
|
73
|
+
map_element "bcp14", to: :bcp14
|
74
|
+
map_element "br", to: :br
|
75
|
+
map_element "cref", to: :cref
|
76
|
+
map_element "em", to: :em
|
77
|
+
map_element "eref", to: :eref
|
78
|
+
map_element "iref", to: :iref
|
79
|
+
map_element "relref", to: :relref
|
80
|
+
map_element "strong", to: :strong
|
81
|
+
map_element "sub", to: :sub
|
82
|
+
map_element "sup", to: :sup
|
83
|
+
map_element "tt", to: :tt
|
84
|
+
map_element "u", to: :u
|
85
|
+
map_element "xref", to: :xref
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
@@ -0,0 +1,82 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "lutaml/model"
|
4
|
+
|
5
|
+
require_relative "bcp14"
|
6
|
+
require_relative "br"
|
7
|
+
require_relative "contact"
|
8
|
+
require_relative "cref"
|
9
|
+
require_relative "em"
|
10
|
+
require_relative "eref"
|
11
|
+
require_relative "iref"
|
12
|
+
require_relative "relref"
|
13
|
+
require_relative "spanx"
|
14
|
+
require_relative "strong"
|
15
|
+
require_relative "sub"
|
16
|
+
require_relative "sup"
|
17
|
+
require_relative "tt"
|
18
|
+
require_relative "u"
|
19
|
+
require_relative "vspace"
|
20
|
+
require_relative "xref"
|
21
|
+
|
22
|
+
module Rfcxml
|
23
|
+
module V3
|
24
|
+
class List < Lutaml::Model::Serializable; end
|
25
|
+
|
26
|
+
class Text < Lutaml::Model::Serializable
|
27
|
+
attribute :content, :string
|
28
|
+
attribute :anchor, :string
|
29
|
+
attribute :pn, :string
|
30
|
+
attribute :hang_text, :string
|
31
|
+
attribute :indent, :string, default: -> { "0" }
|
32
|
+
attribute :keep_with_next, :string, default: -> { "false" }
|
33
|
+
attribute :keep_with_previous, :string, default: -> { "false" }
|
34
|
+
attribute :bcp14, Bcp14, collection: true
|
35
|
+
attribute :br, Br, collection: true
|
36
|
+
attribute :contact, Contact, collection: true
|
37
|
+
attribute :cref, Cref, collection: true
|
38
|
+
attribute :em, Em, collection: true
|
39
|
+
attribute :eref, Eref, collection: true
|
40
|
+
attribute :iref, Iref, collection: true
|
41
|
+
attribute :list, List, collection: true
|
42
|
+
attribute :relref, Relref, collection: true
|
43
|
+
attribute :spanx, Spanx, collection: true
|
44
|
+
attribute :strong, Strong, collection: true
|
45
|
+
attribute :sub, Sub, collection: true
|
46
|
+
attribute :sup, Sup, collection: true
|
47
|
+
attribute :tt, Tt, collection: true
|
48
|
+
attribute :u, U, collection: true
|
49
|
+
attribute :vspace, Vspace, collection: true
|
50
|
+
attribute :xref, Xref, collection: true
|
51
|
+
|
52
|
+
xml do
|
53
|
+
root "t", mixed: true
|
54
|
+
|
55
|
+
map_content to: :content
|
56
|
+
map_attribute "anchor", to: :anchor
|
57
|
+
map_attribute "pn", to: :pn
|
58
|
+
map_attribute "hangText", to: :hang_text
|
59
|
+
map_attribute "indent", to: :indent
|
60
|
+
map_attribute "keepWithNext", to: :keep_with_next
|
61
|
+
map_attribute "keepWithPrevious", to: :keep_with_previous
|
62
|
+
map_element "bcp14", to: :bcp14
|
63
|
+
map_element "br", to: :br
|
64
|
+
map_element "contact", to: :contact
|
65
|
+
map_element "cref", to: :cref
|
66
|
+
map_element "em", to: :em
|
67
|
+
map_element "eref", to: :eref
|
68
|
+
map_element "iref", to: :iref
|
69
|
+
map_element "list", to: :list
|
70
|
+
map_element "relref", to: :relref
|
71
|
+
map_element "spanx", to: :spanx
|
72
|
+
map_element "strong", to: :strong
|
73
|
+
map_element "sub", to: :sub
|
74
|
+
map_element "sup", to: :sup
|
75
|
+
map_element "tt", to: :tt
|
76
|
+
map_element "u", to: :u
|
77
|
+
map_element "vspace", to: :vspace
|
78
|
+
map_element "xref", to: :xref
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "lutaml/model"
|
4
|
+
|
5
|
+
require_relative "c"
|
6
|
+
require_relative "name"
|
7
|
+
require_relative "postamble"
|
8
|
+
require_relative "preamble"
|
9
|
+
require_relative "ttcol"
|
10
|
+
|
11
|
+
module Rfcxml
|
12
|
+
module V3
|
13
|
+
class Texttable < Lutaml::Model::Serializable
|
14
|
+
attribute :anchor, :string
|
15
|
+
attribute :title, :string, default: -> { "" }
|
16
|
+
attribute :suppress_title, :string, default: -> { "false" }
|
17
|
+
attribute :align, :string, default: -> { "center" }
|
18
|
+
attribute :style, :string, default: -> { "full" }
|
19
|
+
attribute :name, Name
|
20
|
+
attribute :preamble, Preamble
|
21
|
+
attribute :ttcol, Ttcol, collection: true
|
22
|
+
attribute :c, C, collection: true
|
23
|
+
attribute :postamble, Postamble
|
24
|
+
|
25
|
+
xml do
|
26
|
+
root "texttable"
|
27
|
+
|
28
|
+
map_attribute "anchor", to: :anchor
|
29
|
+
map_attribute "title", to: :title
|
30
|
+
map_attribute "suppress-title", to: :suppress_title
|
31
|
+
map_attribute "align", to: :align
|
32
|
+
map_attribute "style", to: :style
|
33
|
+
map_element "name", to: :name
|
34
|
+
map_element "preamble", to: :preamble
|
35
|
+
map_element "ttcol", to: :ttcol
|
36
|
+
map_element "c", to: :c
|
37
|
+
map_element "postamble", to: :postamble
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "lutaml/model"
|
4
|
+
|
5
|
+
require_relative "tr"
|
6
|
+
|
7
|
+
module Rfcxml
|
8
|
+
module V3
|
9
|
+
class Tfoot < Lutaml::Model::Serializable
|
10
|
+
attribute :anchor, :string
|
11
|
+
attribute :tr, Tr, collection: true
|
12
|
+
|
13
|
+
xml do
|
14
|
+
root "tfoot"
|
15
|
+
|
16
|
+
map_attribute "anchor", to: :anchor
|
17
|
+
map_element "tr", to: :tr
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/lib/rfcxml/v3/th.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "lutaml/model"
|
4
|
+
|
5
|
+
require_relative "tr"
|
6
|
+
|
7
|
+
module Rfcxml
|
8
|
+
module V3
|
9
|
+
class Thead < Lutaml::Model::Serializable
|
10
|
+
attribute :anchor, :string
|
11
|
+
attribute :tr, Tr, collection: true
|
12
|
+
|
13
|
+
xml do
|
14
|
+
root "thead"
|
15
|
+
|
16
|
+
map_attribute "anchor", to: :anchor
|
17
|
+
map_element "tr", to: :tr
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "lutaml/model"
|
4
|
+
|
5
|
+
require_relative "br"
|
6
|
+
|
7
|
+
module Rfcxml
|
8
|
+
module V3
|
9
|
+
class Title < Lutaml::Model::Serializable
|
10
|
+
attribute :content, :string
|
11
|
+
attribute :abbrev, :string
|
12
|
+
attribute :ascii, :string
|
13
|
+
attribute :br, Br, collection: true
|
14
|
+
|
15
|
+
xml do
|
16
|
+
root "title"
|
17
|
+
|
18
|
+
map_content to: :content
|
19
|
+
map_attribute "abbrev", to: :abbrev
|
20
|
+
map_attribute "ascii", to: :ascii
|
21
|
+
map_element "br", to: :br
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "lutaml/model"
|
4
|
+
|
5
|
+
require_relative "section"
|
6
|
+
|
7
|
+
module Rfcxml
|
8
|
+
module V3
|
9
|
+
class Toc < Lutaml::Model::Serializable
|
10
|
+
attribute :section, Section, collection: true
|
11
|
+
|
12
|
+
xml do
|
13
|
+
root "toc"
|
14
|
+
|
15
|
+
map_element "section", to: :section
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/lib/rfcxml/v3/tr.rb
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "lutaml/model"
|
4
|
+
|
5
|
+
require_relative "td"
|
6
|
+
require_relative "th"
|
7
|
+
|
8
|
+
module Rfcxml
|
9
|
+
module V3
|
10
|
+
class Tr < Lutaml::Model::Serializable
|
11
|
+
attribute :anchor, :string
|
12
|
+
attribute :td, Td, collection: true
|
13
|
+
attribute :th, Th, collection: true
|
14
|
+
|
15
|
+
xml do
|
16
|
+
root "tr"
|
17
|
+
|
18
|
+
map_attribute "anchor", to: :anchor
|
19
|
+
map_element "td", to: :td
|
20
|
+
map_element "th", to: :th
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
data/lib/rfcxml/v3/tt.rb
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "lutaml/model"
|
4
|
+
|
5
|
+
require_relative "bcp14"
|
6
|
+
require_relative "br"
|
7
|
+
require_relative "cref"
|
8
|
+
require_relative "em"
|
9
|
+
require_relative "eref"
|
10
|
+
require_relative "iref"
|
11
|
+
require_relative "relref"
|
12
|
+
require_relative "strong"
|
13
|
+
require_relative "sub"
|
14
|
+
require_relative "sup"
|
15
|
+
require_relative "xref"
|
16
|
+
|
17
|
+
module Rfcxml
|
18
|
+
module V3
|
19
|
+
class Cref < Lutaml::Model::Serializable; end
|
20
|
+
|
21
|
+
class Tt < Lutaml::Model::Serializable
|
22
|
+
attribute :content, :string
|
23
|
+
attribute :bcp14, Bcp14, collection: true
|
24
|
+
attribute :br, Br, collection: true
|
25
|
+
attribute :cref, Cref, collection: true
|
26
|
+
attribute :em, Em, collection: true
|
27
|
+
attribute :eref, Eref, collection: true
|
28
|
+
attribute :iref, Iref, collection: true
|
29
|
+
attribute :relref, Relref, collection: true
|
30
|
+
attribute :strong, Strong, collection: true
|
31
|
+
attribute :sub, Sub, collection: true
|
32
|
+
attribute :sup, Sup, collection: true
|
33
|
+
attribute :xref, Xref, collection: true
|
34
|
+
|
35
|
+
xml do
|
36
|
+
root "tt"
|
37
|
+
|
38
|
+
map_content to: :content
|
39
|
+
map_element "bcp14", to: :bcp14
|
40
|
+
map_element "br", to: :br
|
41
|
+
map_element "cref", to: :cref
|
42
|
+
map_element "em", to: :em
|
43
|
+
map_element "eref", to: :eref
|
44
|
+
map_element "iref", to: :iref
|
45
|
+
map_element "relref", to: :relref
|
46
|
+
map_element "strong", to: :strong
|
47
|
+
map_element "sub", to: :sub
|
48
|
+
map_element "sup", to: :sup
|
49
|
+
map_element "xref", to: :xref
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "lutaml/model"
|
4
|
+
|
5
|
+
require_relative "cref"
|
6
|
+
require_relative "eref"
|
7
|
+
require_relative "iref"
|
8
|
+
require_relative "xref"
|
9
|
+
|
10
|
+
module Rfcxml
|
11
|
+
module V3
|
12
|
+
class Ttcol < Lutaml::Model::Serializable
|
13
|
+
attribute :content, :string
|
14
|
+
attribute :width, :string
|
15
|
+
attribute :align, :string, default: -> { "left" }
|
16
|
+
attribute :cref, Cref, collection: true
|
17
|
+
attribute :eref, Eref, collection: true
|
18
|
+
attribute :iref, Iref, collection: true
|
19
|
+
attribute :xref, Xref, collection: true
|
20
|
+
|
21
|
+
xml do
|
22
|
+
root "ttcol"
|
23
|
+
|
24
|
+
map_content to: :content
|
25
|
+
map_attribute "width", to: :width
|
26
|
+
map_attribute "align", to: :align
|
27
|
+
map_element "cref", to: :cref
|
28
|
+
map_element "eref", to: :eref
|
29
|
+
map_element "iref", to: :iref
|
30
|
+
map_element "xref", to: :xref
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
data/lib/rfcxml/v3/u.rb
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "lutaml/model"
|
4
|
+
|
5
|
+
module Rfcxml
|
6
|
+
module V3
|
7
|
+
class U < Lutaml::Model::Serializable
|
8
|
+
attribute :content, :string
|
9
|
+
attribute :anchor, :string
|
10
|
+
attribute :ascii, :string
|
11
|
+
attribute :format, :string, default: -> { "lit-name-num" }
|
12
|
+
attribute :pn, :string
|
13
|
+
|
14
|
+
xml do
|
15
|
+
root "u"
|
16
|
+
|
17
|
+
map_content to: :content
|
18
|
+
map_attribute "anchor", to: :anchor
|
19
|
+
map_attribute "ascii", to: :ascii
|
20
|
+
map_attribute "format", to: :format
|
21
|
+
map_attribute "pn", to: :pn
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
data/lib/rfcxml/v3/ul.rb
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "lutaml/model"
|
4
|
+
|
5
|
+
module Rfcxml
|
6
|
+
module V3
|
7
|
+
class Li < Lutaml::Model::Serializable; end
|
8
|
+
|
9
|
+
class Ul < Lutaml::Model::Serializable
|
10
|
+
attribute :anchor, :string
|
11
|
+
attribute :spacing, :string, default: -> { "normal" }
|
12
|
+
attribute :empty, :string, default: -> { "false" }
|
13
|
+
attribute :bare, :string, default: -> { "false" }
|
14
|
+
attribute :indent, :string, default: -> { "3" }
|
15
|
+
attribute :pn, :string
|
16
|
+
attribute :li, Li, collection: true
|
17
|
+
|
18
|
+
xml do
|
19
|
+
root "ul"
|
20
|
+
|
21
|
+
map_attribute "anchor", to: :anchor
|
22
|
+
map_attribute "spacing", to: :spacing
|
23
|
+
map_attribute "empty", to: :empty
|
24
|
+
map_attribute "bare", to: :bare
|
25
|
+
map_attribute "indent", to: :indent
|
26
|
+
map_attribute "pn", to: :pn
|
27
|
+
map_element "li", to: :li
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "lutaml/model"
|
4
|
+
|
5
|
+
module Rfcxml
|
6
|
+
module V3
|
7
|
+
class Vspace < Lutaml::Model::Serializable
|
8
|
+
attribute :blank_lines, :string, default: -> { "0" }
|
9
|
+
|
10
|
+
xml do
|
11
|
+
root "vspace"
|
12
|
+
|
13
|
+
map_attribute "blankLines", to: :blank_lines
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "lutaml/model"
|
4
|
+
|
5
|
+
module Rfcxml
|
6
|
+
module V3
|
7
|
+
class Workgroup < Lutaml::Model::Serializable
|
8
|
+
attribute :content, :string
|
9
|
+
|
10
|
+
xml do
|
11
|
+
root "workgroup"
|
12
|
+
|
13
|
+
map_content to: :content
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "lutaml/model"
|
4
|
+
|
5
|
+
require_relative "xref_text"
|
6
|
+
|
7
|
+
module Rfcxml
|
8
|
+
module V3
|
9
|
+
class Xref < Lutaml::Model::Serializable
|
10
|
+
attribute :content, :string
|
11
|
+
attribute :target, :string
|
12
|
+
attribute :pageno, :string, default: -> { "false" }
|
13
|
+
attribute :format, :string, default: -> { "default" }
|
14
|
+
attribute :derived_content, :string
|
15
|
+
attribute :section_format, :string, default: -> { "of" }
|
16
|
+
attribute :section, :string
|
17
|
+
attribute :relative, :string
|
18
|
+
attribute :derived_link, :string
|
19
|
+
include XrefText
|
20
|
+
|
21
|
+
xml do
|
22
|
+
root "xref"
|
23
|
+
|
24
|
+
map_content to: :content
|
25
|
+
map_attribute "target", to: :target
|
26
|
+
map_attribute "pageno", to: :pageno
|
27
|
+
map_attribute "format", to: :format
|
28
|
+
map_attribute "derivedContent", to: :derived_content
|
29
|
+
map_attribute "sectionFormat", to: :section_format
|
30
|
+
map_attribute "section", to: :section
|
31
|
+
map_attribute "relative", to: :relative
|
32
|
+
map_attribute "derivedLink", to: :derived_link
|
33
|
+
map_element "em", to: :em
|
34
|
+
map_element "strong", to: :strong
|
35
|
+
map_element "sub", to: :sub
|
36
|
+
map_element "sup", to: :sup
|
37
|
+
map_element "tt", to: :tt
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# require_relative "em"
|
4
|
+
# require_relative "strong"
|
5
|
+
# require_relative "sub"
|
6
|
+
# require_relative "sup"
|
7
|
+
# require_relative "tt"
|
8
|
+
require "lutaml/model"
|
9
|
+
|
10
|
+
module Rfcxml
|
11
|
+
module V3
|
12
|
+
class Strong < Lutaml::Model::Serializable; end
|
13
|
+
class Em < Strong; end
|
14
|
+
class Sub < Lutaml::Model::Serializable; end
|
15
|
+
class Sup < Sub; end
|
16
|
+
class Tt < Lutaml::Model::Serializable; end
|
17
|
+
|
18
|
+
module XrefText
|
19
|
+
def self.included(base)
|
20
|
+
base.class_eval do
|
21
|
+
attribute :em, ::Rfcxml::V3::Em, collection: true
|
22
|
+
attribute :strong, V3::Strong, collection: true
|
23
|
+
attribute :sub, V3::Sub, collection: true
|
24
|
+
attribute :sup, V3::Sup, collection: true
|
25
|
+
attribute :tt, V3::Tt, collection: true
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
data/lib/rfcxml/v3.rb
ADDED
data/lib/rfcxml.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "lutaml/model"
|
4
|
+
|
5
|
+
Lutaml::Model::Config.configure do |config|
|
6
|
+
require "lutaml/model/xml_adapter/nokogiri_adapter"
|
7
|
+
config.xml_adapter = Lutaml::Model::XmlAdapter::NokogiriAdapter
|
8
|
+
end
|
9
|
+
|
10
|
+
module Rfcxml
|
11
|
+
class Error < StandardError; end
|
12
|
+
|
13
|
+
# Your code goes here...
|
14
|
+
end
|
15
|
+
|
16
|
+
require_relative "rfcxml/version"
|
17
|
+
require_relative "rfcxml/v3"
|