Skip to content

Commit

Permalink
(gh-181) Initial kindlepreviewer package updates
Browse files Browse the repository at this point in the history
Initial updates of the Kindle Previewer package to bring the package
inline with repository standards and implement an AU automatic updater.
  • Loading branch information
dgalbraith committed Jan 21, 2021
1 parent 66b2c42 commit c6e4436
Show file tree
Hide file tree
Showing 5 changed files with 147 additions and 45 deletions.
37 changes: 37 additions & 0 deletions automatic/kindlepreviewer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# [<img src="https://cdn.jsdelivr.net/gh/dgalbraith/chocolatey-packages@53619ae4c9b43750b7f5801f620a5c94155a641d/icons/kindlepreviewer.png" width="48" height="48" />Kindle Previewer](https://chocolatey.org/packages/kindlepreviewer)

[![Software license](https://img.shields.io/badge/license-Proprietary-lightgrey)](https://www.amazon.com/gp/feature.html?docId=1000599251)
[![Maintenance status](https://img.shields.io/badge/maintained%3F-yes-green.svg)](https://gitHub.com/dgalbraith/chocolatey-packages/graphs/commit-activity)
[![AppVeyor build](https://img.shields.io/appveyor/ci/dgalbraith/chocolatey-packages)](https://ci.appveyor.com/project/dgalbraith/chocolatey-packages)
[![Software version](https://img.shields.io/badge/source-v3.50-blue.svg)](https://www.amazon.com/gp/feature.html?docId=1000765261)
[![Chocolatey package version](https://img.shields.io/chocolatey/v/kindlepreviewer?label=Chocolatey)](https://chocolatey.org/packages/kindlepreviewer)

Kindle Previewer is a graphical user interface tool that emulates how books display across Kindle devices and apps. Kindle Previewer makes it easy for publishers to preview the layout of a book and make sure its text displays properly for any orientation or font size to ensure publishers produce and submit the highest quality Kindle books.

As a best practice we recommend you use the Kindle Previewer to review how their books look across all Kindle devices and apps.

* Preview and validate books faster with Kindle Previewer
* Preview key aspects of your book such as images, tables, drop caps and links
* Preview how your book will look on different screen sizes, font sizes and orientations

## Features

• Get a bird’s-eye view of your Enhanced Typesetting enabled book to validate the overall layout faster.
• Easy navigation options to review images, lists, tables and dropcaps without having to go through the entire book.
• Ability to run Kindle Previewer from the command-line interface to validate multiple books.
• Regular updates with access to latest Kindle layout and typographic features that come with Enhanced Typesetting.
• Reflects the layout of the book as delivered to Kindle customers with the latest Enhanced Typesetting features.
• Simplified installer for Mac and Windows that does not require you to manually download additional software.
• Full-page previews without having to scroll.
• Ability to change the fonts during preview.
• Separate navigation pane for quicker page navigation.
• Faster text search, page navigation, and book re-open.

![screenshot](https://cdn.jsdelivr.net/gh/dgalbraith/chocolatey-packages@66b2c423b4784a1ae6e7da1796f066755885fbae/automatic/kindlepreviewer/screenshot.png)

## Notes

* The installer is provided using a fixed name (```KindlePreviewInstaller.exe```) so older versions of this package will fail the hash check
* The application is only available in a 64-bit version - there is no 32-bit support
* This package is automatically updated using the [Chocolatey Automatic Package Update Model (AU)](https://github.com/majkinetor/au/blob/master/README.md).
If you find it is out of date by more than a day or two, please contact the maintainer(s) and let them know the package is no longer updating correctly.
91 changes: 58 additions & 33 deletions automatic/kindlepreviewer/kindlepreviewer.nuspec
Original file line number Diff line number Diff line change
@@ -1,33 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<metadata>
<id>kindlepreviewer</id>
<title>Kindle Previewer</title>
<version>3.30</version>
<authors>Amazon</authors>
<owners>Anthony Mastrean</owners>
<summary>Kindle Previewer is a graphical user interface tool that emulates how books display across Kindle devices and apps.</summary>
<description>
Kindle Previewer is a graphical user interface tool that emulates how books display across Kindle devices and apps. Kindle Previewer makes it easy for publishers to preview the layout of a book and make sure its text displays properly for any orientation or font size to ensure publishers produce and submit the highest quality Kindle books.

As a best practice we recommend you use the Kindle Previewer to review how their books look across all Kindle devices and apps.

Highlights of Kindle Previewer functionality

* Ability to preview your content across Kindle devices and apps
* Support for previewing Kindle Text Pop Ups and Kindle Panel Views
* Accurate rendering of your content across Kindle devices and apps
* Faster previewing through features like Auto flip mode, Image flip mode
* Auto updates for future enhancements
</description>
<projectUrl>http://www.amazon.com/gp/feature.html?ie=UTF8&amp;docId=1000765261</projectUrl>
<licenseUrl>http://www.amazon.com/gp/feature.html?docId=1000599251</licenseUrl>
<packageSourceUrl>https://github.com/AnthonyMastrean/chocolateypackages/</packageSourceUrl>
<mailingListUrl>https://www.amazon.com/gp/help/customer/forums/kindleqna/ref=hp_ss_qs_v3_dv_kh</mailingListUrl>
<bugTrackerUrl>https://www.amazon.com/gp/help/customer/contact-us?ie=UTF8&amp;ref_=hp_ss_qs_v3_dv_cu_t2</bugTrackerUrl>
<docsUrl>http://kindlepreviewer.s3.amazonaws.com/UserGuide.pdf</docsUrl>
<tags>amazon kindle preview notsilent notunattended admin</tags>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<iconUrl>https://cdn.rawgit.com/AnthonyMastrean/chocolateypackages/e1562a92b25e6a2bac1485e550f1237e21780258/public/icons/kindlepreviewer.png</iconUrl>
</metadata>
</package>
<?xml version="1.0" encoding="utf-8"?>
<!-- Do not remove this test for UTF-8: if “Ω” doesn’t appear as greek uppercase omega letter enclosed in quotation marks, you should use an editor that supports UTF-8, not this one. -->
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>kindlepreviewer</id>
<version>3.50</version>
<packageSourceUrl>https://github.com/dgalbraith/chocolatey-packages/tree/master/automatic/kindlepreviewer</packageSourceUrl>
<owners>dgalbraith</owners>
<title>Kindle Previewer</title>
<authors>Amazon</authors>
<projectUrl>http://www.amazon.com/gp/feature.html?docId=1000765261</projectUrl>
<iconUrl>https://cdn.jsdelivr.net/gh/dgalbraith/chocolatey-packages@53619ae4c9b43750b7f5801f620a5c94155a641d/icons/kindlepreviewer.png</iconUrl>
<copyright>Copyright Amazon.com 2020</copyright>
<licenseUrl>https://www.amazon.com/gp/feature.html?docId=1000599251</licenseUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<docsUrl>http://kindlepreviewer3.s3.amazonaws.com/UserGuide320_EN.pdf</docsUrl>
<mailingListUrl>https://www.amazonforum.com/s/global-search/previewer</mailingListUrl>
<tags>kindlepreview kindlepreviewer kindle amazon</tags>
<summary>A graphical user interface tool that emulates how books display across Kindle devices and apps</summary>
<description><![CDATA[
Kindle Previewer is a graphical user interface tool that emulates how books display across Kindle devices and apps. Kindle Previewer makes it easy for publishers to preview the layout of a book and make sure its text displays properly for any orientation or font size to ensure publishers produce and submit the highest quality Kindle books.
As a best practice we recommend you use the Kindle Previewer to review how their books look across all Kindle devices and apps.
* Preview and validate books faster with Kindle Previewer
* Preview key aspects of your book such as images, tables, drop caps and links
* Preview how your book will look on different screen sizes, font sizes and orientations
## Features
• Get a bird’s-eye view of your Enhanced Typesetting enabled book to validate the overall layout faster.
• Easy navigation options to review images, lists, tables and dropcaps without having to go through the entire book.
• Ability to run Kindle Previewer from the command-line interface to validate multiple books.
• Regular updates with access to latest Kindle layout and typographic features that come with Enhanced Typesetting.
• Reflects the layout of the book as delivered to Kindle customers with the latest Enhanced Typesetting features.
• Simplified installer for Mac and Windows that does not require you to manually download additional software.
• Full-page previews without having to scroll.
• Ability to change the fonts during preview.
• Separate navigation pane for quicker page navigation.
• Faster text search, page navigation, and book re-open.
![screenshot](https://cdn.jsdelivr.net/gh/dgalbraith/chocolatey-packages@66b2c423b4784a1ae6e7da1796f066755885fbae/automatic/kindlepreviewer/screenshot.png)
## Notes
* The installer is provided using a fixed name (```KindlePreviewInstaller.exe```) so older versions of this package will fail the hash check
* The application is only available in a 64-bit version - there is no 32-bit support
* This package is automatically updated using the [Chocolatey Automatic Package Update Model (AU)](https://github.com/majkinetor/au/blob/master/README.md).
If you find it is out of date by more than a day or two, please contact the maintainer(s) and let them know the package is no longer updating correctly.
]]></description>
<releaseNotes>https://s3.amazonaws.com/kindlepreviewer/UG_ReleaseNotes_EN.txt</releaseNotes>
</metadata>
<files>
<file src="tools\**" target="tools" />
</files>
</package>
20 changes: 13 additions & 7 deletions automatic/kindlepreviewer/tools/chocolateyInstall.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
Install-ChocolateyPackage `
-PackageName 'kindlepreviewer' `
-Url 'https://s3.amazonaws.com/kindlepreviewer3/KindlePreviewerInstaller.exe' `
-Checksum 'E9C4654C52314F72C1CAB0A60871480BF40931B333B84C0D2A33FF544AF12AF4' `
-ChecksumType 'SHA256' `
-FileType 'EXE' `
-SilentArgs '/S'
$ErrorActionPreference = 'Stop';

$packageArgs = @{
packageName = $env:ChocolateyPackageName
fileType = 'exe'
url = 'https://s3.amazonaws.com/kindlepreviewer3/KindlePreviewerInstaller.exe'
checksum = '8474d50d7ae57f2e7274f6c9aae236eeeb9950c4b66291c949fcd1411ba86838'
checksumType = 'sha256'
silentArgs = '/S'
validExitCodes= @(0)
}

Install-ChocolateyPackage @packageArgs
5 changes: 0 additions & 5 deletions automatic/kindlepreviewer/tools/chocolateyUninstall.ps1

This file was deleted.

39 changes: 39 additions & 0 deletions automatic/kindlepreviewer/update.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import-module au

$ErrorActionPreference = 'STOP'

$releases = 'https://www.amazon.com/gp/feature.html?docId=1000765261'

$re64 = '(?<Url>(https://s.+exe))'
$reVersion = '(>K|-v).*?(?<Version>(\d\.\d+))'

function global:au_SearchReplace {
@{
".\README.md" = @{
"$($reVersion)" = "`${1}$($Latest.Version)"
}

".\tools\chocolateyinstall.ps1" = @{
"(url\s*=\s*)('.*')" = "`$1'$($Latest.Url64)'"
"(checksum\s*=\s*)('.*')" = "`$1'$(Get-RemoteChecksum $Latest.Url64)'"
}
}
}

function global:au_GetLatest {
$downloadPage = Invoke-WebRequest -UseBasicParsing -Uri $releases -MaximumRedirection 0 -ErrorAction SilentlyContinue

$downloadPage.Content -match $re64
$url64 = $Matches.Url

$downloadPage.Content -match $reVersion
$version = $Matches.Version

return @{
URL64 = $url64
ChecksumType64 = 'sha256'
Version = $version
}
}

update -ChecksumFor none -NoReadme

0 comments on commit c6e4436

Please sign in to comment.