softcover 0.6.2 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.pull_requests/1384801823 +0 -0
- data/lib/softcover/book.rb +2 -2
- data/lib/softcover/builder.rb +0 -4
- data/lib/softcover/template/README.md +10 -0
- data/lib/softcover/template/chapters/a_chapter.md +1 -1
- data/lib/softcover/template/gitignore +1 -0
- data/lib/softcover/utils.rb +7 -1
- data/lib/softcover/version.rb +1 -1
- data/spec/commands/generator_spec.rb +4 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10050a73b2276354c459a451a053cfbad32209fe
|
4
|
+
data.tar.gz: 97e8bf921f4323d76ce8c4065bca10dbc7c888a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1202e237981b7afc03e48585cd3150c52a7e432120fb7954dd6d14acf8637bca4cffd493550ba3e8aba554b002df15554685bf547816cdbebd2992c2f04239ab
|
7
|
+
data.tar.gz: 14dbbc6c586b8b402e7bb22d3e1c824c64daf911d353ea39f5fe01ca85af7cac231e061d9a45fdf06ba8fb4e4e07c5fa9ea9d99fe5965cbd7ceb8682429d7988
|
File without changes
|
data/lib/softcover/book.rb
CHANGED
@@ -8,9 +8,9 @@ class Softcover::Book
|
|
8
8
|
|
9
9
|
class UploadError < StandardError; end
|
10
10
|
|
11
|
-
def initialize
|
11
|
+
def initialize(options={})
|
12
12
|
require "softcover/client"
|
13
|
-
@manifest = Softcover::BookManifest.new
|
13
|
+
@manifest = Softcover::BookManifest.new(options)
|
14
14
|
@client = Softcover::Client.new_with_book self
|
15
15
|
|
16
16
|
@screencasts_dir = DEFAULT_SCREENCASTS_DIR
|
data/lib/softcover/builder.rb
CHANGED
@@ -24,10 +24,6 @@ module Softcover
|
|
24
24
|
def setup; end
|
25
25
|
def verify; end
|
26
26
|
|
27
|
-
def source
|
28
|
-
Dir.glob(path('chapters/*.md')).empty? ? :polytex : :markdown
|
29
|
-
end
|
30
|
-
|
31
27
|
# Writes out the PolyTeXnic commands from polytexnic.
|
32
28
|
def write_polytexnic_commands_file
|
33
29
|
Polytexnic.write_polytexnic_style_file(Dir.pwd)
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# Document README (please edit)
|
2
|
+
|
3
|
+
This is the README generated by `softcover new <document>`. It's not used by the [Softcover](http://softcover.io/) website, but it's a good practice to have a README when storing your document's source at, e.g., [GitHub](http://github.com/) or [Bitbucket](http://bitbucket.org/). (The latter is especially recommended for documents whose source isn't public, as Bitbucket allows unlimited free private repositories.)
|
4
|
+
|
5
|
+
Softcover documents come with a `.gitignore` file for use with [Git](http://git-scm.com/). To get started, add your files as follows:
|
6
|
+
|
7
|
+
$ git add -A
|
8
|
+
$ git commit -m "Initialize repository"
|
9
|
+
|
10
|
+
Then follow the instructions at [GitHub](http://github.com/) or [Bitbucket](http://bitbucket.org/) to create and push a remote repository.
|
@@ -52,7 +52,7 @@ end
|
|
52
52
|
|
53
53
|
Softcover's Markdown mode supports mathematical typesetting using \LaTeX\ syntax, including inline math, such as \( \phi^2 - \phi - 1 = 0, \) and centered math, such as
|
54
54
|
\[ \phi = \frac{1+\sqrt{5}}{2}. \]
|
55
|
-
It also
|
55
|
+
It also supports centered equations with linked cross-reference via embedded \PolyTeX\ (Eq.~\eqref{eq:phi}).
|
56
56
|
|
57
57
|
\begin{equation}
|
58
58
|
\label{eq:phi}
|
data/lib/softcover/utils.rb
CHANGED
@@ -4,10 +4,15 @@ module Softcover::Utils
|
|
4
4
|
def current_book
|
5
5
|
# using module level variable because it should be context independent
|
6
6
|
@@current_book ||= begin
|
7
|
-
in_book_directory? ? Softcover::Book.new : false
|
7
|
+
in_book_directory? ? Softcover::Book.new(origin: source) : false
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
11
|
+
# Returns the source type (PolyTeX or Markdown) of the current book.
|
12
|
+
def source
|
13
|
+
Dir.glob(path('chapters/*.md')).empty? ? :polytex : :markdown
|
14
|
+
end
|
15
|
+
|
11
16
|
def reset_current_book!
|
12
17
|
@@current_book = nil
|
13
18
|
end
|
@@ -52,6 +57,7 @@ module Softcover::Utils
|
|
52
57
|
# Returns the tmp version of a filename.
|
53
58
|
# E.g., tmpify('foo.tex') => 'foo.tmp.tex'
|
54
59
|
def tmpify(manifest, filename)
|
60
|
+
mkdir 'tmp'
|
55
61
|
sep = File::SEPARATOR
|
56
62
|
filename.sub(manifest.polytex_dir + sep, 'tmp' + sep).
|
57
63
|
sub('.tex', '.tmp.tex')
|
data/lib/softcover/version.rb
CHANGED
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.6.
|
4
|
+
version: 0.6.3
|
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: 2013-11-
|
12
|
+
date: 2013-11-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: polytexnic
|
@@ -363,6 +363,7 @@ files:
|
|
363
363
|
- .pull_requests/1384304643
|
364
364
|
- .pull_requests/1384447036
|
365
365
|
- .pull_requests/1384468478
|
366
|
+
- .pull_requests/1384801823
|
366
367
|
- .rspec
|
367
368
|
- .ruby-gemset
|
368
369
|
- .ruby-version
|
@@ -409,6 +410,7 @@ files:
|
|
409
410
|
- lib/softcover/server/views/main.js.erb
|
410
411
|
- lib/softcover/template/.softcover-deploy
|
411
412
|
- lib/softcover/template/Book.txt
|
413
|
+
- lib/softcover/template/README.md
|
412
414
|
- lib/softcover/template/book.tex
|
413
415
|
- lib/softcover/template/book.yml.erb
|
414
416
|
- lib/softcover/template/chapters/a_chapter.md
|
@@ -973,7 +975,6 @@ files:
|
|
973
975
|
- lib/softcover/template/polytexnic_commands.sty
|
974
976
|
- lib/softcover/template/simple_book.tex
|
975
977
|
- lib/softcover/template/softcover.sty
|
976
|
-
- lib/softcover/template/tmp/.gitkeep
|
977
978
|
- lib/softcover/template/upquote.sty
|
978
979
|
- lib/softcover/uploader.rb
|
979
980
|
- lib/softcover/utils.rb
|