slideshow 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -13,7 +13,7 @@ Hoe.spec 'slideshow' do
13
13
 
14
14
  self.extra_deps = [
15
15
  ['RedCloth','>= 4.2.9'],
16
- ['kramdown','>= 0.13.5']
16
+ ['markdown_select','>= 0.1.2']
17
17
  ]
18
18
 
19
19
  self.remote_rdoc_dir = 'doc'
@@ -21,4 +21,13 @@ Hoe.spec 'slideshow' do
21
21
  # switch extension to .rdoc for gihub formatting
22
22
  self.readme_file = 'README.rdoc'
23
23
  self.history_file = 'History.rdoc'
24
- end
24
+
25
+ self.post_install_message =<<EOS
26
+ ******************************************************************************
27
+
28
+ Questions? Comments? Send them along to the mailing list.
29
+ https://groups.google.com/group/webslideshow
30
+
31
+ ******************************************************************************
32
+ EOS
33
+ end
@@ -35,20 +35,4 @@ rest:
35
35
  extnames: [ .rst, .rest ]
36
36
 
37
37
  markdown:
38
- extnames: [ .markdown, .m, .mark, .mkdn, .md, .txt, .text ]
39
-
40
- # note: only kramdown is listed as a dependency in gem specs (because it's Ruby only and, thus, easy to install)
41
- # if you want to use other markdown libs install the required/desired lib e.g.
42
- # use gem install rdiscount for rdiscount and so on
43
- #
44
- # also note for now the first present markdown library gets used
45
- # the search order is first come, first serve, that is: rdiscount, rpeg-markdown, maruku, bluecloth, kramdown (fallback, always present)
46
-
47
- libs:
48
- - pandoc-ruby
49
- - rdiscount
50
- - rpeg-markdown
51
- - maruku
52
- - bluecloth
53
- - kramdown
54
-
38
+ extnames: [ .markdown, .m, .mark, .mkdn, .md, .txt, .text ]
data/config/slideshow.yml CHANGED
@@ -68,9 +68,7 @@ helper:
68
68
  filters: []
69
69
 
70
70
  textile:
71
- extnames: []
71
+ extnames: []
72
72
 
73
73
  markdown:
74
- extnames: []
75
- libs: []
76
-
74
+ extnames: []
data/lib/slideshow.rb CHANGED
@@ -18,9 +18,8 @@ require 'yaml'
18
18
  require 'cgi'
19
19
 
20
20
  # required gems
21
- require 'redcloth' # default textile library
22
- require 'kramdown' # default markdown library
23
-
21
+ require 'redcloth' # default textile library
22
+ require 'markdown_select' # default markdown library
24
23
 
25
24
  # our own code
26
25
  require 'slideshow/opts'
@@ -55,7 +54,7 @@ require 'slideshow/filters/slide_filter'
55
54
 
56
55
  module Slideshow
57
56
 
58
- VERSION = '1.0.0'
57
+ VERSION = '1.0.1'
59
58
 
60
59
  # version string for generator meta tag (includes ruby version)
61
60
  def Slideshow.generator
@@ -41,17 +41,6 @@ class Config
41
41
  end
42
42
 
43
43
  end
44
-
45
- def markdown_to_html_method( lib )
46
- method = @hash.fetch( 'user', {} ).fetch( lib, {} ).fetch( 'converter', nil )
47
-
48
- # use default name
49
- if method.nil?
50
- method = "#{lib.downcase}_to_html"
51
- end
52
-
53
- method.tr('-','_').to_sym
54
- end
55
44
 
56
45
  def markdown_post_processing?( lib )
57
46
  @hash.fetch( 'user', {} ).fetch( lib, {} ).fetch( 'post-processing', true )
@@ -76,16 +65,6 @@ class Config
76
65
  @hash[ 'markdown' ][ 'extnames' ] + @hash[ 'builtin' ][ 'markdown' ][ 'extnames' ]
77
66
  end
78
67
 
79
- def known_markdown_libs
80
- # returns an array of known markdown engines e.g.
81
- # [ pandoc-ruby, rdiscount, rpeg-markdown, maruku, bluecloth, kramdown ]
82
-
83
- libs = @hash[ 'markdown' ][ 'libs' ] + @hash[ 'builtin' ][ 'markdown' ][ 'libs' ]
84
- user_libs = @hash.fetch( 'user', {} ).fetch( 'markdown', {} ).fetch( 'libs', [] )
85
-
86
- user_libs + libs
87
- end
88
-
89
68
  def known_extnames
90
69
  # ruby check: is it better self. ?? or more confusing
91
70
  # possible conflict only with write access (e.g. prop=)
@@ -33,7 +33,7 @@ def directives_percent_style( content )
33
33
  # - pandoc uses % for its own markdown extension
34
34
  # - don't process % pass it along/through to pandoc
35
35
 
