forked from puppetlabs/showoff
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Making markdown engine configurable per slideshow
* allows to configure the markdown engine in the showoff.json * allows to use math mode for slides if applicable * documentation on how to use other markdown engines
- Loading branch information
1 parent
0657b2d
commit 14706b6
Showing
6 changed files
with
152 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
!SLIDE | ||
# My Presentation # | ||
|
||
!SLIDE bullets incremental | ||
# Bullet Points # | ||
|
||
* first point | ||
* second point | ||
* third point | ||
|
||
|
||
!SLIDE | ||
|
||
# Math Mode # | ||
|
||
$\forall x \in X; \sum_i=x^i$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ "name": "My Preso", | ||
"sections": [ {"section":"one"} ], | ||
"markdown" : "maruku", | ||
"maruku" : { | ||
"use_tex" : true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
require File.expand_path "../test_helper", __FILE__ | ||
|
||
begin | ||
require 'maruku' | ||
do_maruku = true | ||
rescue LoadError | ||
do_maruku = false | ||
end | ||
|
||
context "ShowOff Maruku tests" do | ||
|
||
def app | ||
opt = {:verbose => false, :pres_dir => "test/fixtures/maruku", :pres_file => 'showoff.json'} | ||
ShowOff.set opt | ||
ShowOff.new | ||
end | ||
|
||
setup do | ||
end | ||
|
||
test "maruku can get the index page" do | ||
get '/' | ||
assert last_response.ok? | ||
assert_match '<div id="preso">', last_response.body | ||
end | ||
|
||
test "maruku can get basic slides" do | ||
get '/slides' | ||
assert last_response.ok? | ||
assert_match /<h1(.*?)>My Presentation<\/h1>/, last_response.body | ||
end | ||
|
||
test "maruku transforms equation to math mode" do | ||
get '/slides' | ||
assert_match /<span class="maruku-inline"><img alt="\$\\forall/, last_response.body | ||
end | ||
|
||
test "maruku can math mode" do | ||
assert_equal "maruku", ShowOffUtils.showoff_markdown("test/fixtures/maruku") | ||
end | ||
|
||
|
||
end if do_maruku |