vimdeck 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +5 -5
- data/VERSION +1 -1
- data/img/demo1.png +0 -0
- data/lib/vimdeck.rb +35 -42
- data/presentation/script.vim +1 -1
- data/presentation/slide2.md +4 -5
- data/presentation/slide4.md +5 -4
- data/slides.md +7 -6
- metadata +2 -2
- data/vimdeck-0.0.2.gem +0 -0
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# vimdeck
|
2
2
|
|
3
3
|
VIM as a presentation tool
|
4
4
|
|
@@ -7,24 +7,24 @@ VIM as a presentation tool
|
|
7
7
|
|
8
8
|
1. Write your slides in a markdown file
|
9
9
|
|
10
|
-
2. Run `bin/
|
10
|
+
2. Run `bin/vimdeck` and it will generate a file for each slide and open them in VIM
|
11
11
|
|
12
12
|
## VIM Script
|
13
13
|
|
14
|
-
|
14
|
+
Vimdeck will also provide a script file that will set up keybindings for you.
|
15
15
|
|
16
16
|
PageUp/Left go backwards
|
17
17
|
PageDown/Right go forward
|
18
18
|
|
19
19
|
##Screenshots:
|
20
20
|
|
21
|
-
|
21
|
+
Vimdeck converts h1s and h2s into ascii art
|
22
22
|
![](img/demo1.png)
|
23
23
|
|
24
24
|
Lists are displayed as they are written
|
25
25
|
![](img/demo2.png)
|
26
26
|
|
27
|
-
|
27
|
+
Vimdeck will also augment its vimscript to provide syntax highlighting
|
28
28
|
![](img/demo3.png)
|
29
29
|
|
30
30
|
Images are even converted to ascii art!
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.4
|
data/img/demo1.png
CHANGED
Binary file
|
data/lib/vimdeck.rb
CHANGED
@@ -16,7 +16,8 @@ module Vimdeck
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def self.ascii_art(img)
|
19
|
-
AsciiArt.new(img)
|
19
|
+
a = AsciiArt.new(img)
|
20
|
+
a.to_ascii_art width: 30
|
20
21
|
end
|
21
22
|
|
22
23
|
def self.script_template
|
@@ -30,70 +31,62 @@ module Vimdeck
|
|
30
31
|
@buffers = []
|
31
32
|
|
32
33
|
Dir.mkdir("presentation") unless File.exists?("presentation")
|
34
|
+
|
33
35
|
slides.each_with_index do |slide, i|
|
34
|
-
|
35
|
-
headers = []
|
36
|
+
code_block = false
|
36
37
|
|
37
38
|
slide.each_line do |line|
|
38
|
-
match = line.match(
|
39
|
-
if match && match[1]
|
40
|
-
|
41
|
-
|
42
|
-
|
39
|
+
match = line.match( /```(.*)$/ )
|
40
|
+
if !code_block && match && match[1]
|
41
|
+
code_block = true
|
42
|
+
elsif code_block && line.match( /```/ )
|
43
|
+
code_block=false
|
44
|
+
elsif !code_block
|
45
|
+
match = line.match( /##\s*(.*)\n/ )
|
43
46
|
if match && match[1]
|
44
|
-
|
47
|
+
slide.sub!( match[0], artii(match[1], "small") + "\n" )
|
48
|
+
else
|
49
|
+
match = line.match( /#\s*(.*)\n/ )
|
50
|
+
if match && match[1]
|
51
|
+
slide.sub!( match[0], artii(match[1], "large") + "\n" )
|
52
|
+
else
|
53
|
+
match = line.match( /\!\[\]\(([^\(\)]*)\)/ )
|
54
|
+
if match && match[1]
|
55
|
+
slide.sub!(match[0], self.ascii_art(match[1]))
|
56
|
+
end
|
57
|
+
end
|
45
58
|
end
|
46
59
|
end
|
47
60
|
end
|
48
61
|
|
49
|
-
rest = slide.gsub( /#+\s*(.*)\n/, '' )
|
50
|
-
images = rest.scan( /\!\[\]\([^\(\)]*\)/ )
|
51
|
-
text = rest.split( /\!\[\]\([^\(\)]*\)/ )
|
52
|
-
|
53
|
-
if images.length > 0
|
54
|
-
rest = ''
|
55
|
-
images.each_with_index do |img,j|
|
56
|
-
rest += text[j] if text[j]
|
57
|
-
|
58
|
-
a = AsciiArt.new(img.match(/\(([^\(\)]*)\)/)[1])
|
59
|
-
rest += a.to_ascii_art width: 30
|
60
|
-
end
|
61
|
-
end
|
62
|
-
|
63
62
|
buffer = {:num => i + 1}
|
64
63
|
code_height = 0
|
65
64
|
code = nil
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
rest = rest.gsub( /```[^\n]*\n/, '' ).gsub( /\n```/, '' )
|
73
|
-
end
|
65
|
+
code = slide.match( /```([^\n]*)\n.*\n```/m )
|
66
|
+
if code
|
67
|
+
buffer[:code] = { :language => code[1] }
|
68
|
+
code_height = code[0].split("\n").length - 2
|
69
|
+
code = code[0].gsub( /```[^\n]*\n/, '' ).gsub( /\n```/, '' )
|
70
|
+
slide = slide.gsub( /```[^\n]*\n/, '' ).gsub( /\n```/, '' )
|
74
71
|
end
|
75
72
|
|
76
|
-
|
77
|
-
new_slide += h + "\n"
|
78
|
-
end
|
79
|
-
new_slide += rest if rest
|
80
|
-
new_slide += "\n" * 80
|
73
|
+
slide += "\n" * 80
|
81
74
|
|
82
75
|
if code_height > 0
|
83
|
-
start =
|
84
|
-
start =
|
76
|
+
start = slide.index(code)
|
77
|
+
start = slide[0..start].split("\n").length
|
85
78
|
buffer[:code][:end] = code_height + start - 1
|
86
79
|
buffer[:code][:start] = start
|
87
80
|
end
|
88
81
|
|
89
82
|
spaces = " "
|
90
|
-
|
91
|
-
|
92
|
-
|
83
|
+
slide = slide.gsub( /\n/, "\n#{spaces}" )
|
84
|
+
slide = spaces + slide
|
85
|
+
slide = slide.gsub( / *\n/, "\n" ).gsub( / *$/, '' )
|
93
86
|
|
94
87
|
|
95
88
|
File.open("presentation/slide#{i}.md", "w") do |file|
|
96
|
-
file.write
|
89
|
+
file.write slide
|
97
90
|
end
|
98
91
|
|
99
92
|
@buffers << buffer
|
data/presentation/script.vim
CHANGED
data/presentation/slide2.md
CHANGED
@@ -1,8 +1,7 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
/_/ |_/\__,_/_/ /_/ /_/_.___/\___/_/ \___/\__,_/ /_____/_/____/\__/
|
1
|
+
_ __ __ __ __ _ __
|
2
|
+
/ |/ /_ ____ _ / / ___ _______ ___/ / / / (_)__/ /_
|
3
|
+
/ / // / ' \/ _ \ -_) __/ -_) _ / / /__/ (_-< __/
|
4
|
+
/_/|_/\_,_/_/_/_/_.__\__/_/ \__/\_,_/ /____/_/___\__/
|
6
5
|
|
7
6
|
|
8
7
|
1. This is how a numbered list
|
data/presentation/slide4.md
CHANGED
data/slides.md
CHANGED
@@ -8,7 +8,7 @@ Presentations with nothing but vim
|
|
8
8
|
![](img/vim.png)
|
9
9
|
|
10
10
|
|
11
|
-
|
11
|
+
## Numbered List
|
12
12
|
|
13
13
|
1. This is how a numbered list
|
14
14
|
2. Looks in vimdeck
|
@@ -26,12 +26,13 @@ Presentations with nothing but vim
|
|
26
26
|
|
27
27
|
Vimdeck does syntax highlighting too!
|
28
28
|
|
29
|
-
```
|
30
|
-
|
29
|
+
```ruby
|
30
|
+
require 'erb'
|
31
31
|
|
32
|
-
|
33
|
-
|
34
|
-
|
32
|
+
template = ERB.new('template.erb')
|
33
|
+
|
34
|
+
# Compile template
|
35
|
+
template.result(binding)
|
35
36
|
```
|
36
37
|
|
37
38
|
|
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.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -39,7 +39,7 @@ files:
|
|
39
39
|
- README.md
|
40
40
|
- slides.md
|
41
41
|
- VERSION
|
42
|
-
- vimdeck-0.0.
|
42
|
+
- vimdeck-0.0.4.gem
|
43
43
|
- vimdeck.gemspec
|
44
44
|
homepage: http://github.com/tybenz/vimdeck
|
45
45
|
licenses:
|
data/vimdeck-0.0.2.gem
DELETED
Binary file
|