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 +4 -4
 - data/lib/publication.rb +2 -0
 - data/lib/publication/cli.rb +12 -2
 - data/lib/publication/setup.rb +32 -0
 - data/lib/publication/spellchecker.rb +10 -0
 - data/lib/publication/version.rb +1 -1
 - metadata +18 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: ee2b8ec7539e4ed98bdfe45924a1575e9b46d0c3
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 80b2ec43ee0fbad6c1334c125e3603754a948473
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: eede8eaadd43ab1d02dc31acb48033c65ef632730ec14f253a7fabf532a02dbb2f6107626f5bba68801cc198cd7aba68140183905220edd39adcdfbe8cf81c17
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: a448a33f4f712799da398a6771a5a904f3c85506b8837036a3daf6925122c23ff88332ca422472fa54304305910c135ce3ffa478ba2ca31b81dcf2e3b619bd0d
         
     | 
    
        data/lib/publication.rb
    CHANGED
    
    
    
        data/lib/publication/cli.rb
    CHANGED
    
    | 
         @@ -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: ' 
     | 
| 
      
 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
         
     | 
    
        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.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- 
     | 
| 
      
 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:
         
     |