legal_markdown 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. data/.gitignore +0 -1
  2. data/README.md +1 -1
  3. data/lib/legal_markdown.rb +29 -12
  4. data/lib/legal_markdown/make_yaml_frontmatter.rb +1 -1
  5. data/lib/legal_markdown/version.rb +1 -1
  6. data/test/test_legal_markdown_to_markdown.rb +43 -0
  7. data/test/tests/00.load_write_no_action.lmd +20 -0
  8. data/test/tests/00.load_write_no_action.md +20 -0
  9. data/test/tests/01.load_partial_no_action.lmd +22 -0
  10. data/test/tests/01.load_partial_no_action.md +27 -0
  11. data/test/tests/02.load_partials_no_action.lmd +24 -0
  12. data/test/tests/02.load_partials_no_action.md +34 -0
  13. data/test/tests/10.mixins_in_headers_and_text.lmd +20 -0
  14. data/test/tests/10.mixins_in_headers_and_text.md +12 -0
  15. data/test/tests/11.mixins_in_today_function.lmd +4 -0
  16. data/test/tests/11.mixins_in_today_function.md +1 -0
  17. data/test/tests/12.opt_clauses_no_subs.lmd +18 -0
  18. data/test/tests/12.opt_clauses_no_subs.md +9 -0
  19. data/test/tests/13.opt_clauses_subs.lmd +27 -0
  20. data/test/tests/13.opt_clauses_subs.md +11 -0
  21. data/test/tests/14.opt_clauses_with_mixins.lmd +24 -0
  22. data/test/tests/14.opt_clauses_with_mixins.md +9 -0
  23. data/test/tests/20.block_no_addons.lmd +32 -0
  24. data/test/tests/20.block_no_addons.md +40 -0
  25. data/test/tests/21.block_no_indents.lmd +33 -0
  26. data/test/tests/21.block_no_indents.md +40 -0
  27. data/test/tests/22.block_all_indents.lmd +33 -0
  28. data/test/tests/22.block_all_indents.md +40 -0
  29. data/test/tests/23.block_all_indents.md +40 -0
  30. data/test/tests/24.block_part_indents.lmd +40 -0
  31. data/test/tests/24.block_part_indents.md +52 -0
  32. data/test/tests/25.block_no_resets.lmd +33 -0
  33. data/test/tests/25.block_no_resets.md +40 -0
  34. data/test/tests/26.block_all_resets.lmd +33 -0
  35. data/test/tests/26.block_all_resets.md +40 -0
  36. data/test/tests/27.block_part_resets.lmd +40 -0
  37. data/test/tests/27.block_part_resets.md +52 -0
  38. data/test/tests/28.block_provs_multi_line_no_indent.lmd +42 -0
  39. data/test/tests/28.block_provs_multi_line_no_indent.md +52 -0
  40. data/test/tests/29.block_provs_multi_line_indents.lmd +42 -0
  41. data/test/tests/29.block_provs_multi_line_indents.md +52 -0
  42. data/test/tests/30.block_all_leader_types.lmd +43 -0
  43. data/test/tests/30.block_all_leader_types.md +52 -0
  44. data/test/tests/31.block_complex_leader_types.lmd +44 -0
  45. data/test/tests/31.block_complex_leader_types.md +52 -0
  46. data/test/tests/32.block_new_leader_style.lmd +47 -0
  47. data/test/tests/32.block_new_leader_style.md +52 -0
  48. data/test/tests/33.block_with_pre_simple.lmd +33 -0
  49. data/test/tests/33.block_with_pre_simple.md +40 -0
  50. data/test/tests/34.block_with_pre_complex.lmd +34 -0
  51. data/test/tests/34.block_with_pre_complex.md +40 -0
  52. data/test/tests/35.block_with_preval.lmd +33 -0
  53. data/test/tests/35.block_with_preval.md +40 -0
  54. data/test/tests/36.block_with_crossrefs.lmd +33 -0
  55. data/test/tests/36.block_with_crossrefs.md +40 -0
  56. data/test/tests/37.block_with_diff_start_pt.lmd +34 -0
  57. data/test/tests/37.block_with_diff_start_pt.md +40 -0
  58. data/test/tests/40.block_with_mixins.lmd +45 -0
  59. data/test/tests/40.block_with_mixins.md +52 -0
  60. data/test/tests/41.block_with_opt_clauses.lmd +48 -0
  61. data/test/tests/41.block_with_opt_clauses.md +50 -0
  62. data/test/tests/42.block_with_opt_clauses_and_mixins.lmd +54 -0
  63. data/test/tests/42.block_with_opt_clauses_and_mixins.md +50 -0
  64. data/test/tests/partials/z.partial1 +6 -0
  65. data/test/tests/partials/z.partial2 +6 -0
  66. metadata +125 -5
