coradoc 0.2.0 → 0.3.0
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 +4 -4
- data/.docker/Dockerfile +1 -1
- data/.docker/docker-compose.yml +2 -2
- data/.editorconfig +15 -0
- data/CHANGELOG.md +4 -0
- data/Rakefile +10 -0
- data/coradoc.gemspec +11 -2
- data/exe/reverse_adoc +70 -0
- data/exe/w2a +72 -0
- data/lib/coradoc/document.rb +5 -6
- data/lib/coradoc/element/admonition.rb +8 -6
- data/lib/coradoc/element/attribute_list.rb +2 -2
- data/lib/coradoc/element/audio.rb +1 -1
- data/lib/coradoc/element/author.rb +16 -14
- data/lib/coradoc/element/base.rb +0 -2
- data/lib/coradoc/element/block/core.rb +2 -2
- data/lib/coradoc/element/block/literal.rb +1 -1
- data/lib/coradoc/element/block/sourcecode.rb +2 -2
- data/lib/coradoc/element/image/core.rb +1 -0
- data/lib/coradoc/element/image.rb +0 -1
- data/lib/coradoc/element/inline/bold.rb +1 -0
- data/lib/coradoc/element/inline/highlight.rb +1 -0
- data/lib/coradoc/element/inline/image.rb +1 -0
- data/lib/coradoc/element/inline/italic.rb +1 -0
- data/lib/coradoc/element/inline/link.rb +9 -9
- data/lib/coradoc/element/inline/monospace.rb +1 -0
- data/lib/coradoc/element/inline/quotation.rb +1 -0
- data/lib/coradoc/element/inline/subscript.rb +1 -0
- data/lib/coradoc/element/inline/superscript.rb +1 -0
- data/lib/coradoc/element/inline.rb +0 -1
- data/lib/coradoc/element/list/core.rb +3 -4
- data/lib/coradoc/element/list.rb +0 -1
- data/lib/coradoc/element/list_item.rb +1 -1
- data/lib/coradoc/element/paragraph.rb +1 -1
- data/lib/coradoc/element/revision.rb +18 -16
- data/lib/coradoc/element/table.rb +10 -10
- data/lib/coradoc/element/text_element.rb +21 -15
- data/lib/coradoc/element/title.rb +2 -2
- data/lib/coradoc/element/video.rb +1 -1
- data/lib/coradoc/generator.rb +2 -2
- data/lib/coradoc/legacy_parser.rb +41 -41
- data/lib/coradoc/oscal.rb +2 -4
- data/lib/coradoc/parser/asciidoc/content.rb +15 -15
- data/lib/coradoc/parser/asciidoc/document_attributes.rb +1 -1
- data/lib/coradoc/parser/asciidoc/header.rb +6 -6
- data/lib/coradoc/parser/asciidoc/section.rb +1 -1
- data/lib/coradoc/reverse_adoc/LICENSE.txt +25 -0
- data/lib/coradoc/reverse_adoc/README.adoc +302 -0
- data/lib/coradoc/reverse_adoc/cleaner.rb +113 -0
- data/lib/coradoc/reverse_adoc/config.rb +54 -0
- data/lib/coradoc/reverse_adoc/converters/a.rb +42 -0
- data/lib/coradoc/reverse_adoc/converters/aside.rb +16 -0
- data/lib/coradoc/reverse_adoc/converters/audio.rb +29 -0
- data/lib/coradoc/reverse_adoc/converters/base.rb +100 -0
- data/lib/coradoc/reverse_adoc/converters/blockquote.rb +27 -0
- data/lib/coradoc/reverse_adoc/converters/br.rb +15 -0
- data/lib/coradoc/reverse_adoc/converters/bypass.rb +81 -0
- data/lib/coradoc/reverse_adoc/converters/code.rb +56 -0
- data/lib/coradoc/reverse_adoc/converters/div.rb +18 -0
- data/lib/coradoc/reverse_adoc/converters/drop.rb +22 -0
- data/lib/coradoc/reverse_adoc/converters/em.rb +55 -0
- data/lib/coradoc/reverse_adoc/converters/figure.rb +25 -0
- data/lib/coradoc/reverse_adoc/converters/h.rb +42 -0
- data/lib/coradoc/reverse_adoc/converters/head.rb +23 -0
- data/lib/coradoc/reverse_adoc/converters/hr.rb +15 -0
- data/lib/coradoc/reverse_adoc/converters/ignore.rb +16 -0
- data/lib/coradoc/reverse_adoc/converters/img.rb +93 -0
- data/lib/coradoc/reverse_adoc/converters/li.rb +17 -0
- data/lib/coradoc/reverse_adoc/converters/mark.rb +21 -0
- data/lib/coradoc/reverse_adoc/converters/math.rb +31 -0
- data/lib/coradoc/reverse_adoc/converters/ol.rb +64 -0
- data/lib/coradoc/reverse_adoc/converters/p.rb +23 -0
- data/lib/coradoc/reverse_adoc/converters/pass_through.rb +13 -0
- data/lib/coradoc/reverse_adoc/converters/pre.rb +55 -0
- data/lib/coradoc/reverse_adoc/converters/q.rb +16 -0
- data/lib/coradoc/reverse_adoc/converters/strong.rb +52 -0
- data/lib/coradoc/reverse_adoc/converters/sub.rb +16 -0
- data/lib/coradoc/reverse_adoc/converters/sup.rb +16 -0
- data/lib/coradoc/reverse_adoc/converters/table.rb +69 -0
- data/lib/coradoc/reverse_adoc/converters/td.rb +83 -0
- data/lib/coradoc/reverse_adoc/converters/text.rb +65 -0
- data/lib/coradoc/reverse_adoc/converters/th.rb +14 -0
- data/lib/coradoc/reverse_adoc/converters/tr.rb +22 -0
- data/lib/coradoc/reverse_adoc/converters/video.rb +29 -0
- data/lib/coradoc/reverse_adoc/converters.rb +32 -0
- data/lib/coradoc/reverse_adoc/errors.rb +10 -0
- data/lib/coradoc/reverse_adoc/html_converter.rb +61 -0
- data/lib/coradoc/reverse_adoc.rb +27 -0
- data/lib/coradoc/transformer.rb +24 -14
- data/lib/coradoc/version.rb +1 -1
- data/lib/reverse_adoc.rb +20 -0
- metadata +178 -4
|
@@ -8,10 +8,9 @@ module Coradoc
|
|
|
8
8
|
@title = title
|
|
9
9
|
@id = options.fetch(:id, nil)
|
|
10
10
|
@anchor = @id.nil? ? nil : Inline::Anchor.new(@id)
|
|
11
|
-
@attrs = options.fetch(:attrs,
|
|
11
|
+
@attrs = options.fetch(:attrs, "")
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
-
|
|
15
14
|
def to_adoc
|
|
16
15
|
anchor = @anchor.nil? ? "" : "#{@anchor.to_adoc}\n"
|
|
17
16
|
attrs = @attrs.to_s.empty? ? "" : "#{@attrs.to_adoc}\n"
|
|
@@ -28,7 +27,7 @@ module Coradoc
|
|
|
28
27
|
@columns = columns
|
|
29
28
|
@header = header
|
|
30
29
|
end
|
|
31
|
-
|
|
30
|
+
|
|
32
31
|
def table_header_row?
|
|
33
32
|
@header
|
|
34
33
|
end
|
|
@@ -42,22 +41,23 @@ module Coradoc
|
|
|
42
41
|
def underline_for
|
|
43
42
|
"\n"
|
|
44
43
|
end
|
|
45
|
-
|
|
46
44
|
end
|
|
45
|
+
|
|
47
46
|
class Cell
|
|
48
47
|
attr_reader :anchor
|
|
48
|
+
|
|
49
49
|
def initialize(options = {})
|
|
50
50
|
@id = options.fetch(:id, nil)
|
|
51
51
|
@anchor = @id.nil? ? nil : Inline::Anchor.new(@id)
|
|
52
|
-
@colrowattr = options.fetch(:colrowattr,
|
|
53
|
-
@alignattr = options.fetch(:alignattr,
|
|
54
|
-
@style = options.fetch(:style,
|
|
55
|
-
@content = options.fetch(:content,
|
|
56
|
-
@delim = options.fetch(:delim,
|
|
52
|
+
@colrowattr = options.fetch(:colrowattr, "")
|
|
53
|
+
@alignattr = options.fetch(:alignattr, "")
|
|
54
|
+
@style = options.fetch(:style, "")
|
|
55
|
+
@content = options.fetch(:content, "")
|
|
56
|
+
@delim = options.fetch(:delim, "")
|
|
57
57
|
end
|
|
58
58
|
|
|
59
59
|
def to_adoc
|
|
60
|
-
anchor = @anchor.nil? ? "" :
|
|
60
|
+
anchor = @anchor.nil? ? "" : @anchor.to_adoc.to_s
|
|
61
61
|
content = Coradoc::Generator.gen_adoc(@content)
|
|
62
62
|
"#{@colrowattr}#{@alignattr}#{@style}| #{anchor}#{content}#{@delim}"
|
|
63
63
|
end
|
|
@@ -1,26 +1,32 @@
|
|
|
1
1
|
module Coradoc
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
module Element
|
|
3
|
+
class TextElement
|
|
4
|
+
attr_reader :id, :content, :line_break
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
def initialize(content, options = {})
|
|
7
|
+
@content = content # .to_s
|
|
8
|
+
@id = options.fetch(:id, nil)
|
|
9
|
+
@line_break = options.fetch(:line_break, "")
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def to_adoc
|
|
13
|
+
Coradoc::Generator.gen_adoc(@content)
|
|
14
|
+
end
|
|
13
15
|
end
|
|
14
16
|
end
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
module Element
|
|
19
|
+
class LineBreak
|
|
20
|
+
attr_reader :line_break
|
|
18
21
|
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
def initialize(line_break)
|
|
23
|
+
@line_break = line_break
|
|
24
|
+
end
|
|
21
25
|
end
|
|
22
26
|
end
|
|
23
27
|
|
|
24
|
-
|
|
28
|
+
module Element
|
|
29
|
+
class Highlight < Element::TextElement
|
|
30
|
+
end
|
|
25
31
|
end
|
|
26
32
|
end
|
|
@@ -13,14 +13,14 @@ module Coradoc
|
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
def level
|
|
16
|
-
@
|
|
16
|
+
@level ||= level_from_string
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
def to_adoc
|
|
20
20
|
anchor = @anchor.nil? ? "" : "#{@anchor.to_adoc}\n"
|
|
21
21
|
content = Coradoc::Generator.gen_adoc(@content)
|
|
22
22
|
level_str = "=" * (@level_int + 1)
|
|
23
|
-
|
|
23
|
+
["\n", anchor, level_str, " ", content, "\n"].join("")
|
|
24
24
|
end
|
|
25
25
|
|
|
26
26
|
alias :text :content
|
|
@@ -7,7 +7,7 @@ module Coradoc
|
|
|
7
7
|
@title = title
|
|
8
8
|
@id = options.fetch(:id, nil)
|
|
9
9
|
@anchor = @id.nil? ? nil : Inline::Anchor.new(@id)
|
|
10
|
-
@src = options.fetch(:src,
|
|
10
|
+
@src = options.fetch(:src, "")
|
|
11
11
|
@attributes = options.fetch(:attributes, [])
|
|
12
12
|
# @attributes.add_valid_named('opts')
|
|
13
13
|
end
|
data/lib/coradoc/generator.rb
CHANGED
|
@@ -4,13 +4,13 @@ module Coradoc
|
|
|
4
4
|
if content.is_a?(Array)
|
|
5
5
|
content.map do |elem|
|
|
6
6
|
Coradoc::Generator.gen_adoc(elem)
|
|
7
|
-
end.join(
|
|
7
|
+
end.join("")
|
|
8
8
|
elsif content.respond_to? :to_adoc
|
|
9
9
|
content.to_adoc
|
|
10
10
|
elsif content.is_a?(String)
|
|
11
11
|
content
|
|
12
12
|
elsif content.nil?
|
|
13
|
-
|
|
13
|
+
""
|
|
14
14
|
end
|
|
15
15
|
end
|
|
16
16
|
end
|
|
@@ -23,8 +23,8 @@ module Coradoc
|
|
|
23
23
|
|
|
24
24
|
rule(:text_line) do
|
|
25
25
|
special_character.absent? >>
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
match("[^\n]").repeat(1).as(:text) >>
|
|
27
|
+
line_ending.as(:break)
|
|
28
28
|
end
|
|
29
29
|
|
|
30
30
|
# Common Helpers
|
|
@@ -33,52 +33,52 @@ module Coradoc
|
|
|
33
33
|
|
|
34
34
|
# Document
|
|
35
35
|
rule(:document) do
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
36
|
+
(
|
|
37
|
+
document_attributes.repeat(1).as(:document_attributes) |
|
|
38
|
+
section.as(:section) |
|
|
39
|
+
header.as(:header) |
|
|
40
|
+
block_with_title.as(:block) |
|
|
41
|
+
empty_line.repeat(1) |
|
|
42
|
+
any.as(:unparsed)
|
|
43
|
+
).repeat(1).as(:document)
|
|
44
44
|
end
|
|
45
45
|
|
|
46
46
|
# Header
|
|
47
47
|
rule(:header) do
|
|
48
48
|
match("=") >> space? >> text.as(:title) >> newline >>
|
|
49
|
-
|
|
49
|
+
author.maybe.as(:author) >> revision.maybe.as(:revision)
|
|
50
50
|
end
|
|
51
51
|
|
|
52
52
|
rule(:author) do
|
|
53
53
|
words.as(:first_name) >> str(",") >> space? >> words.as(:last_name) >>
|
|
54
|
-
|
|
54
|
+
space? >> str("<") >> email.as(:email) >> str(">") >> endline
|
|
55
55
|
end
|
|
56
56
|
|
|
57
57
|
rule(:revision) do
|
|
58
58
|
(word >> (str(".") >> word).maybe).as(:number) >>
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
str(",") >> space? >> word.as(:date) >>
|
|
60
|
+
str(":") >> space? >> words.as(:remark) >> newline
|
|
61
61
|
end
|
|
62
62
|
|
|
63
63
|
# DocumentAttributes
|
|
64
64
|
rule(:document_attributes) do
|
|
65
65
|
str(":") >> attribute_name.as(:key) >> str(":") >>
|
|
66
|
-
|
|
66
|
+
space? >> attribute_value.as(:value) >> endline
|
|
67
67
|
end
|
|
68
68
|
|
|
69
69
|
# Section
|
|
70
70
|
rule(:section) do
|
|
71
71
|
heading.as(:title) >>
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
(list.as(:list) |
|
|
73
|
+
blocks.as(:blocks) |
|
|
74
|
+
paragraphs.as(:paragraphs)).maybe
|
|
75
75
|
end
|
|
76
76
|
|
|
77
77
|
# Heading
|
|
78
78
|
rule(:heading) do
|
|
79
79
|
(anchor_name >> newline).maybe >>
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
match("=").repeat(2, 8).as(:level) >>
|
|
81
|
+
space? >> text.as(:text) >> endline.as(:break)
|
|
82
82
|
end
|
|
83
83
|
|
|
84
84
|
rule(:anchor_name) { str("[#") >> keyword.as(:name) >> str("]") }
|
|
@@ -110,51 +110,51 @@ module Coradoc
|
|
|
110
110
|
rule(:block_type) { str("[") >> keyword.as(:type) >> str("]") >> newline }
|
|
111
111
|
|
|
112
112
|
rule(:block_attribute) do
|
|
113
|
-
str("[")
|
|
114
|
-
|
|
113
|
+
str("[") >> keyword.as(:key) >>
|
|
114
|
+
str("=") >> keyword.as(:value) >> str("]")
|
|
115
115
|
end
|
|
116
116
|
|
|
117
117
|
rule(:simple_block) do
|
|
118
118
|
block_attribute.as(:attributes) >> newline >>
|
|
119
|
-
|
|
119
|
+
text_line.repeat(1).as(:lines)
|
|
120
120
|
end
|
|
121
121
|
|
|
122
122
|
rule(:open_block) do
|
|
123
123
|
block_title >>
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
124
|
+
block_type >>
|
|
125
|
+
str("--").as(:delimiter) >> newline >>
|
|
126
|
+
text_line.repeat.as(:lines) >>
|
|
127
|
+
str("--") >> line_ending
|
|
128
128
|
end
|
|
129
129
|
|
|
130
130
|
rule(:example_block) do
|
|
131
131
|
block_title >>
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
132
|
+
block_type >>
|
|
133
|
+
str("====").as(:delimiter) >> newline >>
|
|
134
|
+
text_line.repeat(1).as(:lines) >>
|
|
135
|
+
str("====") >> newline
|
|
136
136
|
end
|
|
137
137
|
|
|
138
138
|
rule(:sidebar_block) do
|
|
139
139
|
block_title >>
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
140
|
+
block_type.maybe >>
|
|
141
|
+
str("****").as(:delimiter) >> newline >>
|
|
142
|
+
text_line.repeat(1).as(:lines) >>
|
|
143
|
+
str("****") >> newline
|
|
144
144
|
end
|
|
145
145
|
|
|
146
146
|
rule(:source_block) do
|
|
147
147
|
block_title >>
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
148
|
+
str("----").as(:delimiter) >> newline >>
|
|
149
|
+
text_line.repeat(1).as(:lines) >>
|
|
150
|
+
str("----") >> newline
|
|
151
151
|
end
|
|
152
152
|
|
|
153
153
|
rule(:quote_block) do
|
|
154
154
|
block_title >>
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
155
|
+
str("____").as(:delimiter) >> newline >>
|
|
156
|
+
text_line.repeat.as(:lines) >>
|
|
157
|
+
str("____") >> newline
|
|
158
158
|
end
|
|
159
159
|
|
|
160
160
|
rule(:block_with_title) do
|
data/lib/coradoc/oscal.rb
CHANGED
|
@@ -15,7 +15,7 @@ module Coradoc
|
|
|
15
15
|
def to_oscal
|
|
16
16
|
{
|
|
17
17
|
"metadata" => _doc.document_attributes.to_hash,
|
|
18
|
-
"groups" => sections_as_groups
|
|
18
|
+
"groups" => sections_as_groups,
|
|
19
19
|
}
|
|
20
20
|
end
|
|
21
21
|
|
|
@@ -80,9 +80,7 @@ module Coradoc
|
|
|
80
80
|
end
|
|
81
81
|
|
|
82
82
|
def build_oscal_prose(paragraph)
|
|
83
|
-
|
|
84
|
-
paragraph.texts.join(" ")
|
|
85
|
-
end
|
|
83
|
+
paragraph&.texts&.join(" ")
|
|
86
84
|
end
|
|
87
85
|
end
|
|
88
86
|
end
|
|
@@ -50,13 +50,13 @@ module Coradoc
|
|
|
50
50
|
block_style("=")
|
|
51
51
|
end
|
|
52
52
|
|
|
53
|
-
def block_style(delimiter="*", repeater = 4)
|
|
53
|
+
def block_style(delimiter = "*", repeater = 4)
|
|
54
54
|
block_title.maybe >>
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
55
|
+
newline.maybe >>
|
|
56
|
+
block_type.maybe >>
|
|
57
|
+
str(delimiter).repeat(repeater).as(:delimiter) >> newline >>
|
|
58
|
+
text_line.repeat(1).as(:lines) >>
|
|
59
|
+
str(delimiter).repeat(repeater) >> newline
|
|
60
60
|
end
|
|
61
61
|
|
|
62
62
|
def block_type
|
|
@@ -65,7 +65,7 @@ module Coradoc
|
|
|
65
65
|
|
|
66
66
|
def highlight
|
|
67
67
|
text_id >> newline >>
|
|
68
|
-
|
|
68
|
+
underline >> highlight_text >> newline
|
|
69
69
|
end
|
|
70
70
|
|
|
71
71
|
def underline
|
|
@@ -79,14 +79,14 @@ module Coradoc
|
|
|
79
79
|
# Table
|
|
80
80
|
def table
|
|
81
81
|
block_title >>
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
82
|
+
str("|===") >> line_ending >>
|
|
83
|
+
table_row.repeat(1).as(:rows) >>
|
|
84
|
+
str("|===") >> line_ending
|
|
85
85
|
end
|
|
86
86
|
|
|
87
87
|
def table_row
|
|
88
|
-
(literal_space? >> str("|") >> (cell_content | empty_cell_content))
|
|
89
|
-
repeat(1).as(:cols) >> line_ending
|
|
88
|
+
(literal_space? >> str("|") >> (cell_content | empty_cell_content))
|
|
89
|
+
.repeat(1).as(:cols) >> line_ending
|
|
90
90
|
end
|
|
91
91
|
|
|
92
92
|
def empty_cell_content
|
|
@@ -98,7 +98,7 @@ module Coradoc
|
|
|
98
98
|
end
|
|
99
99
|
|
|
100
100
|
def literal_space
|
|
101
|
-
(match[
|
|
101
|
+
(match[" "] | match[' \t']).repeat(1)
|
|
102
102
|
end
|
|
103
103
|
|
|
104
104
|
# Override
|
|
@@ -113,7 +113,7 @@ module Coradoc
|
|
|
113
113
|
# Text
|
|
114
114
|
def text_line
|
|
115
115
|
(asciidoc_char_with_id.absent? | text_id) >> literal_space? >>
|
|
116
|
-
|
|
116
|
+
text.as(:text) >> line_ending.as(:break)
|
|
117
117
|
end
|
|
118
118
|
|
|
119
119
|
def asciidoc_char
|
|
@@ -137,7 +137,7 @@ module Coradoc
|
|
|
137
137
|
|
|
138
138
|
def glossary
|
|
139
139
|
keyword.as(:key) >> str("::") >> space? >>
|
|
140
|
-
|
|
140
|
+
text.as(:value) >> line_ending.as(:break)
|
|
141
141
|
end
|
|
142
142
|
|
|
143
143
|
def ordered_list
|
|
@@ -8,8 +8,8 @@ module Coradoc
|
|
|
8
8
|
|
|
9
9
|
def header
|
|
10
10
|
header_title >>
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
author.maybe.as(:author) >>
|
|
12
|
+
revision.maybe.as(:revision) >> newline.maybe
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
def header_title
|
|
@@ -18,14 +18,14 @@ module Coradoc
|
|
|
18
18
|
|
|
19
19
|
def author
|
|
20
20
|
words.as(:first_name) >> str(",") >>
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
space? >> words.as(:last_name) >>
|
|
22
|
+
space? >> str("<") >> email.as(:email) >> str(">") >> newline
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
def revision
|
|
26
26
|
(word >> (str(".") >> word).maybe).as(:number) >>
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
str(",") >> space? >> date.as(:date) >> str(":") >>
|
|
28
|
+
space? >> words.as(:remark) >> newline
|
|
29
29
|
end
|
|
30
30
|
end
|
|
31
31
|
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
BSD 2-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2018, Ribose
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
|
8
|
+
|
|
9
|
+
* Redistributions of source code must retain the above copyright notice, this
|
|
10
|
+
list of conditions and the following disclaimer.
|
|
11
|
+
|
|
12
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
|
13
|
+
this list of conditions and the following disclaimer in the documentation
|
|
14
|
+
and/or other materials provided with the distribution.
|
|
15
|
+
|
|
16
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
17
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
18
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
19
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
20
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
21
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
22
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
23
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
24
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
25
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|