publication 0.0.5 → 0.0.6

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: fb0016229fc9af80860d3b88fff3dd71fdd47877
4
- data.tar.gz: 00a4d5a8538b7b763bebf9d083cfd2fb59ede1b1
3
+ metadata.gz: ee2b8ec7539e4ed98bdfe45924a1575e9b46d0c3
4
+ data.tar.gz: 80b2ec43ee0fbad6c1334c125e3603754a948473
5
5
  SHA512:
6
- metadata.gz: 10ce4c923901772a7818162100b5221ef77d88b87dde180466e63aa602aa664107cc72367c142ae22dc885653498f6e8582fa286a3a1e29bd51968e93c08f1e3
7
- data.tar.gz: e344038291688cf9a04466f58a11eb9e63c31fb1610917c90dc6ecfccff56037266b00a47fbcfb341acfff49a0d8ff4f198135f4bdf1dec6a667649dc779913d
6
+ metadata.gz: eede8eaadd43ab1d02dc31acb48033c65ef632730ec14f253a7fabf532a02dbb2f6107626f5bba68801cc198cd7aba68140183905220edd39adcdfbe8cf81c17
7
+ data.tar.gz: a448a33f4f712799da398a6771a5a904f3c85506b8837036a3daf6925122c23ff88332ca422472fa54304305910c135ce3ffa478ba2ca31b81dcf2e3b619bd0d
@@ -1,2 +1,4 @@
1
1
  require 'active_support/all'
2
+ require 'publication/setup'
3
+ require 'publication/spellchecker'
2
4
  require 'publication/publish'
@@ -3,12 +3,22 @@ require 'publication'
3
3
 
4
4
  class Publication::CLI < Thor
5
5
 
6
+ desc 'init', 'Initialize a standard template for the publication'
7
+ def init
8
+ Publication::Setup.init
9
+ end
10
+
11
+ desc 'spellcheck', 'Spellcheck the your markdown'
12
+ def spellcheck
13
+ Publication::Spellchecker.check
14
+ end
15
+
6
16
  desc 'publish', 'Create a new publication of the desired format'
7
17
  method_option :output, type: :string, required: false, banner: 'OUTPUT', desc: 'Name of the output file', aliases: '-o', default: 'output'
8
18
  method_option :paths, type: :string, required: false, banner: 'DIR', desc: 'Glob of source directory tree, parsed lexically and recursively', aliases: '-p', default: 'doc/**/*'
9
19
  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+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'
20
+ method_option :type, type: :string, required: false, banner: 'FORMAT', desc: 'Type (format) of input files', aliases: '-t', default: 'markdown+yaml_metadata_block+pandoc_title_block'
21
+ method_option :extraopts, type: :string, required: false, banner: 'EXTRA', desc: 'Extra options to pass to pandoc (advanced)', aliases: '-e', default: '--smart --chapters'
12
22
  def publish
13
23
  opts = options.deep_symbolize_keys
14
24
  Publication::Publisher.new(**opts).publish
@@ -0,0 +1,32 @@
1
+ require 'fileutils'
2
+ require 'date'
3
+ require 'yaml'
4
+
5
+ module Publication
6
+ module Setup
7
+ extend self
8
+ TITLE_STUB = <<-eos
9
+ ---
10
+ title: Example Publication Title
11
+ subtitle: Example publication subtitle
12
+ documentclass: book
13
+ toc: true
14
+ date: #{Date.today.to_s}
15
+
16
+ ---
17
+ eos
18
+
19
+ MDSPELL_DEFAULTS = <<-eos
20
+ ignored [
21
+ 'documentclass',
22
+ 'toc'
23
+ ]
24
+ eos
25
+
26
+ def init
27
+ FileUtils.mkdir_p('doc')
28
+ File.write('doc/title.md', TITLE_STUB) unless File.exists?('doc/title.md')
29
+ File.write('.mdspell.config', MDSPELL_DEFAULTS) unless File.exists?('.mdspell.config')
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,10 @@
1
+ module Publication
2
+ module Spellchecker
3
+ extend self
4
+
5
+ def check
6
+ files = Dir['doc/**/*'].map { |f| f if File.file?(f) }
7
+ puts `bundle exec mdspell #{files.join(' ')} #{"-c .mdspell.config" if File.exists?('.mdspell.config')}`
8
+ end
9
+ end
10
+ end
@@ -1,3 +1,3 @@
1
1
  module Publication
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.6'
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.5
4
+ version: 0.0.6
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-05 00:00:00.000000000 Z
11
+ date: 2016-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-pandoc
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - '='
67
67
  - !ruby/object:Gem::Version
68
68
  version: 4.2.5
69
+ - !ruby/object:Gem::Dependency
70
+ name: mdspell
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '='
74
+ - !ruby/object:Gem::Version
75
+ version: 0.2.0
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '='
81
+ - !ruby/object:Gem::Version
82
+ version: 0.2.0
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: pry
71
85
  requirement: !ruby/object:Gem::Requirement
@@ -134,6 +148,8 @@ files:
134
148
  - lib/publication/cli.rb
135
149
  - lib/publication/publish.rb
136
150
  - lib/publication/rake_tasks.rb
151
+ - lib/publication/setup.rb
152
+ - lib/publication/spellchecker.rb
137
153
  - lib/publication/version.rb
138
154
  homepage: https://github.com/dalehamel/publication
139
155
  licenses: