legal_markdown 0.4.8 → 0.4.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,90 +8,127 @@ require 'optparse'
8
8
  module LegalMarkdown
9
9
 
10
10
  def self.parse(*args)
11
- if args.size == 1 && args.first.class == Array
12
- args = args.first
13
- end
14
11
 
15
12
  config={}
16
13
  config[:input] = {}
17
14
  config[:output] = {}
18
15
 
16
+ if args.size == 1 && args.first.class == Array
17
+ args = args.first
18
+ end
19
+ args, config = optsparse args, config
20
+
21
+ if args.size >= 1
22
+ caller args, config
23
+ else
24
+ puts opt_parser
25
+ end
26
+
27
+ end
28
+
29
+ def self.optsparse args, config
19
30
  opt_parser = OptionParser.new do |opt|
20
- opt.banner = "Usage: legal2md [commands] [input_file] [output_file]"
21
- opt.separator ""
22
- opt.separator "[input_file] can be a file or use \"-\" for STDIN"
23
- opt.separator "[output_file] can be a file or use \"-\" for STDOUT"
24
- opt.separator ""
25
- opt.separator "Specific Commands:"
26
-
27
- config[:output][:markdown] = false
28
- opt.on( '-m', '--to-markdown', 'Parse the Legal Markdown file and produce a Text document (md, rst, txt, etc.).' ) do
29
- config[:output][:markdown] = true
30
- end
31
-
32
- config[:output][:jason] = false
33
- opt.on( '-j', '--to-json', 'Parse the Legal Markdown file and produce a JSON document.' ) do
34
- config[:output][:jason] = true
35
- end
36
-
37
- config[:verbose] = false
38
- opt.on('--verbose', 'Debug legal_markdown. Only works with output options, not with headers switch.') do
39
- config[:verbose] = true
40
- end
41
-
42
- config[:headers] = false
43
- opt.on( '-d', '--headers', 'Make the YAML Frontmatter automatically.' ) do
44
- config[:headers] = true
45
- end
46
-
47
- if args.include? :headers
48
- config[:headers] = true
49
- args.delete :headers
50
- end
51
-
52
- if args.include?( :to_json ) || (begin args[-1][/\.json/]; rescue; end;)
53
- config[:output][:jason] = true
54
- args.delete(:to_json) if args.include?( :to_json )
55
- end
56
-
57
- if args.include? :to_markdown || (begin args[-1][/\.md|\.markdown/]; rescue; end;)
58
- config[:output][:markdown] = true
59
- args.delete :markdown
60
- end
61
-
62
- opt.on( '-v', '--version', 'Display the gem\'s current version that you are using.' ) do
63
- puts 'Legal Markdown version ' + LegalMarkdown::VERSION
64
- exit
65
- end
66
-
67
- opt.on( '-h', '--help', 'Display this screen at any time.' ) do
68
- puts opt_parser
69
- exit
70
- end
71
-
72
- opt.separator ""
73
- opt.separator "Notes:"
74
- opt.separator "If the command is --headers or with --to-markdown you can enter one file to be parsed if you wish."
75
- opt.separator "When these commands are called with only one file I will set the input_file and the output_file to be the same."
76
- opt.separator "The other commands will require the original legal_markdown file and the output file."
77
- opt.separator "There is no need to explicitly enter the --to-json if your output_file is *.json I can handle it."
78
- opt.separator "There is no need to explicitly enter the --to-markdown if your output_file is *.md or *.markdown I can handle it."
79
- opt.separator ""
31
+ optsheaders opt
32
+ optsmarkdown opt, config, args
33
+ optsjason opt, config, args
34
+ optsmakeyaml opt, config, args
35
+ optsmakeother opt, config, args
36
+ optsfooters opt
80
37
  end
81
38
 
82
39
  opt_parser.parse!(args)
40
+ return args, config
41
+ end
83
42
 
84
- if args.size >= 1
85
- if config[:headers]
86
- MakeYamlFrontMatter.new(args)
87
- elsif config[:output][:jason]
88
- LegalToMarkdown.parse_jason(args, config[:verbose])
89
- elsif config[:output][:markdown] || args.size <= 2
90
- LegalToMarkdown.parse_markdown(args, config[:verbose])
91
- end
92
- else
43
+ def self.caller args, config
44
+ if config[:headers]
45
+ MakeYamlFrontMatter.new(args)
46
+ elsif config[:output][:jason]
47
+ LegalToMarkdown.parse_jason(args, config[:verbose])
48
+ elsif config[:output][:markdown] || args.size <= 2
49
+ LegalToMarkdown.parse_markdown(args, config[:verbose])
50
+ end
51
+ end
52
+
53
+ def self.optsheaders opt
54
+ opt.banner = "Usage: legal2md [commands] [input_file] [output_file]"
55
+ opt.separator ""
56
+ opt.separator "[input_file] can be a file or use \"-\" for STDIN"
57
+ opt.separator "[output_file] can be a file or use \"-\" for STDOUT"
58
+ opt.separator ""
59
+ opt.separator "Specific Commands:"
60
+ end
61
+
62
+ def self.optsmarkdown opt, config, args
63
+
64
+ config[:output][:markdown] = false
65
+ opt.on( '-m', '--to-markdown', 'Parse the Legal Markdown file and produce a Text document (md, rst, txt, etc.).' ) do
66
+ config[:output][:markdown] = true
67
+ end
68
+
69
+ if args.include?(:to_markdown) || (begin args[-1][/\.md|\.markdown/]; rescue; end;)
70
+ config[:output][:markdown] = true
71
+ args.delete :markdown
72
+ end
73
+
74
+ end
75
+
76
+ def self.optsjason opt, config, args
77
+
78
+ config[:output][:jason] = false
79
+ opt.on( '-j', '--to-json', 'Parse the Legal Markdown file and produce a JSON document.' ) do
80
+ config[:output][:jason] = true
81
+ end
82
+
83
+ if args.include?(:to_json) || (begin args[-1][/\.json/]; rescue; end;)
84
+ config[:output][:jason] = true
85
+ args.delete(:to_json) if args.include?( :to_json )
86
+ end
87
+
88
+ end
89
+
90
+ def self.optsmakeyaml opt, config, args
91
+
92
+ config[:headers] = false
93
+ opt.on( '-d', '--headers', 'Make the YAML Frontmatter automatically.' ) do
94
+ config[:headers] = true
95
+ end
96
+
97
+ if args.include? :headers
98
+ config[:headers] = true
99
+ args.delete :headers
100
+ end
101
+
102
+ end
103
+
104
+ def self.optsmakeother opt, config, args
105
+
106
+ config[:verbose] = false
107
+ opt.on('--verbose', 'Debug legal_markdown. Only works with output options, not with headers switch.') do
108
+ config[:verbose] = true
109
+ end
110
+
111
+ opt.on( '-v', '--version', 'Display the gem\'s current version that you are using.' ) do
112
+ puts 'Legal Markdown version ' + LegalMarkdown::VERSION
113
+ exit
114
+ end
115
+
116
+ opt.on( '-h', '--help', 'Display this screen at any time.' ) do
93
117
  puts opt_parser
118
+ exit
94
119
  end
120
+
121
+ end
122
+
123
+ def self.optsfooters opt
124
+ opt.separator ""
125
+ opt.separator "Notes:"
126
+ opt.separator "If the command is --headers or with --to-markdown you can enter one file to be parsed if you wish."
127
+ opt.separator "When these commands are called with only one file I will set the input_file and the output_file to be the same."
128
+ opt.separator "The other commands will require the original legal_markdown file and the output file."
129
+ opt.separator "There is no need to explicitly enter the --to-json if your output_file is *.json I can handle it."
130
+ opt.separator "There is no need to explicitly enter the --to-markdown if your output_file is *.md or *.markdown I can handle it."
131
+ opt.separator ""
95
132
  end
96
133
  end
97
134
 
@@ -30,58 +30,33 @@ module LegalToMarkdown
30
30
  end
31
31
 
32
32
  def parse_controller source
33
- verbose_after_load source if @verbose
33
+ verbose_after_process source, 'loading'
34
34
  source.run_mixins if source.mixins
35
- verbose_after_mixins source if @verbose
35
+ verbose_after_process source, 'mixins'
36
36
  source.run_leaders if source.leaders
37
- verbose_after_leaders source if @verbose
37
+ verbose_after_process source, 'headers'
38
38
  source.build_jason if source.writer == :jason
39
39
  write_it(source.content, source.writer)
40
40
  end
41
41
 
42
- def verbose_after_load source
43
- puts
44
- puts
45
- puts Paint["Here's what I found after loading.", :blue, :bold]
46
- puts Paint['==================================', :blue]
47
- puts
48
- puts Paint["The Headers I found are:", :green, :bold]
49
- puts Paint['------------------------', :green]
50
- puts Paint[(source.headers), :magenta]
51
- puts
52
- puts Paint["The Content I found is:", :green, :bold]
53
- puts Paint['-----------------------', :green]
54
- puts Paint[(source.content), :yellow]
55
- puts
56
- puts Paint["There are MIXINS to be parsed.", :red, :bold] if source.mixins
57
- puts Paint["There are STRUCTURED HEADERS to be parsed.", :red, :bold] if source.leaders
58
- end
59
-
60
- def verbose_after_mixins source
61
- puts
62
- puts Paint["Here's what I found after the mixins.", :blue, :bold]
63
- puts Paint['=====================================', :blue]
64
- puts
65
- puts Paint["The Headers I found are:", :green, :bold]
66
- puts Paint['------------------------', :green]
67
- puts Paint[(source.headers), :magenta]
68
- puts
69
- puts Paint["The Content I found is:", :green, :bold]
70
- puts Paint['-----------------------', :green]
71
- puts Paint[(source.content), :yellow]
72
- end
73
-
74
- def verbose_after_leaders source
75
- puts
76
- puts Paint["Here's what I found after the headers.", :blue, :bold]
77
- puts Paint['=====================================', :blue]
78
- puts
79
- puts Paint["The Headers I found are:", :green, :bold]
80
- puts Paint['------------------------', :green]
81
- puts Paint[(source.headers), :magenta]
82
- puts
83
- puts Paint["The Content I found is:", :green, :bold]
84
- puts Paint['-----------------------', :green]
85
- puts Paint[(source.content), :yellow]
42
+ def verbose_after_process source, action
43
+ if @verbose
44
+ puts
45
+ puts Paint["Here's what I found after running the #{action}.", :blue, :bold]
46
+ puts Paint['=============================================', :blue]
47
+ puts
48
+ puts Paint["The Headers I found are:", :green, :bold]
49
+ puts Paint['------------------------', :green]
50
+ puts Paint[(source.headers), :magenta]
51
+ puts
52
+ puts Paint["The Content I found is:", :green, :bold]
53
+ puts Paint['-----------------------', :green]
54
+ puts Paint[(source.content), :yellow]
55
+ if action == 'loading'
56
+ puts
57
+ puts Paint["There are MIXINS to be parsed.", :red, :bold] if source.mixins
58
+ puts Paint["There are STRUCTURED HEADERS to be parsed.", :red, :bold] if source.leaders
59
+ end
60
+ end
86
61
  end
87
62
  end
@@ -64,6 +64,9 @@ module LegalToMarkdown
64
64
  def get_file( file )
65
65
  begin
66
66
  f = File::read(file)
67
+ f.gsub!("\xEF\xBB\xBF".force_encoding("UTF-8"), '')
68
+ f.gsub!("\xC3\xAF\xC2\xBB\xC2\xBF".force_encoding("UTF-8"), '')
69
+ f
67
70
  rescue => e
68
71
  puts "Sorry, I could not read the file #{file}: #{e.message}."
69
72
  exit 0
@@ -77,9 +80,14 @@ module LegalToMarkdown
77
80
  end
78
81
 
79
82
  def string_guard strings
