Skip to content

Commit

Permalink
Merge branch 'softcover:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
shishi authored Aug 21, 2021
2 parents d570cf6 + 447efcd commit f657c0d
Show file tree
Hide file tree
Showing 15 changed files with 121 additions and 106 deletions.
106 changes: 52 additions & 54 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
PATH
remote: .
specs:
softcover (1.6.3)
softcover (1.7.3)
activesupport (~> 4.2.3)
async_sinatra (~> 1.1.0)
coffee-script (>= 2.2.0)
curb (>= 0.9.7)
i18n (>= 0.7.0)
kramdown (>= 1.6.0)
listen (~> 1.3.1)
listen (~> 3.2.1)
maruku (~> 0.7.1)
msgpack (~> 1.2.0)
nokogiri (>= 1.6.0, < 2.0)
polytexnic (~> 1.5.16)
pygments.rb (~> 1.2.1)
rb-fsevent (~> 0.9.3)
polytexnic (~> 1.6)
pygments.rb (~> 2.1)
rest-client (>= 1.8.0)
ruby-progressbar (~> 1.10)
sanitize (~> 4.6.3)
sanitize (>= 4.6.3, < 5.3.0)
sinatra (~> 1.4.4)
sinatra-respond_to (~> 0.9.0)
thin (~> 1.6.1)
Expand All @@ -26,94 +25,93 @@ PATH
GEM
remote: https://rubygems.org/
specs:
activesupport (4.2.11.1)
activesupport (4.2.11.3)
i18n (~> 0.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.7.0)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
async_sinatra (1.1.0)
rack (>= 1.4.1)
sinatra (>= 1.3.2)
coderay (1.1.2)
coderay (1.1.3)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.12.2)
concurrent-ruby (1.1.6)
concurrent-ruby (1.1.9)
coveralls (0.8.23)
json (>= 1.8, < 3)
simplecov (~> 0.16.1)
term-ansicolor (~> 1.3)
thor (>= 0.19.4, < 2.0)
tins (~> 1.6)
crack (0.4.3)
safe_yaml (~> 1.0.0)
crack (0.4.5)
rexml
crass (1.0.6)
curb (0.9.10)
daemons (1.3.1)
diff-lcs (1.3)
docile (1.3.2)
curb (0.9.11)
daemons (1.4.0)
diff-lcs (1.4.4)
docile (1.4.0)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
eventmachine (1.2.7)
execjs (2.7.0)
ffi (1.12.2)
execjs (2.8.1)
ffi (1.15.3)
hashdiff (1.0.1)
http-accept (1.7.0)
http-cookie (1.0.3)
http-cookie (1.0.4)
domain_name (~> 0.5)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
json (2.3.0)
kramdown (1.17.0)
listen (1.3.1)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
rb-kqueue (>= 0.2)
json (2.3.1)
kramdown (2.3.1)
rexml
listen (3.2.1)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
maruku (0.7.3)
method_source (1.0.0)
mime-types (3.3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2019.1009)
mini_portile2 (2.4.0)
minitest (5.14.0)
mime-types-data (3.2021.0704)
mini_portile2 (2.5.3)
minitest (5.14.4)
msgpack (1.2.10)
multi_json (1.14.1)
netrc (0.11.0)
nokogiri (1.10.9)
mini_portile2 (~> 2.4.0)
nokogumbo (1.5.0)
nokogiri
polytexnic (1.5.16)
nokogiri (1.11.7)
mini_portile2 (~> 2.5.0)
racc (~> 1.4)
nokogumbo (2.0.5)
nokogiri (~> 1.8, >= 1.8.4)
polytexnic (1.6.4)
json (~> 2.3.0)
kramdown (~> 1.17)
kramdown (>= 2.0, < 3.0)
msgpack (~> 1.2.0)
nokogiri (~> 1.10.8)
pygments.rb (~> 1.2.1)
pry (0.13.1)
nokogiri (>= 1.6.0, < 2.0)
pygments.rb (~> 2.1)
pry (0.14.1)
coderay (~> 1.1)
method_source (~> 1.0)
public_suffix (4.0.4)
pygments.rb (1.2.1)
multi_json (>= 1.0.0)
public_suffix (4.0.6)
pygments.rb (2.2.0)
racc (1.5.2)
rack (1.6.13)
rack-protection (1.5.5)
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
rake (13.0.1)
rb-fsevent (0.9.8)
rake (13.0.6)
rb-fsevent (0.11.0)
rb-inotify (0.10.1)
ffi (~> 1.0)
rb-kqueue (0.2.5)
ffi (>= 0.5.0)
rest-client (2.1.0)
http-accept (>= 1.7.0, < 2.0)
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
rexml (3.2.5)
rspec (2.14.1)
rspec-core (~> 2.14.0)
rspec-expectations (~> 2.14.0)
Expand All @@ -122,13 +120,13 @@ GEM
rspec-expectations (2.14.5)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.14.6)
ruby-prof (1.3.1)
ruby-progressbar (1.10.1)
ruby-prof (1.4.3)
ruby-progressbar (1.11.0)
safe_yaml (1.0.4)
sanitize (4.6.6)
sanitize (5.2.3)
crass (~> 1.0.2)
nokogiri (>= 1.4.4)
nokogumbo (~> 1.4)
nokogiri (>= 1.8.0)
nokogumbo (~> 2.0)
simplecov (0.16.1)
docile (~> 1.1)
json (>= 1.8, < 3)
Expand All @@ -147,17 +145,17 @@ GEM
daemons (~> 1.0, >= 1.0.9)
eventmachine (~> 1.0, >= 1.0.4)
rack (~> 1.0)
thor (1.0.1)
thor (1.1.0)
thread_safe (0.3.6)
tilt (2.0.10)
tins (1.24.1)
tins (1.29.1)
sync
tzinfo (1.2.7)
tzinfo (1.2.9)
thread_safe (~> 0.1)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.7)
webmock (3.8.3)
webmock (3.13.0)
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
Expand Down
6 changes: 3 additions & 3 deletions lib/softcover/article_template/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Document README (please edit)

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.)
This is the README generated by `softcover new <document>`. It's not used by the [Softcover](https://www.softcover.io/) website, but it's a good practice to have a README when storing your document's source at, e.g., [GitHub](https://github.com/).