36
- return content if @markup_type == :markdown && @markdown_libs.first == 'pandoc-ruby'
36
+ return content if @markup_type == :markdown && MarkdownSelect.lib == 'pandoc-ruby'
37
37
 
38
38
 
39
39
  directive_unparsed = 0
@@ -101,7 +101,7 @@ def comments_percent_style( content )
101
101
  # skip filter for pandoc
102
102
  # - pandoc uses % for its own markdown extension
103
103
 
104
- return content if @markup_type == :markdown && @markdown_libs.first == 'pandoc-ruby'
104
+ return content if @markup_type == :markdown && MarkdownSelect.lib == 'pandoc-ruby'
105
105
 
106
106
  # remove comments
107
107
  # % comments
data/lib/slideshow/gen.rb CHANGED
@@ -171,7 +171,7 @@ class Gen
171
171
 
172
172
  # 1) add slide break
173
173
 
174
- if (@markup_type == :markdown && @markdown_libs.first == 'pandoc-ruby') || @markup_type == :rest
174
+ if (@markup_type == :markdown && MarkdownSelect.lib == 'pandoc-ruby') || @markup_type == :rest
175
175
  content = add_slide_directive_before_div_h1( content )
176
176
  else
177
177
  content = add_slide_directive_before_h1( content )
@@ -370,7 +370,7 @@ class Gen
370
370
  # make content2 and slide2 available to erb template
371
371
  # -- todo: cleanup variable names and use attr_readers for content and slide
372
372
 
373
- if @markup_type == :markdown && config.markdown_post_processing?( @markdown_libs.first ) == false
373
+ if @markup_type == :markdown && config.markdown_post_processing?( MarkdownSelect.lib ) == false
374
374
  puts " Skipping post-processing (passing content through as is)..."
375
375
  @content = content # content all-in-one - make it available in erb templates
376
376
  else
@@ -503,7 +503,6 @@ def run( args )
503
503
  elsif opts.fetch?
504
504
  fetch_slideshow_templates
505
505
  else
506
- load_markdown_libs
507
506
  load_plugins # check for optional plugins/extension in ./lib folder
508
507
 
509
508
  args.each { |fn| create_slideshow( fn ) }
@@ -1,90 +1,14 @@
1
1
  module Slideshow
2
2
  module MarkdownEngines
3
3
 
4
- def pandoc_ruby_to_html( content )
5
- content = PandocRuby.new( content, :from => :markdown, :to => :html ).convert
6
- end
7
-
8
- def pandoc_ruby_to_html_incremental( content )
9
- content = PandocRuby.new( content, :from => :markdown, :to => :html ).convert
10
- content = content.gsub(/<(ul|ol)/) do |match|
11
- "#{Regexp.last_match(0)} class='step'"
12
- end
13
- content
14
- end
15
-
16
- # sample how to use your own converter
17
- # configure in slideshow.yml
18
- # pandoc-ruby:
19
- # converter: pandoc-ruby-to-s5
20
-
21
- def pandoc_ruby_to_s5( content )
22
- content = PandocRuby.new( content, {:from => :markdown, :to => :s5}, :smart ).convert
23
- content = content.gsub(/class="incremental"/,'class="step"')
24
- content = content.to_a[13..-1].join # remove the layout div
25
- end
26
-
27
- def pandoc_ruby_to_s5_incremental( content )
28
- content = PandocRuby.new( content, {:from => :markdown, :to => :s5 }, :incremental, :smart ).convert
29
- content = content.gsub(/class="incremental"/,'class="step"')
30
- content = content.to_a[13..-1].join # remove the layout div
31
- end
32
-
33
- def rdiscount_to_html( content )
34
- RDiscount.new( content ).to_html
35
- end
36
-
37
- def rpeg_markdown_to_html( content )
38
- PEGMarkdown.new( content ).to_html
39
- end
40
-
41
- def maruku_to_html( content )
42
- Maruku.new( content, {:on_error => :raise} ).to_html
43
- end
44
-
45
- def bluecloth_to_html( content )
46
- BlueCloth.new( content ).to_html
47
- end
48
-
49
- def kramdown_to_html( content )
50
- Kramdown::Document.new( content ).to_html
51
- end
52
-
53
-
54
- ### code for managing multiple markdown libs
55
-
56
- def load_markdown_libs
57
- # check for available markdown libs/gems
58
- # try to require each lib and remove any not installed
59
- @markdown_libs = []
60
-
61
- config.known_markdown_libs.each do |lib|
62
- begin
63
- require lib
64
- @markdown_libs << lib
65
- rescue LoadError => ex
66
- logger.debug "Markdown library #{lib} not found. Use gem install #{lib} to install."
67
- end
68
- end
69
-
70
- puts " Found #{@markdown_libs.length} Markdown libraries: #{@markdown_libs.join(', ')}"
71
- end
72
-
4
+ ## note: code move to its own gem, that is, markdown_select
5
+ ## see https://github.com/geraldb/markdown_select
73
6
 
