publication 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/publication/cli.rb +2 -2
- data/lib/publication/publish.rb +3 -2
- data/lib/publication/rake_tasks.rb +1 -0
- data/lib/publication/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d0a46ca7a808a6b777284d957bdc1729dd48b05
|
4
|
+
data.tar.gz: 35cd90f29dfcaa78492e5bcfd2e2c5ec7ed28802
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f5a04ebfe6510b4462422c7164b08d36daef5c3952aa7affb9d4e90a7c1fd5a6175802061e874cddddf13990a0001c12696faaebce12016fe35531c49e8adbd9
|
7
|
+
data.tar.gz: 64047ec5d556e08e2038baa223fba2a4fb1db2d59346a6626901715d4a0aa751f402107b664908d50a9f404449b69554e3fc083aa5db399f3bd76a259bba3892
|
data/lib/publication/cli.rb
CHANGED
@@ -7,8 +7,8 @@ class Publication::CLI < Thor
|
|
7
7
|
method_option :output, type: :string, required: false, banner: 'OUTPUT', desc: 'Name of the output file', aliases: '-o', default: 'output'
|
8
8
|
method_option :paths, type: :string, required: false, banner: 'DIR', desc: 'Glob of source directory tree, parsed lexically and recursively', aliases: '-p', default: 'doc/**/*'
|
9
9
|
method_option :formats, type: :array, required: false, banner: 'FORMATS', desc: 'Formats to output, space separated', aliases: '-f', default: ['epub', 'epub3', 'pdf', 'html']
|
10
|
-
method_option :type, type: :string, required: false, banner: 'FORMAT', desc: 'Type (format) of input files', aliases: '-t', default: 'markdown'
|
11
|
-
|
10
|
+
method_option :type, type: :string, required: false, banner: 'FORMAT', desc: 'Type (format) of input files', aliases: '-t', default: 'markdown+yaml_metadata_block'
|
11
|
+
method_option :extraopts, type: :string, required: false, banner: 'EXTRA', desc: 'Extra options to pass to pandoc (advanced)', aliases: '-e', default: '-S'
|
12
12
|
def publish
|
13
13
|
opts = options.deep_symbolize_keys
|
14
14
|
Publication::Publisher.new(**opts).publish
|
data/lib/publication/publish.rb
CHANGED
@@ -3,18 +3,19 @@ require 'ruby-pandoc'
|
|
3
3
|
module Publication
|
4
4
|
class Publisher
|
5
5
|
|
6
|
-
def initialize(paths: nil, type: nil, output: nil, formats: [])
|
6
|
+
def initialize(paths: nil, type: nil, output: nil, formats: [], extraopts: nil)
|
7
7
|
@paths = Dir["#{Dir.pwd}/#{paths}"]
|
8
8
|
@type = type
|
9
9
|
@output = output
|
10
10
|
@formats = formats
|
11
|
+
@extraopts = extraopts
|
11
12
|
fail "No input files found at #{paths}" if @paths.empty?
|
12
13
|
fail "No output format specified" if @formats.empty?
|
13
14
|
end
|
14
15
|
|
15
16
|
def publish
|
16
17
|
@formats.each do |format|
|
17
|
-
RubyPandoc::Converter.new(@paths, from: @type, output: "#{@output}.#{format}").convert
|
18
|
+
RubyPandoc::Converter.new(@paths, from: @type, output: "#{@output}.#{format}", extra: extraopts).convert
|
18
19
|
end
|
19
20
|
end
|
20
21
|
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'ruby-pandoc/rake_tasks'
|
data/lib/publication/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: publication
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dale Hamel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-pandoc
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.0.
|
19
|
+
version: 0.0.5
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.0.
|
26
|
+
version: 0.0.5
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: thor
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -133,6 +133,7 @@ files:
|
|
133
133
|
- lib/publication.rb
|
134
134
|
- lib/publication/cli.rb
|
135
135
|
- lib/publication/publish.rb
|
136
|
+
- lib/publication/rake_tasks.rb
|
136
137
|
- lib/publication/version.rb
|
137
138
|
homepage: https://github.com/dalehamel/publication
|
138
139
|
licenses:
|