From eed33559169ec4331c88ba16dd67fbfa2db8ab4d Mon Sep 17 00:00:00 2001 From: Alex Cabal Date: Wed, 9 Sep 2020 22:22:00 -0500 Subject: [PATCH] Rename .epub3 output to _advanced.epub --- config/apache/standardebooks.org.conf | 3 +-- config/apache/standardebooks.test.conf | 3 +-- lib/Ebook.php | 18 +++++++++--------- templates/OpdsAcquisitionEntry.php | 2 +- .../producing-an-ebook-step-by-step.php | 4 ++-- www/ebooks/ebook.php | 6 +++--- www/help/how-to-use-our-ebooks.php | 2 +- 7 files changed, 18 insertions(+), 20 deletions(-) diff --git a/config/apache/standardebooks.org.conf b/config/apache/standardebooks.org.conf index 794691f0..61aa8120 100644 --- a/config/apache/standardebooks.org.conf +++ b/config/apache/standardebooks.org.conf @@ -71,7 +71,6 @@ Define domain standardebooks.org # Log downloads SetEnvIf Request_URI "\.epub$" logdownload SetEnvIf Request_URI "\.kepub.epub$" logdownload - SetEnvIf Request_URI "\.epub3$" logdownload SetEnvIf Request_URI "\.azw3$" logdownload CustomLog /var/log/local/downloads.log "%h [%{%Y-%m-%d %H:%M:%S %Z}t] \"%r\" %>s %b" env=logdownload DirectorySlash Off @@ -90,7 +89,7 @@ Define domain standardebooks.org CGIPassAuth on - AddType application/epub+zip .epub .epub3 + AddType application/epub+zip .epub AddType application/x-mobi8-ebook .azw3 diff --git a/config/apache/standardebooks.test.conf b/config/apache/standardebooks.test.conf index 12b5dc5c..7addc3ba 100644 --- a/config/apache/standardebooks.test.conf +++ b/config/apache/standardebooks.test.conf @@ -70,7 +70,6 @@ Define domain standardebooks.test # Log downloads SetEnvIf Request_URI "\.epub$" logdownload SetEnvIf Request_URI "\.kepub.epub$" logdownload - SetEnvIf Request_URI "\.epub3$" logdownload SetEnvIf Request_URI "\.azw3$" logdownload CustomLog /var/log/local/downloads.log "%h [%{%Y-%m-%d %H:%M:%S %Z}t] \"%r\" %>s %b" env=logdownload DirectorySlash Off @@ -89,7 +88,7 @@ Define domain standardebooks.test CGIPassAuth on - AddType application/epub+zip .epub .epub3 + AddType application/epub+zip .epub AddType application/x-mobi8-ebook .azw3 diff --git a/lib/Ebook.php b/lib/Ebook.php index 55ad8550..79bb3d4a 100644 --- a/lib/Ebook.php +++ b/lib/Ebook.php @@ -13,7 +13,7 @@ class Ebook{ public $Url; public $KindleCoverUrl; public $EpubUrl; - public $Epub3Url; + public $AdvancedEpubUrl; public $KepubUrl; public $Azw3Url; public $HasDownloads; @@ -97,16 +97,16 @@ class Ebook{ $this->KindleCoverUrl = $this->Url . '/dist/' . basename($tempPath[0]); } - // Generate the epub URL. + // Generate the compatible epub URL. $tempPath = glob($this->WwwFilesystemPath . '/dist/*.epub'); if(sizeof($tempPath) > 0){ $this->EpubUrl = $this->Url . '/dist/' . basename($tempPath[0]); } - // Generate the epub3 URL - $tempPath = glob($this->WwwFilesystemPath . '/dist/*.epub3'); + // Generate the epub URL + $tempPath = glob($this->WwwFilesystemPath . '/dist/*_advanced.epub'); if(sizeof($tempPath) > 0){ - $this->Epub3Url = $this->Url . '/dist/' . basename($tempPath[0]); + $this->AdvancedEpubUrl = $this->Url . '/dist/' . basename($tempPath[0]); } // Generate the Kepub URL @@ -121,7 +121,7 @@ class Ebook{ $this->Azw3Url = $this->Url . '/dist/' . basename($tempPath[0]); } - $this->HasDownloads = $this->EpubUrl || $this->Epub3Url || $this->KepubUrl || $this->Azw3Url; + $this->HasDownloads = $this->EpubUrl || $this->AdvancedEpubUrl || $this->KepubUrl || $this->Azw3Url; $tempPath = glob($this->WwwFilesystemPath . '/dist/cover.jpg'); if(sizeof($tempPath) > 0){ @@ -489,11 +489,11 @@ class Ebook{ $output->encoding[] = $encodingObject; } - if($this->Epub3Url){ + if($this->AdvancedEpubUrl){ $encodingObject = new stdClass(); $encodingObject->{'@type'} = 'MediaObject'; - $encodingObject->encodingFormat = 'epub3'; - $encodingObject->contentUrl = SITE_URL . $this->Epub3Url; + $encodingObject->encodingFormat = 'epub'; + $encodingObject->contentUrl = SITE_URL . $this->AdvancedEpubUrl; $output->encoding[] = $encodingObject; } diff --git a/templates/OpdsAcquisitionEntry.php b/templates/OpdsAcquisitionEntry.php index 64d7989f..fd0fe0aa 100644 --- a/templates/OpdsAcquisitionEntry.php +++ b/templates/OpdsAcquisitionEntry.php @@ -26,7 +26,7 @@ - + diff --git a/www/contribute/producing-an-ebook-step-by-step.php b/www/contribute/producing-an-ebook-step-by-step.php index 2a5bbfb1..6b3a5479 100644 --- a/www/contribute/producing-an-ebook-step-by-step.php +++ b/www/contribute/producing-an-ebook-step-by-step.php @@ -402,10 +402,10 @@ proceed to seal up my confession, I bring the life of that unhappy Henry Jekyll