74
7
  def markdown_to_html( content )
75
- # call markdown filter; turn markdown lib name into method_name (mn)
76
- # eg. rpeg-markdown => rpeg_markdown_to_html
77
-
78
- # lets you use differnt options/converters for a single markdown lib
79
- mn = config.markdown_to_html_method( @markdown_libs.first )
80
-
81
- puts " Converting Markdown-text (#{content.length} bytes) to HTML using library '#{@markdown_libs.first}' calling '#{mn}'..."
8
+ ## puts " Converting Markdown-text (#{content.length} bytes) to HTML using library '#{@markdown_libs.first}' calling '#{mn}'..."
82
9
 
83
- send mn, content # call 1st configured markdown engine e.g. kramdown_to_html( content )
10
+ MarkdownSelect.new( content ).to_html
84
11
  end
85
-
86
-
87
-
88
12
 
89
13
  end # module MarkdownEngines
90
14
  end # module Slideshow
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slideshow
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
5
- prerelease: false
4
+ hash: 21
5
+ prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 0
10
- version: 1.0.0
9
+ - 1
10
+ version: 1.0.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Gerald Bauer
@@ -15,8 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-03-04 00:00:00 +01:00
19
- default_executable:
18
+ date: 2012-05-26 00:00:00 Z
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
22
21
  name: RedCloth
@@ -35,35 +34,34 @@ dependencies:
35
34
  type: :runtime
36
35
  version_requirements: *id001
37
36
  - !ruby/object:Gem::Dependency
38
- name: kramdown
37
+ name: markdown_select
39
38
  prerelease: false
40
39
  requirement: &id002 !ruby/object:Gem::Requirement
41
40
  none: false
42
41
  requirements:
43
42
  - - ">="
44
43
  - !ruby/object:Gem::Version
45
- hash: 33
44
+ hash: 31
46
45
  segments:
47
46
  - 0
48
- - 13
49
- - 5
50
- version: 0.13.5
47
+ - 1
48
+ - 2
49
+ version: 0.1.2
51
50
  type: :runtime
52
51
  version_requirements: *id002
53
52
  - !ruby/object:Gem::Dependency
54
- name: rubyforge
53
+ name: rdoc
55
54
  prerelease: false
56
55
  requirement: &id003 !ruby/object:Gem::Requirement
57
56
  none: false
58
57
  requirements:
59
- - - ">="
58
+ - - ~>
60
59
  - !ruby/object:Gem::Version
61
- hash: 7
60
+ hash: 19
62
61
  segments:
63
- - 2
64
- - 0
65
- - 4
66
- version: 2.0.4
62
+ - 3
63
+ - 10
64
+ version: "3.10"
67
65
  type: :development
68
66
  version_requirements: *id003
69
67
  - !ruby/object:Gem::Dependency
@@ -72,14 +70,13 @@ dependencies:
72
70
  requirement: &id004 !ruby/object:Gem::Requirement
73
71
  none: false
74
72
  requirements:
75
- - - ">="
73
+ - - ~>
76
74
  - !ruby/object:Gem::Version
77
- hash: 21
75
+ hash: 29
78
76
  segments:
79
77
  - 2
80
- - 6
81
- - 1
82
- version: 2.6.1
78
+ - 15
79
+ version: "2.15"
83
80
  type: :development
84
81
  version_requirements: *id004
85
82
  description: |-
@@ -93,7 +90,9 @@ executables:
93
90
  extensions: []
94
91
 
95
92
  extra_rdoc_files:
93
+ - History.rdoc
96
94
  - Manifest.txt
95
+ - README.rdoc
97
96
  - templates/s6.txt
98
97
  files:
99
98
  - History.rdoc
@@ -140,11 +139,17 @@ files:
140
139
  - templates/slides.html.erb
141
140
  - templates/slides.pdf.html.erb
142
141
  - templates/style.css.erb
143
- has_rdoc: true
144
142
  homepage: http://slideshow.rubyforge.org
145
143
  licenses: []
146
144
 
147
- post_install_message:
145
+ post_install_message: |
146
+ ******************************************************************************
147
+
148
+ Questions? Comments? Send them along to the mailing list.
149
+ https://groups.google.com/group/webslideshow
150
+
151
+ ******************************************************************************
152
+
148
153
  rdoc_options:
149
154
  - --main
150
155
  - README.rdoc
@@ -171,7 +176,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
171
176
  requirements: []
172
177
 
173
178
  rubyforge_project: slideshow
174
- rubygems_version: 1.3.7
179
+ rubygems_version: 1.8.17
175
180
  signing_key:
176
181
  specification_version: 3
177
182
  summary: Slide Show (S9) - A Free Web Alternative to PowerPoint and KeyNote in Ruby