mdslide 2.1.1 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,14 @@
1
+ === 3.0.0 2012-05-20
2
+
3
+ * My-own-configurations is implemented
4
+ === 2.1.1 2012-05-16
5
+ === 2.1.0 2012-05-16
6
+ === 2.0.0 2012-05-16
7
+ === 1.1.0 2012-05-16
8
+ === 1.0.0 2012-05-11
9
+ === 0.0.4 2012-04-23
10
+ === 0.0.3 2012-04-23
11
+ === 0.0.2 2012-04-23
1
12
  === 0.0.1 2012-04-21
2
13
 
3
14
  * 1 major enhancement:
@@ -6,17 +6,22 @@ Rakefile
6
6
  lib/mdslide.rb
7
7
  lib/mdslide/command.rb
8
8
  lib/mdslide/creator.rb
9
+ lib/mdslide/themes.rb
10
+ lib/mdslide/config.rb
9
11
  templates/page.html.erb
10
12
  templates/slide.html.erb
13
+ assets/themes.yaml
11
14
  assets/js/jquery.min.js
12
15
  assets/js/slides.js
13
16
  assets/js/slides.coffee
14
17
  assets/css/base.css
15
- assets/css/black.css
16
- assets/css/takahashi.css
17
- assets/css/white.css
18
+ assets/css/color-black.css
19
+ assets/css/color-white.css
20
+ assets/css/position-takahashi.css
21
+ assets/css/transition-crossfade.css
22
+ assets/css/transition-hide-show.css
18
23
  script/console
19
- spec/mdslide_spec.rb
24
+ spec/creator_spec.rb
20
25
  spec/spec.opts
21
26
  spec/spec_helper.rb
22
27
  tasks/rspec.rake
@@ -54,6 +54,25 @@ Others can be shown with --help option
54
54
 
55
55
  $ mdslide --help
56
56
 
57
+ === CONFIGURATIONS
58
+ `mdslide` command reads ~/.mdslide/config.yaml if it exists. You can describe your own settings and themes in YAML format.
59
+
60
+ :themes:
61
+ :my-theme:
62
+ :css:
63
+ - my-theme.css
64
+ - color-black.css
65
+ - transition-crossfade.css
66
+ :js:
67
+ - my-theme.js
68
+ :config:
69
+ :bind: 0.0.0.0
70
+ :title: "My Slide"
71
+ :port: 10080
72
+ :theme: white-crossfade
73
+
74
+ CSS/JS files included in customized themes will be loaded in this order: relative path from the Markdown file -> relative path from your configuration directory (~/.mdslide/) -> assets directory of mdslide library (default). If you want to create your own theme, locate files on ~/.mdslide/.
75
+
57
76
  == LICENSE:
58
77
 
59
78
  (The MIT License)
@@ -1,7 +1,6 @@
1
1
  body {
2
2
  color: #000;
3
3
  background-color:#fff;
4
- overflow: hidden;
5
4
  }
