Merge branch 'gutenberg1' of github.com:gutenbergtools/autocat3 into gutenberg1

Conflicts:
	CoverPages.py
work-in-progress
autocat 2020-03-11 15:55:01 -04:00
commit e80116ca19
9 changed files with 32 additions and 33 deletions

View File

@ -64,7 +64,7 @@ tools.gzip.on: True
tools.gzip.mime_types: ['text/html', 'application/xhtml+xml', 'application/atom+xml'] tools.gzip.mime_types: ['text/html', 'application/xhtml+xml', 'application/atom+xml']
tools.I18nTool.on: True tools.I18nTool.on: True
tools.I18nTool.default: 'en_US' tools.I18nTool.default: 'en'
tools.I18nTool.mo_dir: CherryPyApp.install_dir + '/i18n' tools.I18nTool.mo_dir: CherryPyApp.install_dir + '/i18n'
tools.I18nTool.domain: 'messages' tools.I18nTool.domain: 'messages'

View File

@ -39,7 +39,7 @@ class CoverPages (object):
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en" xml:base="http://www.gutenberg.org"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en" xml:base="http://www.gutenberg.org">
<head> <head>
<title>Cover Flow</title> <title>Cover Flow</title>
<style> <!--<style>
.cover-thumb { .cover-thumb {
display: inline-block; display: inline-block;
background-position: center; background-position: center;
@ -74,7 +74,13 @@ class CoverPages (object):
target="_top" target="_top"
><div class="cover-container"><img src="{url}" alt="{title}" title="{title}" draggable="false"><h5>{title}\n</h5></div></a>\n""".format ( ><div class="cover-container"><img src="{url}" alt="{title}" title="{title}" draggable="false"><h5>{title}\n</h5></div></a>\n""".format (
url = url, href = href, title = title, size = size) url = url, href = href, title = title, size = size)
<<<<<<< HEAD
return (s + '<!--</div></body></html>-->\n').encode ('utf-8') return (s + '<!--</div></body></html>-->\n').encode ('utf-8')
=======
return (s + '</div></body></html>\n').encode ('utf-8')
>>>>>>> 0253c4308e81c77c840eed00fd2df1fe998dc5f5
def index (self, count, size, order, **kwargs): def index (self, count, size, order, **kwargs):
""" Internal help function. """ """ Internal help function. """

View File

@ -129,9 +129,7 @@ class HTMLFormatter (XMLishFormatter):
""" Produce HTML output. """ """ Produce HTML output. """
CONTENT_TYPE = 'text/html; charset=UTF-8' CONTENT_TYPE = 'text/html; charset=UTF-8'
DOCTYPE = ('html', DOCTYPE = 'html5'
'-//W3C//DTD XHTML+RDFa 1.0//EN',
'http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd')
def __init__ (self): def __init__ (self):
super (HTMLFormatter, self).__init__ () super (HTMLFormatter, self).__init__ ()
@ -139,7 +137,7 @@ class HTMLFormatter (XMLishFormatter):
def get_serializer (self): def get_serializer (self):
# return BaseFormatter.XHTMLSerializer (doctype = self.DOCTYPE, strip_whitespace = False) # return BaseFormatter.XHTMLSerializer (doctype = self.DOCTYPE, strip_whitespace = False)
return genshi.output.XHTMLSerializer (doctype = self.DOCTYPE, strip_whitespace = False) return genshi.output.HTMLSerializer (doctype = self.DOCTYPE, strip_whitespace = False)
def fix_dc (self, dc, os): def fix_dc (self, dc, os):
@ -195,16 +193,14 @@ class MobileFormatter (XMLishFormatter):
""" Produce HTML output suitable for mobile devices. """ """ Produce HTML output suitable for mobile devices. """
CONTENT_TYPE = mt.xhtml + '; charset=UTF-8' CONTENT_TYPE = mt.xhtml + '; charset=UTF-8'
DOCTYPE = ('html', DOCTYPE = 'html5'
'-//WAPFORUM//DTD XHTML Mobile 1.2//EN',
'http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd')
def __init__ (self): def __init__ (self):
super (MobileFormatter, self).__init__ () super (MobileFormatter, self).__init__ ()
def get_serializer (self): def get_serializer (self):
return genshi.output.XMLSerializer (doctype = self.DOCTYPE, strip_whitespace = False) return genshi.output.HTMLSerializer (doctype = self.DOCTYPE, strip_whitespace = False)
def fix_dc (self, dc, os): def fix_dc (self, dc, os):

View File

@ -21,7 +21,7 @@ Gutenberg metadata much faster than by scraping.
xmlns:marcrel="http://www.loc.gov/loc.terms/relators/" xmlns:marcrel="http://www.loc.gov/loc.terms/relators/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xml:lang="${os.lang}" xml:lang="${os.lang}"
version="XHTML+RDFa 1.0"> >
<?python <?python
import re import re
@ -53,8 +53,7 @@ Gutenberg metadata much faster than by scraping.
title="${explain (topic)}"><span class="icon icon_help noprint" /></a> title="${explain (topic)}"><span class="icon icon_help noprint" /></a>
</py:def> </py:def>
<head profile="http://a9.com/-/spec/opensearch/1.1/" <head xmlns:og="http://opengraphprotocol.org/schema/">
xmlns:og="http://opengraphprotocol.org/schema/">
${site_head ()} ${site_head ()}
@ -63,7 +62,7 @@ Gutenberg metadata much faster than by scraping.
<link rel="alternate nofollow" type="${mt.rdf}" <link rel="alternate nofollow" type="${mt.rdf}"
href="${os.url ('bibrec', id = os.id, format = 'rdf')}" /> href="${os.url ('bibrec', id = os.id, format = 'rdf')}" />
<style type="text/css"> <style>
.qrcode { background: transparent url(${os.qrcode_url}) 0 0 no-repeat; } .qrcode { background: transparent url(${os.qrcode_url}) 0 0 no-repeat; }
</style> </style>
<meta name="google" content="notranslate" /> <meta name="google" content="notranslate" />
@ -149,7 +148,7 @@ ${site_top()}
<h2>Bibliographic Record <span>${help (_('Table: Bibliographic Record'))}</span></h2> <h2>Bibliographic Record <span>${help (_('Table: Bibliographic Record'))}</span></h2>
<table class="bibrec" summary="Bibliographic data of author and book."> <table class="bibrec" >
<colgroup> <colgroup>
<col class="narrow" /> <col class="narrow" />
<col /> <col />
@ -245,7 +244,7 @@ ${site_top()}
<tr itemprop="offers" itemscope="itemscope" itemtype="http://schema.org/Offer"> <tr itemprop="offers" itemscope="itemscope" itemtype="http://schema.org/Offer">
<th>Price</th> <th>Price</th>
<td><span itemprop="priceCurrency" content="USD" /><span itemprop="price">$0.00</span><span itemprop="availability" href="http://schema.org/InStock" content="In Stock" /></td> <td><span itemprop="priceCurrency" content="USD" /><span itemprop="price">$0.00</span><span itemprop="availability" content="In Stock" ><a href="http://schema.org/InStock"></a></span></td>
</tr> </tr>
</table> </table>
@ -289,14 +288,15 @@ ${site_top()}
<py:for each="e in os.entries"> <py:for each="e in os.entries">
<py:if test="isinstance (e, bs.DC)"> <py:if test="isinstance (e, bs.DC)">
<div about="[ebook:$e.project_gutenberg_id]" rel="dcterms:hasFormat" rev="dcterms:isFormatOf"> <div about="[ebook:$e.project_gutenberg_id]" rel="dcterms:hasFormat" ><!--! rev="dcterms:isFormatOf" -->
<h2>Download This eBook</h2> <h2>Download This eBook</h2>
<table class="files" summary="Table of available file types and sizes."> <table class="files">
<colgroup> <colgroup>
<col class="narrow" /> <col class="narrow" />
<col /> <col />
<col />
<col /> <col />
<col class="narrow noprint" /> <col class="narrow noprint" />
<col class="narrow noprint" /> <col class="narrow noprint" />
@ -320,8 +320,7 @@ ${site_top()}
<td><span class="icon icon_${e.icon}" /></td> <td><span class="icon icon_${e.icon}" /></td>
<td property="dcterms:format" content="${file_.mediatypes[-1]}" datatype="dcterms:IMT" <td property="dcterms:format" content="${file_.mediatypes[-1]}" datatype="dcterms:IMT"
class="unpadded icon_save" class="unpadded icon_save"
><a href="/${file_.filename}" type="${file_.mediatypes[-1]}" charset="${file_.encoding}" ><a href="/${file_.filename}" type="${file_.mediatypes[-1]}" class="link"
class="link"
title="Download">${file_.hr_filetype}</a></td> title="Download">${file_.hr_filetype}</a></td>
<td class="noscreen">${file_.url}</td> <td class="noscreen">${file_.url}</td>
<td class="right" <td class="right"

View File

@ -8,7 +8,7 @@
xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:fb="http://www.facebook.com/2008/fbml"
py:strip=""> py:strip="">
<head> <head>
<style type="text/css"> <style>
.icon { background: transparent url(/pics/sprite.png?${cherrypy.config['css_mtime']}) 0 0 no-repeat; } .icon { background: transparent url(/pics/sprite.png?${cherrypy.config['css_mtime']}) 0 0 no-repeat; }
</style> </style>
<link rel="stylesheet" type="text/css" <link rel="stylesheet" type="text/css"

View File

@ -22,8 +22,7 @@ which contains *all* Project Gutenberg metadata in one RDF/XML file.
xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:og="http://opengraphprotocol.org/schema/" xmlns:og="http://opengraphprotocol.org/schema/"
xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:fb="http://www.facebook.com/2008/fbml"
xml:lang="${os.lang}" xml:lang="${os.lang}">
version="XHTML+RDFa 1.0">
<?python <?python
old_header = os.title old_header = os.title
@ -33,7 +32,7 @@ which contains *all* Project Gutenberg metadata in one RDF/XML file.
<xi:include href="site-layout.html" /> <xi:include href="site-layout.html" />
<xi:include href="social-functions.html" /> <xi:include href="social-functions.html" />
<head profile="http://a9.com/-/spec/opensearch/1.1/"> <head >
${site_head ()} ${site_head ()}
<title>${os.title} - ${os.pg}</title> <title>${os.title} - ${os.pg}</title>

View File

@ -11,7 +11,7 @@ py:strip="">
from i18n_tool import ugettext as _ from i18n_tool import ugettext as _
?> ?>
<py:def function="site_head"> <py:def function="site_head">
<style type="text/css"> <style >
.icon { background: transparent url(/pics/sprite.png?${cherrypy.config['css_mtime']}) 0 0 no-repeat; } .icon { background: transparent url(/pics/sprite.png?${cherrypy.config['css_mtime']}) 0 0 no-repeat; }
</style> </style>
@ -22,7 +22,7 @@ href="/gutenberg/new_nav.css?${cherrypy.config['css_mtime']}"/>
<link rel="stylesheet" type="text/css" <link rel="stylesheet" type="text/css"
href="/gutenberg/style.css?${cherrypy.config['css_mtime']}"/> href="/gutenberg/style.css?${cherrypy.config['css_mtime']}"/>
<!--! IE8 does not recognize application/javascript --> <!--! IE8 does not recognize application/javascript -->
<script type="text/javascript">//<![CDATA[ <script >//<![CDATA[
var json_search = "${os.json_search}"; var json_search = "${os.json_search}";
var mobile_url = "${os.mobile_url}"; var mobile_url = "${os.mobile_url}";
var canonical_url = "${os.canonical_url}"; var canonical_url = "${os.canonical_url}";
@ -34,7 +34,7 @@ var dialog_title = "${os.user_dialog[1]}";
var dialog_message = "${os.user_dialog[0]}"; var dialog_message = "${os.user_dialog[0]}";
//]]></script> //]]></script>
<script type="text/javascript" <script
src="/js/pg-desktop-one.js?${cherrypy.config['js_mtime']}" /> src="/js/pg-desktop-one.js?${cherrypy.config['js_mtime']}" />
<link rel="shortcut icon" href="/gutenberg/favicon" /> <link rel="shortcut icon" href="/gutenberg/favicon" />
@ -55,8 +55,7 @@ href="${os.url_carry (format = 'opds')}" />
<meta py:if="os.viewport" name="viewport" content="${os.viewport}" /> <meta py:if="os.viewport" name="viewport" content="${os.viewport}" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Style-Type" content="text/css" /> <meta http-equiv="default-style" content="text/css" />
<meta http-equiv="Content-Language" content="${os.lang}" />
<!--! plain old metadata --> <!--! plain old metadata -->
<meta name="title" content="${os.title}" /> <meta name="title" content="${os.title}" />
@ -179,7 +178,7 @@ title="Powered by PostgreSQL">
<!--! xml:lang avoids extraction for translation --> <!--! xml:lang avoids extraction for translation -->
<input xml:lang="en" type="hidden" name="cmd" value="_s-xclick" /> <input xml:lang="en" type="hidden" name="cmd" value="_s-xclick" />
<input xml:lang="en" type="hidden" name="hosted_button_id" value="XKAL6BZL3YPSN" /> <input xml:lang="en" type="hidden" name="hosted_button_id" value="XKAL6BZL3YPSN" />
<input type="image" name="submit" <input type="image" alt ="paypal icon" name="submit"
src="/pics/paypal/${os.paypal_lang}.gif" src="/pics/paypal/${os.paypal_lang}.gif"
title="Send us money through PayPal." /> title="Send us money through PayPal." />
</div> </div>

View File

@ -10,7 +10,7 @@
?> ?>
<py:def function="site_head"> <py:def function="site_head">
<style type="text/css"> <style >
.icon { background: transparent url(/pics/sprite.png?${cherrypy.config['css_mtime']}) 0 0 no-repeat; } .icon { background: transparent url(/pics/sprite.png?${cherrypy.config['css_mtime']}) 0 0 no-repeat; }
</style> </style>
<link rel="stylesheet" type="text/css" <link rel="stylesheet" type="text/css"

View File

@ -54,7 +54,7 @@
<a href="https://twitter.com/share?${p (params)}" <a href="https://twitter.com/share?${p (params)}"
title="Share on Twitter" title="Share on Twitter"
onclick="open_share_popup(this.href, this.target, 640, 320)" onclick="open_share_popup(this.href, this.target, 640, 320)"
target="_tw_share_popup"> target="_top">
<span class="icon icon_twitter" /> <span class="icon icon_twitter" />
</a> </a>
</div> </div>