Skip to content

Instantly share code, notes, and snippets.

View JayPanoz's full-sized avatar

Jiminy Panoz JayPanoz

View GitHub Profile
JayPanoz /
Last active September 18, 2019 07:21
List of eprdctn merit badges
JayPanoz / nm-bookmarklet.txt
Last active October 15, 2018 16:30
Poor man’s night mode
View nm-bookmarklet.txt
Converted using Mr Coles’ Bookmarklet Creator:
JayPanoz / book.css
Created April 5, 2018 14:26
JS and CSS files Pages iOS outputs when exporting to EPUB3
View book.css
/* unvisited link */
a:link {
color: initial;
/* visited link */
a:visited {
color: initial;
JayPanoz / index.js
Last active June 5, 2019 16:23
A proof of concept script to append aria doc roles based on epub:type
View index.js
// This is now its own package @
// Please check Rodebert’s repo for a better and more up-to-date version
"use strict";
// Get all the elements with epub:type
// Since querySelectorAll can’t be used with XHTML attributes,
// we create an array in which we’ll push elements with an epub:type attribute
var epubTypes = [];
JayPanoz / Dynamic-leading.html
Last active September 3, 2017 14:48
A quick and dirty web app to get the optimal value for leading
View Dynamic-leading.html
<!DOCTYPE html>
<style type="text/css" id="styles">
html, body {margin: 0; padding: 0;}
.main {
box-sizing: border-box;
display: flex;
JayPanoz /
Last active September 6, 2017 08:48
Readium CSS User Agent Properties

There is a proposal for user agent properties. To sum things up, browsers would expose user settings so that you can use them in your CSS.

For instance:

body {
  font-size: const(user-font-size);
  font-family: const(user-font-family);
  /* And so on and so forth… */
JayPanoz / equationEnvironment.xml
Created August 16, 2017 12:34
XML file for MathML you can find in iBooks Author’s EPUB 3
View equationEnvironment.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
JayPanoz / defaultUserStylesheet.js
Last active June 21, 2017 15:20
Dauwhe’s magical mystery Reading System
View defaultUserStylesheet.js
/* Dauwhe’s magical mystery Reading System
A quick and dirty proto to implement
This is the future of ebooks’ default stylesheet
r(function() {
var style = document.createElement("style"); = "ImSorryDaveImAfraidICanDoThat";
JayPanoz /
Last active June 15, 2017 18:18
Which line-height do you get when sizing based on font-size, x-height and character width

Line Height based on the typeface x-height and character width | Golden Ratio edition

CSS snippet

p {
  font-size: 1em;
  line-height: calc(1.618em + (1ex - 1ch));