slideshow-md 0.1.3 → 0.1.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 49187438766f5622302e7619bb7b3258c02d8a87
4
- data.tar.gz: 78b8662d513b4e3234442851ad7091af01e013fb
3
+ metadata.gz: 49c8b09627d02a40a1b4707d570458a00aa635fe
4
+ data.tar.gz: 12d536bcc8c8df5512e42c5338ebf59cd7478312
5
5
  SHA512:
6
- metadata.gz: f2648a430c378487ef02d662a7d14646a735c2ec3c79e35259178ec7b5817a3a9fbfac300118a24325b672a4bd79200df7455fb7782a00be92428629c8428430
7
- data.tar.gz: 70155e6ec7fafe74a8c263adc46bdbc7f3d4d16a32248422865109b731f261c5fe62e177f7b61aea5d368d7a8e116e8acf580bd82a19842806a9b870c1c50bbb
6
+ metadata.gz: 0ebf0b6987573695d6e41d42443bafbde74d7349958dbba53f351fe83a355abbd4f14f4c37e5f30bbff9a50a58711de9ad547be736949455b7fb3c1581890afc
7
+ data.tar.gz: 5156b928d60da3efc9f343fb949342b2921fd59362e76ee08749832b075a445aa80619d3c7dd5e4dcff5dc9cb9950d2fe88f49c7519548674ada3cf7613f577e
data/README.md CHANGED
@@ -6,11 +6,11 @@ A Ruby-wrapper for the `remarkjs` library - presents a local markdown file as a
6
6
 
7
7
  Install it yourself as:
8
8
 
9
- $ gem install slideshowmd
9
+ $ gem install slideshow-md
10
10
 
11
11
  ## Usage
12
12
 
13
- To use, simply just run `slideshowmd [slideshow name]`. This gem expects a slideshow file in the current directory formatted via `markdown` file format.
13
+ To use, simply just run `slideshow-md start [slideshow name]`. This gem expects a slideshow file in the current directory formatted via `markdown` file format.
14
14
  Currently we only support a single Markdown file containing the entire slideshow.
15
15
 
16
16
  An example slideshow is below:
@@ -31,11 +31,11 @@ An example slideshow is below:
31
31
  # Introduction
32
32
  ```
33
33
 
34
- ## Development
34
+ After starting the application, go to `localhost:4567` and your slideshow will be present in your browser!
35
35
 
36
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
36
+ ## Development
37
37
 
38
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
38
+ Fork the repo and create a branch that contains your changes. Make a PR against the master branch here and it'll be merged in if accepted!
39
39
 
40
40
  ## Contributing
41
41
 
@@ -0,0 +1,4 @@
1
+ #! /usr/bin/env ruby
2
+ require 'slideshow_md'
3
+
4
+ SlideshowMD::CLI.start(ARGV)
@@ -1,23 +1,16 @@
1
- module SlideshowMD
2
- class CLI
3
- def start(slideshow)
4
- unless slideshow
5
- $stderr.puts usage_message
6
- exit
7
- end
1
+ require 'thor'
8
2
 
9
- slideshow_file = File.read(slideshow)
3
+ module SlideshowMD
4
+ class CLI < Thor
5
+ desc "start SLIDESHOW_PATH", "starts the slideshow from the specified markdown file"
6
+ method_option :theme, aliases: "-d", desc: "Optional theme for slideshow"
7
+ def start(slideshow_path)
8
+ slideshow_file = File.read(slideshow_path)
9
+ slideshow_theme = options[:theme] || "default"
10
10
 
11
11
  SlideshowMD::Server.set(:slideshow_file, slideshow_file)
12
+ SlideshowMD::Server.set(:theme, slideshow_theme)
12
13
  SlideshowMD::Server.run!
13
14
  end
14
-
15
- private
16
- def usage_message
17
- <<~TEXT
18
- Run using `slideshow [slideshow_name]`. Slideshow_name must match the
19
- filename of the slideshow. Currently only supports a single markdown (.md) file.
20
- TEXT
21
- end
22
15
  end
23
16
  end
@@ -0,0 +1,3 @@
1
+ /* default theme for markdown */
2
+ body { font-family: sans-serif; }
3
+ .remark-code, .remark-inline-code { font-family: monospace; }
@@ -4,7 +4,8 @@ module SlideshowMD
4
4
  class Server < Sinatra::Base
5
5
  get '/' do
6
6
  # slideshow_file is the markdown file we'll be presenting
7
- erb :index, locals: { slideshow_file: settings.slideshow_file }
7
+ erb :index,
8
+ locals: { slideshow_file: settings.slideshow_file, theme: settings.theme }
8
9
  end
9
10
  end
10
11
  end
@@ -1,3 +1,3 @@
1
1
  module SlideshowMD
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
@@ -1,7 +1,7 @@
1
1
  <!DOCTYPE html>
2
2
  <html>
3
3
  <head>
4
- <link rel="stylesheet" href="assets/css/main.css"></link>
4
+ <link rel="stylesheet" href=<%= "assets/css/#{theme}.css" %>></link>
5
5
  </head>
6
6
  <body>
7
7
  <textarea id="source">
@@ -18,10 +18,11 @@ Gem::Specification.new do |spec|
18
18
  f.match(%r{^(test|spec|features)/})
19
19
  end
20
20
  spec.bindir = "bin"
21
- spec.executables = ["slideshow_md"]
21
+ spec.executables = ["slideshow-md"]
22
22
  spec.require_paths = ["lib"]
23
23
 
24
24
  spec.add_dependency "sinatra"
25
+ spec.add_dependency "thor"
25
26
  spec.add_development_dependency "bundler", "~> 1.15"
26
27
  spec.add_development_dependency "rake", "~> 10.0"
27
28
  spec.add_development_dependency "rspec", "~> 3.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slideshow-md
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - achengscode
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-16 00:00:00.000000000 Z
11
+ date: 2017-11-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sinatra
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: thor
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'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: bundler
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -70,7 +84,7 @@ description: Run a slideshow based off of `remark.js` in your browser.
70
84
  email:
71
85
  - docaholic@gmail.com
72
86
  executables:
73
- - slideshow_md
87
+ - slideshow-md
74
88
  extensions: []
75
89
  extra_rdoc_files: []
76
90
  files:
@@ -83,9 +97,10 @@ files:
83
97
  - Rakefile
84
98
  - bin/console
85
99
  - bin/setup
86
- - bin/slideshow_md
100
+ - bin/slideshow-md
87
101
  - lib/slideshow_md.rb
88
102
  - lib/slideshow_md/cli.rb
103
+ - lib/slideshow_md/public/assets/css/default.css
89
104
  - lib/slideshow_md/public/assets/js/remark.min.js
90
105
  - lib/slideshow_md/server.rb
91
106
  - lib/slideshow_md/version.rb
@@ -1,7 +0,0 @@
1
- #! /usr/bin/env ruby
2
- require 'slideshow_md'
3
-
4
- slideshow_name = ARGV[0]
5
-
6
- cli = SlideshowMD::CLI.new
7
- cli.start(slideshow_name)