6
5
  .slide {
7
6
  position:absolute;
@@ -0,0 +1,12 @@
1
+ body {
2
+ background-color:#000;
3
+ color:#fff;
4
+ font-family: sans-serif;
5
+ }
6
+
7
+ a { color: #66f; text-decoration:none; }
8
+ a:hover { text-decoration:underline; }
9
+
10
+ .slide pre {
11
+ border: 3px solid #ccc;
12
+ }
@@ -0,0 +1,12 @@
1
+ body {
2
+ background-color:#fff;
3
+ color:#000;
4
+ font-family: sans-serif;
5
+ }
6
+
7
+ a { color: #66f; text-decoration:none; }
8
+ a:hover { text-decoration:underline; }
9
+
10
+ .slide pre {
11
+ border: 3px solid #ccc;
12
+ }
@@ -0,0 +1,5 @@
1
+ .slide {
2
+ font-weight:bold;
3
+ font-family:sans-serif;
4
+ font-size: 300px;
5
+ }
@@ -0,0 +1,11 @@
1
+ .slide {
2
+ opacity: 0;
3
+ -moz-opacity: 0;
4
+ filter: alpha(opacity=0);
5
+ -webkit-transition-duration:0.3s;
6
+ }
7
+ .slide.current {
8
+ opacity: 1;
9
+ -moz-opacity: 1;
10
+ filter: alpha(opacity=100);
11
+ }
@@ -0,0 +1,6 @@
1
+ .slide {
2
+ display:none;
3
+ }
4
+ .slide.current {
5
+ display:block;
6
+ }
@@ -38,6 +38,7 @@ jQuery ->
38
38
  jQuery('#slides').hide()
39
39
  jQuery('#toolbox .forOutline').show()
40
40
  jQuery('#toolbox .forSlides').hide()
41
+ jQuery('body').css overflow:'visible'
41
42
 
42
43
  hideOutline = ()->
43
44
  jQuery(KEYTARGET).unbind('keyup',keyAction)
@@ -46,6 +47,7 @@ jQuery ->
46
47
  jQuery('#slides').show()
47
48
  jQuery('#toolbox .forOutline').hide()
48
49
  jQuery('#toolbox .forSlides').show()
50
+ jQuery('body').css overflow:'hidden'
49
51
 
50
52
  showSlide = (num)->
51
53
  slides = jQuery('.slide')
@@ -44,7 +44,10 @@
44
44
  jQuery('#outline').show();
45
45
  jQuery('#slides').hide();
46
46
  jQuery('#toolbox .forOutline').show();
47
- return jQuery('#toolbox .forSlides').hide();
47
+ jQuery('#toolbox .forSlides').hide();
48
+ return jQuery('body').css({
49
+ overflow: 'visible'
50
+ });
48
51
  };
49
52
  hideOutline = function() {
50
53
  jQuery(KEYTARGET).unbind('keyup', keyAction);
@@ -52,7 +55,10 @@
52
55
  jQuery('#outline').hide();
53
56
  jQuery('#slides').show();
54
57
  jQuery('#toolbox .forOutline').hide();
55
- return jQuery('#toolbox .forSlides').show();
58
+ jQuery('#toolbox .forSlides').show();
59
+ return jQuery('body').css({
60
+ overflow: 'hidden'
61
+ });
56
62
  };
57
63
  showSlide = function(num) {
58
64
  var slides;
@@ -0,0 +1,22 @@
1
+ ---
2
+ :white:
3
+ :css:
4
+ - color-white.css
5
+ - transition-hide-show.css
6
+ :black:
7
+ :css:
8
+ - color-black.css
9
+ - transition-hide-show.css
10
+ :black-crossfade:
11
+ :css:
12
+ - color-black.css
13
+ - transition-crossfade.css
14
+ :white-crossfade:
15
+ :css:
16
+ - color-white.css
17
+ - transition-crossfade.css
18
+ :takahashi:
19
+ :css:
20
+ - color-white.css
21
+ - position-takahashi.css
22
+ - transition-hide-show.css
@@ -4,5 +4,5 @@ $:.unshift(File.dirname(__FILE__)) unless
4
4
  require 'mdslide/creator'
5
5
 
6
6
  module Mdslide
7
- VERSION = '2.1.1'
7
+ VERSION = '3.0.0'
8
8
  end
@@ -8,7 +8,6 @@ require 'fileutils'
8
8
  module Mdslide
9
9
 
10
10
  ASSETS_DIR = File.expand_path(File.dirname(__FILE__) + '/../../assets')
11
- CONFIG_DIR = File.expand_path('~/.mdslide')
12
11
 
13
12
  def Mdslide.find_path path, dir_list
14
13
  dir_list.each do |dir_path|
@@ -24,10 +23,10 @@ module Mdslide
24
23
  arg :version,"Shows Mdslide Version", :alias => :v
25
24
  arg :help, "Shows Help", :alias => :h
26
25
  arg :input, "Input File", :alias => :i
27
- arg :theme, "Theme", :alias => :t, :default => 'white'
28
- arg :bind, "Bind IP Address", :alias => :b, :default => '127.0.0.1'
29
- arg :port, "Port Number", :alias => :p, :default => '3000'
30
- arg :title, "Title", :alias => :T, :default => 'Slides converted by Mdslide'
26
+ arg :theme, "Theme", :alias => :t, :default => Defaults[:theme]
27
+ arg :bind, "Bind IP Address", :alias => :b, :default => Defaults[:bind ]
28
+ arg :port, "Port Number", :alias => :p, :default => Defaults[:port ]
29
+ arg :title, "Title", :alias => :T, :default => Defaults[:title]
31
30
  arg :output, "Output File", :alias => :o
32
31
  arg :'without-assets-dir', "Does not create js/css directory"
33
32
  arg :'without-css-dir', "Does not create css directory"
@@ -42,13 +41,12 @@ module Mdslide
42
41
  return 0
43
42
  end
44
43
 
45
- config_path = File.expand_path(CONFIG_DIR + '/config.yaml')
46
- my_config = nil
47
- if File.exist? config_path
48
- my_config = YAML.load_file(config_path)
49
- Themes.merge! my_config[:themes]
50
- end
51
-
44
+ #config_path = File.expand_path(CONFIG_DIR + '/config.yaml')
45
+ #my_config = nil
46
+ #if File.exist? config_path
47
+ # my_config = YAML.load_file(config_path)
48
+ # Themes.merge! my_config[:themes]
49
+ #end
52
50
 
53
51
  creator = Creator.new
54
52
  creator.title = parser[:title]
@@ -110,6 +108,7 @@ module Mdslide
110
108
  end
111
109
 
112
110
  if !root_path
111
+ Mdslide.load_config
113
112
  m = req.path.match(/\/(.+)/)
114
113
  theme = (m && m[1]) || default_theme
115
114
  creator.set_theme theme
@@ -0,0 +1,22 @@
1
+ require 'yaml'
2
+ module Mdslide
3
+ CONFIG_DIR = File.expand_path('~/.mdslide')
4
+ Defaults = {
5
+ :theme => 'white',
6
+ :bind => '127.0.0.1',
7
+ :port => '3000',
8
+ :title => 'Slides converted by Mdslide',
9
+ }
10
+
11
+ def Mdslide.load_config config_file=(CONFIG_DIR + '/config.yaml')
12
+ config_path = File.expand_path(config_file)
13
+ my_config = nil
14
+ if File.exist? config_path
15
+ my_config = YAML.load_file(config_path)
16
+ Themes.merge! my_config[:themes] if my_config[:themes]
17
+ Defaults.merge! my_config[:config] if my_config[:config]
18
+ end
19
+ end
20
+
21
+ Mdslide.load_config
22
+ end
@@ -1,13 +1,10 @@
1
1
  require 'rubygems'
2
2
  require 'kramdown'
3
3
  require 'erb'
4
+ require 'mdslide/themes'
5
+ require 'mdslide/config'
4
6
 
5
7
  module Mdslide
6
- Themes = {
7
- :black => {:css => ['black.css'],},
8
- :white => {:css => ['white.css'],},
9
- :takahashi => {:css => ['takahashi.css'],},
10
- }
11
8
 
12
9
  class Creator
13
10
  attr_reader :stylesheets,:scripts,:theme_stylesheets,:theme_scripts
@@ -0,0 +1,4 @@
1
+ require 'yaml'
2
+ module Mdslide
3
+ Themes = YAML.load_file(File.dirname(__FILE__)+'/../../assets/themes.yaml')
4
+ end
@@ -28,5 +28,6 @@ describe "Mdslide" do
28
28
  slide.should be_true
29
29
  slide.should be_kind_of(String)
30
30
  end
31
+
31
32
  end
32
33
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mdslide
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 3.0.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-17 00:00:00.000000000 Z
12
+ date: 2012-05-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: args_parser
16
- requirement: &82646180 !ruby/object:Gem::Requirement
16
+ requirement: &68500600 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.0.1
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *82646180
24
+ version_requirements: *68500600
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: kramdown
27
- requirement: &82645730 !ruby/object:Gem::Requirement
27
+ requirement: &68499270 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 0.13.6
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *82645730
35
+ version_requirements: *68499270
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rdoc
38
- requirement: &82645140 !ruby/object:Gem::Requirement
38
+ requirement: &68498280 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '3.10'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *82645140
46
+ version_requirements: *68498280
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: newgem
49
- requirement: &82644720 !ruby/object:Gem::Requirement
49
+ requirement: &68496640 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 1.5.3
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *82644720
57
+ version_requirements: *68496640
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: hoe
60
- requirement: &82644210 !ruby/object:Gem::Requirement
60
+ requirement: &68495040 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,7 +65,7 @@ dependencies:
65
65
  version: '3.0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *82644210
68
+ version_requirements: *68495040
69
69
  description: Mdslide is an slide generator for presentation based on Markdown (RedCarpet).
70
70
  It can convert extended Markdown file to HTML it can show as aslides and/or outlines.
71
71
  It outputs HTML, CSS and Javascript files, also you can use this HTTP Server for
@@ -89,17 +89,22 @@ files:
89
89
  - lib/mdslide.rb
90
90
  - lib/mdslide/command.rb
91
91
  - lib/mdslide/creator.rb
92
+ - lib/mdslide/themes.rb
93
+ - lib/mdslide/config.rb
92
94
  - templates/page.html.erb
93
95
  - templates/slide.html.erb
96
+ - assets/themes.yaml
94
97
  - assets/js/jquery.min.js
95
98
  - assets/js/slides.js
96
99
  - assets/js/slides.coffee
97
100
  - assets/css/base.css
98
- - assets/css/black.css
99
- - assets/css/takahashi.css
100
- - assets/css/white.css
101
+ - assets/css/color-black.css
102
+ - assets/css/color-white.css
103
+ - assets/css/position-takahashi.css
104
+ - assets/css/transition-crossfade.css
105
+ - assets/css/transition-hide-show.css
101
106
  - script/console
102
- - spec/mdslide_spec.rb
107
+ - spec/creator_spec.rb
103
108
  - spec/spec.opts
104
109
  - spec/spec_helper.rb
105
110
  - tasks/rspec.rake
@@ -1,28 +0,0 @@
1
- body {
2
- background-color:#000;
3
- color:#fff;
4
- font-family: sans-serif;
5
- }
6
-
7
- a { color: #66f; text-decoration:none; }
8
- a:hover { text-decoration:underline; }
9
-
10
- .slide {
11
- opacity: 0;
12
- -moz-opacity: 0;
13
- filter: alpha(opacity=0);
14
- -webkit-transition-duration:0.2s;
15
- }
16
- .slide.current {
17
- opacity: 1;
18
- -moz-opacity: 1;
19
- filter: alpha(opacity=100);
20
- }
21
-
22
- .slide pre {
23
- border: 3px solid #ccc;
24
- }
25
-
26
- code {
27
- font-family: monospace;
28
- }
@@ -1,15 +0,0 @@
1
- body {
2
- background-color:#fff;
3
- color:#000;
4
- }
5
-
6
- .slide {
7
- font-weight:bold;
8
- font-family:sans-serif;
9
- font-size: 300px;
10
- display:none;
11
- }
12
- .slide.current {
13
- display:block;
14
-
15
- }
@@ -1,28 +0,0 @@
1
- body {
2
- background-color:#fff;
3
- color:#000;
4
- font-family: sans-serif;
5
- }
6
-
7
- a { color: #66f; text-decoration:none; }
8
- a:hover { text-decoration:underline; }
9
-
10
- .slide {
11
- opacity: 0;
12
- -moz-opacity: 0;
13
- filter: alpha(opacity=0);
14
- -webkit-transition-duration:0.2s;
15
- }
16
- .slide.current {
17
- opacity: 1;
18
- -moz-opacity: 1;
19
- filter: alpha(opacity=100);
20
- }
21
-
22
- .slide pre {
23
- border: 3px solid #ccc;
24
- }
25
-
26
- code {
27
- font-family: monospace;
28
- }