mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
GwR tweaks
This commit is contained in:
commit
ef47738914
@ -538,7 +538,7 @@ class BasicNewsRecipe(Recipe):
|
||||
Intended to be used to get article metadata like author/summary/etc.
|
||||
from the parsed HTML (soup).
|
||||
:param article: A object of class :class:`calibre.web.feeds.Article`.
|
||||
If you chane the sumamry, remeber to also change the
|
||||
If you change the summary, remember to also change the
|
||||
text_summary
|
||||
:param soup: Parsed HTML belonging to this article
|
||||
:param first: True iff the parsed HTML is the first page of the article.
|
||||
@ -800,9 +800,6 @@ class BasicNewsRecipe(Recipe):
|
||||
table.toc {
|
||||
font-size:large;
|
||||
}
|
||||
td.article_count {
|
||||
text-align:right;
|
||||
}
|
||||
'''
|
||||
|
||||
templ = templates.TouchscreenFeedTemplate()
|
||||
@ -1135,7 +1132,8 @@ class BasicNewsRecipe(Recipe):
|
||||
mi.publisher = __appname__
|
||||
mi.author_sort = __appname__
|
||||
if self.output_profile.name == 'iPad':
|
||||
mi.authors = [strftime('%A, %d %B %Y')]
|
||||
date_as_author = '%s, %s %s, %s' % (strftime('%A'), strftime('%B'), strftime('%d').lstrip('0'), strftime('%Y'))
|
||||
mi.authors = [date_as_author]
|
||||
mi.author_sort = strftime('%Y-%m-%d')
|
||||
mi.publication_type = 'periodical:'+self.publication_type
|
||||
mi.timestamp = nowf()
|
||||
|
@ -120,6 +120,7 @@ class TouchscreenNavBarTemplate(Template):
|
||||
href = '%s%s/%s/index.html'%(prefix, up, next)
|
||||
navbar.text = '| '
|
||||
navbar.append(A('Next', href=href))
|
||||
|
||||
href = '%s../index.html#article_%d'%(prefix, art)
|
||||
navbar.iterchildren(reversed=True).next().tail = ' | '
|
||||
navbar.append(A('Section Menu', href=href))
|
||||
@ -130,6 +131,7 @@ class TouchscreenNavBarTemplate(Template):
|
||||
href = '%s../article_%d/index.html'%(prefix, art-1)
|
||||
navbar.iterchildren(reversed=True).next().tail = ' | '
|
||||
navbar.append(A('Previous', href=href))
|
||||
|
||||
navbar.iterchildren(reversed=True).next().tail = ' | '
|
||||
if not bottom:
|
||||
navbar.append(HR())
|
||||
@ -165,8 +167,14 @@ class TouchscreenIndexTemplate(Template):
|
||||
def _generate(self, title, masthead, datefmt, feeds, extra_css=None, style=None):
|
||||
if isinstance(datefmt, unicode):
|
||||
datefmt = datefmt.encode(preferred_encoding)
|
||||
date = strftime(datefmt)
|
||||
masthead_img = IMG(src=masthead,alt="masthead")
|
||||
date = '%s, %s %s, %s' % (strftime('%A'), strftime('%B'), strftime('%d').lstrip('0'), strftime('%Y'))
|
||||
masthead_p = etree.Element("p")
|
||||
masthead_p.set("style","text-align:center")
|
||||
masthead_img = etree.Element("img")
|
||||
masthead_img.set("src",masthead)
|
||||
masthead_img.set("alt","masthead")
|
||||
masthead_p.append(masthead_img)
|
||||
|
||||
head = HEAD(TITLE(title))
|
||||
if style:
|
||||
head.append(STYLE(style, type='text/css'))
|
||||
@ -178,11 +186,11 @@ class TouchscreenIndexTemplate(Template):
|
||||
if feed:
|
||||
tr = TR()
|
||||
tr.append(TD( CLASS('toc_item'), A(feed.title, href='feed_%d/index.html'%i)))
|
||||
tr.append(TD( CLASS('article_count'),'%d' % len(feed.articles)))
|
||||
tr.append(TD( '%s' % len(feed.articles), style="text-align:right"))
|
||||
toc.append(tr)
|
||||
|
||||
div = DIV(
|
||||
PT(masthead_img,style='text-align:center'),
|
||||
masthead_p,
|
||||
PT(date, style='text-align:center'),
|
||||
toc,
|
||||
CLASS('calibre_rescale_100'))
|
||||
|
Loading…
x
Reference in New Issue
Block a user