Softcover documents come with a `.gitignore` file for use with [Git](http://git-scm.com/). To get started, add your files as follows:
Softcover documents come with a `.gitignore` file for use with [Git](https://git-scm.com/). To get started, add your files as follows:

$ git add -A
$ git commit -m "Initialize repository"

Then follow the instructions at [GitHub](http://github.com/) or [Bitbucket](http://bitbucket.org/) to create and push a remote repository.
Then follow the instructions at [GitHub](https://github.com/), [GitLab](https://gitlab.com/), or [Bitbucket](https://bitbucket.org/) to create and push a remote repository.
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,12 @@ body #book {
margin-top: -0.4em;
}

#book .code .highlight .linenos {
color: #666;
font-weight: normal;
}

/* Include `.lineno` for backward-compatibility with Pygments 1. */
#book .code .highlight .lineno {
color: #666;
font-weight: normal;
Expand Down Expand Up @@ -434,7 +440,7 @@ body #book {
color: red;
}

#book .sc {
#book .smallcaps {
font-variant: small-caps;
}

Expand Down
6 changes: 3 additions & 3 deletions lib/softcover/book_template/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Document README (please edit)

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.)
This is the README generated by `softcover new <document>`. It's not used by the [Softcover](https://www.softcover.io/) website, but it's a good practice to have a README when storing your document's source at, e.g., [GitHub](https://github.com/).

Softcover documents come with a `.gitignore` file for use with [Git](http://git-scm.com/). To get started, add your files as follows:
Softcover documents come with a `.gitignore` file for use with [Git](https://git-scm.com/). To get started, add your files as follows:

$ git add -A
$ git commit -m "Initialize repository"

Then follow the instructions at [GitHub](http://github.com/) or [Bitbucket](http://bitbucket.org/) to create and push a remote repository.
Then follow the instructions at [GitHub](https://github.com/), [GitLab](https://gitlab.com/), or [Bitbucket](https://bitbucket.org/) to create and push a remote repository.
8 changes: 7 additions & 1 deletion lib/softcover/book_template/html/stylesheets/softcover.css
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,12 @@ body #book {
margin-top: -0.4em;
}

#book .code .highlight .linenos {
color: #666;
font-weight: normal;
}

/* Include `.lineno` for backward-compatibility with Pygments 1. */
#book .code .highlight .lineno {
color: #666;
font-weight: normal;
Expand Down Expand Up @@ -434,7 +440,7 @@ body #book {
color: red;
}

#book .sc {
#book .smallcaps {
font-variant: small-caps;
}

