Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

specs pass - docs updated

  • Loading branch information...
commit 57d1d6c8e33a0924b71f2a1116e28e43ced24e11 1 parent c9cf717
Kristian Mandrup authored September 14, 2012
26  README.rdoc → README.md
Source Rendered
... ...
@@ -1,6 +1,6 @@
1  
-= mongoid-markdown
  1
+# Mongoid Markdown
2 2
 
3  
-Add Markdown functionality for any Mongoid object.
  3
+Add Markdown functionality to any Mongoid object.
4 4
 
5 5
 ```ruby
6 6
 
@@ -11,24 +11,34 @@ class Message
11 11
   field :body, :markdown => true
12 12
 end
13 13
 
14  
-message = Message.new :body => my_markdown_text
  14
+message = Message.new :body => "## Hello world"
  15
+
  16
+message.marked_down? # => false
15 17
 
16 18
 message.markdown!
17 19
 
18  
-message.body = some_other_markedup_txt
  20
+message.marked_down? # => true
  21
+
  22
+puts message.body # => "<h2>Hello world</h2>"
  23
+
  24
+message.body = "## Goodbye cruel world..."
19 25
 
20  
-message.body.reload
  26
+message.reload # not sure about this!
21 27
 
22  
-message.body.marked_down?
  28
+message.marked_down? # => true
23 29
 ```
24 30
 
25 31
 Enjoy!
26 32
 
27 33
 Extracted from: https://github.com/baphled/chat-engine/blob/master/lib/mongoid/markdown.rb
28 34
 
29  
-Hopefully should work on both Mongoid pre 2.4 and later, including 3.x. Please help fix any bugs.
  35
+See specs for more usage examples
  36
+
  37
+Should work on both Mongoid pre 2.4 and later, including 3.x. 
  38
+
  39
+Please help fix any bugs or come with suggestions to improvements.
30 40
 
31  
-== Contributing to mongoid-markdown
  41
+## Contributing to mongoid-markdown
32 42
  
33 43
 * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
34 44
 * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
1  spec/mongoid-markdown_spec.rb
@@ -19,6 +19,7 @@ class Message
19 19
 
20 20
     it "should markup text" do
21 21
       subject.marked_down?.should be_true
  22
+      puts subject.body
22 23
       subject.body.should_not == markdown_text
23 24
     end
24 25
   end

0 notes on commit 57d1d6c

Please sign in to comment.
Something went wrong with that request. Please try again.