@@ -0,0 +1,24 @@
1
+ ---
2
+
3
+ # Mixins
4
+ test1: mnbvcx
5
+ test2: poiuytre
6
+ test3: qwertyu
7
+
8
+ # Optional Clauses
9
+ test_2: true
10
+ test_3: false
11
+
12
+ ---
13
+
14
+ # This is a header
15
+
16
+ asd;lfkajsdf;lkj
17
+
18
+ [{{test_2}}TEST2: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, {{test1}} quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Optional clause....]
19
+
20
+ ## This is a second header
21
+
22
+ [{{test_3}} Russian {{test2}} optional clause df;laksdj]
23
+
24
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation {{test3}} ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
@@ -0,0 +1,9 @@
1
+ # This is a header
2
+
3
+ asd;lfkajsdf;lkj
4
+
5
+ TEST2: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, mnbvcx quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Optional clause....
6
+
7
+ ## This is a second header
8
+
9
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation qwertyu ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
@@ -0,0 +1,32 @@
1
+ ---
2
+
3
+ # Structured Headers
4
+ level-1: "Article 1."
5
+ level-2: "Section 1."
6
+ level-3: "1."
7
+
8
+ ---
9
+
10
+ # TEST 4
11
+
12
+ ```
13
+ l. Provision for Article 1.
14
+ ll. Provision for Section 1.1.
15
+ ll. Provision for 1.1.1.
16
+ lll. Provision for 1.1.2.
17
+ lll. Provision for Section 1.2.
18
+ lll. Provision for 1.2.1.
19
+ l. Provision for 1.2.2.
20
+ ll. Profivis asl;jksfd;lg; lkshflksjdh
21
+ ll. asd;flkajsdf;lkjl.
22
+ lll. ;alsdkfjasd;flkajsd
23
+ ll. as;dlfkjasd;flakjsdll.
24
+ lll. a;lsdfkjasd;lfkjlll. asd;lgkhj
25
+ lll. a;sdlfkajsd;flk
26
+ l. as;dlfkajsd;flkj
27
+ ll. a;sldfkajsd;
28
+ lll. a;sldfkjasd;flkajs
29
+ lll. a;lsdfkajsd;lfkj
30
+ lll. a;sdlfkajsd;flkajs
31
+ lll. as;dlfkjasd;lfkjsll.
32
+ ```
@@ -0,0 +1,40 @@
1
+ # TEST 4
2
+
3
+ Article 1. Provision for Article 1.
4
+
5
+ Section 1. Provision for Section 1.1.
6
+
7
+ Section 2. Provision for 1.1.1.
8
+
9
+ 1. Provision for 1.1.2.
10
+
11
+ 2. Provision for Section 1.2.
12
+
13
+ 3. Provision for 1.2.1.
14
+
15
+ Article 2. Provision for 1.2.2.
16
+
17
+ Section 1. Profivis asl;jksfd;lg; lkshflksjdh
18
+
19
+ Section 2. asd;flkajsdf;lkjl.
20
+
21
+ 1. ;alsdkfjasd;flkajsd
22
+
23
+ Section 3. as;dlfkjasd;flakjsdll.
24
+
25
+ 1. a;lsdfkjasd;lfkjlll. asd;lgkhj
26
+
27
+ 2. a;sdlfkajsd;flk
28
+
29
+ Article 3. as;dlfkajsd;flkj
30
+
31
+ Section 1. a;sldfkajsd;
32
+
33
+ 1. a;sldfkjasd;flkajs
34
+
35
+ 2. a;lsdfkajsd;lfkj
36
+
37
+ 3. a;sdlfkajsd;flkajs
38
+
39
+ 4. as;dlfkjasd;lfkjsll.
40
+
@@ -0,0 +1,33 @@
1
+ ---
2
+
3
+ # Structured Headers
4
+ level-1: "Article 1."
5
+ level-2: "Section 1."
6
+ level-3: "1."
7
+ no-indent: l., ll., lll.
8
+
9
+ ---
10
+
11
+ # TEST 4
12
+
13
+ ```
14
+ l. Provision for Article 1.
15
+ ll. Provision for Section 1.1.
16
+ ll. Provision for 1.1.1.
17
+ lll. Provision for 1.1.2.
18
+ lll. Provision for Section 1.2.
19
+ lll. Provision for 1.2.1.
20
+ l. Provision for 1.2.2.
21
+ ll. Profivis asl;jksfd;lg; lkshflksjdh
22
+ ll. asd;flkajsdf;lkj
23
+ lll. ;alsdkfjasd;flkajsd
24
+ ll. as;dlfkjasd;flakjsdll.
25
+ lll. a;lsdfkjasd;lfkj
26
+ lll. a;sdlfkajsd;flk
27
+ l. as;dlfkajsd;flkj
28
+ ll. a;sldfkajsd;
29
+ lll. a;sldfkjasd;flkajs
30
+ lll. a;lsdfkajsd;lfkj
31
+ lll. a;sdlfkajsd;flkajs
32
+ lll. as;dlfkjasd;lfkjs
33
+ ```
@@ -0,0 +1,40 @@
1
+ # TEST 4
2
+
3
+ Article 1. Provision for Article 1.
4
+
5
+ Section 1. Provision for Section 1.1.
6
+
7
+ Section 2. Provision for 1.1.1.
8
+
9
+ 1. Provision for 1.1.2.
10
+
11
+ 2. Provision for Section 1.2.
12
+
13
+ 3. Provision for 1.2.1.
14
+
15
+ Article 2. Provision for 1.2.2.
16
+
17
+ Section 1. Profivis asl;jksfd;lg; lkshflksjdh
18
+
19
+ Section 2. asd;flkajsdf;lkj
20
+
21
+ 1. ;alsdkfjasd;flkajsd
22
+
23
+ Section 3. as;dlfkjasd;flakjsdll.
24
+
25
+ 1. a;lsdfkjasd;lfkj
26
+
27
+ 2. a;sdlfkajsd;flk
28
+
29
+ Article 3. as;dlfkajsd;flkj
30
+
31
+ Section 1. a;sldfkajsd;
32
+
33
+ 1. a;sldfkjasd;flkajs
34
+
35
+ 2. a;lsdfkajsd;lfkj
36
+
37
+ 3. a;sdlfkajsd;flkajs
38
+
39
+ 4. as;dlfkjasd;lfkjs
40
+
@@ -0,0 +1,33 @@
1
+ ---
2
+
3
+ # Structured Headers
4
+ level-1: "Article 1."
5
+ level-2: "Section 1."
6
+ level-3: "1."
7
+ no-indent:
8
+
9
+ ---
10
+
11
+ # TEST 4
12
+
13
+ ```
14
+ l. Provision for Article 1.
15
+ ll. Provision for Section 1.1.
16
+ ll. Provision for 1.1.1.
17
+ lll. Provision for 1.1.2.
18
+ lll. Provision for Section 1.2.
19
+ lll. Provision for 1.2.1.
20
+ l. Provision for 1.2.2.
21
+ ll. Profivis asl;jksfd;lg; lkshflksjdh
22
+ ll. asd;flkajsdf;lkj
23
+ lll. ;alsdkfjasd;flkajsd
24
+ ll. as;dlfkjasd;flakjsdll.
25
+ lll. a;lsdfkjasd;lfkj
26
+ lll. a;sdlfkajsd;flk
27
+ l. as;dlfkajsd;flkj
28
+ ll. a;sldfkajsd;
29
+ lll. a;sldfkjasd;flkajs
30
+ lll. a;lsdfkajsd;lfkj
31
+ lll. a;sdlfkajsd;flkajs
32
+ lll. as;dlfkjasd;lfkjs
33
+ ```
@@ -0,0 +1,40 @@
1
+ # TEST 4
2
+
3
+ Article 1. Provision for Article 1.
4
+
5
+ Section 1. Provision for Section 1.1.
6
+
7
+ Section 2. Provision for 1.1.1.
8
+
9
+ 1. Provision for 1.1.2.
10
+
11
+ 2. Provision for Section 1.2.
12
+
13
+ 3. Provision for 1.2.1.
14
+
15
+ Article 2. Provision for 1.2.2.
16
+
17
+ Section 1. Profivis asl;jksfd;lg; lkshflksjdh
18
+
19
+ Section 2. asd;flkajsdf;lkj
20
+
21
+ 1. ;alsdkfjasd;flkajsd
22
+
23
+ Section 3. as;dlfkjasd;flakjsdll.
24
+
25
+ 1. a;lsdfkjasd;lfkj
26
+
27
+ 2. a;sdlfkajsd;flk
28
+
29
+ Article 3. as;dlfkajsd;flkj
30
+
31
+ Section 1. a;sldfkajsd;
32
+
33
+ 1. a;sldfkjasd;flkajs
34
+
35
+ 2. a;lsdfkajsd;lfkj
36
+
37
+ 3. a;sdlfkajsd;flkajs
38
+
39
+ 4. as;dlfkjasd;lfkjs
40
+
@@ -0,0 +1,40 @@
1
+ # TEST 4
2
+
3
+ Article 1. Provision for Article 1.
4
+
5
+ Section 1. Provision for Section 1.1.
6
+
7
+ Section 2. Provision for 1.1.1.
8
+
9
+ 1. Provision for 1.1.2.
10
+
11
+ 2. Provision for Section 1.2.
12
+
13
+ 3. Provision for 1.2.1.
14
+
15
+ Article 2. Provision for 1.2.2.
16
+
17
+ Section 1. Profivis asl;jksfd;lg; lkshflksjdh
18
+
19
+ Section 2. asd;flkajsdf;lkj
20
+
21
+ 1. ;alsdkfjasd;flkajsd
22
+
23
+ Section 3. as;dlfkjasd;flakjsdll.
24
+
25
+ 1. a;lsdfkjasd;lfkj
26
+
27
+ 2. a;sdlfkajsd;flk
28
+
29
+ Article 3. as;dlfkajsd;flkj
30
+
31
+ Section 1. a;sldfkajsd;
32
+
33
+ 1. a;sldfkjasd;flkajs
34
+
35
+ 2. a;lsdfkajsd;lfkj
36
+
37
+ 3. a;sdlfkajsd;flkajs
38
+
39
+ 4. as;dlfkjasd;lfkjs
40
+
@@ -0,0 +1,40 @@
1
+ ---
2
+
3
+ # Structured Headers
4
+ level-1: "Article 1."
5
+ level-2: "Section 1."
6
+ level-3: "1."
7
+ level-4: "a."
8
+ no-indent: ll., lll.
9
+
10
+ ---
11
+
12
+ # TEST 4
13
+
14
+ ```
15
+ l. Provision for Article 1.
16
+ ll. Provision for Section 1.1.
17
+ lll. Provision for 1.1.1.
18
+ lll. Provision for 1.1.2.
19
+ ll. Provision for Section 1.2.
20
+ lll. Provision for 1.2.1.
21
+ l. Provision for 1.2.2.
22
+ ll. Profivis asl;jksfd;lg; lkshflksjdh
23
+ l. asd;flkajsdf;lkj
24
+ ll. ;alsdkfjasd;flkajsd
25
+ lll. as;dlfkjasd;flakjsdll.
26
+ llll. a;lsdfkjasd;lfkj
27
+ ll. a;sdlfkajsd;flk
28
+ l. as;dlfkajsd;flkj
29
+ lll. a;sldfkajsd;
30
+ ll. a;sldfkjasd;flkajs
31
+ llll. a;lsdfkajsd;lfkj
32
+ ll. a;sdlfkajsd;flkajs
33
+ lll. as;dlfkjasd;lfkjs
34
+ llll. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
35
+ llll. tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
36
+ ll. quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
37
+ llll. consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
38
+ l. cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
39
+ ll. proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
40
+ ```
@@ -0,0 +1,52 @@
1
+ # TEST 4
2
+
3
+ Article 1. Provision for Article 1.
4
+
5
+ Section 1. Provision for Section 1.1.
6
+
7
+ 1. Provision for 1.1.1.
8
+
9
+ 2. Provision for 1.1.2.
10
+
11
+ Section 2. Provision for Section 1.2.
12
+
13
+ 1. Provision for 1.2.1.
14
+
15
+ Article 2. Provision for 1.2.2.
16
+
17
+ Section 1. Profivis asl;jksfd;lg; lkshflksjdh
18
+
19
+ Article 3. asd;flkajsdf;lkj
20
+
21
+ Section 1. ;alsdkfjasd;flkajsd
22
+
23
+ 1. as;dlfkjasd;flakjsdll.
24
+
25
+ a. a;lsdfkjasd;lfkj
26
+
27
+ Section 2. a;sdlfkajsd;flk
28
+
29
+ Article 4. as;dlfkajsd;flkj
30
+
31
+ 1. a;sldfkajsd;
32
+
33
+ Section 1. a;sldfkjasd;flkajs
34
+
35
+ a. a;lsdfkajsd;lfkj
36
+
37
+ Section 2. a;sdlfkajsd;flkajs
38
+
39
+ 1. as;dlfkjasd;lfkjs
40
+
41
+ a. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
42
+
43
+ b. tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
44
+
45
+ Section 3. quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
46
+
47
+ a. consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
48
+
49
+ Article 5. cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
50
+
51
+ Section 1. proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
52
+
@@ -0,0 +1,33 @@
1
+ ---
2
+
3
+ # Structured Headers
4
+ level-1: "Article 1."
5
+ level-2: "Section 1."
6
+ level-3: "1."
7
+ no-reset: l., ll., lll.
8
+
9
+ ---
10
+
11
+ # TEST 4
12
+
13
+ ```
14
+ l. Provision for Article 1.
15
+ ll. Provision for Section 1.1.
16
+ lll. Provision for 1.1.1.
17
+ lll. Provision for 1.1.2.
18
+ ll. Provision for Section 1.2.
19
+ lll. Provision for 1.2.1.
20
+ l. Provision for 1.2.2.
21
+ ll. Profivis asl;jksfd;lg; lkshflksjdh
22
+ l. asd;flkajsdf;lkj
23
+ lll. ;alsdkfjasd;flkajsd
24
+ ll. as;dlfkjasd;flakjsdll.
25
+ lll. a;lsdfkjasd;lfkj
26
+ ll. a;sdlfkajsd;flk
27
+ l. as;dlfkajsd;flkj
28
+ lll. a;sldfkajsd;
29
+ ll. a;sldfkjasd;flkajs
30
+ lll. a;lsdfkajsd;lfkj
31
+ ll. a;sdlfkajsd;flkajs
32
+ lll. as;dlfkjasd;lfkjs
33
+ ```
@@ -0,0 +1,40 @@
1
+ # TEST 4
2
+
3
+ Article 1. Provision for Article 1.
4
+
5
+ Section 1. Provision for Section 1.1.
6
+
7
+ 1. Provision for 1.1.1.
8
+
9
+ 2. Provision for 1.1.2.
10
+
11
+ Section 2. Provision for Section 1.2.
12
+
13
+ 3. Provision for 1.2.1.
14
+
15
+ Article 2. Provision for 1.2.2.
16
+
17
+ Section 3. Profivis asl;jksfd;lg; lkshflksjdh
18
+
19
+ Article 3. asd;flkajsdf;lkj
20
+
21
+ 4. ;alsdkfjasd;flkajsd
22
+
23
+ Section 4. as;dlfkjasd;flakjsdll.
24
+
25
+ 5. a;lsdfkjasd;lfkj
26
+
27
+ Section 5. a;sdlfkajsd;flk
28
+
29
+ Article 4. as;dlfkajsd;flkj
30
+
31
+ 6. a;sldfkajsd;
32
+
33
+ Section 6. a;sldfkjasd;flkajs
34
+
35
+ 7. a;lsdfkajsd;lfkj
36
+
37
+ Section 7. a;sdlfkajsd;flkajs
38
+
39
+ 8. as;dlfkjasd;lfkjs
40
+