Expand Down
1 change: 1 addition & 0 deletions lib/softcover/book_template/markdown_gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ html/*.xhtml

# Generated EPUB files
epub/OEBPS/*.html
epub/OEBPS/*.xhtml
epub/OEBPS/*.opf
epub/OEBPS/*.ncx
epub/OEBPS/images
Expand Down
17 changes: 1 addition & 16 deletions lib/softcover/builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,10 @@ def verify; end
def ensure_style_file_locations
styles_dir = Softcover::Directories::STYLES
mkdir styles_dir
fix_custom_include
files = Dir.glob('*.sty')
FileUtils.mv(files, styles_dir)
end

# Fixes the custom include.
# The template includes the custom style file as an example
# of file inclusion. Unfortunately, the location of 'custom.sty', has
# changed, which will result in older templates spontaneously breaking.
def fix_custom_include
first_chapter = File.join('chapters', 'a_chapter.tex')
if File.exist?(first_chapter)
text = File.read(first_chapter)
text.gsub!('<<(custom.sty',
"<<(#{Softcover::Directories::STYLES}/custom.sty" )
File.write(first_chapter, text)
end
end

# Writes out the PolyTeXnic commands from polytexnic.
def write_polytexnic_commands_file
Polytexnic.write_polytexnic_style_file(styles_dir)
Expand Down Expand Up @@ -83,4 +68,4 @@ def listing_customization
end

end
end
end
12 changes: 6 additions & 6 deletions lib/softcover/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ def build
desc "build:#{format}", "Build #{format.upcase}"
if format == 'pdf'
method_option :debug, aliases: '-d',
desc: "Run raw xelatex for debugging purposes",
desc: "Run raw xelatex for debugging",
type: :boolean
method_option :once, aliases: '-o',
desc: "Run PDF generator once (no xref update)",
desc: "Run generator once",
type: :boolean
method_option :'find-overfull', aliases: '-f',
desc: "Find overfull hboxes",
type: :boolean
method_option :nonstop, aliases: '-n',
desc: "Run PDF generator in nonstopmode",
desc: "Run generator in nonstopmode",
type: :boolean
elsif format == 'mobi'
method_option :amazon, aliases: '-a',
Expand Down Expand Up @@ -205,8 +205,8 @@ def deploy
method_option :polytex,
:type => :boolean,
:default => false,
:aliases => "-p",
:desc => "Generate a PolyTeX document."
:aliases => %w[-p --latex -l],
:desc => "Generate a LaTeX document."
method_option :article,
:type => :boolean,
:default => false,
Expand Down Expand Up @@ -267,7 +267,7 @@ def config
# ===============================================
# Utilities
# ===============================================
desc "exercises", "Add exercise id elements as spans (warning: files are overwritten)"
desc "exercises", "Add exercise id elements as spans"
define_method "exercises" do
Softcover::Commands::Exercises.add_to_chapters!
end
Expand Down
6 changes: 3 additions & 3 deletions lib/softcover/commands/check.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def dependencies
[:java, 'Java'],
[:zip, 'zip'],
[:epubcheck, 'EpubCheck'],
[:python2, 'Python 2']
[:python3, 'Python 3']
]
end

Expand Down Expand Up @@ -86,8 +86,8 @@ def missing_dependency_message(label)
message += " ∟ Unzip and place epubcheck-4.2.2/ in a directory on your path"
when :inkscape
message = "Inkscape (https://inkscape.org/)"
when :python2
message = "Configure your shell so that `python` runs Python 2"
when :python3
message = "Configure your shell so that `python3` runs Python 3"
else
raise "Unknown label #{label}"
end
Expand Down
Loading

0 comments on commit f657c0d

Please sign in to comment.