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,44 @@
1
+ ---
2
+
3
+ level-1: "# Article (1)"
4
+ level-2: "*Section (a)"
5
+ level-3: "#$%^&* A."
6
+ level-4: "|}{POIUYTR (A)"
7
+ level-5: "~!@#$%^&* a."
8
+ level-6: "123645789 X."
9
+ level-7: "987654321 (x)"
10
+ level-8: "098765432 1."
11
+ level-9: "=-098765432 x."
12
+ no-indent: l., ll., lll., llll., lllll., lllll., lllllll., llllllll., lllllllll.
13
+ no-reset: l., ll., lll., llll., lllll., lllll., lllllll., llllllll., lllllllll.
14
+ ---
15
+
16
+ # TEST 4
17
+
18
+ ```
19
+ l. Provision for Article 1.
20
+ ll. Provision for Section 1.1.
21
+ lll. Provision for 1.1.1.
22
+ llll. Provision for 1.1.2.
23
+ lllll. Provision for Section 1.2.
24
+ lll. Provision for 1.2.1.
25
+ ll. Provision for 1.2.2.
26
+ lll. Profivis asl;jksfd;lg; lkshflksjdh
27
+ llll. asd;flkajsdf;lkj
28
+ lllll. ;alsdkfjasd;flkajsd
29
+ llllll. as;dlfkjasd;flakjsdll.
30
+ lll. a;lsdfkjasd;lfkj
31
+ lll. a;sdlfkajsd;flk
32
+ llll. as;dlfkajsd;flkj
33
+ lllll. a;sldfkajsd;
34
+ llllll. a;sldfkjasd;flkajs
35
+ lllllll. a;lsdfkajsd;lfkj
36
+ llllllll. a;sdlfkajsd;flkajs
37
+ lllllllll. as;dlfkjasd;lfkjs
38
+ lllllllll. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
39
+ lllllllll. tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
40
+ llllllll. quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
41
+ lllllll. consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
42
+ lllll. cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
43
+ lll. proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
44
+ ```
@@ -0,0 +1,52 @@
1
+ # TEST 4
2
+
3
+ # Article (1) Provision for Article 1.
4
+
5
+ *Section (a) Provision for Section 1.1.
6
+
7
+ #$%^&* A. Provision for 1.1.1.
8
+
9
+ |}{POIUYTR (A) Provision for 1.1.2.
10
+
11
+ ~!@#$%^&* a. Provision for Section 1.2.
12
+
13
+ #$%^&* B. Provision for 1.2.1.
14
+
15
+ *Section (b) Provision for 1.2.2.
16
+
17
+ #$%^&* C. Profivis asl;jksfd;lg; lkshflksjdh
18
+
19
+ |}{POIUYTR (B) asd;flkajsdf;lkj
20
+
21
+ ~!@#$%^&* b. ;alsdkfjasd;flkajsd
22
+
23
+ 123645789 I. as;dlfkjasd;flakjsdll.
24
+
25
+ #$%^&* D. a;lsdfkjasd;lfkj
26
+
27
+ #$%^&* E. a;sdlfkajsd;flk
28
+
29
+ |}{POIUYTR (C) as;dlfkajsd;flkj
30
+
31
+ ~!@#$%^&* c. a;sldfkajsd;
32
+
33
+ 123645789 I. a;sldfkjasd;flkajs
34
+
35
+ 987654321 (x) a;lsdfkajsd;lfkj
36
+
37
+ 098765432 1. a;sdlfkajsd;flkajs
38
+
39
+ =-098765432 x. as;dlfkjasd;lfkjs
40
+
41
+ =-098765432 xi. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
42
+
43
+ =-098765432 xii. tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
44
+
45
+ 098765432 2. quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
46
+
47
+ 987654321 (xi) consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
48
+
49
+ ~!@#$%^&* d. cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
50
+
51
+ #$%^&* F. proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
52
+
@@ -0,0 +1,47 @@
1
+ ---
2
+
3
+ # Structured Headers
4
+ level-1: "# Article (1)"
5
+ level-2: "*Section (a)"
6
+ level-3: "#$%^&* A."
7
+ level-4: "|}{POIUYTR (A)"
8
+ level-5: "~!@#$%^&* a."
9
+ level-6: "123645789 X."
10
+ level-7: "987654321 (x)"
11
+ level-8: "098765432 1."
12
+ level-9: "=-098765432 x."
13
+ level-style: "l1."
14
+ no-indent: l1., l2., l3., l4., l5., l6., l7., l8., l9.
15
+ no-reset: l1., l2., l3., l4., l5., l6., l7., l8., l9.
16
+
17
+ ---
18
+
19
+ # TEST 4
20
+
21
+ ```
22
+ l1. Provision for Article 1.
23
+ l2. Provision for Section 1.1.
24
+ l3. Provision for 1.1.1.
25
+ l4. Provision for 1.1.2.
26
+ l5. Provision for Section 1.2.
27
+ l3. Provision for 1.2.1.
28
+ l2. Provision for 1.2.2.
29
+ l3. Profivis asl;jksfd;lg; lkshflksjdh
30
+ l4. asd;flkajsdf;lkj
31
+ l5. ;alsdkfjasd;flkajsd
32
+ l6. as;dlfkjasd;flakjsdll.
33
+ l3. a;lsdfkjasd;lfkj
34
+ l3. a;sdlfkajsd;flk
35
+ l4. as;dlfkajsd;flkj
36
+ l5. a;sldfkajsd;
37
+ l6. a;sldfkjasd;flkajs
38
+ l7. a;lsdfkajsd;lfkj
39
+ l8. a;sdlfkajsd;flkajs
40
+ l9. as;dlfkjasd;lfkjs
41
+ l9. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
42
+ l8. tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
43
+ l7. quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
44
+ l6. consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
45
+ l5. cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
46
+ l3. proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
47
+ ```
@@ -0,0 +1,52 @@
1
+ # TEST 4
2
+
3
+ # Article (1) Provision for Article 1.
4
+
5
+ *Section (a) Provision for Section 1.1.
6
+
7
+ #$%^&* A. Provision for 1.1.1.
8
+
9
+ |}{POIUYTR (A) Provision for 1.1.2.
10
+
11
+ ~!@#$%^&* a. Provision for Section 1.2.
12
+
13
+ #$%^&* B. Provision for 1.2.1.
14
+
15
+ *Section (b) Provision for 1.2.2.
16
+
17
+ #$%^&* C. Profivis asl;jksfd;lg; lkshflksjdh
18
+
19
+ |}{POIUYTR (B) asd;flkajsdf;lkj
20
+
21
+ ~!@#$%^&* b. ;alsdkfjasd;flkajsd
22
+
23
+ 123645789 X. as;dlfkjasd;flakjsdll.
24
+
25
+ #$%^&* D. a;lsdfkjasd;lfkj
26
+
27
+ #$%^&* E. a;sdlfkajsd;flk
28
+
29
+ |}{POIUYTR (C) as;dlfkajsd;flkj
30
+
31
+ ~!@#$%^&* c. a;sldfkajsd;
32
+
33
+ 123645789 XI. a;sldfkjasd;flkajs
34
+
35
+ 987654321 (x) a;lsdfkajsd;lfkj
36
+
37
+ 098765432 1. a;sdlfkajsd;flkajs
38
+
39
+ =-098765432 x. as;dlfkjasd;lfkjs
40
+
41
+ =-098765432 xi. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
42
+
43
+ 098765432 2. tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
44
+
45
+ 987654321 (xi) quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
46
+
47
+ 123645789 XII. consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
48
+
49
+ ~!@#$%^&* d. cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
50
+
51
+ #$%^&* F. 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: "pre a."
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
+ 2.a. Provision for 1.1.2.
10
+
11
+ 2.b. Provision for Section 1.2.
12
+
13
+ 2.c. 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
+ 2.a. ;alsdkfjasd;flkajsd
22
+
23
+ Section 3. as;dlfkjasd;flakjsdll.
24
+
25
+ 3.a. a;lsdfkjasd;lfkj
26
+
27
+ 3.b. a;sdlfkajsd;flk
28
+
29
+ Article 3. as;dlfkajsd;flkj
30
+
31
+ Section 1. a;sldfkajsd;
32
+
33
+ 1.a. a;sldfkjasd;flkajs
34
+
35
+ 1.b. a;lsdfkajsd;lfkj
36
+
37
+ 1.c. a;sdlfkajsd;flkajs
38
+
39
+ 1.d. as;dlfkjasd;lfkjs
40
+
@@ -0,0 +1,34 @@
1
+ ---
2
+
3
+ # Structured Headers
4
+ level-1: "Article 1."
5
+ level-2: "pre (a)"
6
+ level-3: "pre (i)"
7
+ no-indent: l., ll., lll.
8
+ no-reset: l., ll., lll.
9
+
10
+ ---
11
+
12
+ # TEST 4
13
+
14
+ ```
15
+ l. Provision for Article 1.
16
+ ll. Provision for Section 1.1.
17
+ ll. Provision for 1.1.1.
18
+ lll. Provision for 1.1.2.
19
+ lll. 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
+ ll. asd;flkajsdf;lkj
24
+ lll. ;alsdkfjasd;flkajsd
25
+ ll. as;dlfkjasd;flakjsdll.
26
+ lll. a;lsdfkjasd;lfkj
27
+ lll. a;sdlfkajsd;flk
28
+ l. as;dlfkajsd;flkj
29
+ ll. a;sldfkajsd;
30
+ lll. a;sldfkjasd;flkajs
31
+ lll. a;lsdfkajsd;lfkj
32
+ lll. a;sdlfkajsd;flkajs
33
+ lll. as;dlfkjasd;lfkjs
34
+ ```
@@ -0,0 +1,40 @@
1
+ # TEST 4
2
+
3
+ Article 1. Provision for Article 1.
4
+
5
+ 1(a) Provision for Section 1.1.
6
+
7
+ 1(b) Provision for 1.1.1.
8
+
9
+ 1(b)(i) Provision for 1.1.2.
10
+
11
+ 1(b)(ii) Provision for Section 1.2.
12
+
13
+ 1(b)(iii) Provision for 1.2.1.
14
+
15
+ Article 2. Provision for 1.2.2.
16
+
17
+ 2(c) Profivis asl;jksfd;lg; lkshflksjdh
18
+
19
+ 2(d) asd;flkajsdf;lkj
20
+
21
+ 2(d)(iv) ;alsdkfjasd;flkajsd
22
+
23
+ 2(e) as;dlfkjasd;flakjsdll.
24
+
25
+ 2(e)(v) a;lsdfkjasd;lfkj
26
+
27
+ 2(e)(vi) a;sdlfkajsd;flk
28
+
29
+ Article 3. as;dlfkajsd;flkj
30
+
31
+ 3(f) a;sldfkajsd;
32
+
33
+ 3(f)(vii) a;sldfkjasd;flkajs
34
+
35
+ 3(f)(viii) a;lsdfkajsd;lfkj
36
+
37
+ 3(f)(ix) a;sdlfkajsd;flkajs
38
+
39
+ 3(f)(x) as;dlfkjasd;lfkjs
40
+
@@ -0,0 +1,33 @@
1
+ ---
2
+
3
+ # Structured Headers
4
+ level-1: "Article 1."
5
+ level-2: "preval 1."
6
+ level-3: "(a)"
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
+ ll. Provision for 1.2.1.
20
+ l. Provision for 1.2.2.
21
+ lll. 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
+ ll. a;lsdfkajsd;lfkj
31
+ lll. a;sdlfkajsd;flkajs
32
+ ll. as;dlfkjasd;lfkjs
33
+ ```
@@ -0,0 +1,40 @@
1
+ # TEST 4
2
+
3
+ Article 1. Provision for Article 1.
4
+
5
+ 101. Provision for Section 1.1.
6
+
7
+ 102. Provision for 1.1.1.
8
+
9
+ (a) Provision for 1.1.2.
10
+
11
+ (b) Provision for Section 1.2.
12
+
13
+ 103. Provision for 1.2.1.
14
+
15
+ Article 2. Provision for 1.2.2.
16
+
17
+ (a) Profivis asl;jksfd;lg; lkshflksjdh
18
+
19
+ 201. asd;flkajsdf;lkj
20
+
21
+ (a) ;alsdkfjasd;flkajsd
22
+
23
+ 202. as;dlfkjasd;flakjsdll.
24
+
25
+ (a) a;lsdfkjasd;lfkj
26
+
27
+ (b) a;sdlfkajsd;flk
28
+
29
+ Article 3. as;dlfkajsd;flkj
30
+
31
+ 301. a;sldfkajsd;
32
+
33
+ (a) a;sldfkjasd;flkajs
34
+
35
+ 302. a;lsdfkajsd;lfkj
36
+
37
+ (a) a;sdlfkajsd;flkajs
38
+
39
+ 303. as;dlfkjasd;lfkjs
40
+
@@ -0,0 +1,33 @@
1
+ ---
2
+
3
+ # Structured Headers
4
+ level-1: "Article 1."
5
+ level-2: "Section preval 1."
6
+ level-3: "pre (a)"
7
+ no-indent: l., ll., lll.
8
+
9
+ ---
10
+
11
+ # TEST 4
12
+
13
+ ```
14
+ l. |123| Provision for Article 1.
15
+ ll. Provision for Section 1.1.
16
+ ll. Provision for 1.1.1. under |123|
17
+ lll. |432| Provision for 1.1.2.
18
+ lll. Provision for Section 1.2.
19
+ lll. Provision for 1.2.1. above is |432|
20
+ l. Provision for 1.2.2.
21
+ ll. Profivis asl;jksfd;lg; lkshflksjdh
22
+ ll. asd;flkajsdf;lkj
23
+ lll. ;alsdkfjas |123| d;flkajsd
24
+ ll. as;dlfkjasd;flakjsdll.
25
+ lll. a;lsdfkjasd; |432| 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
+ ```