Skip to content

Commit

Permalink
Revert "Added support for various forms of charts."
Browse files Browse the repository at this point in the history
This reverts commit a508e50.
  • Loading branch information
schacon committed Oct 18, 2010
1 parent 1c4b8b3 commit 9cb6661
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 458 deletions.
19 changes: 0 additions & 19 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -138,25 +138,6 @@ definition, where tname is one of the following supported transitions:

The transitions are provided by jQuery Cycle plugin. See http://www.malsup.com/jquery/cycle/browser.html to view the effects and http://www.malsup.com/jquery/cycle/adv2.html for how to add custom effects.

Charts can be specified through the use of chart=cname on the !SLIDE definition,
where cname is one of the following supported chart types:

* pie
* bar (both single and multi-series versions)
* stacked
* line
* area

Data for the chart is taken from a table on the slide itself. Because you cannot
arbitarily create 'th' elements using the markdown table syntax, the code looks for
'em' elements within the table cells ('td' elements). These 'em' elements are
used for naming series and value points. All other cells are assumed to be point
values for each series.

It sounds complicated but if you look at section 'four' of the example it should
more sense! Note, to get table markdown support you need to have installed the
kramdown gem.

You can manage the presentation with the following keys:

* space, cursor right: next slide
Expand Down
109 changes: 0 additions & 109 deletions example/four/charts.md

This file was deleted.

3 changes: 1 addition & 2 deletions example/showoff.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"sections": [
{"section":"one"},
{"section":"two"},
{"section":"three"},
{"section":"four"}
{"section":"three"}
]
}
22 changes: 3 additions & 19 deletions lib/showoff.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,10 @@
end

begin
require 'kramdown'
Markdown = Kramdown::Document

puts 'Using kramdown for markdown parsing'
require 'rdiscount'
rescue LoadError
begin
require 'rdiscount'

puts 'Using rdiscount for markdown parsing'
rescue LoadError
require 'bluecloth'
Markdown = BlueCloth

puts 'Using bluecloth for markdown parsing'
end
require 'bluecloth'
Markdown = BlueCloth
end
require 'pp'

Expand Down Expand Up @@ -99,16 +88,12 @@ def process_markdown(name, content, static=false)
# extract transition, defaulting to none
transition = 'none'
content_classes.delete_if { |x| x =~ /^transition=(.+)/ && transition = $1 }
# extract chart, defaulting to nil
chart = nil
content_classes.delete_if { |x| x =~ /^chart=(.+)/ && chart = $1 }
# extract id, defaulting to none
id = nil
content_classes.delete_if { |x| x =~ /^#([\w-]+)/ && id = $1 }
puts "id: #{id}" if id
puts "classes: #{content_classes.inspect}"
puts "transition: #{transition}"
puts "chart: #{chart}"
# create html
md += "<div"
md += " id=\"#{id}\"" if id
Expand All @@ -122,7 +107,6 @@ def process_markdown(name, content, static=false)
sl = Markdown.new(slide).to_html
sl = update_image_paths(name, sl, static)
md += sl
md += "<div class=\"chart\" data-chart=\"#{chart}\"></div>" unless chart.nil?
md += "</div>\n"
md += "</div>\n"
final += update_commandline_code(md)
Expand Down
5 changes: 0 additions & 5 deletions public/css/showoff.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@
overflow:hidden;
}

.slide .chart {
height: 580px;
margin: 0 auto;
}

#footer {
background: #eee;
padding: 2px;
Expand Down
152 changes: 0 additions & 152 deletions public/js/charts.js

This file was deleted.

Loading

0 comments on commit 9cb6661

Please sign in to comment.