First install color-convert
npm install color-convertCreate a javaScript file (different require syntax for CommonJs: https://reflectoring.io/nodejs-modules-imports/ , this is Common JS)
First install color-convert
npm install color-convertCreate a javaScript file (different require syntax for CommonJs: https://reflectoring.io/nodejs-modules-imports/ , this is Common JS)
| <?php // colophon section which can be edited in WordPress customizer (GeneratePress child-theme) | |
| add_action( 'customize_register', function( $wp_customize ) { | |
| $wp_customize->add_section( 'fia_colophon_section', array( | |
| 'title' => __( 'Colofon Informatie', 'fia-theme' ), | |
| 'priority' => 120, | |
| ) ); | |
| // Velden configuratie | |
| $fields = array( |
| gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/prepress -dNOPAUSE -dQUIET -dBATCH -sOutputFile=compressed.pdf input.pdf |
| /* https://codepen.io/editor/chriscoyier/pen/0198772a-a759-7dc4-b8fc-1dfdbed39fdb | |
| ** https://shoptalkshow.com/681/ */ | |
| @layer reset { | |
| html { | |
| color-scheme: light dark; | |
| font: | |
| clamp(1rem, 1rem + 0.5dvw, 2rem) / 1.4 system-ui, | |
| sans-serif; | |
| tab-size: 2; | |
| hanging-punctuation: first allow-end last; |
| <?php | |
| // Start output buffering and clean whitespace | |
| ob_start(function ($buffer) { | |
| // Remove tabs, newlines, multiple spaces between tags | |
| $buffer = preg_replace('/\s+/', ' ', $buffer); | |
| // Remove spaces between HTML tags | |
| $buffer = preg_replace('/>\s+</', '><', $buffer); | |
| return trim($buffer); | |
| }); | |
| ?> |
| find . -mindepth 1 -type f -not -name "*.*" -not -name "*\?*" -exec sh -c 'mv "{}" "{}".html' \; | |
| # In this version, I've removed the -name '*.*' option, since we want to rename files that don't have a suffix. | |
| # I've also replaced the -not -name '*\?' option with -not -name "*\?*", | |
| # which should correctly exclude files that contain a ? character in their name. |
| /* grid 24x24 */ | |
| .container { | |
| background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='enable-background:new 0 0 24 24' viewBox='0 0 24 24'%3E%3Cpath d='M0 5h24v1H0zM0 17h24v1H0z' style='fill:%23ddd'/%3E%3Cpath d='M5 0h1v24H5z' style='fill:%23ddd'/%3E%3Cpath d='M11 0h1v24h-1z' style='fill:%23bbb'/%3E%3Cpath d='M17 0h1v24h-1z' style='fill:%23ddd'/%3E%3Cpath d='M0 11h24v1H0z' style='fill:%23bbb'/%3E%3Cpath d='M0 23h24v1H0z' style='fill:%23999'/%3E%3Cpath d='M23 0h1v24h-1z' style='fill:%23999'/%3E%3C/svg%3E"); | |
| } |
To unzip the epub, move the ePub to a folder, cd to it then simply:
unzip MyEbook.epub
E-book readers require that the mimetype file is the first one in the zip document. What's more, to be fully compliant, this file should start at a very specific point - a 30-byte offset from the beginning of the zip file (so that the mimetype text itself starts at byte 38). If this sounds intimidating, don't worry. It's actually quite easy to achieve if you're careful.