vimdeck 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.5
1
+ 0.1.6
data/bin/vimdeck CHANGED
@@ -3,10 +3,15 @@
3
3
  #>
4
4
  #> Commands:
5
5
  #>
6
- #> slideshow: generate and show slides (default)
7
- #> generate: generate slides only
8
- #> open: open slides in presentation folder (no file needed)
6
+ #> slideshow generate and show slides (default)
7
+ #> generate generate slides only
8
+ #> open open slides in presentation folder (no file needed)
9
+ #>
10
+ #> Options:
11
+ #>
12
+ #> --no-ascii skip ascii headers
9
13
 
14
+ require "optparse"
10
15
  require "vimdeck"
11
16
 
12
17
  def usage
@@ -15,54 +20,43 @@ def usage
15
20
  end
16
21
  end
17
22
 
18
- def check_file(file)
19
- if !File.exists?(file)
23
+ def check_file(file, opt_parser)
24
+ if !file || !File.exists?(file)
20
25
  usage
21
26
  puts "\nFile does not exist! #{file}"
22
27
  exit 0
23
28
  end
24
29
  end
25
30
 
26
- if ARGV.include?("--help") || ARGV.include?("-h")
27
- usage
28
- exit 0
31
+ options = {}
32
+
33
+ opt_parser = OptionParser.new do |opt|
34
+ opt.on("-A", "--no-ascii") do
35
+ options[:no_ascii] = true
36
+ end
29
37
  end
30
38
 
31
- if ARGV.length == 0
32
- usage
33
- exit 0
34
- elsif ARGV.length == 1
35
- if ARGV[0] == "open"
36
- Vimdeck::Slideshow.open
37
- else
38
- file = ARGV[0]
39
- check_file file
39
+ opt_parser.parse!
40
40
 
41
- Vimdeck::Slideshow.start(ARGV[0])
42
- end
43
- elsif ARGV.length == 2
44
- command = ARGV[0]
45
- file = ARGV[1]
41
+ file = ARGV.length > 1 ? ARGV[1] : ARGV[0]
46
42
 
47
- if command != "slideshow" && command != "generate" && command != "open"
48
- usage
49
- exit 0
50
- end
43
+ if !ARGV[0] || ( ARGV[0] && ARGV[0] != "open" )
44
+ check_file(file, opt_parser)
45
+ end
51
46
 
52
- if command == "open"
47
+ case ARGV[0]
48
+ when "slideshow"
49
+ Vimdeck::Slideshow.start(file, options)
50
+ when "generate"
51
+ Vimdeck::Slideshow.generate(file, options)
52
+ when "open"
53
+ if ARGV.length == 2
53
54
  puts "Vimdeck will open already existing slides"
54
55
  puts "File name will be ignored"
55
56
  sleep 3
56
- else
57
- check_file file
58
57
  end
59
58
 
60
- case command
61
- when "slideshow"
62
- Vimdeck::Slideshow.start(file)
63
- when "generate"
64
- Vimdeck::Slideshow.generate(file)
65
- else # open
66
- Vimdeck::Slideshow.open()
67
- end
59
+ Vimdeck::Slideshow.open
60
+ else
61
+ Vimdeck::Slideshow.start(file, options)
68
62
  end
data/lib/vimdeck.rb CHANGED
@@ -61,12 +61,16 @@ module Vimdeck
61
61
  end
62
62
 
63
63
  def header(title, level)
64
- case level
65
- when 1
66
- Vimdeck::Ascii.header(title, "large") + "\n"
64
+ if !Vimdeck::Slideshow.options[:no_ascii]
65
+ case level
66
+ when 1
67
+ Vimdeck::Ascii.header(title, "large") + "\n"
67
68
 
68
- when 2
69
- Vimdeck::Ascii.header(title, "small") + "\n"
69
+ when 2
70
+ Vimdeck::Ascii.header(title, "small") + "\n"
71
+ end
72
+ else
73
+ title + "\n\n"
70
74
  end
71
75
  end
72
76
 
@@ -88,6 +92,12 @@ module Vimdeck
88
92
  end
89
93
 
90
94
  class Slideshow
95
+ @options = {}
96
+
97
+ def self.options
98
+ @options
99
+ end
100
+
91
101
  def self.slide_padding
92
102
  " "
93
103
  end
@@ -97,7 +107,8 @@ module Vimdeck
97
107
  template.result(binding)
98
108
  end
99
109
 
100
- def self.generate(filename)
110
+ def self.generate(filename, options)
111
+ @options = options
101
112
  slides = File.read(filename)
102
113
 
103
114
  renderer = Redcarpet::Markdown.new(Vimdeck::Render, :fenced_code_blocks => true)
@@ -192,8 +203,8 @@ module Vimdeck
192
203
  exec 'vim presentation/*.md -S presentation/script.vim'
193
204
  end
194
205
 
195
- def self.start(filename)
196
- generate(filename)
206
+ def self.start(filename, options)
207
+ generate(filename, options)
197
208
  open
198
209
  end
199
210
  end
@@ -45,13 +45,13 @@ call matchadd("Comment", "• First\\n • Second\\(\\_.*slide 7\\)\\@=")
45
45
 
46
46
  b 8
47
47
 
48
- 6,17SyntaxInclude ruby
48
+ 3,14SyntaxInclude ruby
49
49
 
50
50
 
51
51
 
52
52
  b 9
53
53
 
54
- 6,17SyntaxInclude ruby
54
+ 3,14SyntaxInclude ruby
55
55
 
56
56
 
57
57
  call matchadd("Comment", "module Parts\\n class foo\\n def slide\\n \"of a\"\\n end\\n\\n def can\\n highlight = \\(\\_.*slide 9\\)\\@=")
@@ -61,7 +61,7 @@ call matchadd("Comment", "\\n end\\n end\\n end\\(\\_
61
61
 
62
62
  b 10
63
63
 
64
- 6,17SyntaxInclude ruby
64
+ 3,14SyntaxInclude ruby
65
65
 
66
66
 
67
67
  call matchadd("Comment", "module Parts\\n class foo\\n def slide\\n \"of a\"\\n end\\n\\n def\\(\\_.*slide 10\\)\\@=")
@@ -71,7 +71,7 @@ call matchadd("Comment", "highlight = \"vimdeck\"\\n end\\n
71
71
 
72
72
  b 11
73
73
 
74
- 6,17SyntaxInclude ruby
74
+ 3,14SyntaxInclude ruby
75
75
 
76
76
 
77
77
  call matchadd("Comment", "module Parts\\n class foo\\n def slide\\n \"of a\"\\n end\\n\\n def can\\(\\_.*slide 11\\)\\@=")
@@ -81,7 +81,7 @@ call matchadd("Comment", "= \"vimdeck\"\\n end\\n end\\n
81
81
 
82
82
  b 12
83
83
 
84
- 6,17SyntaxInclude ruby
84
+ 3,14SyntaxInclude ruby
85
85
 
86
86
 
87
87
  call matchadd("Comment", "module\\(\\_.*slide 12\\)\\@=")
@@ -91,7 +91,7 @@ call matchadd("Comment", "class foo\\n def slide\\n \"of
91
91
 
92
92
  b 13
93
93
 
94
- 6,17SyntaxInclude ruby
94
+ 3,14SyntaxInclude ruby
95
95
 
96
96
 
97
97
  call matchadd("Comment", "module Parts\\n class foo\\n def slide\\(\\_.*slide 13\\)\\@=")
@@ -101,7 +101,7 @@ call matchadd("Comment", "end\\n\\n def can\\n highlight
101
101
 
102
102
  b 14
103
103
 
104
- 6,17SyntaxInclude ruby
104
+ 3,14SyntaxInclude ruby
105
105
 
106
106
 
107
107
  call matchadd("Comment", "module Parts\\n class foo\\n def\\(\\_.*slide 14\\)\\@=")
@@ -1,13 +1,6 @@
1
- _ ________ _______ ______________ __
2
- | | / / _/ |/ / __ \/ ____/ ____/ //_/
3
- | | / // // /|_/ / / / / __/ / / / ,<
4
- | |/ // // / / / /_/ / /___/ /___/ /| |
5
- |___/___/_/ /_/_____/_____/\____/_/ |_|
6
-
7
- ___ __ _____ ____ ___ _ ______________ __ _______
8
- / _ \/ / / / _ \/ __/ / _ | | /| / / __/ __/ __ \/ |/ / __/
9
- / ___/ /_/ / , _/ _/ / __ | |/ |/ / _/_\ \/ /_/ / /|_/ / _/
10
- /_/ \____/_/|_/___/ /_/ |_|__/|__/___/___/\____/_/ /_/___/
1
+ VIMDECK
2
+
3
+ PURE AWESOME
11
4
 
12
5
 
13
6
 
@@ -1,8 +1,4 @@
1
- _ ________ ___ ____ ____ ________ _______ __
2
- | | / / _/ |/ / / __ \/ __ \/ ____/ //_/ ___// /
3
- | | / // // /|_/ / / /_/ / / / / / / ,< \__ \/ /
4
- | |/ // // / / / / _, _/ /_/ / /___/ /| |___/ /_/
5
- |___/___/_/ /_/ /_/ |_|\____/\____/_/ |_/____(_)
1
+ VIM ROCKS!
6
2
 
7
3
  +------------------------------+
8
4
  | :.. |
@@ -1,7 +1,4 @@
1
- ___ ___ ___ ___ ________ ___ ___ __ ______
2
- / _ \/ _ | / _ \/ _ |/ ___/ _ \/ _ | / _ \/ // / __/
3
- / ___/ __ |/ , _/ __ / (_ / , _/ __ |/ ___/ _ /\ \
4
- /_/ /_/ |_/_/|_/_/ |_\___/_/|_/_/ |_/_/ /_//_/___/
1
+ PARAGRAPHS
5
2
 
6
3
  This is a paragraph (plain text)
7
4
 
@@ -1,7 +1,4 @@
1
- _ ____ ____ ______ _______ _______ __ ______________
2
- / |/ / / / / |/ / _ )/ __/ _ \/ __/ _ \ / / / _/ __/_ __/
3
- / / /_/ / /|_/ / _ / _// , _/ _// // / / /___/ /_\ \ / /
4
- /_/|_/\____/_/ /_/____/___/_/|_/___/____/ /____/___/___/ /_/
1
+ NUMBERED LIST
5
2
 
6
3
  1. This is how a numbered list
7
4
  2. Looks in vimdeck
@@ -1,8 +1,4 @@
1
- ____ __ ____ __ _________________
2
- / __ )/ / / / / / / / ____/_ __/ ___/
3
- / __ / / / / / / / / __/ / / \__ \
4
- / /_/ / /_/ / /___/ /___/ /___ / / ___/ /
5
- /_____/\____/_____/_____/_____/ /_/ /____/
1
+ BULLETS
6
2
 
7
3
  • First
8
4
  • Second
@@ -1,8 +1,4 @@
1
- ____ __ ____ __ _________________
2
- / __ )/ / / / / / / / ____/_ __/ ___/
3
- / __ / / / / / / / / __/ / / \__ \
4
- / /_/ / /_/ / /___/ /___/ /___ / / ___/ /
5
- /_____/\____/_____/_____/_____/ /_/ /____/
1
+ BULLETS
6
2
 
7
3
  • First
8
4
  • Second
@@ -1,8 +1,4 @@
1
- ____ __ ____ __ _________________
2
- / __ )/ / / / / / / / ____/_ __/ ___/
3
- / __ / / / / / / / / __/ / / \__ \
4
- / /_/ / /_/ / /___/ /___/ /___ / / ___/ /
5
- /_____/\____/_____/_____/_____/ /_/ /____/
1
+ BULLETS
6
2
 
7
3
  • First
8
4
  • Second
@@ -1,7 +1,4 @@
1
- _________ ___ ____
2
- / ___/ __ \/ _ \/ __/
3
- / /__/ /_/ / // / _/
4
- \___/\____/____/___/
1
+ CODE
5
2
 
6
3
  module Parts
7
4
  class foo
@@ -1,7 +1,4 @@
1
- _________ ___ ____
2
- / ___/ __ \/ _ \/ __/
3
- / /__/ /_/ / // / _/
4
- \___/\____/____/___/
1
+ CODE
5
2
 
6
3
  module Parts
7
4
  class foo
@@ -1,7 +1,4 @@
1
- _________ ___ ____
2
- / ___/ __ \/ _ \/ __/
3
- / /__/ /_/ / // / _/
4
- \___/\____/____/___/
1
+ CODE
5
2
 
6
3
  module Parts
7
4
  class foo
@@ -1,7 +1,4 @@
1
- _________ ___ ____
2
- / ___/ __ \/ _ \/ __/
3
- / /__/ /_/ / // / _/
4
- \___/\____/____/___/
1
+ CODE
5
2
 
6
3
  module Parts
7
4
  class foo
@@ -1,7 +1,4 @@
1
- _________ ___ ____
2
- / ___/ __ \/ _ \/ __/
3
- / /__/ /_/ / // / _/
4
- \___/\____/____/___/
1
+ CODE
5
2
 
6
3
  module Parts
7
4
  class foo
@@ -1,7 +1,4 @@
1
- _________ ___ ____
2
- / ___/ __ \/ _ \/ __/
3
- / /__/ /_/ / // / _/
4
- \___/\____/____/___/
1
+ CODE
5
2
 
6
3
  module Parts
7
4
  class foo
@@ -1,7 +1,4 @@
1
- _________ ___ ____
2
- / ___/ __ \/ _ \/ __/
3
- / /__/ /_/ / // / _/
4
- \___/\____/____/___/
1
+ CODE
5
2
 
6
3
  module Parts
7
4
  class foo
@@ -1,8 +1,4 @@
1
- ________ ______ ____
2
- /_ __/ /_ ___ / ____/___ ____/ / /
3
- / / / __ \/ _ \ / __/ / __ \/ __ / /
4
- / / / / / / __/ / /___/ / / / /_/ /_/
5
- /_/ /_/ /_/\___/ /_____/_/ /_/\__,_(_)
1
+ The End!
6
2
 
7
3
 
8
4
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vimdeck
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -97,12 +97,6 @@ files:
97
97
  - README.md
98
98
  - slides.md
99
99
  - VERSION
100
- - vimdeck-0.0.9.gem
101
- - vimdeck-0.1.0.gem
102
- - vimdeck-0.1.1.gem
103
- - vimdeck-0.1.2.gem
104
- - vimdeck-0.1.3.gem
105
- - vimdeck-0.1.4.gem
106
100
  - vimdeck.gemspec
107
101
  homepage: http://github.com/tybenz/vimdeck
108
102
  licenses:
data/vimdeck-0.0.9.gem DELETED
Binary file
data/vimdeck-0.1.0.gem DELETED
Binary file
data/vimdeck-0.1.1.gem DELETED
Binary file
data/vimdeck-0.1.2.gem DELETED
Binary file
data/vimdeck-0.1.3.gem DELETED
Binary file
data/vimdeck-0.1.4.gem DELETED
Binary file