legal_markdown 0.4.4 → 0.4.5

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -16,3 +16,4 @@ spec/reports
16
16
  test/tmp
17
17
  test/version_tmp
18
18
  tmp
19
+ coverage
data/Gemfile CHANGED
@@ -2,3 +2,7 @@ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
4
  gem 'rake'
5
+
6
+ group :development, :test do
7
+ gem 'coveralls', require: false
8
+ end
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Status
2
2
 
3
- [![Build Status](https://travis-ci.org/compleatang/legal-markdown.png)](https://travis-ci.org/compleatang/legal-markdown)[![Code Climate](https://codeclimate.com/github/compleatang/legal-markdown.png)](https://codeclimate.com/github/compleatang/legal-markdown)[![Dependency Status](https://gemnasium.com/compleatang/legal-markdown.png)](https://gemnasium.com/compleatang/legal-markdown)
3
+ [![Build Status](https://travis-ci.org/compleatang/legal-markdown.png)](https://travis-ci.org/compleatang/legal-markdown)[![Coverage Status](https://coveralls.io/repos/compleatang/legal-markdown/badge.png?branch=master)](https://coveralls.io/r/compleatang/legal-markdown?branch=master)[![Code Climate](https://codeclimate.com/github/compleatang/legal-markdown.png)](https://codeclimate.com/github/compleatang/legal-markdown)[![Dependency Status](https://gemnasium.com/compleatang/legal-markdown.png)](https://gemnasium.com/compleatang/legal-markdown)
4
4
 
5
5
  # Introduction
6
6
 
@@ -32,7 +32,7 @@ If you install the package there is no need to install the gem, but you will sti
32
32
 
33
33
  ## How to Use This Gem?
34
34
 
35
- After the gem has finished its installation on your system then you can simply type `$> legal2md [filename]` where the filename is the fileyou want the gem to parse. Legal Markdown will parse the file and output the same filename.
35
+ After the gem has finished its installation on your system then you can simply type `$> legal2md [filename]` where the filename is the file you want the gem to parse. Legal Markdown will parse the file and output the same filename.
36
36
 
37
37
  If you prefer to output as a different filename (which will allow you to keep the YAML front-matter), then you simply type `$> legal2md [input-filename] [output-filename]`.
38
38
 
@@ -79,14 +79,15 @@ In the body of your document you put the entire clause in square-brackets (as yo
79
79
 
80
80
  In the YAML Front-Matter you simply add "true" or "false" to turn that entire clause on or off. **Note**, if you do not add the mixin to your header, legal_markdown is just going to leave it as is, which is very unlikely to be what you want to see in your output file.
81
81
 
82
- You are able to nest optional clauses inside of other optional clauses. However, if you do so, make sure that you include all of the sub-provisions of the master provision in the YAML matter, else the gem will think that you closed your square brackets too early (which it was probably the closure of a nested clause. If you use the automatic YAML population feature either from the command line (see above) or by using the Sublime package, it will simplify this process for you greatly.
82
+ You are able to nest optional clauses inside of other optional clauses. However, if you do so, make sure that you include all of the sub-provisions of the master provision in the YAML matter, else the gem will think that you closed your square brackets earlier than you thought the nested clause closed. If you use the automatic YAML population feature either from the command line (see above) or by using the Sublime package, it will simplify this process for you greatly.
83
83
 
84
84
  Another thing to note, if you include nested provisions, you can turn off an inside provision and leave an outside provision on, but if you turn off an outside provision the entire portion will not be produced, even if you turned an inner portion on. Usually, as long as you keep this rule in mind you can draft around it, and it is generally the case that that will be the result that you will want any way.
85
85
 
86
86
  So, this is how the body of the text would look.
87
87
 
88
- ```md
89
- [{{my_optional_clause}}Both parties agree that upon material breach of this agreement by either party they will both commit suicide in homage to Kurt Cobain.]
88
+ ```lmd
89
+ [{{my_optional_clause}}Both parties agree that upon material breach of this agreement by either
90
+ party they will both commit suicide in homage to Kurt Cobain.]
90
91
  ```
91
92
 
92
93
  Then the YAML Front Matter would look like this
@@ -188,7 +189,7 @@ You can easily to that by doing the following steps.
188
189
 
189
190
  ### Step 1: Type the body
190
191
 
191
- ```md
192
+ ```lmd
192
193
  l. Provision for Article 1.
193
194
  ll. Provision for Section 1.1.
194
195
  lll. Provision for 1.1.1.
@@ -292,7 +293,7 @@ no-indent: l., ll.
292
293
 
293
294
  and the body of the text looked like this:
294
295
 
295
- ```md
296
+ ```lmd
296
297
  ...
297
298
  ll. |123| This provision will need to be referenced later.
298
299
  ll. Provision
@@ -324,11 +325,11 @@ When you are building documents sometime you simply want to put `date: @today`.
324
325
 
325
326
  ### Citations
326
327
 
327
- At this point legal_markdown does not have a native citation handling ability. For now, I've outsourced that to the primary processor. If you look at pandoc, it has excellent bibtex and citation support that will bluebook up everything for you. Legal Markdown does not get in the way if how pandoc does citations so it is fully compatible.
328
+ At this point legal_markdown does not have a native citation handling ability. For now, I've outsourced that to the primary processor. If you look at pandoc, it has excellent bibtex and citation support that will bluebook up everything for you. Legal Markdown does not get in the way of how pandoc does citations so it is fully compatible.
328
329
 
329
330
  ## A Few Gotchas
330
331
 
331
- * Legal_markdown is optimized primarily for contracts, legislation, and regulations. It is not optimized for cases. For memoranda and filings I use the mixin portion but not the header portion which is enough to meet my needs - in particular, when matched with Sublime Text snippets. If you area looking for a more complete solution for cases and filings I would recommend the [Precedent Gem](https://github.com/BlackacreLabs/precedent) built by [Kyle Mitchell](https://github.com/kemitchell) for [Blackacre Labs](https://github.com/BlackacreLabs)
332
+ * Legal_markdown is optimized primarily for contracts, legislation, and regulations. It is not optimized for cases. For memoranda and filings I use the mixin portion but not the structured headers functionality which is enough to meet my needs - in particular, when matched with Sublime Text snippets. If you area looking for a solution for cases and filings I would recommend the [Precedent Gem](https://github.com/BlackacreLabs/precedent) built by [Kyle Mitchell](https://github.com/kemitchell) for [Blackacre Labs](https://github.com/BlackacreLabs)
332
333
  * At this point, you cannot have more than 9 levels for headers, but if you have more than 9 levels of headers you have some insane case study which will require more than this tool to cope with.
333
334
 
334
335
  ## Roadmap / TODO
data/bin/legal2md CHANGED
@@ -2,6 +2,10 @@
2
2
  #
3
3
  # == USAGE
4
4
  # legal2md input_file output_file
5
-
5
+ if ARGV.size == 1
6
+ args = [:to_markdown, ARGV.first, ARGV.first]
7
+ else
8
+ args = ARGV
9
+ end
6
10
  require 'legal_markdown'
7
- LegalMarkdown::parse(ARGV)
11
+ LegalMarkdown::parse(args)
@@ -19,7 +19,8 @@ Gem::Specification.new do |s|
19
19
  s.require_paths = ["lib"]
20
20
  s.license = 'MIT'
21
21
 
22
- # s.add_dependency
22
+ # s.add_dependency('dependency')
23
+ s.add_development_dependency('coveralls')
23
24
 
24
25
  s.description = <<desc
25
26
  This gem will parse YAML Front Matter of Markdown Documents. Typically, this gem would be called with a md renderer, such as Pandoc, that would turn the md into a document such as a .pdf file or a .docx file. By combining this pre-processing with a markdown renderer, you can ensure that both the structured content and the structured styles necessary for your firm or organization are more strictly enforced. Plus you won't have to deal with Word any longer, and every lawyer should welcome that. Why? Because Word is awful.
@@ -8,7 +8,9 @@ require 'optparse'
8
8
  module LegalMarkdown
9
9
 
10
10
  def self.parse(*args)
11
- args ||= ARGV.dup
11
+ if args.size == 1 && args.first.class == Array
12
+ args = args.first
13
+ end
12
14
 
13
15
  config={}
14
16
  config[:input] = {}
@@ -1,3 +1,3 @@
1
1
  module LegalMarkdown
2
- VERSION = "0.4.4"
2
+ VERSION = "0.4.5"
3
3
  end
@@ -1,4 +1,7 @@
1
- #! ruby
1
+ #!/usr/bin/env ruby
2
+ require 'coveralls'
3
+ Coveralls.wear!
4
+
2
5
  require 'test/unit'
3
6
  require 'securerandom'
4
7
  require 'json'
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.4
4
+ version: 0.4.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,8 +9,24 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-07-30 00:00:00.000000000 Z
13
- dependencies: []
12
+ date: 2013-08-05 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: coveralls
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
14
30
  description: ! ' This gem will parse YAML Front Matter of Markdown Documents. Typically,
15
31
  this gem would be called with a md renderer, such as Pandoc, that would turn the
16
32
  md into a document such as a .pdf file or a .docx file. By combining this pre-processing
@@ -178,7 +194,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
178
194
  version: '0'
179
195
  segments:
180
196
  - 0
181
- hash: 2539326547040470176
197
+ hash: 264622749286327641
182
198
  required_rubygems_version: !ruby/object:Gem::Requirement
183
199
  none: false
184
200
  requirements:
@@ -187,7 +203,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
187
203
  version: '0'
188
204
  segments:
189
205
  - 0
190
- hash: 2539326547040470176
206
+ hash: 264622749286327641
191
207
  requirements: []
192
208
  rubyforge_project:
193
209
  rubygems_version: 1.8.25