80
- if strings =~ /(:\s*(\d+\.))$/
81
- strings = strings.gsub($1, ": \"" + $2 + "\"" )
83
+ strings.scan(/\:(\S.*)$/){ |m| strings = strings.gsub( m[0], " " + m[0] ) }
84
+ strings.scan(/^((level-\d+:)(.+)\"*)$/) do |m|
85
+ line = m[0]; level = m[1]; field = m[2]
86
+ if field !=~ /(.+)\.\z/ || field !=~ /(.+)\)\z/
87
+ strings = strings.gsub(line, level + " " + field.lstrip + ".")
88
+ end
82
89
  end
90
+ strings.scan(/(:\s*(\d+\.))$/){ |m| strings = strings.gsub( m[0], ": \"" + m[1] + "\"" ) }
83
91
  strings
84
92
  end
85
93
  end
@@ -6,7 +6,7 @@ module LegalToMarkdown
6
6
  require 'json' if writer == :jason
7
7
  if @output_file && @output_file != "-"
8
8
  File.open(@output_file, "w") {|f| f.write( final_content ); f.close } if writer == :markdown
9
- File.open(@output_file, "w") { |f| IO.write( f, JSON.pretty_generate( final_content ) ); f.close } if writer == :jason
9
+ File.open(@output_file, "w") { |f| f.write( JSON.pretty_generate( final_content ) ); f.close } if writer == :jason
10
10
  else
11
11
  STDOUT.write final_content
12
12
  end
@@ -18,6 +18,9 @@ class MakeYamlFrontMatter
18
18
  begin
19
19
  source_file = @input_file == "-" ? STDIN.read : File::read(@input_file)
20
20
  source_file = guard_partials_start source_file
21
+ source_file.gsub!("\xEF\xBB\xBF".force_encoding("UTF-8"), '')
22
+ source_file.gsub!("\xC3\xAF\xC2\xBB\xC2\xBF".force_encoding("UTF-8"), '')
23
+ source_file
21
24
  rescue
22
25
  puts "Sorry, I could not read the input file #{@input_file}."
23
26
  exit 0
@@ -40,7 +43,7 @@ class MakeYamlFrontMatter
40
43
  def scan_and_filter_yaml
41
44
  mixin_pattern = /[^\[]{{(\S+)}}/
42
45
  opt_clauses_pattern = /\[{{(\S+)}}/
43
- @structured_headers_pattern = /(^l+.|^l\d+.)/
46
+ @structured_headers_pattern = /(^l+\.|^l\d+\.)/
44
47
  @yaml_data_as_array = []
45
48
  @yaml_data_as_array << ( filter_yaml mixin_pattern || {} )
46
49
  @yaml_data_as_array << ( filter_yaml opt_clauses_pattern || {} )
@@ -119,9 +122,14 @@ class MakeYamlFrontMatter
119
122
  end
120
123
 
121
124
  def guard_strings strings
122
- if strings =~ /(:\s*(\d+\.))$/
123
- strings = strings.gsub($1, ": \"" + $2 + "\"" )
125
+ strings.scan(/\:(\S.*)$/){ |m| strings = strings.gsub( m[0], " " + m[0] ) }
126
+ strings.scan(/^((level-\d+:)(.+)\"*)$/) do |m|
127
+ line = m[0]; level = m[1]; field = m[2]
128
+ if field !=~ /(.+)\.\z/ || field !=~ /(.+)\)\z/
129
+ strings = strings.gsub(line, level + " " + field.lstrip + ".")
130
+ end
124
131
  end
132
+ strings.scan(/(:\s*(\d+\.))$/){ |m| strings = strings.gsub( m[0], ": \"" + m[1] + "\"" ) }
125
133
  strings
126
134
  end
127
135
 
@@ -1,3 +1,3 @@
1
1
  module LegalMarkdown
2
- VERSION = "0.4.8"
2
+ VERSION = "0.4.9"
3
3
  end
@@ -0,0 +1,60 @@
1
+ ---
2
+
3
+ # Mixins
4
+ contract_title: "Non-Disclosure Agreement"
5
+ forum: "New York, New York"
6
+
7
+ # Optional Clauses
8
+ arbitration_clause: "false"
9
+ judicial_forum_clause: "true"
10
+
11
+ # Structured Headers
12
+ level-1: "1."
13
+ level-2: "A."
14
+ level-3: "i."
15
+
16
+ # Properties
17
+ no-indent: ""
18
+ no-reset: ""
19
+ level-style: ""
20
+
21
+ ---
22
+
23
+ ```
24
+
25
+ l. {{contract_title}}
26
+
27
+ ll. Definitions
28
+
29
+ lll. "Agreement" means this certain Non-Disclosure Agreement dated 6 August, 201
30
+ 3.
31
+
32
+ lll. "Control" means to own or control, directly or indirectly, more than 50% of
33
+ voting shares.
34
+
35
+ lll. "Information" means confidential information disclosed under this Agreement
36
+ .
37
+
38
+ ll. Form Of Disclosure. Information may be disclosed:
39
+
40
+ lll. in writing;
41
+
42
+ lll. by oral presentation;
43
+
44
+ lll. by visual presentation;
45
+
46
+ lll. by Discloser giving Recipient access to a database or digital archive of an
47
+ y kind; or
48
+
49
+ lll. by delivery of physical objects.
50
+
51
+ [{{arbitration_clause}}ll. Arbitration.
52
+ Any controversy or claim arising out of or relating to this Agreement, or the br
53
+ each thereof, whether sounding in contract, tort, or otherwise, shall be settled
54
+ by arbitration administered by the American Arbitration Association under its C
55
+ ommercial Arbitration Rules, and judgment on the award rendered by the arbitrato
56
+ r(s) may be entered in any court having jurisdiction thereof.]
57
+ [{{judicial_forum_clause}}ll. Dispute Resolution.
58
+ Any controversy or claim arising out of or relating to this Agreement, or the br
59
+ each thereof, whether sounding in contract, tort, or otherwise, shall be decided
60
+ solely and exclusively by State or Federal courts located in {{forum}}.]
@@ -0,0 +1,256 @@
1
+ {
2
+ "id": "3baaba6229d833856b6f415badb4962c",
3
+ "nodes": {
4
+ "document": {
5
+ "title": "",
6
+ "abstract": "",
7
+ "views": [
8
+ "content"
9
+ ]
10
+ },
11
+ "provision:500605d1a906c2a11aae31bbbb98de3a": {
12
+ "id": "provision:500605d1a906c2a11aae31bbbb98de3a",
13
+ "type": "provision",
14
+ "data": {
15
+ "level": "1",
16
+ "provision_reference": "1.",
17
+ "provision_text": "Non-Disclosure Agreement",
18
+ "citation": "",
19
+ "substitution": [
20
+ "type0",
21
+ "",
22
+ "",
23
+ "2",
24
+ ".",
25
+ null,
26
+ ""
27
+ ]
28
+ }
29
+ },
30
+ "provision:dd1ca6ff2b29be1912fbf1276bab6fc6": {
31
+ "id": "provision:dd1ca6ff2b29be1912fbf1276bab6fc6",
32
+ "type": "provision",
33
+ "data": {
34
+ "level": "2",
35
+ "provision_reference": "A.",
36
+ "provision_text": "Definitions",
37
+ "citation": "",
38
+ "substitution": [
39
+ "type5",
40
+ "",
41
+ "",
42
+ "C",
43
+ ".",
44
+ null,
45
+ " "
46
+ ]
47
+ }
48
+ },
49
+ "provision:287868a85dd0f9e115ba07f5bd6d4641": {
50
+ "id": "provision:287868a85dd0f9e115ba07f5bd6d4641",
51
+ "type": "provision",
52
+ "data": {
53
+ "level": "3",
54
+ "provision_reference": "i.",
55
+ "provision_text": "\"Agreement\" means this certain Non-Disclosure Agreement dated 6 August, 201\n3.",
56
+ "citation": "",
57
+ "substitution": [
58
+ "type3",
59
+ "",
60
+ "",
61
+ "i",
62
+ ".",
63
+ null,
64
+ " "
65
+ ]
66
+ }
67
+ },
68
+ "provision:e0b084042d99777fca77ee4c5d354a6a": {
69
+ "id": "provision:e0b084042d99777fca77ee4c5d354a6a",
70
+ "type": "provision",
71
+ "data": {
72
+ "level": "3",
73
+ "provision_reference": "ii.",
74
+ "provision_text": "\"Control\" means to own or control, directly or indirectly, more than 50% of\n voting shares.",
75
+ "citation": "",
76
+ "substitution": [
77
+ "type3",
78
+ "",
79
+ "",
80
+ "i",
81
+ ".",
82
+ null,
83
+ " "
84
+ ]
85
+ }
86
+ },
87
+ "provision:a0023de08371e6bde054f4304fc07fd6": {
88
+ "id": "provision:a0023de08371e6bde054f4304fc07fd6",
89
+ "type": "provision",
90
+ "data": {
91
+ "level": "3",
92
+ "provision_reference": "iii.",
93
+ "provision_text": "\"Information\" means confidential information disclosed under this Agreement\n.",
94
+ "citation": "",
95
+ "substitution": [
96
+ "type3",
97
+ "",
98
+ "",
99
+ "i",
100
+ ".",
101
+ null,
102
+ " "
103
+ ]
104
+ }
105
+ },
106
+ "provision:be136d13c2dbecab3ba18c1e32577af1": {
107
+ "id": "provision:be136d13c2dbecab3ba18c1e32577af1",
108
+ "type": "provision",
109
+ "data": {
110
+ "level": "2",
111
+ "provision_reference": "B.",
112
+ "provision_text": "Form Of Disclosure. Information may be disclosed:",
113
+ "citation": "",
114
+ "substitution": [
115
+ "type5",
116
+ "",
117
+ "",
118
+ "C",
119
+ ".",
120
+ null,
121
+ " "
122
+ ]
123
+ }
124
+ },
125
+ "provision:924bff0108e18c4e2cbe0f02b2279cfb": {
126
+ "id": "provision:924bff0108e18c4e2cbe0f02b2279cfb",
127
+ "type": "provision",
128
+ "data": {
129
+ "level": "3",
130
+ "provision_reference": "i.",
131
+ "provision_text": "in writing;",
132
+ "citation": "",
133
+ "substitution": [
134
+ "type3",
135
+ "",
136
+ "",
137
+ "i",
138
+ ".",
139
+ null,
140
+ " "
141
+ ]
142
+ }
143
+ },
144
+ "provision:85622e5c9f23d889409ba91969753252": {
145
+ "id": "provision:85622e5c9f23d889409ba91969753252",
146
+ "type": "provision",
147
+ "data": {
148
+ "level": "3",
149
+ "provision_reference": "ii.",
150
+ "provision_text": "by oral presentation;",
151
+ "citation": "",
152
+ "substitution": [
153
+ "type3",
154
+ "",
155
+ "",
156
+ "i",
157
+ ".",
158
+ null,
159
+ " "
160
+ ]
161
+ }
162
+ },
163
+ "provision:a3da2246fe0ef478b71d322211fd0e4f": {
164
+ "id": "provision:a3da2246fe0ef478b71d322211fd0e4f",
165
+ "type": "provision",
166
+ "data": {
167
+ "level": "3",
168
+ "provision_reference": "iii.",
169
+ "provision_text": "by visual presentation;",
170
+ "citation": "",
171
+ "substitution": [
172
+ "type3",
173
+ "",
174
+ "",
175
+ "i",
176
+ ".",
177
+ null,
178
+ " "
179
+ ]
180
+ }
181
+ },
182
+ "provision:59982055aad5bd1bcb22c76e71c67241": {
183
+ "id": "provision:59982055aad5bd1bcb22c76e71c67241",
184
+ "type": "provision",
185
+ "data": {
186
+ "level": "3",
187
+ "provision_reference": "iv.",
188
+ "provision_text": "by Discloser giving Recipient access to a database or digital archive of an\ny kind; or",
189
+ "citation": "",
190
+ "substitution": [
191
+ "type3",
192
+ "",
193
+ "",
194
+ "i",
195
+ ".",
196
+ null,
197
+ " "
198
+ ]
199
+ }
200
+ },
201
+ "provision:5d410b2c8fa7fc83c63e37e60a058d38": {
202
+ "id": "provision:5d410b2c8fa7fc83c63e37e60a058d38",
203
+ "type": "provision",
204
+ "data": {
205
+ "level": "3",
206
+ "provision_reference": "v.",
207
+ "provision_text": "by delivery of physical objects.",
208
+ "citation": "",
209
+ "substitution": [
210
+ "type3",
211
+ "",
212
+ "",
213
+ "i",
214
+ ".",
215
+ null,
216
+ " "
217
+ ]
218
+ }
219
+ },
220
+ "provision:844216efbcd095c1b8dd3438c1055c09": {
221
+ "id": "provision:844216efbcd095c1b8dd3438c1055c09",
222
+ "type": "provision",
223
+ "data": {
224
+ "level": "2",
225
+ "provision_reference": "C.",
226
+ "provision_text": "Dispute Resolution.\nAny controversy or claim arising out of or relating to this Agreement, or the br\neach thereof, whether sounding in contract, tort, or otherwise, shall be decided\n solely and exclusively by State or Federal courts located in New York, New York.",
227
+ "citation": "",
228
+ "substitution": [
229
+ "type5",
230
+ "",
231
+ "",
232
+ "C",
233
+ ".",
234
+ null,
235
+ " "
236
+ ]
237
+ }
238
+ },
239
+ "content": {
240
+ "nodes": [
241
+ "provision:500605d1a906c2a11aae31bbbb98de3a",
242
+ "provision:dd1ca6ff2b29be1912fbf1276bab6fc6",
243
+ "provision:287868a85dd0f9e115ba07f5bd6d4641",
244
+ "provision:e0b084042d99777fca77ee4c5d354a6a",
245
+ "provision:a0023de08371e6bde054f4304fc07fd6",
246
+ "provision:be136d13c2dbecab3ba18c1e32577af1",
247
+ "provision:924bff0108e18c4e2cbe0f02b2279cfb",
248
+ "provision:85622e5c9f23d889409ba91969753252",
249
+ "provision:a3da2246fe0ef478b71d322211fd0e4f",
250
+ "provision:59982055aad5bd1bcb22c76e71c67241",
251
+ "provision:5d410b2c8fa7fc83c63e37e60a058d38",
252
+ "provision:844216efbcd095c1b8dd3438c1055c09"
253
+ ]
254
+ }
255
+ }
256
+ }
@@ -0,0 +1,60 @@
1
+ ---
2
+
3
+ # Mixins
4
+ contract_title:"Non-Disclosure Agreement"
5
+ forum:"New York, New York"
6
+
7
+ # Optional Clauses
8
+ arbitration_clause:false
9
+ judicial_forum_clause:true
10
+
11
+ # Structured Headers
12
+ level-1: 1
13
+ level-2: A
14
+ level-3: i
15
+
16
+ # Properties
17
+ no-indent: ""
18
+ no-reset: ""
19
+ level-style: ""
20
+
21
+ ---
22
+
23
+ ```
24
+
25
+ l. {{contract_title}}
26
+
27
+ ll. Definitions
28
+
29
+ lll. "Agreement" means this certain Non-Disclosure Agreement dated 6 August, 201
30
+ 3.
31
+
32
+ lll. "Control" means to own or control, directly or indirectly, more than 50% of
33
+ voting shares.
34
+
35
+ lll. "Information" means confidential information disclosed under this Agreement
36
+ .
37
+
38
+ ll. Form Of Disclosure. Information may be disclosed:
39
+
40
+ lll. in writing;
41
+
42
+ lll. by oral presentation;
43
+
44
+ lll. by visual presentation;
45
+
46
+ lll. by Discloser giving Recipient access to a database or digital archive of an
47
+ y kind; or
48
+
49
+ lll. by delivery of physical objects.
50
+
51
+ [{{arbitration_clause}}ll. Arbitration.
52
+ Any controversy or claim arising out of or relating to this Agreement, or the br
53
+ each thereof, whether sounding in contract, tort, or otherwise, shall be settled
54
+ by arbitration administered by the American Arbitration Association under its C
55
+ ommercial Arbitration Rules, and judgment on the award rendered by the arbitrato
56
+ r(s) may be entered in any court having jurisdiction thereof.]
57
+ [{{judicial_forum_clause}}ll. Dispute Resolution.
58
+ Any controversy or claim arising out of or relating to this Agreement, or the br
59
+ each thereof, whether sounding in contract, tort, or otherwise, shall be decided
60
+ solely and exclusively by State or Federal courts located in {{forum}}.]
@@ -0,0 +1,38 @@
1
+ 1. Non-Disclosure Agreement
2
+
3
+ A. Definitions
4
+
5
+ i. "Agreement" means this certain Non-Disclosure Agreement dated 6 August, 201
6
+
7
+ 3.
8
+
9
+ ii. "Control" means to own or control, directly or indirectly, more than 50% of
10
+
11
+ voting shares.
12
+
13
+ iii. "Information" means confidential information disclosed under this Agreement
14
+
15
+ .
16
+
17
+ B. Form Of Disclosure. Information may be disclosed:
18
+
19
+ i. in writing;
20
+
21
+ ii. by oral presentation;
22
+
23
+ iii. by visual presentation;
24
+
25
+ iv. by Discloser giving Recipient access to a database or digital archive of an
26
+
27
+ y kind; or
28
+
29
+ v. by delivery of physical objects.
30
+
31
+ C. Dispute Resolution.
32
+
33
+ Any controversy or claim arising out of or relating to this Agreement, or the br
34
+
35
+ each thereof, whether sounding in contract, tort, or otherwise, shall be decided
36
+
37
+ solely and exclusively by State or Federal courts located in New York, New York.
38
+
@@ -1,7 +1,6 @@
1
1
 
2
-
3
- Here's what I found after loading.
4
- ==================================
2
+ Here's what I found after running the loading.
3
+ =============================================
5
4
 
6
5
  The Headers I found are:
7
6
  ------------------------
@@ -107,8 +106,8 @@ ll. Amendments*. [{{dirs_can_amend_bylaws}} The Board of Directors is expressly
107
106
  There are MIXINS to be parsed.
108
107
  There are STRUCTURED HEADERS to be parsed.
109
108
 
110
- Here's what I found after the mixins.
111
- =====================================
109
+ Here's what I found after running the mixins.
110
+ =============================================
112
111
 
113
112
  The Headers I found are:
114
113
  ------------------------
@@ -211,8 +210,8 @@ l. Amendments
211
210
  ll. Amendments*. The Shareholders shall have power to adopt, amend or repeal these Bylaws.
212
211
  ```
213
212
 
214
- Here's what I found after the headers.
215
- =====================================
213
+ Here's what I found after running the headers.
214
+ =============================================
216
215
 
217
216
  The Headers I found are:
218
217
  ------------------------
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: legal_markdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.8
4
+ version: 0.4.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -177,6 +177,10 @@ files:
177
177
  - test/tests/37.block_with_diff_start_pt.json
178
178
  - test/tests/37.block_with_diff_start_pt.lmd
179
179
  - test/tests/37.block_with_diff_start_pt.md
180
+ - test/tests/38.block_with_bom_characters_windows_produces.headers
181
+ - test/tests/38.block_with_bom_characters_windows_produces.json
182
+ - test/tests/38.block_with_bom_characters_windows_produces.lmd
183
+ - test/tests/38.block_with_bom_characters_windows_produces.md
180
184
  - test/tests/40.block_with_mixins.headers
181
185
  - test/tests/40.block_with_mixins.json
182
186
  - test/tests/40.block_with_mixins.lmd
@@ -215,7 +219,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
215
219
  version: '0'
216
220
  segments:
217
221
  - 0
218
- hash: 1997262115818648382
222
+ hash: 3178532797669360793
219
223
  required_rubygems_version: !ruby/object:Gem::Requirement
220
224
  none: false
221
225
  requirements:
@@ -224,7 +228,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
224
228
  version: '0'
225
229
  segments:
226
230
  - 0
227
- hash: 1997262115818648382
231
+ hash: 3178532797669360793
228
232
  requirements: []
229
233
  rubyforge_project:
230
234
  rubygems_version: 1.8.25
@@ -334,6 +338,10 @@ test_files:
334
338
  - test/tests/37.block_with_diff_start_pt.json
335
339
  - test/tests/37.block_with_diff_start_pt.lmd
336
340
  - test/tests/37.block_with_diff_start_pt.md
341
+ - test/tests/38.block_with_bom_characters_windows_produces.headers
342
+ - test/tests/38.block_with_bom_characters_windows_produces.json
343
+ - test/tests/38.block_with_bom_characters_windows_produces.lmd
344
+ - test/tests/38.block_with_bom_characters_windows_produces.md
337
345
  - test/tests/40.block_with_mixins.headers
338
346
  - test/tests/40.block_with_mixins.json
339
347
  - test/tests/40.block_with_mixins.lmd