reveal.rb 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -0
- data/Gemfile.lock +15 -1
- data/README.md +8 -1
- data/Rakefile +7 -0
- data/lib/reveal/cli.rb +15 -97
- data/lib/reveal/command.rb +109 -0
- data/lib/reveal/templates/revealjs/css/print/paper.css +193 -167
- data/lib/reveal/templates/revealjs/css/print/pdf.css +20 -53
- data/lib/reveal/templates/revealjs/css/reveal.css +1175 -0
- data/lib/reveal/templates/revealjs/css/theme/beige.css +183 -60
- data/lib/reveal/templates/revealjs/css/theme/black.css +267 -0
- data/lib/reveal/templates/revealjs/css/theme/blood.css +190 -80
- data/lib/reveal/templates/revealjs/css/theme/league.css +273 -0
- data/lib/reveal/templates/revealjs/css/theme/moon.css +174 -51
- data/lib/reveal/templates/revealjs/css/theme/night.css +171 -42
- data/lib/reveal/templates/revealjs/css/theme/serif.css +187 -58
- data/lib/reveal/templates/revealjs/css/theme/simple.css +179 -50
- data/lib/reveal/templates/revealjs/css/theme/sky.css +176 -47
- data/lib/reveal/templates/revealjs/css/theme/solarized.css +174 -51
- data/lib/reveal/templates/revealjs/css/theme/white.css +267 -0
- data/lib/reveal/templates/revealjs/index.html +411 -0
- data/lib/reveal/templates/revealjs/js/reveal.js +4508 -0
- data/lib/reveal/templates/revealjs/lib/css/zenburn.css +74 -71
- data/lib/reveal/templates/revealjs/lib/font/{league_gothic_license → league-gothic/LICENSE} +0 -0
- data/lib/reveal/templates/revealjs/lib/font/league-gothic/league-gothic.css +10 -0
- data/lib/reveal/templates/revealjs/lib/font/league-gothic/league-gothic.eot +0 -0
- data/lib/reveal/templates/revealjs/lib/font/league-gothic/league-gothic.ttf +0 -0
- data/lib/reveal/templates/revealjs/lib/font/league-gothic/league-gothic.woff +0 -0
- data/lib/reveal/templates/revealjs/lib/font/source-sans-pro/LICENSE +45 -0
- data/lib/reveal/templates/revealjs/lib/font/source-sans-pro/source-sans-pro-italic.eot +0 -0
- data/lib/reveal/templates/revealjs/lib/font/source-sans-pro/source-sans-pro-italic.ttf +0 -0
- data/lib/reveal/templates/revealjs/lib/font/source-sans-pro/source-sans-pro-italic.woff +0 -0
- data/lib/reveal/templates/revealjs/lib/font/source-sans-pro/source-sans-pro-regular.eot +0 -0
- data/lib/reveal/templates/revealjs/lib/font/source-sans-pro/source-sans-pro-regular.ttf +0 -0
- data/lib/reveal/templates/revealjs/lib/font/source-sans-pro/source-sans-pro-regular.woff +0 -0
- data/lib/reveal/templates/revealjs/lib/font/source-sans-pro/source-sans-pro-semibold.eot +0 -0
- data/lib/reveal/templates/revealjs/lib/font/source-sans-pro/source-sans-pro-semibold.ttf +0 -0
- data/lib/reveal/templates/revealjs/lib/font/source-sans-pro/source-sans-pro-semibold.woff +0 -0
- data/lib/reveal/templates/revealjs/lib/font/source-sans-pro/source-sans-pro-semibolditalic.eot +0 -0
- data/lib/reveal/templates/revealjs/lib/font/source-sans-pro/source-sans-pro-semibolditalic.ttf +0 -0
- data/lib/reveal/templates/revealjs/lib/font/source-sans-pro/source-sans-pro-semibolditalic.woff +0 -0
- data/lib/reveal/templates/revealjs/lib/font/source-sans-pro/source-sans-pro.css +39 -0
- data/lib/reveal/templates/revealjs/lib/js/html5shiv.js +0 -0
- data/lib/reveal/templates/revealjs/plugin/highlight/highlight.js +2 -4
- data/lib/reveal/templates/revealjs/plugin/leap/leap.js +4 -2
- data/lib/reveal/templates/revealjs/plugin/markdown/example.html +3 -3
- data/lib/reveal/templates/revealjs/plugin/markdown/example.md +0 -0
- data/lib/reveal/templates/revealjs/plugin/markdown/markdown.js +10 -9
- data/lib/reveal/templates/revealjs/plugin/markdown/marked.js +2 -33
- data/lib/reveal/templates/revealjs/plugin/math/math.js +1 -1
- data/lib/reveal/templates/revealjs/plugin/multiplex/client.js +0 -0
- data/lib/reveal/templates/revealjs/plugin/multiplex/index.js +0 -0
- data/lib/reveal/templates/revealjs/plugin/multiplex/master.js +0 -0
- data/lib/reveal/templates/revealjs/plugin/notes/notes.html +321 -182
- data/lib/reveal/templates/revealjs/plugin/notes/notes.js +89 -45
- data/lib/reveal/templates/revealjs/plugin/notes-server/client.js +49 -46
- data/lib/reveal/templates/revealjs/plugin/notes-server/index.js +28 -21
- data/lib/reveal/templates/revealjs/plugin/notes-server/notes.html +351 -97
- data/lib/reveal/templates/revealjs/plugin/print-pdf/print-pdf.js +24 -20
- data/lib/reveal/templates/revealjs/plugin/remotes/remotes.js +0 -0
- data/lib/reveal/templates/revealjs/plugin/search/search.js +0 -0
- data/lib/reveal/templates/revealjs/plugin/zoom-js/zoom.js +78 -58
- data/lib/reveal/templates/template.html +17 -24
- data/lib/reveal/version.rb +1 -1
- data/lib/reveal.rb +1 -0
- data/reveal.rb.gemspec +3 -0
- data/spec/lib/reveal/cli_spec.rb +26 -0
- data/spec/lib/reveal/command_spec.rb +165 -0
- metadata +65 -28
- data/lib/reveal/templates/revealjs/css/reveal.min.css +0 -7
- data/lib/reveal/templates/revealjs/css/theme/README.md +0 -25
- data/lib/reveal/templates/revealjs/css/theme/default.css +0 -148
- data/lib/reveal/templates/revealjs/css/theme/source/beige.scss +0 -50
- data/lib/reveal/templates/revealjs/css/theme/source/blood.scss +0 -91
- data/lib/reveal/templates/revealjs/css/theme/source/default.scss +0 -42
- data/lib/reveal/templates/revealjs/css/theme/source/moon.scss +0 -68
- data/lib/reveal/templates/revealjs/css/theme/source/night.scss +0 -35
- data/lib/reveal/templates/revealjs/css/theme/source/serif.scss +0 -35
- data/lib/reveal/templates/revealjs/css/theme/source/simple.scss +0 -38
- data/lib/reveal/templates/revealjs/css/theme/source/sky.scss +0 -46
- data/lib/reveal/templates/revealjs/css/theme/source/solarized.scss +0 -74
- data/lib/reveal/templates/revealjs/css/theme/template/mixins.scss +0 -29
- data/lib/reveal/templates/revealjs/css/theme/template/settings.scss +0 -34
- data/lib/reveal/templates/revealjs/css/theme/template/theme.scss +0 -170
- data/lib/reveal/templates/revealjs/js/reveal.min.js +0 -9
- data/lib/reveal/templates/revealjs/lib/font/league_gothic-webfont.eot +0 -0
- data/lib/reveal/templates/revealjs/lib/font/league_gothic-webfont.svg +0 -230
- data/lib/reveal/templates/revealjs/lib/font/league_gothic-webfont.ttf +0 -0
- data/lib/reveal/templates/revealjs/lib/font/league_gothic-webfont.woff +0 -0
- data/lib/reveal/templates/revealjs/plugin/postmessage/example.html +0 -39
- data/lib/reveal/templates/revealjs/plugin/postmessage/postmessage.js +0 -42
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aeddfdafa8a8712ac291c0450ae335e32b21e895
|
4
|
+
data.tar.gz: 618130631940cf2a6aaa464045eb93cac66f18b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c43a12a10adc8869ee97bacc1be19539d9449084e3daa28b2845d5648dcb13b25db6ed7bfe673235cee911a4ab43283eb54bdef1e12b15c4b3488e11c6260672
|
7
|
+
data.tar.gz: a0d3306ccd4bcf3dfe94e3846aabaf6501b7b7531a83a3e9d752e91a30e93621cc49cb7966dcfb92a77ec6330bc0e8117fa7027fc55f4dffb9f2e2c7e2067194
|
data/.travis.yml
ADDED
data/Gemfile.lock
CHANGED
@@ -1,14 +1,28 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
reveal.rb (0.
|
4
|
+
reveal.rb (0.4.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
+
byebug (3.4.0)
|
10
|
+
columnize (~> 0.8)
|
11
|
+
debugger-linecache (~> 1.2)
|
12
|
+
slop (~> 3.6)
|
13
|
+
columnize (0.8.9)
|
14
|
+
debugger-linecache (1.2.0)
|
15
|
+
m (1.3.2)
|
16
|
+
method_source (>= 0.6.7)
|
17
|
+
rake (>= 0.9.2.2)
|
18
|
+
method_source (0.8.2)
|
19
|
+
rake (0.9.6)
|
20
|
+
slop (3.6.0)
|
9
21
|
|
10
22
|
PLATFORMS
|
11
23
|
ruby
|
12
24
|
|
13
25
|
DEPENDENCIES
|
26
|
+
byebug
|
27
|
+
m
|
14
28
|
reveal.rb!
|
data/README.md
CHANGED
@@ -1,8 +1,13 @@
|
|
1
1
|
# reveal.rb
|
2
2
|
|
3
|
+
[![Code Climate](https://codeclimate.com/github/ggarnier/reveal.rb/badges/gpa.svg)](https://codeclimate.com/github/ggarnier/reveal.rb)
|
4
|
+
[![Build Status](https://travis-ci.org/ggarnier/reveal.rb.svg)](https://travis-ci.org/ggarnier/reveal.rb)
|
5
|
+
[![Dependency Status](https://gemnasium.com/ggarnier/reveal.rb.png)](https://gemnasium.com/ggarnier/reveal.rb)
|
6
|
+
[![Analytics](https://ga-beacon.appspot.com/UA-25495907-3/github/reveal.rb)](https://github.com/igrigorik/ga-beacon)
|
7
|
+
|
3
8
|
[reveal.js](https://github.com/hakimel/reveal.js) presentation generator.
|
4
9
|
|
5
|
-
Current version uses reveal.js
|
10
|
+
Current version uses reveal.js 3.1.0
|
6
11
|
|
7
12
|
## Installation
|
8
13
|
|
@@ -34,12 +39,14 @@ There are two ways to order your slides:
|
|
34
39
|
|
35
40
|
* **Manual order**: set `order` parameter to `manual` and list your slide names in `slides` parameter. This is the default configuration, and it's automatically done for you with `reveal add-slide` command. Any slide file created inside `source` directory but not included in the configuration file will be ignored. Example:
|
36
41
|
|
42
|
+
<pre>
|
37
43
|
---
|
38
44
|
order: manual
|
39
45
|
slides:
|
40
46
|
- slide1
|
41
47
|
- slide2
|
42
48
|
- slide3
|
49
|
+
</pre>
|
43
50
|
|
44
51
|
* **Alphabetical order**: if you omit `order` parameter (or set it to anything other than `manual`), `reveal generate` command will add all slide files inside `source`, in alphabetical order.
|
45
52
|
|
data/Rakefile
ADDED
data/lib/reveal/cli.rb
CHANGED
@@ -1,111 +1,29 @@
|
|
1
|
-
require '
|
2
|
-
require 'yaml'
|
1
|
+
require 'logger'
|
3
2
|
|
4
3
|
module Reveal
|
5
|
-
SOURCE_DIR = "source"
|
6
|
-
OUTPUT_DIR = "output"
|
7
|
-
TEMPLATE_FILENAME = "template.html"
|
8
|
-
CONFIG_FILENAME = "reveal.yml"
|
9
|
-
SLIDES_TAG = "<slides>"
|
10
|
-
|
11
4
|
module Cli
|
12
5
|
extend self
|
13
6
|
|
14
|
-
def process
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
if File.exists?(name)
|
22
|
-
puts "#{name} already exists."
|
23
|
-
exit 1
|
24
|
-
end
|
25
|
-
|
26
|
-
FileUtils.mkdir_p(File.join(name, SOURCE_DIR))
|
27
|
-
FileUtils.mkdir_p(File.join(name, OUTPUT_DIR))
|
28
|
-
FileUtils.cp(File.join(templates_path, TEMPLATE_FILENAME), name)
|
29
|
-
FileUtils.cp(File.join(templates_path, CONFIG_FILENAME), name)
|
30
|
-
FileUtils.cp_r(File.join(templates_path, "revealjs", "."), File.join(name, OUTPUT_DIR))
|
31
|
-
|
32
|
-
puts "Presentation '#{name}' created."
|
33
|
-
end
|
34
|
-
|
35
|
-
def add_slide args
|
36
|
-
check_if_presentation_exists
|
37
|
-
|
38
|
-
config["slides"] ||= []
|
39
|
-
|
40
|
-
args.each do |slide_name|
|
41
|
-
filepath = File.join(SOURCE_DIR, "#{slide_name}.md")
|
42
|
-
FileUtils.touch(filepath)
|
43
|
-
config["slides"] << slide_name
|
44
|
-
puts "Slide '#{filepath}' created."
|
45
|
-
end
|
46
|
-
|
47
|
-
write_config
|
48
|
-
end
|
49
|
-
|
50
|
-
def generate args
|
51
|
-
check_if_presentation_exists
|
52
|
-
|
53
|
-
source_content = ""
|
54
|
-
|
55
|
-
ordered_slide_names.each do |filename|
|
56
|
-
source_content << <<-SLIDE
|
57
|
-
<section data-markdown>
|
58
|
-
<script type="text/template">
|
59
|
-
#{File.read(filename)}
|
60
|
-
</script>
|
61
|
-
</section>
|
62
|
-
|
63
|
-
SLIDE
|
64
|
-
end
|
65
|
-
|
66
|
-
template = File.read(TEMPLATE_FILENAME)
|
67
|
-
compiled_filename = File.join(OUTPUT_DIR, "index.html")
|
68
|
-
File.open(compiled_filename, "w") do |file|
|
69
|
-
file.write(template.gsub(SLIDES_TAG, source_content))
|
70
|
-
end
|
71
|
-
|
72
|
-
puts "#{compiled_filename} presentation file generated."
|
7
|
+
def process(args)
|
8
|
+
command_name = args.first.gsub('-', '_')
|
9
|
+
command_args = args[1..-1]
|
10
|
+
Reveal::Command.new(logger).send(command_name, command_args)
|
11
|
+
rescue Exception => e
|
12
|
+
puts e.message
|
13
|
+
exit 1
|
73
14
|
end
|
74
15
|
|
75
16
|
private
|
76
|
-
def check_if_presentation_exists
|
77
|
-
unless File.exists?(TEMPLATE_FILENAME) && Dir.exists?(SOURCE_DIR) && Dir.exists?(OUTPUT_DIR)
|
78
|
-
puts "Error: The current working directory does not seem to have a reveal.rb presentation."
|
79
|
-
puts "Create one with 'reveal create <presentation name>'."
|
80
|
-
exit 1
|
81
|
-
end
|
82
|
-
end
|
83
17
|
|
84
|
-
def
|
85
|
-
@
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
end
|
91
|
-
end
|
18
|
+
def logger
|
19
|
+
@logger ||= begin
|
20
|
+
logger = ::Logger.new(STDOUT)
|
21
|
+
logger.formatter = proc do |_, _, _, msg|
|
22
|
+
"#{msg}\n"
|
23
|
+
end
|
92
24
|
|
93
|
-
|
94
|
-
if config && config["order"] == "manual" && config["slides"]
|
95
|
-
config["slides"].
|
96
|
-
map { |slide_name| File.join(SOURCE_DIR, "#{slide_name}.md") }.
|
97
|
-
select { |filepath| File.readable?(filepath) }
|
98
|
-
else
|
99
|
-
Dir.glob(File.join(SOURCE_DIR, "*.md"))
|
25
|
+
logger
|
100
26
|
end
|
101
27
|
end
|
102
|
-
|
103
|
-
def config
|
104
|
-
@config ||= YAML.load(File.read(CONFIG_FILENAME))
|
105
|
-
end
|
106
|
-
|
107
|
-
def write_config
|
108
|
-
File.write(CONFIG_FILENAME, config.to_yaml)
|
109
|
-
end
|
110
28
|
end
|
111
29
|
end
|
@@ -0,0 +1,109 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
require 'yaml'
|
3
|
+
require 'logger'
|
4
|
+
|
5
|
+
module Reveal
|
6
|
+
SOURCE_DIR = 'source'
|
7
|
+
OUTPUT_DIR = 'output'
|
8
|
+
TEMPLATE_FILENAME = 'template.html'
|
9
|
+
CONFIG_FILENAME = 'reveal.yml'
|
10
|
+
SLIDES_TAG = '<slides>'
|
11
|
+
|
12
|
+
class Command
|
13
|
+
def initialize(logger = ::Logger.new(STDOUT))
|
14
|
+
@logger = logger
|
15
|
+
end
|
16
|
+
|
17
|
+
def create(args)
|
18
|
+
name = Array(args).first
|
19
|
+
|
20
|
+
if File.exist?(name)
|
21
|
+
raise "ERROR: #{name} already exists."
|
22
|
+
end
|
23
|
+
|
24
|
+
FileUtils.mkdir_p(File.join(name, SOURCE_DIR))
|
25
|
+
FileUtils.mkdir_p(File.join(name, OUTPUT_DIR))
|
26
|
+
|
27
|
+
FileUtils.cp(File.join(templates_path, TEMPLATE_FILENAME), name)
|
28
|
+
FileUtils.cp(File.join(templates_path, CONFIG_FILENAME), name)
|
29
|
+
FileUtils.cp_r(File.join(templates_path, 'revealjs', '.'), File.join(name, OUTPUT_DIR))
|
30
|
+
|
31
|
+
@logger.info("Presentation '#{name}' created.")
|
32
|
+
end
|
33
|
+
|
34
|
+
def add_slide(args)
|
35
|
+
check_if_presentation_exists
|
36
|
+
|
37
|
+
config['slides'] ||= []
|
38
|
+
|
39
|
+
Array(args).each do |slide_name|
|
40
|
+
filepath = File.join(SOURCE_DIR, "#{slide_name}.md")
|
41
|
+
FileUtils.touch(filepath)
|
42
|
+
config['slides'] << slide_name
|
43
|
+
@logger.info("Slide '#{filepath}' created.")
|
44
|
+
end
|
45
|
+
|
46
|
+
write_config
|
47
|
+
end
|
48
|
+
|
49
|
+
def generate(_ = nil)
|
50
|
+
check_if_presentation_exists
|
51
|
+
|
52
|
+
source_content = ''
|
53
|
+
|
54
|
+
ordered_slide_names.each do |filename|
|
55
|
+
source_content << <<-SLIDE
|
56
|
+
<section data-markdown>
|
57
|
+
<script type="text/template">
|
58
|
+
#{File.read(filename)}
|
59
|
+
</script>
|
60
|
+
</section>
|
61
|
+
|
62
|
+
SLIDE
|
63
|
+
end
|
64
|
+
|
65
|
+
template = File.read(TEMPLATE_FILENAME)
|
66
|
+
compiled_filename = File.join(OUTPUT_DIR, 'index.html')
|
67
|
+
File.open(compiled_filename, 'w') do |file|
|
68
|
+
file.write(template.gsub(SLIDES_TAG, source_content))
|
69
|
+
end
|
70
|
+
|
71
|
+
@logger.info("'#{compiled_filename}' presentation file generated.")
|
72
|
+
end
|
73
|
+
|
74
|
+
private
|
75
|
+
|
76
|
+
def check_if_presentation_exists
|
77
|
+
unless File.exist?(TEMPLATE_FILENAME) && File.exist?(CONFIG_FILENAME) && Dir.exist?(SOURCE_DIR) && Dir.exist?(OUTPUT_DIR)
|
78
|
+
raise "ERROR: The current working directory does not seem to have a reveal.rb presentation.\nCreate one with 'reveal create <presentation name>'."
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
def templates_path
|
83
|
+
@templates_path ||= begin
|
84
|
+
[
|
85
|
+
File.join(File.dirname(File.expand_path($0)), '..', 'lib', 'reveal', 'templates'),
|
86
|
+
File.join(Gem.dir, 'gems', "reveal.rb-#{Reveal::VERSION}", 'lib', 'reveal', 'templates')
|
87
|
+
].select { |item| File.readable?(item) }.first
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
def ordered_slide_names
|
92
|
+
if config && config['order'] == 'manual' && config['slides']
|
93
|
+
config['slides'].
|
94
|
+
map { |slide_name| File.join(SOURCE_DIR, "#{slide_name}.md") }.
|
95
|
+
select { |filepath| File.readable?(filepath) }
|
96
|
+
else
|
97
|
+
Dir.glob(File.join(SOURCE_DIR, '*.md'))
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
def config
|
102
|
+
@config ||= YAML.load(File.read(CONFIG_FILENAME))
|
103
|
+
end
|
104
|
+
|
105
|
+
def write_config
|
106
|
+
File.write(CONFIG_FILENAME, config.to_yaml)
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|