publication 0.0.3 → 0.0.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: aca2cd73586a7ad4d804107e0f438a71d85cb727
4
- data.tar.gz: 7aeaa748c653da378c4b73e0db241ddeda3129e2
3
+ metadata.gz: 7d0a46ca7a808a6b777284d957bdc1729dd48b05
4
+ data.tar.gz: 35cd90f29dfcaa78492e5bcfd2e2c5ec7ed28802
5
5
  SHA512:
6
- metadata.gz: 6e8518dcab6a9c7eb22902bc022e7f1729e4a717e6c748188111d943eafbd47009adbc4a5a87a89cef207222dcd6273203e603c29dc5db9b02075540747aee80
7
- data.tar.gz: 4f7b25d699157204af1bb0407a038d9d026a11e4d9207d5ae594ba3a6c4a47023c3017c071f4e889a8c4ca2adf9897e1794a0555b857defa7725128b64936b66
6
+ metadata.gz: f5a04ebfe6510b4462422c7164b08d36daef5c3952aa7affb9d4e90a7c1fd5a6175802061e874cddddf13990a0001c12696faaebce12016fe35531c49e8adbd9
7
+ data.tar.gz: 64047ec5d556e08e2038baa223fba2a4fb1db2d59346a6626901715d4a0aa751f402107b664908d50a9f404449b69554e3fc083aa5db399f3bd76a259bba3892
@@ -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
- #method_option :extraopts, type: :string, required: false, banner: 'EXTRA', desc: 'Extra options to pass to pandoc (advanced)', aliases: '-e' # not yet used
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
@@ -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'
@@ -1,3 +1,3 @@
1
1
  module Publication
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
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.3
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-04 00:00:00.000000000 Z
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.3
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.3
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: