This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from selenium import webdriver | |
from selenium.webdriver.support.ui import WebDriverWait | |
from pyvirtualdisplay import Display | |
import os | |
from bs4 import BeautifulSoup | |
import csv | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This snippet adds epub mime-type to WordPress' allowed mime-types, so you can upload epub files to WP | |
// add this to your theme's function.php file | |
add_filter('upload_mimes', 'eme_myme_types', 1, 1); | |
function eme_myme_types($mime_types){ | |
$mime_types['epub'] = 'application/epub+zip'; | |
return $mime_types; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// main lang | |
if ($("html").get(0).hasAttribute("lang")) { | |
var main_lang = $("html").attr("lang"); | |
} else { | |
var main_lang = $("body").attr("lang"); | |
} | |
console.log("Main language is "+main_lang); | |
// children lang | |
var langs = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(Gen|Es|Lv|Nm|Dt|Gs|Gdc|Rt|1Sam|2Sam|1Re|2Re|1Cr|2Cr|Esd|Ne|Tb|Gdt|Est|1Mac|2Mac|Gb|Sal|Prv|Qo|Ct|Sap|Sir|Is|Ger|Lam|Bar|Ez|Dn|Os|Gl|Am|Abd|Gio|Mic|Mi|Na|Ab|Sof|Ag|Zc|Ml|Mt|Mc|Lc|Gv|At|Rm|1Cor|2Cor|Gal|Ef|Fil|Col|1Ts|2Ts|1Tm|2Tm|Tt|Fm|Eb|Gc|1Pt|2Pt|1Gv|2Gv|3Gv|Gd|Ap)(?= \d) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dc="http://purl.org/dc/elements/1.1/" version="1.0"> | |
<xsl:output method="xml" indent="yes" /> | |
<xsl:template match="Header" /> | |
<xsl:template match="Product"> | |
<!-- dc:identifier https://www.w3.org/TR/epub-33/#sec-opf-dcidentifier --> | |
<dc:identifier id="bookid"> | |
<xsl:value-of select="concat('urn:isbn:', ProductIdentifier[ProductIDType='15']/IDValue)" /> | |
</dc:identifier> | |
<meta property="identifier-type" refines="#bookid" scheme="onix:codelist5">15</meta> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// based on https://www.id-extras.com/apply-paragraph-style-footnotes/ | |
paragraph_style = document.footnoteOptions.footnoteTextStyle; | |
if(paragraph_style.name.charAt(0) == "[") { | |
alert("Please set a paragraph style for notes in Text > Document footnotes options..."); | |
} else { | |
document.stories.everyItem().footnotes.everyItem().texts.everyItem().applyParagraphStyle(paragraph_style, true); | |
} |