diff --git a/README.md b/README.md index cb562f1..232498b 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ The guard statement defines which guard your configuring and sets any optional p * :convert_on_start - if true will run all conversions when you start the guard. Defaults to true * :dry_run - if true won't actually run the conversion process, but it will output the files being watched and the file it would write to. Use it to tweak your watch statements and when you're happy set it to false. -If you want to pass additional options directly to kramdown add them as an addition options hash to `kram_ops`. +If you want to pass additional options directly to kramdown add them as an additional options hash to `kram_ops`. For example to generate a table of contents consisting of headers 2 through 6 first make sure that something like the following is in your markdown source file. This serves as a placeholder which will be replaced with the table of contents. See: [Automatic Table of Contents Generation](http://kramdown.rubyforge.org/converter/html.html#toc). diff --git a/spec/lib/guard/markdown_spec.rb b/spec/lib/guard/markdown_spec.rb index 43013e5..e303946 100644 --- a/spec/lib/guard/markdown_spec.rb +++ b/spec/lib/guard/markdown_spec.rb @@ -118,8 +118,8 @@ end end - describe "with additional kram_ops" do - it "should use the template when converting the source file" do + describe "with a template file and additional kramdown options" do + it "should use the additional kramdown options and the template when converting the source file" do file_double = double() file_double.should_receive(:read).and_return("#Title") File.should_receive(:open).with("input.md","rb").and_return(file_double) @@ -168,9 +168,3 @@ def mock_kramdown text Kramdown::Document.should_receive(:new).with(text, :input => "kramdown", :output=> "html").and_return(kram_doc) kram_doc end - -def mock_kramdown_with_kram_ops text - kram_doc = double() - Kramdown::Document.should_receive(:new).with(text, :input => "kramdown", :output=> "html").and_return(kram_doc) - kram_doc -end