softcover 0.8.3 → 0.8.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8517d20ed35112c9a9cb2bc96f20e238d01d8693
4
- data.tar.gz: 065d1b1c0f0bbec15eac9c36b6eb8dfc74f208cb
3
+ metadata.gz: 6c09ee1b732a2b77aec54235afb4981ca7a57359
4
+ data.tar.gz: a15fc7199ef5d68a002d6efb523a0d34ef40c896
5
5
  SHA512:
6
- metadata.gz: 3b149d52b4f0f4686035d75aaec4718a21013ecaa4f3ca9c1502ccb37bf1e83d1d7549f06c5112dc93a3421521736ed459ff46bd8b4cf86777a9e358b9183653
7
- data.tar.gz: 27cc1180736a28e52a952d578fbad1f6516f110ca4a7f98b12ad78583beb08526c97542758af33329eda325567892c049e75a44220137a5360701fac021d352b
6
+ metadata.gz: 339a0c2f48ecb057ff76fb0495e00b2cd48a775d0eaaafd9362e3b64e470cf300db8456d53db765e1c6927c999680b3f15671edf9cd3f1941cc359f92d25d2a9
7
+ data.tar.gz: 556fce0cf5f69af781b98a1a3ed34a5eb3a5c37e8c965490eb13cdc712d10e89cf48ec99dadd6d758dcffec7371e37b0a5a72e23740330d1960e5e9be45d1254
File without changes
@@ -7,16 +7,8 @@ class Softcover::BookManifest < OpenStruct
7
7
 
8
8
  YAML_PATH = File.join(Softcover::Directories::CONFIG, 'marketing.yml')
9
9
  def initialize
10
- ensure_marketing_file
11
10
  marshal_load read_from_yml.symbolize_keys!
12
11
  end
13
-
14
- # Ensures the existence of 'marketing.yml'.
15
- # We copy from the template if necessary.
16
- def ensure_marketing_file
17
- template = File.join(File.dirname(__FILE__), 'template', YAML_PATH)
18
- FileUtils.cp(template, YAML_PATH) unless File.exist?(YAML_PATH)
19
- end
20
12
  end
21
13
 
22
14
 
@@ -83,6 +75,8 @@ class Softcover::BookManifest < OpenStruct
83
75
  @source = options[:source] || :polytex
84
76
  @origin = options[:origin]
85
77
 
78
+ ensure_template_files
79
+
86
80
  if ungenerated_markdown?
87
81
  puts "Error: No book to publish"
88
82
  puts "Run `softcover build:<format>` for at least one format"
@@ -137,6 +131,23 @@ class Softcover::BookManifest < OpenStruct
137
131
  verify_paths! if options[:verify_paths]
138
132
  end
139
133
 
134
+ # Ensures the existence of needed template files like 'marketing.yml'.
135
+ # We copy from the template if necessary.
136
+ # Needed for backwards compatibility.
137
+ def ensure_template_files
138
+ self.class.find_book_root!
139
+ template_dir = File.join(File.dirname(__FILE__), 'template')
140
+ files = [File.join(Softcover::Directories::CONFIG, 'marketing.yml'),
141
+ path('images/cover-web.png'),
142
+ path('latex_styles/custom_pdf.sty')]
143
+ files.each do |file|
144
+ unless File.exist?(file)
145
+ puts "Copying missing file '#{file}' from template"
146
+ FileUtils.cp(File.join(template_dir, file), file)
147
+ end
148
+ end
149
+ end
150
+
140
151
  # Handles case of Markdown books without running `softcover build`.
141
152
  def ungenerated_markdown?
142
153
  dir = 'generated_polytex'
@@ -68,7 +68,7 @@ body #book {
68
68
  }
69
69
 
70
70
  #book code {
71
- font-size: 100%;
71
+ font-size: 95%;
72
72
  color: darkgreen;
73
73
  font-weight: bold;
74
74
  }
@@ -1,4 +1,8 @@
1
1
  % Place additional custom commands below.
2
+ % NOTE: These commands will generally be available across output formats.
3
+ % For commands (such as hyphenation) that only pertain to PDF output, use the
4
+ % file `custom_pdf.sty` instead.
5
+
2
6
  % Examples:
3
7
  % No arguments:
4
8
  % Insert '\emph{The Ruby on Rails Tutorial}' wherever '\tutorial' occurs:
@@ -9,8 +13,3 @@
9
13
  % Convert '\bfi{text}' to '\textbf{\textit{text}}' (boldface italic):
10
14
  %
11
15
  % \newcommand{\bfi}[1]{\textbf{\textit{{#1}}}}
12
-
13
- % You can also use this file to define the proper hypenation of any words
14
- % LaTeX can't hyphenate natively.
15
- %
16
- \hyphenation{Ja-va-Script}
@@ -0,0 +1,7 @@
1
+ % You can also use this file to define commands that *only* pertain to the PDF.
2
+ % For example, you can define the proper hypenation of any words that LaTeX
3
+ % can't hyphenate natively.
4
+ \hyphenation{Ja-va-Script}
5
+ % You can also include and use packages.
6
+ \usepackage{newunicodechar}
7
+ \newunicodechar{★}{\ensuremath{\star}}
@@ -145,4 +145,4 @@
145
145
 
146
146
  % Add custom commands.
147
147
  \usepackage{latex_styles/custom}
148
-
148
+ \usepackage{latex_styles/custom_pdf}
@@ -1,3 +1,3 @@
1
1
  module Softcover
2
- VERSION = "0.8.3"
2
+ VERSION = "0.8.4"
3
3
  end
data/softcover.gemspec CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |gem|
18
18
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
19
19
  gem.require_paths = ["lib"]
20
20
 
21
- gem.add_dependency 'polytexnic', '~> 0.8.0'
21
+ gem.add_dependency 'polytexnic', '~> 0.8.1'
22
22
  gem.add_dependency 'msgpack', '~> 0.4.2'
23
23
  gem.add_dependency 'nokogiri', '~> 1.6.0'
24
24
  gem.add_dependency 'thor'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: softcover
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.3
4
+ version: 0.8.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Hartl
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-01-03 00:00:00.000000000 Z
12
+ date: 2014-01-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: polytexnic
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - ~>
19
19
  - !ruby/object:Gem::Version
20
- version: 0.8.0
20
+ version: 0.8.1
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - ~>
26
26
  - !ruby/object:Gem::Version
27
- version: 0.8.0
27
+ version: 0.8.1
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: msgpack
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -382,6 +382,7 @@ files:
382
382
  - .pull_requests/1388441218
383
383
  - .pull_requests/1388518194
384
384
  - .pull_requests/1388713504
385
+ - .pull_requests/1388804598
385
386
  - .rspec
386
387
  - .travis.yml
387
388
  - Gemfile
@@ -992,6 +993,7 @@ files:
992
993
  - lib/softcover/template/images/figures/.gitkeep
993
994
  - lib/softcover/template/images/testimonial_1.png
994
995
  - lib/softcover/template/latex_styles/custom.sty
996
+ - lib/softcover/template/latex_styles/custom_pdf.sty
995
997
  - lib/softcover/template/latex_styles/framed.sty
996
998
  - lib/softcover/template/latex_styles/softcover.sty
997
999
  - lib/softcover/template/latex_styles/upquote.sty