vimdeck-without-ascii-art 0.2.9

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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: e0bf357762ab6d9a2d3d76dcfdad2e46b2e16dd6
4
+ data.tar.gz: fc9c23616d831c9f6eea5431a5c5893fb7616a53
5
+ SHA512:
6
+ metadata.gz: c516ca414fb63dda4ce82688b40089624502738ada6a3de69d9c32b461bf7723dcd1fd4f50f5eeccab7a3083fb832373ea5b10fae4b8464cd90110fc3804ed47
7
+ data.tar.gz: ca11ee7055c3b41848c5875f41463b738bb9c3e68546611e2cbc8770161df81530a9f3e914c53e0df02dfaa98bb32b4e5f86bd743e818ee68591fd76ac618f68
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'rake'
4
+ gem 'artii', '~>2.0.4'
5
+ gem 'redcarpet', '~>3.1.2'
data/Gemfile.lock ADDED
@@ -0,0 +1,14 @@
1
+ GEM
2
+ remote: https://rubygems.org/
3
+ specs:
4
+ artii (2.0.4)
5
+ rake (10.1.1)
6
+ redcarpet (3.1.2)
7
+
8
+ PLATFORMS
9
+ ruby
10
+
11
+ DEPENDENCIES
12
+ artii (~> 2.0.4)
13
+ rake
14
+ redcarpet (~> 3.1.2)
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+
2
+ The MIT License (MIT)
3
+
4
+ Copyright (c) [year] [fullname]
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
7
+ this software and associated documentation files (the "Software"), to deal in
8
+ the Software without restriction, including without limitation the rights to
9
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
10
+ the Software, and to permit persons to whom the Software is furnished to do so,
11
+ subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
18
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
19
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,138 @@
1
+ # Vimdeck [![Gem Version](https://badge.fury.io/rb/vimdeck.png)](http://badge.fury.io/rb/vimdeck)
2
+
3
+ VIM as a presentation tool
4
+
5
+
6
+ ## News
7
+
8
+ Vimdeck now uses [redcarpet](http://github.com/vmg/redcarpet) to parse and render markdown!
9
+
10
+ I've cleaned up the code significantly. So those of you who like more features in Vimdeck
11
+ can fork and pull-request your buns off.
12
+
13
+
14
+ ## Installation
15
+
16
+ Install a markdown syntax highlighting plugin for VIM. (I recommend [tpope/vim-markdown](http://github.com/tpope/vim-markdown))
17
+
18
+ Install the VIM plugin [SyntaxRange](https://github.com/vim-scripts/SyntaxRange).
19
+
20
+ ```
21
+ gem install vimdeck
22
+ ```
23
+
24
+ If you have problems getting RMagick to install, try installing [ImageMagick](http://www.imagemagick.org/) explicitly first.
25
+
26
+
27
+ ## Usage
28
+
29
+ 1. Write your slides in a markdown file (See below for details on _limited_ markdown syntax)
30
+
31
+ 2. Run `vimdeck <file_name.md>` and it will generate a file for each slide and open them in VIM
32
+
33
+
34
+ ## VIM Script
35
+
36
+ Vimdeck will also provide a script file that will set up keybindings for you.
37
+
38
+ - PageUp/Left go backwards
39
+ - PageDown/Right go forward
40
+ - Q closes presentation
41
+
42
+
43
+ ## A Note about VIM
44
+
45
+ This is a tool meant for VIM users. In other words, it is not a VIM plugin
46
+ &mdash; it's a script that converts a plain text document into multiple files.
47
+
48
+ The only hard dependency is [SyntaxRange](https://github.com/vim-scripts/SyntaxRange).
49
+
50
+ Other than that you may need some syntax highlighting plugins to handle the code syntax highlighting.
51
+
52
+
53
+ ## A Note About Markdown
54
+
55
+ Slides are separated by 2 newlines in a row.
56
+
57
+ Example:
58
+
59
+ ```
60
+ # Slide 1
61
+
62
+ - has some
63
+ - really important
64
+ - information
65
+
66
+
67
+ # Slide 2
68
+
69
+ Is less important
70
+ ```
71
+
72
+ Vimdeck uses redcarpet to parse its markdown and implements a custom renderer
73
+ for things like ascii art. It uses a very small subset of markdown. List of items supported:
74
+
75
+ - h1s
76
+ - h2s
77
+ - images
78
+ - fenced code blocks
79
+
80
+ That's it. The point of Markdown is that it's human-readable. Other stuff like (un)ordered
81
+ lists, block quotes, indented code blocks, etc. will be displayed just as they were written.
82
+
83
+ Fenced code blocks look like this:
84
+
85
+ ```javascript
86
+ this.is = 'code'
87
+ ```
88
+
89
+ ## Highlighting Syntax
90
+
91
+ Vimdeck also supports "highlighting" parts of a slide. This is an experimental feature and needs more testing.
92
+
93
+ Use `{~ unimportant_text_here ~}` to "unhighlight" portions of a slide:
94
+
95
+ # Slide Title
96
+
97
+ {~- Unimportant bullet~}
98
+ - Important bullet
99
+ {~- Really unimportant bullet~}
100
+
101
+ This allows you to create multiple versions of the same slide but with different parts highlighted.
102
+ Which is something I like to use often when presenting code snippets.
103
+
104
+ ## Why Ruby?
105
+
106
+ Additionally, I want to point out that I realize that it's odd to have a VIM-based tool
107
+ and not write it as a VIM script. Ruby was my language of choice only because the ascii art dependencies
108
+ were implemented as ruby gems. Plus, I &hearts; ruby.
109
+
110
+
111
+ ##Screenshots:
112
+
113
+
114
+ Vimdeck converts h1s and h2s into ascii art
115
+ ![](img/demo1.png)
116
+
117
+
118
+ Lists are displayed as they are written
119
+ ![](img/demo2.png)
120
+
121
+
122
+ Vimdeck will also augment its vimscript to provide syntax highlighting
123
+ ![](img/demo3.png)
124
+
125
+
126
+ Images are even converted to ascii art!
127
+ ![](img/demo4.png)
128
+
129
+
130
+
131
+
132
+ ---------------------
133
+
134
+ Made by [tybenz](http://github.com/tybenz): [tybenz.com](http://tybenz.com) // [@tybenz](http://twitter.com/tybenz)
135
+
136
+
137
+ [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/tybenz/vimdeck/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
138
+
data/Rakefile ADDED
@@ -0,0 +1,34 @@
1
+ require "rubygems"
2
+ require "rake"
3
+
4
+ VERSION = File.read(File.join(".", "VERSION"))
5
+
6
+ desc "Build gem from gemspec"
7
+ task :build do
8
+ system "rm *.gem"
9
+ system "gem build vimdeck.gemspec"
10
+ end
11
+
12
+ desc "Deploy gem to rubygems.org"
13
+ task :deploy do
14
+ system "gem push vimdeck-#{VERSION.gsub( /\n/, "" )}.gem"
15
+ end
16
+
17
+ desc "Tag git repo with release"
18
+ task :tag do
19
+ system "git tag v#{VERSION}"
20
+ puts "Tag v#{VERSION} created"
21
+ end
22
+
23
+ desc "Push tags to github"
24
+ task :push_tags do
25
+ system "git push --tags origin master"
26
+ end
27
+
28
+ desc "Release new version: build, deploy, and tag"
29
+ task :release do
30
+ ["build", "deploy", "tag", "push_tags"].each do |t|
31
+ Rake::Task[t].reenable
32
+ Rake::Task[t].invoke
33
+ end
34
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.2.9
data/bin/vimdeck ADDED
@@ -0,0 +1,110 @@
1
+ #!/usr/bin/env ruby
2
+ #> Usage: vimdeck [<command>] [<file>]
3
+ #>
4
+ #> Commands:
5
+ #>
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
+ #> --mouse, -m mouse support for navigating slides
13
+ #> --no-indent, -I skip indentation
14
+ #> --no-ascii, -A skip ascii headers
15
+ #> --no-filetype, -n use vim's plaintext syntax highlighting
16
+ #> --header-margin, -m bottom margin for headers. default: 1
17
+ #> --header-font, -h specify header font (http://www.figlet.org/fontdb.cgi)
18
+ #> foregoes the ability to have small and large headers
19
+ #> --editor, -e specify editor to use (e.g., vim, mvim)
20
+
21
+ require "optparse"
22
+ if ENV["VIMDECK_DEBUG"]
23
+ require_relative File.dirname(__FILE__)+"/../../lib/vimdeck.rb"
24
+ else
25
+ require "vimdeck"
26
+ end
27
+
28
+ def usage
29
+ File.read(__FILE__).split("\n").grep(/^#>/).each do |line|
30
+ puts line[3..-1]
31
+ end
32
+ end
33
+
34
+ def check_file(file, opt_parser)
35
+ if !file || !File.exists?(file)
36
+ usage
37
+ puts "\nFile does not exist! #{file}"
38
+ exit 0
39
+ end
40
+ end
41
+
42
+ options = {}
43
+
44
+ opt_parser = OptionParser.new do |opt|
45
+ opt.on("-A", "--no-ascii") do
46
+ options[:no_ascii] = true
47
+ end
48
+
49
+ opt.on("-I", "--no-indent") do
50
+ options[:no_indent] = true
51
+ end
52
+
53
+ opt.on("-h", "--header-font STRING", String) do |option|
54
+ options[:header_font] = option
55
+ end
56
+
57
+ opt.on("-m", "--mouse") do
58
+ options[:mouse_enabled] = true
59
+ end
60
+
61
+ opt.on("-n", "--no-filetype") do
62
+ options[:no_filetype] = true
63
+ end
64
+
65
+ opt.on("-m", "--header-margin NUMBER", Numeric) do |option|
66
+ options[:header_margin] = option
67
+ end
68
+
69
+ opt.on("-d", "--dos-newlines") do
70
+ options[:dos_newlines] = true
71
+ end
72
+
73
+ opt.on("-e", "--editor EDITOR", String) do |option|
74
+ if option == "vim" || option == "mvim" || option == "nvim"
75
+ options[:editor] = option
76
+ else
77
+ raise "Not a valid editor: #{option}"
78
+ end
79
+ end
80
+ end
81
+
82
+ opt_parser.parse!
83
+
84
+ file = ARGV.length > 1 ? ARGV[1] : ARGV[0]
85
+
86
+ if !ARGV[0]
87
+ usage
88
+ exit 0
89
+ end
90
+
91
+ if ARGV[0] && ARGV[0] != "open"
92
+ check_file(file, opt_parser)
93
+ end
94
+
95
+ case ARGV[0]
96
+ when "slideshow"
97
+ Vimdeck::Slideshow.start(file, options)
98
+ when "generate"
99
+ Vimdeck::Slideshow.generate(file, options)
100
+ when "open"
101
+ if ARGV.length == 2
102
+ puts "Vimdeck will open already existing slides"
103
+ puts "File name will be ignored"
104
+ sleep 3
105
+ end
106
+
107
+ Vimdeck::Slideshow.open
108
+ else
109
+ Vimdeck::Slideshow.start(file, options)
110
+ end
@@ -0,0 +1,110 @@
1
+ #!/usr/bin/env ruby
2
+ #> Usage: vimdeck [<command>] [<file>]
3
+ #>
4
+ #> Commands:
5
+ #>
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
+ #> --mouse, -m mouse support for navigating slides
13
+ #> --no-indent, -I skip indentation
14
+ #> --no-ascii, -A skip ascii headers
15
+ #> --no-filetype, -n use vim's plaintext syntax highlighting
16
+ #> --header-margin, -m bottom margin for headers. default: 1
17
+ #> --header-font, -h specify header font (http://www.figlet.org/fontdb.cgi)
18
+ #> foregoes the ability to have small and large headers
19
+ #> --editor, -e specify editor to use (e.g., vim, mvim)
20
+
21
+ require "optparse"
22
+ if ENV["VIMDECK_DEBUG"]
23
+ require_relative File.dirname(__FILE__)+"/../../lib/vimdeck.rb"
24
+ else
25
+ require "vimdeck"
26
+ end
27
+
28
+ def usage
29
+ File.read(__FILE__).split("\n").grep(/^#>/).each do |line|
30
+ puts line[3..-1]
31
+ end
32
+ end
33
+
34
+ def check_file(file, opt_parser)
35
+ if !file || !File.exists?(file)
36
+ usage
37
+ puts "\nFile does not exist! #{file}"
38
+ exit 0
39
+ end
40
+ end
41
+
42
+ options = {}
43
+
44
+ opt_parser = OptionParser.new do |opt|
45
+ opt.on("-A", "--no-ascii") do
46
+ options[:no_ascii] = true
47
+ end
48
+
49
+ opt.on("-I", "--no-indent") do
50
+ options[:no_indent] = true
51
+ end
52
+
53
+ opt.on("-h", "--header-font STRING", String) do |option|
54
+ options[:header_font] = option
55
+ end
56
+
57
+ opt.on("-m", "--mouse") do
58
+ options[:mouse_enabled] = true
59
+ end
60
+
61
+ opt.on("-n", "--no-filetype") do
62
+ options[:no_filetype] = true
63
+ end
64
+
65
+ opt.on("-m", "--header-margin NUMBER", Numeric) do |option|
66
+ options[:header_margin] = option
67
+ end
68
+
69
+ opt.on("-d", "--dos-newlines") do
70
+ options[:dos_newlines] = true
71
+ end
72
+
73
+ opt.on("-e", "--editor EDITOR", String) do |option|
74
+ if option == "vim" || option == "mvim" || option == "nvim"
75
+ options[:editor] = option
76
+ else
77
+ raise "Not a valid editor: #{option}"
78
+ end
79
+ end
80
+ end
81
+
82
+ opt_parser.parse!
83
+
84
+ file = ARGV.length > 1 ? ARGV[1] : ARGV[0]
85
+
86
+ if !ARGV[0]
87
+ usage
88
+ exit 0
89
+ end
90
+
91
+ if ARGV[0] && ARGV[0] != "open"
92
+ check_file(file, opt_parser)
93
+ end
94
+
95
+ case ARGV[0]
96
+ when "slideshow"
97
+ Vimdeck::Slideshow.start(file, options)
98
+ when "generate"
99
+ Vimdeck::Slideshow.generate(file, options)
100
+ when "open"
101
+ if ARGV.length == 2
102
+ puts "Vimdeck will open already existing slides"
103
+ puts "File name will be ignored"
104
+ sleep 3
105
+ end
106
+
107
+ Vimdeck::Slideshow.open
108
+ else
109
+ Vimdeck::Slideshow.start(file, options)
110
+ end