softcover 0.8.3 → 0.8.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 +4 -4
- data/.pull_requests/1388804598 +0 -0
- data/lib/softcover/book_manifest.rb +19 -8
- data/lib/softcover/template/html/stylesheets/softcover.css +1 -1
- data/lib/softcover/template/latex_styles/custom.sty +4 -5
- data/lib/softcover/template/latex_styles/custom_pdf.sty +7 -0
- data/lib/softcover/template/latex_styles/softcover.sty +1 -1
- data/lib/softcover/version.rb +1 -1
- data/softcover.gemspec +1 -1
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c09ee1b732a2b77aec54235afb4981ca7a57359
|
4
|
+
data.tar.gz: a15fc7199ef5d68a002d6efb523a0d34ef40c896
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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'
|
@@ -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}}
|
data/lib/softcover/version.rb
CHANGED
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.
|
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.
|
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-
|
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.
|
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.
|
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
|