revealing 1.0.0

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
+ SHA256:
3
+ metadata.gz: f93791c0c42b0dbaf8e93d8828e1ef8816a52699099831e86e5add1984e24a86
4
+ data.tar.gz: 1275b597fa40be2c4b90b09bd7bbdaa9a1b0b8c65b547ce68fe804394c2f5697
5
+ SHA512:
6
+ metadata.gz: f04d91887e6a4e36f0325b85a7fca0614ce05a4aa74d6d06c7f7d2d871ebbf20a38151a0cb12bf4d9dac0030af465752552a0c996795cfe80d6e661f981fe648
7
+ data.tar.gz: 244beb58f974520d3107a4a12c83283fb1f6aa14fd50e6d8b5d3ea5a3a871691af2219bba4fad0cba4a40b707159a620e4cce7c50edf9c6b6dde5fab4e36e913
data/.gitignore ADDED
@@ -0,0 +1,2 @@
1
+ Gemfile.lock
2
+ pkg
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source "https://rubygems.org"
2
+ gemspec
data/README.markdown ADDED
@@ -0,0 +1,33 @@
1
+ # `revealing` - A Workflow for reveal.js Presentations
2
+
3
+ This gem provides a set of [`Rake`](https://github.com/ruby/rake) tasks to create [`reveal.js`](https://revealjs.com) presentations from markdown files. It uses [`pandoc`](https://pandoc.org/) to create the final presentation. The output is a self-contained set of static HTML files that can be viewed locally uploaded to a web server.
4
+
5
+ Additional features:
6
+
7
+ * Images are resized for the web using [`graphicsmagick`](http://www.graphicsmagick.org/)
8
+ * Embedded [`ditaa`](http://ditaa.sourceforge.net/) snippets are rendered to images
9
+ * `#include` and other [`gpp`](https://logological.org/gpp) features allow organizing the sources of complex presentations
10
+
11
+ # Examples
12
+
13
+ * [Zero to CF in Kube-Cluster in 30 Seconds with Concourse, Helm, Fissile and Eirini](http://zero2cfin30s.eirini.cf/) (source: [suhlig/zero-to-cf-in-30-seconds](https://github.com/suhlig/zero-to-cf-in-30-seconds))
14
+
15
+ # TODO
16
+
17
+ 1. Can the default task still be overridden in projects?
18
+ 1. Bail if any of the prereq tools are not there
19
+ 1. Keep assets in their source folders
20
+ 1. What happens if `customizations.css` is not there?
21
+ 1. `revealing init` creates a new project with the right structure, already `git init`-ed
22
+ 1. Target folders mirror source, so that we don't risk duplicates
23
+ 1. Expose customization of
24
+ * highlight-style
25
+ * slide-level
26
+ * theme
27
+ * slideNumber
28
+ * history
29
+ 1. Read desired versions of dependencies from a YAML file (with sensible defaults coming from this project)
30
+ 1. Add mathjax (copy to target if present, otherwise use CDN)
31
+ 1. Provide a docker image so that we can run without installing everything
32
+ 1. PDF output
33
+ 1. Web interface for live editing
data/Rakefile ADDED
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/gem_tasks'
data/exe/revealing ADDED
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ warn <<EOM
4
+ TBD:
5
+ * git init (at . or at given dir)
6
+ * create src/index.markdown
7
+ * create Gemfile
8
+ * create Rakefile
9
+ * say that 'rake --tasks' is the next thing to do
10
+ EOM
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # probably obsolete
4
+
5
+ require 'rake'
6
+ require 'bundler'
7
+ raise "Bundler is required. Please install bundler with 'gem install bundler'" unless defined?(Bundler)
8
+
9
+ Bundler.setup
10
+ app = Rake.application
11
+
12
+ app.init
13
+ # Pathname(__dir__).parent.glob('{lib/**/*.rake}').each { |t| load t }
14
+ require 'revealing/tasks'
15
+
16
+ tasks = app.tasks
17
+ if ARGV.empty?
18
+ warn "Missing task. Expect one of #{tasks.join(", ")}"
19
+ exit 1
20
+ end
21
+
22
+ task = ARGV[0]
23
+
24
+ if ! tasks.include?(task)
25
+ warn "No such task: #{task}"
26
+ exit 1
27
+ end
28
+
29
+ app.invoke_task(task)
@@ -0,0 +1,13 @@
1
+ RESIZED_ASSETS.zip(RESIZABLE_ASSETS).each do |target, source|
2
+ desc "Resize #{source} to #{target}"
3
+ file target => source do
4
+ sh "gm convert #{source} -geometry '1920x1080>' #{target}"
5
+ end
6
+ end
7
+
8
+ ASSETS.zip(ASSET_SOURCES).each do |target, source|
9
+ desc "Copy #{source} to #{target}"
10
+ file target => source do
11
+ cp source, target
12
+ end
13
+ end
@@ -0,0 +1,4 @@
1
+ desc "Sources are pre-processed into #{TARGET_DIR}"
2
+ file "#{GPP_DIR}/index.markdown" => [GPP_DIR, DIRTY_FILE] + FileList["#{SOURCE_DIR}/**/*.markdown"] do |target|
3
+ sh %(gpp -I src -x -o #{target} #{SOURCE_DIR}/index.markdown)
4
+ end
@@ -0,0 +1,12 @@
1
+ desc 'reveal.js is present'
2
+ directory REVEAL_JS_TARGET_DIR => TARGET_DIR do |target|
3
+ mkdir target.name
4
+
5
+ if ENV['REVEAL_JS_DIR'].to_s.empty?
6
+ warn "Downloading reveal.js #{REVEAL_JS_VERSION}. Set REVEAL_JS_DIR in order to use a cached version."
7
+ sh "curl --location https://github.com/hakimel/reveal.js/archive/#{REVEAL_JS_VERSION}.tar.gz | tar xz -C #{target.name} --strip-components 1"
8
+ else
9
+ warn "Using cached version of reveal.js from #{ENV['REVEAL_JS_DIR']}"
10
+ cp_r FileList["#{ENV['REVEAL_JS_DIR']}/."], target.name, remove_destination: true
11
+ end
12
+ end
@@ -0,0 +1,51 @@
1
+ require 'rake/clean'
2
+ require 'pathname'
3
+ require 'git-dirty'
4
+
5
+ SOURCE_DIR = 'src'.freeze
6
+
7
+ TARGET_DIR = Pathname('public_html')
8
+ directory TARGET_DIR
9
+ TARGET_FILE = TARGET_DIR / 'index.html'
10
+
11
+ GPP_DIR = Pathname('gpp')
12
+ directory GPP_DIR
13
+ DIRTY_FILE = GPP_DIR / '.dirty'
14
+ GPP_FILES = FileList["#{GPP_DIR}/index.markdown"]
15
+
16
+ CLEAN.include GPP_DIR, DIRTY_FILE
17
+ CLOBBER.include TARGET_DIR
18
+
19
+ REVEAL_JS = "reveal.js".freeze
20
+ REVEAL_JS_TARGET_DIR = TARGET_DIR / REVEAL_JS
21
+ REVEAL_JS_VERSION = '3.7.0'.freeze
22
+
23
+ RESIZABLE_ASSETS = (FileList["assets/*.png"] + FileList["assets/*.jpg"])
24
+ RESIZED_ASSETS = RESIZABLE_ASSETS.pathmap("#{TARGET_DIR}/%f")
25
+ ASSET_SOURCES = FileList['assets/*'] - RESIZABLE_ASSETS
26
+ ASSETS = ASSET_SOURCES.pathmap("#{TARGET_DIR}/%f") - RESIZED_ASSETS
27
+
28
+ load "#{__dir__}/tasks/assets.rake"
29
+ load "#{__dir__}/tasks/reveal.js.rake"
30
+ load "#{__dir__}/tasks/gpp.rake"
31
+
32
+ git_dirty_file DIRTY_FILE
33
+
34
+ desc "Build #{TARGET_FILE}"
35
+ file TARGET_FILE => [ TARGET_DIR, REVEAL_JS_TARGET_DIR, GPP_FILES, DIRTY_FILE ] + ASSETS + RESIZED_ASSETS do
36
+ sh %(pandoc
37
+ --to=revealjs
38
+ --standalone
39
+ --highlight-style zenburn
40
+ --slide-level=1
41
+ --output #{TARGET_FILE}
42
+ --variable theme=white
43
+ --variable slideNumber=true
44
+ --variable history=true
45
+ --variable revealjs-url=#{REVEAL_JS}
46
+ --include-in-header=#{TARGET_DIR}/customizations.css
47
+ #{GPP_FILES}
48
+ ).split("\n").join(' ')
49
+ end
50
+
51
+ task default: TARGET_FILE
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Revealing
4
+ VERSION = '1.0.0'
5
+ end
data/revealing.gemspec ADDED
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ lib = File.expand_path('lib', __dir__)
4
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+ require 'revealing/version'
6
+
7
+ # rubocop:disable Metrics/BlockLength
8
+ Gem::Specification.new do |spec|
9
+ spec.name = 'revealing'
10
+ spec.version = Revealing::VERSION
11
+ spec.authors = ['Steffen Uhlig']
12
+ spec.email = ['steffen@familie-uhlig.net']
13
+
14
+ spec.summary = 'Rake tasks to for reveal.js presentations'
15
+ spec.description = %(Provides a workflow for creating reveal.js
16
+ presentations. It uses pandoc to create the
17
+ presentation from markdown files.)
18
+ spec.license = 'MIT'
19
+
20
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
21
+ f.match(%r{^(test|spec|features)/})
22
+ end
23
+ spec.bindir = 'exe'
24
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
25
+ spec.require_paths = ['lib']
26
+
27
+ spec.add_dependency 'rake'
28
+ spec.add_dependency 'bundler'
29
+ spec.add_dependency 'git-dirty'
30
+ end
31
+ # rubocop:enable Metrics/BlockLength
metadata ADDED
@@ -0,0 +1,102 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: revealing
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Steffen Uhlig
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2019-04-13 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rake
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: git-dirty
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: |-
56
+ Provides a workflow for creating reveal.js
57
+ presentations. It uses pandoc to create the
58
+ presentation from markdown files.
59
+ email:
60
+ - steffen@familie-uhlig.net
61
+ executables:
62
+ - revealing
63
+ - revealing-task
64
+ extensions: []
65
+ extra_rdoc_files: []
66
+ files:
67
+ - ".gitignore"
68
+ - Gemfile
69
+ - README.markdown
70
+ - Rakefile
71
+ - exe/revealing
72
+ - exe/revealing-task
73
+ - lib/revealing/tasks.rb
74
+ - lib/revealing/tasks/assets.rake
75
+ - lib/revealing/tasks/gpp.rake
76
+ - lib/revealing/tasks/reveal.js.rake
77
+ - lib/revealing/version.rb
78
+ - revealing.gemspec
79
+ homepage:
80
+ licenses:
81
+ - MIT
82
+ metadata: {}
83
+ post_install_message:
84
+ rdoc_options: []
85
+ require_paths:
86
+ - lib
87
+ required_ruby_version: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ required_rubygems_version: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ requirements: []
98
+ rubygems_version: 3.0.1
99
+ signing_key:
100
+ specification_version: 4
101
+ summary: Rake tasks to for reveal.js presentations
102
+ test_files: []