From 5b597cce851b14706661fae1c6b47a4c2d90ab88 Mon Sep 17 00:00:00 2001 From: Michael Hartl Date: Mon, 18 May 2020 12:26:08 -0700 Subject: [PATCH 01/21] Upgrade listen gem, fix weird a_chapter inclusion bug --- Gemfile.lock | 28 ++++++++++++---------------- lib/softcover/builder.rb | 17 +---------------- lib/softcover/commands/server.rb | 18 ++++++++++++++---- lib/softcover/version.rb | 2 +- softcover.gemspec | 3 +-- 5 files changed, 29 insertions(+), 39 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 35c245d67..c0f029fa1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,20 +1,19 @@ PATH remote: . specs: - softcover (1.6.3) + softcover (1.6.4) 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) rest-client (>= 1.8.0) ruby-progressbar (~> 1.10) sanitize (~> 4.6.3) @@ -26,7 +25,7 @@ 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) @@ -68,17 +67,16 @@ GEM 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) + 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) + mime-types-data (3.2020.0512) mini_portile2 (2.4.0) - minitest (5.14.0) + minitest (5.14.1) msgpack (1.2.10) multi_json (1.14.1) netrc (0.11.0) @@ -95,7 +93,7 @@ GEM pry (0.13.1) coderay (~> 1.1) method_source (~> 1.0) - public_suffix (4.0.4) + public_suffix (4.0.5) pygments.rb (1.2.1) multi_json (>= 1.0.0) rack (1.6.13) @@ -104,11 +102,9 @@ GEM rack-test (1.1.0) rack (>= 1.0, < 3) rake (13.0.1) - rb-fsevent (0.9.8) + rb-fsevent (0.10.4) 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) @@ -122,7 +118,7 @@ GEM rspec-expectations (2.14.5) diff-lcs (>= 1.1.3, < 2.0) rspec-mocks (2.14.6) - ruby-prof (1.3.1) + ruby-prof (1.4.1) ruby-progressbar (1.10.1) safe_yaml (1.0.4) sanitize (4.6.6) @@ -150,7 +146,7 @@ GEM thor (1.0.1) thread_safe (0.3.6) tilt (2.0.10) - tins (1.24.1) + tins (1.25.0) sync tzinfo (1.2.7) thread_safe (~> 0.1) diff --git a/lib/softcover/builder.rb b/lib/softcover/builder.rb index ff9d54bfa..56a4bf823 100644 --- a/lib/softcover/builder.rb +++ b/lib/softcover/builder.rb @@ -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) @@ -83,4 +68,4 @@ def listing_customization end end -end \ No newline at end of file +end diff --git a/lib/softcover/commands/server.rb b/lib/softcover/commands/server.rb index 24eb7ea60..ca9e856c2 100644 --- a/lib/softcover/commands/server.rb +++ b/lib/softcover/commands/server.rb @@ -11,16 +11,14 @@ def listen_for_changes return if defined?(@no_listener) && @no_listener server_pid = Process.pid filter_regex = /(\.md|\.tex|custom\.sty|custom\.css|Book\.txt|book\.yml)$/ - @listener = Listen.to('.') - @listener.filter(filter_regex) - - @listener.change do |modified| + @listener = Listen.to('.', only: filter_regex, ignore: /html\//) do |modified| first_modified = modified.try(:first) unless first_modified =~ ignore_regex rebuild first_modified Process.kill("HUP", server_pid) end end + @listener.start end @@ -65,3 +63,15 @@ def run(port, bind) start_server port, bind end end + +# Listen >=2.8 patch to silence duplicate directory errors. USE AT YOUR OWN RISK +require 'listen/record/symlink_detector' +module Listen + class Record + class SymlinkDetector + def _fail(_, _) + fail Error, "Don't watch locally-symlinked directory twice" + end + end + end +end diff --git a/lib/softcover/version.rb b/lib/softcover/version.rb index 5afe4b0aa..7aa0275ee 100644 --- a/lib/softcover/version.rb +++ b/lib/softcover/version.rb @@ -1,3 +1,3 @@ module Softcover - VERSION = "1.6.3" + VERSION = "1.6.4" end diff --git a/softcover.gemspec b/softcover.gemspec index fb6819c2e..d84daa6f4 100644 --- a/softcover.gemspec +++ b/softcover.gemspec @@ -36,7 +36,6 @@ Gem::Specification.new do |gem| gem.add_dependency 'async_sinatra', '~> 1.1.0' gem.add_dependency 'sinatra-respond_to', '~> 0.9.0' gem.add_dependency 'coffee-script', '>= 2.2.0' - gem.add_dependency 'listen', '~> 1.3.1' - gem.add_dependency 'rb-fsevent', '~> 0.9.3' + gem.add_dependency 'listen', '~> 3.2.1' gem.add_dependency 'sanitize', '~> 4.6.3' end From 8533a251fd734be1a1081f1d9dda3fc0ac74a522 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Jun 2020 22:08:43 +0000 Subject: [PATCH 02/21] Update sanitize requirement from ~> 4.6.3 to >= 4.6.3, < 5.3.0 Updates the requirements on [sanitize](https://github.com/rgrove/sanitize) to permit the latest version. - [Release notes](https://github.com/rgrove/sanitize/releases) - [Changelog](https://github.com/rgrove/sanitize/blob/master/HISTORY.md) - [Commits](https://github.com/rgrove/sanitize/compare/v4.6.6...v5.2.1) Signed-off-by: dependabot[bot] --- Gemfile.lock | 14 +++++++------- softcover.gemspec | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index c0f029fa1..d3a2eef01 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -16,7 +16,7 @@ PATH pygments.rb (~> 1.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) @@ -58,7 +58,7 @@ GEM unf (>= 0.0.5, < 1.0.0) eventmachine (1.2.7) execjs (2.7.0) - ffi (1.12.2) + ffi (1.13.1) hashdiff (1.0.1) http-accept (1.7.0) http-cookie (1.0.3) @@ -82,8 +82,8 @@ GEM netrc (0.11.0) nokogiri (1.10.9) mini_portile2 (~> 2.4.0) - nokogumbo (1.5.0) - nokogiri + nokogumbo (2.0.2) + nokogiri (~> 1.8, >= 1.8.4) polytexnic (1.5.16) json (~> 2.3.0) kramdown (~> 1.17) @@ -121,10 +121,10 @@ GEM ruby-prof (1.4.1) ruby-progressbar (1.10.1) safe_yaml (1.0.4) - sanitize (4.6.6) + sanitize (5.2.1) 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) diff --git a/softcover.gemspec b/softcover.gemspec index d84daa6f4..97e5fb98f 100644 --- a/softcover.gemspec +++ b/softcover.gemspec @@ -37,5 +37,5 @@ Gem::Specification.new do |gem| gem.add_dependency 'sinatra-respond_to', '~> 0.9.0' gem.add_dependency 'coffee-script', '>= 2.2.0' gem.add_dependency 'listen', '~> 3.2.1' - gem.add_dependency 'sanitize', '~> 4.6.3' + gem.add_dependency 'sanitize', '>= 4.6.3', '< 5.3.0' end From 0b170939179cfd8620803731c79befd7af7c8b2d Mon Sep 17 00:00:00 2001 From: Michael Hartl Date: Fri, 19 Jun 2020 17:08:10 -0700 Subject: [PATCH 03/21] Update lock --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index d3a2eef01..34ce23a14 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -35,7 +35,7 @@ GEM 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 From 4b1fa5e873c039ad77488f19fef95761020d670e Mon Sep 17 00:00:00 2001 From: Michael Hartl Date: Fri, 19 Jun 2020 17:08:40 -0700 Subject: [PATCH 04/21] Bump version number --- lib/softcover/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/softcover/version.rb b/lib/softcover/version.rb index 7aa0275ee..7f442aaf3 100644 --- a/lib/softcover/version.rb +++ b/lib/softcover/version.rb @@ -1,3 +1,3 @@ module Softcover - VERSION = "1.6.4" + VERSION = "1.6.5" end From d95c6275bca5ea06f24f1febfb3f5cd71d598e39 Mon Sep 17 00:00:00 2001 From: Michael Hartl Date: Fri, 19 Jun 2020 17:24:48 -0700 Subject: [PATCH 05/21] Update lock --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 34ce23a14..92975d84d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - softcover (1.6.4) + softcover (1.6.5) activesupport (~> 4.2.3) async_sinatra (~> 1.1.0) coffee-script (>= 2.2.0) From 218b96e5a73af7890782b18b086b05adae730be0 Mon Sep 17 00:00:00 2001 From: Michael Hartl Date: Thu, 1 Oct 2020 09:50:42 -0700 Subject: [PATCH 06/21] Change smallcaps CSS class to fix interaction bug with Pygments --- lib/softcover/article_template/html/stylesheets/softcover.css | 2 +- lib/softcover/book_template/html/stylesheets/softcover.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/softcover/article_template/html/stylesheets/softcover.css b/lib/softcover/article_template/html/stylesheets/softcover.css index 5848d280a..2c99ed09b 100644 --- a/lib/softcover/article_template/html/stylesheets/softcover.css +++ b/lib/softcover/article_template/html/stylesheets/softcover.css @@ -434,7 +434,7 @@ body #book { color: red; } -#book .sc { +#book .smallcaps { font-variant: small-caps; } diff --git a/lib/softcover/book_template/html/stylesheets/softcover.css b/lib/softcover/book_template/html/stylesheets/softcover.css index 5848d280a..2c99ed09b 100644 --- a/lib/softcover/book_template/html/stylesheets/softcover.css +++ b/lib/softcover/book_template/html/stylesheets/softcover.css @@ -434,7 +434,7 @@ body #book { color: red; } -#book .sc { +#book .smallcaps { font-variant: small-caps; } From 79d8b943cdb784b2e673f4421c52cd7cef11724a Mon Sep 17 00:00:00 2001 From: Michael Hartl Date: Thu, 1 Oct 2020 10:00:38 -0700 Subject: [PATCH 07/21] Bump version number --- Gemfile.lock | 20 +++++++++++--------- lib/softcover/version.rb | 2 +- softcover.gemspec | 2 +- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 92975d84d..f3a01a696 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - softcover (1.6.5) + softcover (1.7.0) activesupport (~> 4.2.3) async_sinatra (~> 1.1.0) coffee-script (>= 2.2.0) @@ -12,7 +12,7 @@ PATH maruku (~> 0.7.1) msgpack (~> 1.2.0) nokogiri (>= 1.6.0, < 2.0) - polytexnic (~> 1.5.16) + polytexnic (~> 1.6.0) pygments.rb (~> 1.2.1) rest-client (>= 1.8.0) ruby-progressbar (~> 1.10) @@ -40,7 +40,7 @@ GEM coffee-script-source execjs coffee-script-source (1.12.2) - concurrent-ruby (1.1.6) + concurrent-ruby (1.1.7) coveralls (0.8.23) json (>= 1.8, < 3) simplecov (~> 0.16.1) @@ -66,7 +66,8 @@ GEM i18n (0.9.5) concurrent-ruby (~> 1.0) json (2.3.0) - kramdown (1.17.0) + kramdown (2.3.0) + rexml listen (3.2.1) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) @@ -76,17 +77,17 @@ GEM mime-types-data (~> 3.2015) mime-types-data (3.2020.0512) mini_portile2 (2.4.0) - minitest (5.14.1) + minitest (5.14.2) msgpack (1.2.10) - multi_json (1.14.1) + multi_json (1.15.0) netrc (0.11.0) - nokogiri (1.10.9) + nokogiri (1.10.10) mini_portile2 (~> 2.4.0) nokogumbo (2.0.2) nokogiri (~> 1.8, >= 1.8.4) - polytexnic (1.5.16) + polytexnic (1.6.0) json (~> 2.3.0) - kramdown (~> 1.17) + kramdown (>= 1.17, < 3.0) msgpack (~> 1.2.0) nokogiri (~> 1.10.8) pygments.rb (~> 1.2.1) @@ -110,6 +111,7 @@ GEM http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 4.0) netrc (~> 0.8) + rexml (3.2.4) rspec (2.14.1) rspec-core (~> 2.14.0) rspec-expectations (~> 2.14.0) diff --git a/lib/softcover/version.rb b/lib/softcover/version.rb index 7f442aaf3..767719c7e 100644 --- a/lib/softcover/version.rb +++ b/lib/softcover/version.rb @@ -1,3 +1,3 @@ module Softcover - VERSION = "1.6.5" + VERSION = "1.7.0" end diff --git a/softcover.gemspec b/softcover.gemspec index 97e5fb98f..6ba5cb7a9 100644 --- a/softcover.gemspec +++ b/softcover.gemspec @@ -18,7 +18,7 @@ Gem::Specification.new do |gem| gem.test_files = gem.files.grep(%r{^(test|spec|features)/}) gem.require_paths = ["lib"] - gem.add_dependency 'polytexnic', '~> 1.5.16' + gem.add_dependency 'polytexnic', '~> 1.6.0' gem.add_dependency 'msgpack', '~> 1.2.0' gem.add_dependency 'nokogiri', '>= 1.6.0', '< 2.0' gem.add_dependency 'thor', '>= 0.18.1', '< 2.0' From 4a9ac8e10e94afd314467e065bf4a5db8d75c5b7 Mon Sep 17 00:00:00 2001 From: Michael Hartl Date: Thu, 12 Nov 2020 13:12:34 -0800 Subject: [PATCH 08/21] Add LaTeX aliases --- Gemfile.lock | 2 +- lib/softcover/cli.rb | 4 ++-- lib/softcover/version.rb | 2 +- spec/cli_spec.rb | 15 ++++++++++++++- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index f3a01a696..8c3d563ad 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - softcover (1.7.0) + softcover (1.7.1) activesupport (~> 4.2.3) async_sinatra (~> 1.1.0) coffee-script (>= 2.2.0) diff --git a/lib/softcover/cli.rb b/lib/softcover/cli.rb index 36d76b65f..24f9876e1 100644 --- a/lib/softcover/cli.rb +++ b/lib/softcover/cli.rb @@ -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, diff --git a/lib/softcover/version.rb b/lib/softcover/version.rb index 767719c7e..2659e73c0 100644 --- a/lib/softcover/version.rb +++ b/lib/softcover/version.rb @@ -1,3 +1,3 @@ module Softcover - VERSION = "1.7.0" + VERSION = "1.7.1" end diff --git a/spec/cli_spec.rb b/spec/cli_spec.rb index 0288180fc..b762642c4 100644 --- a/spec/cli_spec.rb +++ b/spec/cli_spec.rb @@ -48,7 +48,7 @@ context "softcover new options" do subject { `softcover help new` } - it { should include '-p, [--polytex]' } + it { should include '-p, --latex, -l, [--polytex]' } it { should include '-a, [--article]' } end @@ -155,6 +155,19 @@ it_should_behave_like "book" end + describe "LaTeX books" do + + before(:all) do + remove_book + chdir_to_fixtures + silence { `softcover new book --latex` } + chdir_to_book + end + after(:all) { remove_book } + + it_should_behave_like "book" + end + describe "Markdown books" do before(:all) do From 9350a14d1ead3538b6a307dc9cdf60e1f9b2267c Mon Sep 17 00:00:00 2001 From: Michael Hartl Date: Fri, 27 Nov 2020 10:31:23 -0800 Subject: [PATCH 09/21] Shorten exercise help --- lib/softcover/cli.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/softcover/cli.rb b/lib/softcover/cli.rb index 24f9876e1..9cee3ed90 100644 --- a/lib/softcover/cli.rb +++ b/lib/softcover/cli.rb @@ -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 From 171b690141873e79714cfa28b0f7f9bd7440b9c9 Mon Sep 17 00:00:00 2001 From: Michael Hartl Date: Wed, 17 Feb 2021 18:54:29 -0800 Subject: [PATCH 10/21] Add link to source This should now display a link to the GitHub repo at rubygems.org --- softcover.gemspec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/softcover.gemspec b/softcover.gemspec index 6ba5cb7a9..2a471b29d 100644 --- a/softcover.gemspec +++ b/softcover.gemspec @@ -10,7 +10,8 @@ Gem::Specification.new do |gem| gem.email = ["michael@softcover.io"] gem.description = %q{Command-line interface for softcover.io} gem.summary = %q{An ebook production system & sales and marketing platform for technical authors} - gem.homepage = "http://manual.softcover.io/book" + gem.homepage = "https://manual.softcover.io/book" + gem.source = "https://github.com/softcover/softcover" gem.license = "MIT" gem.files = `git ls-files`.split($/) From e0bcbeaf771ea7155ed9617f999958ded87ff276 Mon Sep 17 00:00:00 2001 From: Michael Hartl Date: Fri, 5 Mar 2021 15:55:27 -0800 Subject: [PATCH 11/21] Upgrade to Pygments 2/Python 3 --- Gemfile.lock | 66 +++++++++---------- .../html/stylesheets/softcover.css | 6 ++ .../html/stylesheets/softcover.css | 6 ++ lib/softcover/commands/check.rb | 6 +- lib/softcover/utils.rb | 9 +-- lib/softcover/version.rb | 2 +- softcover.gemspec | 7 +- spec/builders/pdf_spec.rb | 2 +- 8 files changed, 56 insertions(+), 48 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 8c3d563ad..337519c67 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - softcover (1.7.1) + softcover (1.7.2) activesupport (~> 4.2.3) async_sinatra (~> 1.1.0) coffee-script (>= 2.2.0) @@ -12,8 +12,8 @@ PATH maruku (~> 0.7.1) msgpack (~> 1.2.0) nokogiri (>= 1.6.0, < 2.0) - polytexnic (~> 1.6.0) - pygments.rb (~> 1.2.1) + polytexnic (~> 1.6) + pygments.rb (~> 2.1) rest-client (>= 1.8.0) ruby-progressbar (~> 1.10) sanitize (>= 4.6.3, < 5.3.0) @@ -40,32 +40,32 @@ GEM coffee-script-source execjs coffee-script-source (1.12.2) - concurrent-ruby (1.1.7) + concurrent-ruby (1.1.8) 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) + curb (0.9.11) daemons (1.3.1) - diff-lcs (1.3) - docile (1.3.2) + diff-lcs (1.4.4) + docile (1.3.5) domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) eventmachine (1.2.7) execjs (2.7.0) - ffi (1.13.1) + ffi (1.14.2) hashdiff (1.0.1) http-accept (1.7.0) http-cookie (1.0.3) domain_name (~> 0.5) i18n (0.9.5) concurrent-ruby (~> 1.0) - json (2.3.0) + json (2.3.1) kramdown (2.3.0) rexml listen (3.2.1) @@ -75,34 +75,34 @@ GEM method_source (1.0.0) mime-types (3.3.1) mime-types-data (~> 3.2015) - mime-types-data (3.2020.0512) - mini_portile2 (2.4.0) - minitest (5.14.2) + mime-types-data (3.2021.0225) + mini_portile2 (2.5.0) + minitest (5.14.4) msgpack (1.2.10) - multi_json (1.15.0) netrc (0.11.0) - nokogiri (1.10.10) - mini_portile2 (~> 2.4.0) - nokogumbo (2.0.2) + nokogiri (1.11.1) + mini_portile2 (~> 2.5.0) + racc (~> 1.4) + nokogumbo (2.0.4) nokogiri (~> 1.8, >= 1.8.4) - polytexnic (1.6.0) + polytexnic (1.6.2) json (~> 2.3.0) kramdown (>= 1.17, < 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.0) coderay (~> 1.1) method_source (~> 1.0) - public_suffix (4.0.5) - pygments.rb (1.2.1) - multi_json (>= 1.0.0) + public_suffix (4.0.6) + pygments.rb (2.1.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) + rake (13.0.3) rb-fsevent (0.10.4) rb-inotify (0.10.1) ffi (~> 1.0) @@ -120,10 +120,10 @@ GEM rspec-expectations (2.14.5) diff-lcs (>= 1.1.3, < 2.0) rspec-mocks (2.14.6) - ruby-prof (1.4.1) - ruby-progressbar (1.10.1) + ruby-prof (1.4.3) + ruby-progressbar (1.11.0) safe_yaml (1.0.4) - sanitize (5.2.1) + sanitize (5.2.3) crass (~> 1.0.2) nokogiri (>= 1.8.0) nokogumbo (~> 2.0) @@ -145,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.25.0) + tins (1.28.0) 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.12.0) addressable (>= 2.3.6) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) diff --git a/lib/softcover/article_template/html/stylesheets/softcover.css b/lib/softcover/article_template/html/stylesheets/softcover.css index 2c99ed09b..57802499e 100644 --- a/lib/softcover/article_template/html/stylesheets/softcover.css +++ b/lib/softcover/article_template/html/stylesheets/softcover.css @@ -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; diff --git a/lib/softcover/book_template/html/stylesheets/softcover.css b/lib/softcover/book_template/html/stylesheets/softcover.css index 2c99ed09b..57802499e 100644 --- a/lib/softcover/book_template/html/stylesheets/softcover.css +++ b/lib/softcover/book_template/html/stylesheets/softcover.css @@ -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; diff --git a/lib/softcover/commands/check.rb b/lib/softcover/commands/check.rb index e4e804409..8d3ae1fe0 100644 --- a/lib/softcover/commands/check.rb +++ b/lib/softcover/commands/check.rb @@ -43,7 +43,7 @@ def dependencies [:java, 'Java'], [:zip, 'zip'], [:epubcheck, 'EpubCheck'], - [:python2, 'Python 2'] + [:python3, 'Python 3'] ] end @@ -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 diff --git a/lib/softcover/utils.rb b/lib/softcover/utils.rb index 8e2982cab..797c0f159 100644 --- a/lib/softcover/utils.rb +++ b/lib/softcover/utils.rb @@ -274,12 +274,9 @@ def dependency_filename(label) else "" end - when :python2 - python = get_filename(:python2) - # Python 2 stupidly outputs the version number to STDERR instead of STDOUT. - require 'open3' - stdout, stderr, status = Open3.capture3("#{python} --version") - stderr.match(/Python 2/) ? python : "" + when :python3 + python = get_filename(:python3) + `#{python} --version`.match(/Python 3\.*/) ? python : "" else get_filename(label) end diff --git a/lib/softcover/version.rb b/lib/softcover/version.rb index 2659e73c0..8bc80ef45 100644 --- a/lib/softcover/version.rb +++ b/lib/softcover/version.rb @@ -1,3 +1,3 @@ module Softcover - VERSION = "1.7.1" + VERSION = "1.7.2" end diff --git a/softcover.gemspec b/softcover.gemspec index 2a471b29d..85efa486d 100644 --- a/softcover.gemspec +++ b/softcover.gemspec @@ -10,8 +10,7 @@ Gem::Specification.new do |gem| gem.email = ["michael@softcover.io"] gem.description = %q{Command-line interface for softcover.io} gem.summary = %q{An ebook production system & sales and marketing platform for technical authors} - gem.homepage = "https://manual.softcover.io/book" - gem.source = "https://github.com/softcover/softcover" + gem.homepage = "https://github.com/softcover/softcover" gem.license = "MIT" gem.files = `git ls-files`.split($/) @@ -19,7 +18,7 @@ Gem::Specification.new do |gem| gem.test_files = gem.files.grep(%r{^(test|spec|features)/}) gem.require_paths = ["lib"] - gem.add_dependency 'polytexnic', '~> 1.6.0' + gem.add_dependency 'polytexnic', '~> 1.6' gem.add_dependency 'msgpack', '~> 1.2.0' gem.add_dependency 'nokogiri', '>= 1.6.0', '< 2.0' gem.add_dependency 'thor', '>= 0.18.1', '< 2.0' @@ -29,7 +28,7 @@ Gem::Specification.new do |gem| gem.add_dependency 'curb', '>= 0.9.7' gem.add_dependency 'ruby-progressbar', '~> 1.10' gem.add_dependency 'maruku', '~> 0.7.1' - gem.add_dependency 'pygments.rb', '~> 1.2.1' + gem.add_dependency 'pygments.rb', '~> 2.1' gem.add_dependency 'kramdown', '>= 1.6.0' gem.add_dependency 'sinatra', '~> 1.4.4' diff --git a/spec/builders/pdf_spec.rb b/spec/builders/pdf_spec.rb index 96381d381..2aa5d3271 100644 --- a/spec/builders/pdf_spec.rb +++ b/spec/builders/pdf_spec.rb @@ -73,7 +73,7 @@ context "after removing Book.txt" do before { FileUtils.rm Softcover::BookManifest::TXT_PATH } - it "should still build the book" do + it "should still build the book (run ulimit -n 1024 if this fails)" do expect(Softcover::BookManifest::TXT_PATH).not_to exist expect { @builder.build! }.not_to raise_error end From f1cd985c0d67168fac17e0813bc7fb490e0c157e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Mar 2021 04:34:10 +0000 Subject: [PATCH 12/21] Bump kramdown from 2.3.0 to 2.3.1 Bumps [kramdown](https://github.com/gettalong/kramdown) from 2.3.0 to 2.3.1. - [Release notes](https://github.com/gettalong/kramdown/releases) - [Changelog](https://github.com/gettalong/kramdown/blob/master/doc/news.page) - [Commits](https://github.com/gettalong/kramdown/commits) Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 337519c67..b8ee30488 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -66,7 +66,7 @@ GEM i18n (0.9.5) concurrent-ruby (~> 1.0) json (2.3.1) - kramdown (2.3.0) + kramdown (2.3.1) rexml listen (3.2.1) rb-fsevent (~> 0.10, >= 0.10.3) From a4060d3030fe89c3134b5748174e50df5bad3f52 Mon Sep 17 00:00:00 2001 From: Michael Hartl Date: Tue, 30 Mar 2021 11:09:11 -0700 Subject: [PATCH 13/21] Update lock --- Gemfile.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index b8ee30488..2b1f28e97 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -58,7 +58,7 @@ GEM unf (>= 0.0.5, < 1.0.0) eventmachine (1.2.7) execjs (2.7.0) - ffi (1.14.2) + ffi (1.15.0) hashdiff (1.0.1) http-accept (1.7.0) http-cookie (1.0.3) @@ -80,12 +80,12 @@ GEM minitest (5.14.4) msgpack (1.2.10) netrc (0.11.0) - nokogiri (1.11.1) + nokogiri (1.11.2) mini_portile2 (~> 2.5.0) racc (~> 1.4) - nokogumbo (2.0.4) + nokogumbo (2.0.5) nokogiri (~> 1.8, >= 1.8.4) - polytexnic (1.6.2) + polytexnic (1.6.3) json (~> 2.3.0) kramdown (>= 1.17, < 3.0) msgpack (~> 1.2.0) @@ -95,7 +95,7 @@ GEM coderay (~> 1.1) method_source (~> 1.0) public_suffix (4.0.6) - pygments.rb (2.1.0) + pygments.rb (2.2.0) racc (1.5.2) rack (1.6.13) rack-protection (1.5.5) @@ -155,7 +155,7 @@ GEM unf (0.1.4) unf_ext unf_ext (0.0.7.7) - webmock (3.12.0) + webmock (3.12.2) addressable (>= 2.3.6) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) From a54a3718c87f04d5f62baf7c2826e777f87e2daf Mon Sep 17 00:00:00 2001 From: Michael Hartl Date: Mon, 17 May 2021 11:07:36 -0700 Subject: [PATCH 14/21] Ignore generated files xhtml files in Markown books --- lib/softcover/book_template/markdown_gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/softcover/book_template/markdown_gitignore b/lib/softcover/book_template/markdown_gitignore index bd083a0c6..380eacb4b 100644 --- a/lib/softcover/book_template/markdown_gitignore +++ b/lib/softcover/book_template/markdown_gitignore @@ -17,6 +17,7 @@ html/*.xhtml # Generated EPUB files epub/OEBPS/*.html +epub/OEBPS/*.xhtml epub/OEBPS/*.opf epub/OEBPS/*.ncx epub/OEBPS/images From 06134f4764b3f9e328c2a205880a5e641c253729 Mon Sep 17 00:00:00 2001 From: Michael Hartl Date: Mon, 17 May 2021 11:07:57 -0700 Subject: [PATCH 15/21] Bump version number --- lib/softcover/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/softcover/version.rb b/lib/softcover/version.rb index 8bc80ef45..caea41011 100644 --- a/lib/softcover/version.rb +++ b/lib/softcover/version.rb @@ -1,3 +1,3 @@ module Softcover - VERSION = "1.7.2" + VERSION = "1.7.3" end From 3f7b311fc8421eba035637b951d4dfcd934a9c37 Mon Sep 17 00:00:00 2001 From: Michael Hartl Date: Mon, 17 May 2021 11:10:08 -0700 Subject: [PATCH 16/21] Update lock --- Gemfile.lock | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 2b1f28e97..71b8d3f73 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -51,13 +51,13 @@ GEM rexml crass (1.0.6) curb (0.9.11) - daemons (1.3.1) + daemons (1.4.0) diff-lcs (1.4.4) - docile (1.3.5) + docile (1.4.0) domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) eventmachine (1.2.7) - execjs (2.7.0) + execjs (2.8.1) ffi (1.15.0) hashdiff (1.0.1) http-accept (1.7.0) @@ -76,22 +76,22 @@ GEM mime-types (3.3.1) mime-types-data (~> 3.2015) mime-types-data (3.2021.0225) - mini_portile2 (2.5.0) + mini_portile2 (2.5.1) minitest (5.14.4) msgpack (1.2.10) netrc (0.11.0) - nokogiri (1.11.2) + nokogiri (1.11.4) mini_portile2 (~> 2.5.0) racc (~> 1.4) nokogumbo (2.0.5) nokogiri (~> 1.8, >= 1.8.4) - polytexnic (1.6.3) + polytexnic (1.6.4) json (~> 2.3.0) - kramdown (>= 1.17, < 3.0) + kramdown (>= 2.0, < 3.0) msgpack (~> 1.2.0) nokogiri (>= 1.6.0, < 2.0) pygments.rb (~> 2.1) - pry (0.14.0) + pry (0.14.1) coderay (~> 1.1) method_source (~> 1.0) public_suffix (4.0.6) @@ -103,7 +103,7 @@ GEM rack-test (1.1.0) rack (>= 1.0, < 3) rake (13.0.3) - rb-fsevent (0.10.4) + rb-fsevent (0.11.0) rb-inotify (0.10.1) ffi (~> 1.0) rest-client (2.1.0) @@ -111,7 +111,7 @@ GEM http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 4.0) netrc (~> 0.8) - rexml (3.2.4) + rexml (3.2.5) rspec (2.14.1) rspec-core (~> 2.14.0) rspec-expectations (~> 2.14.0) @@ -148,14 +148,14 @@ GEM thor (1.1.0) thread_safe (0.3.6) tilt (2.0.10) - tins (1.28.0) + tins (1.29.0) sync tzinfo (1.2.9) thread_safe (~> 0.1) unf (0.1.4) unf_ext unf_ext (0.0.7.7) - webmock (3.12.2) + webmock (3.13.0) addressable (>= 2.3.6) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) From e6dde3fac681e300cc9ddfda228b643c69169146 Mon Sep 17 00:00:00 2001 From: Michael Hartl Date: Mon, 17 May 2021 11:11:37 -0700 Subject: [PATCH 17/21] Update softcover gem --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 71b8d3f73..6a172aa08 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - softcover (1.7.2) + softcover (1.7.3) activesupport (~> 4.2.3) async_sinatra (~> 1.1.0) coffee-script (>= 2.2.0) From 7a803510c7960caa663aa31d2ec85b6a633919c0 Mon Sep 17 00:00:00 2001 From: Michael Hartl Date: Fri, 11 Jun 2021 11:01:04 -0700 Subject: [PATCH 18/21] Update generated READMEs --- lib/softcover/article_template/README.md | 6 +++--- lib/softcover/book_template/README.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/softcover/article_template/README.md b/lib/softcover/article_template/README.md index 8bd31178a..56964d373 100644 --- a/lib/softcover/article_template/README.md +++ b/lib/softcover/article_template/README.md @@ -1,10 +1,10 @@ # Document README (please edit) -This is the README generated by `softcover new `. 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 `. 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. \ No newline at end of file +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. diff --git a/lib/softcover/book_template/README.md b/lib/softcover/book_template/README.md index 8bd31178a..56964d373 100644 --- a/lib/softcover/book_template/README.md +++ b/lib/softcover/book_template/README.md @@ -1,10 +1,10 @@ # Document README (please edit) -This is the README generated by `softcover new `. 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 `. 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. \ No newline at end of file +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. From e07b7f64e294e5af9d134fe3bd37ddae6ca46efa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Jul 2021 07:32:34 +0000 Subject: [PATCH 19/21] Bump addressable from 2.7.0 to 2.8.0 Bumps [addressable](https://github.com/sporkmonger/addressable) from 2.7.0 to 2.8.0. - [Release notes](https://github.com/sporkmonger/addressable/releases) - [Changelog](https://github.com/sporkmonger/addressable/blob/main/CHANGELOG.md) - [Commits](https://github.com/sporkmonger/addressable/compare/addressable-2.7.0...addressable-2.8.0) --- updated-dependencies: - dependency-name: addressable dependency-type: indirect ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 6a172aa08..37e821b83 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -30,7 +30,7 @@ GEM 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) From c1c5456a20ecc256fbe459ae21a8ae4e08b11cde Mon Sep 17 00:00:00 2001 From: Michael Hartl Date: Tue, 13 Jul 2021 11:20:03 -0700 Subject: [PATCH 20/21] Update gems --- Gemfile.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 37e821b83..e4c29fed0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -40,7 +40,7 @@ GEM coffee-script-source execjs coffee-script-source (1.12.2) - concurrent-ruby (1.1.8) + concurrent-ruby (1.1.9) coveralls (0.8.23) json (>= 1.8, < 3) simplecov (~> 0.16.1) @@ -58,10 +58,10 @@ GEM unf (>= 0.0.5, < 1.0.0) eventmachine (1.2.7) execjs (2.8.1) - ffi (1.15.0) + 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) @@ -75,12 +75,12 @@ GEM method_source (1.0.0) mime-types (3.3.1) mime-types-data (~> 3.2015) - mime-types-data (3.2021.0225) - mini_portile2 (2.5.1) + mime-types-data (3.2021.0704) + mini_portile2 (2.5.3) minitest (5.14.4) msgpack (1.2.10) netrc (0.11.0) - nokogiri (1.11.4) + nokogiri (1.11.7) mini_portile2 (~> 2.5.0) racc (~> 1.4) nokogumbo (2.0.5) @@ -102,7 +102,7 @@ GEM rack rack-test (1.1.0) rack (>= 1.0, < 3) - rake (13.0.3) + rake (13.0.6) rb-fsevent (0.11.0) rb-inotify (0.10.1) ffi (~> 1.0) @@ -148,7 +148,7 @@ GEM thor (1.1.0) thread_safe (0.3.6) tilt (2.0.10) - tins (1.29.0) + tins (1.29.1) sync tzinfo (1.2.9) thread_safe (~> 0.1) From 447efcd6fd5dcaa07fb12cbf2e5acce5db0f1445 Mon Sep 17 00:00:00 2001 From: Michael Hartl Date: Tue, 3 Aug 2021 20:36:30 -0700 Subject: [PATCH 21/21] Shorten PDF help --- lib/softcover/cli.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/softcover/cli.rb b/lib/softcover/cli.rb index 9cee3ed90..c9cc78357 100644 --- a/lib/softcover/cli.rb +++ b/lib/softcover/cli.rb @@ -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',