Merge branch 'master' of github.com:tdreyno/middleman

This commit is contained in:
Thomas Reynolds 2011-12-14 21:18:30 -08:00
commit a63334813f
15 changed files with 89 additions and 7 deletions

View file

@ -2,6 +2,26 @@ Feature: Markdown support
In order to test included Maruku support
Scenario: Rendering html
Given the Server is running at "test-app"
When I go to "/markdown.html"
Then I should see "<p>Hello World</p>"
Given the Server is running at "markdown-app"
When I go to "/index.html"
Then I should see "<p>Hello World</p>"
Scenario: Redcarpet 2 extensions
Given the Server is running at "markdown-app"
When I go to "/smarty_pants.html"
Then I should see "&ldquo;"
When I go to "/no_intra_emphasis.html"
Then I should not see "<em>"
When I go to "/tables.html"
Then I should see "<table>"
When I go to "/fenced_code_blocks.html"
Then I should see "<code>"
When I go to "/autolink.html"
Then I should see "<a href"
When I go to "/strikethrough.html"
Then I should see "<del>"
When I go to "/space_after_headers.html"
Then I should not see "<h1>"
When I go to "/superscript.html"
Then I should see "<sup>"

View file

@ -0,0 +1,9 @@
set :markdown, :smartypants => true,
:no_intra_emphasis => true,
:tables => true,
:fenced_code_blocks => true,
:autolink => true,
:strikethrough => true,
:lax_html_blocks => true,
:space_after_headers => true,
:superscript => true

View file

@ -0,0 +1,5 @@
---
layout: false
---
http://example.com

View file

@ -0,0 +1,7 @@
---
layout: false
---
~~~~~~~~~~~~~~~~~~~~~
a one-line code block
~~~~~~~~~~~~~~~~~~~~~

View file

@ -0,0 +1,4 @@
---
layout: false
---
Hello World

View file

@ -0,0 +1,5 @@
---
layout: false
---
foo_bar_baz

View file

@ -0,0 +1,5 @@
---
layout: false
---
"Hello"

View file

@ -0,0 +1,5 @@
---
layout: false
---
#this is my header

View file

@ -0,0 +1,5 @@
---
layout: false
---
~~Nope~~

View file

@ -0,0 +1,5 @@
---
layout: false
---
this is the 2^(nd) time

View file

@ -0,0 +1,8 @@
---
layout: false
---
First Header | Second Header
------------- | -------------
Content Cell | Content Cell
Content Cell | Content Cell

View file

@ -23,7 +23,6 @@ end
with_layout false do
page "/request-path.html"
page "/lorem.html"
page "/markdown.html"
page "/relative_image.html"
page "/inline-css.html"
page "/inline-js.html"

View file

@ -1 +0,0 @@
Hello World

View file

@ -41,7 +41,7 @@ module Middleman
def init(name)
key = options[:template].to_sym
unless Middleman::Templates.registered.has_key?(key)
key = :default
raise Thor::Error.new "Unknown project template '#{key}'"
end
thor_group = Middleman::Templates.registered[key]
@ -120,4 +120,4 @@ module Middleman
exit 0
end
end
end
end

View file

@ -2,6 +2,12 @@ module Middleman::Renderers::Markdown
class << self
def registered(app)
require "redcarpet"
# Forcably disable Redcarpet1 support.
# Tilt defaults to this if available, but the compat
# layer disables extensions.
Object.send(:remove_const, :RedcarpetCompat) if defined? ::RedcarpetCompat
app.set :markdown_engine, :redcarpet
app.set :markdown_engine_prefix, ::Tilt