If there are no errors, we’ll see five files in the brand-new ~/dist/ folder in our home directory:

  • -

    the-strange-case-of-dr-jekyll-and-mr-hyde.epub3 is a pure epub3 file—basically just a zipped up version of our source. Unfortunately most ebook readers don’t fully support all of epub3’s capabilities yet, so we’re more interested in…

    +

    the-strange-case-of-dr-jekyll-and-mr-hyde_advanced.epub is the zipped up version of our source. Unfortunately most ebook readers don’t fully support all of epub3’s capabilities yet, or the advanced CSS selectors and XHTML structure we use, so we’re more interested in…

  • -

    the-strange-case-of-dr-jekyll-and-mr-hyde.epub, the epub2 version of our ebook. If you don’t have a Kindle, this is the file you’ll be using to proofread.

    +

    the-strange-case-of-dr-jekyll-and-mr-hyde.epub, the compatible epub version of our ebook. This file is the raw source, plus various compatiblity fixes applied during our build process. If you don’t have a Kindle, this is the file you’ll be using to proofread.

  • the-strange-case-of-dr-jekyll-and-mr-hyde.kepub.epub is the Kobo version of our ebook. You can copy this to a Kobo using a USB cable.

    diff --git a/www/ebooks/ebook.php b/www/ebooks/ebook.php index 046410d0..eaf8cddd 100644 --- a/www/ebooks/ebook.php +++ b/www/ebooks/ebook.php @@ -116,7 +116,7 @@ catch(\Exception $ex){
      EpubUrl !== null){ ?> -
    • epub All devices and apps except Amazon Kindle and Kobo.

      +
    • Compatible epub All devices and apps except Amazon Kindle and Kobo.

    • @@ -130,8 +130,8 @@ catch(\Exception $ex){ - Epub3Url !== null){ ?> -
    • epub3 Advanced format not yet fully compatible with most ereaders.

      + AdvancedEpubUrl !== null){ ?> +
    • Advanced epub An advanced format not yet fully compatible with most ereaders.

    diff --git a/www/help/how-to-use-our-ebooks.php b/www/help/how-to-use-our-ebooks.php index 047018cb..10e7c7b9 100644 --- a/www/help/how-to-use-our-ebooks.php +++ b/www/help/how-to-use-our-ebooks.php @@ -18,7 +18,7 @@ require_once('Core.php');

    All other ereaders: download the epub file. This epub2-compatible file will work in all ereaders except Kindles. While this file will also work on Kobo, it’ll look pretty bad; please download our special kepub file for Kobo devices and software.

  • -

    For advanced ereaders like Readium, and for readers who like bleeding-edge technology: download the pure epub3 file. Pure epub3 isn’t compatible with most ereaders yet, so only download this file if you know what you’re doing.

    +

    For advanced ereaders like Readium, and for readers who like bleeding-edge technology: download the advanced epub file. The advanced epub file isn’t compatible with most ereaders yet, so only download this file if you know what you’re doing.