Adjust for enchanted library stories

This commit is contained in:
Joakim Soderlund 2022-03-16 13:15:28 +01:00
parent b39c916da3
commit ef541b799f
3 changed files with 6 additions and 7 deletions

View file

@ -46,7 +46,7 @@ TARGET = 'target.epub'
TIMEOUT = 300
PROGRAM = 'ebook-convert'
ARGUMENTS = ('--no-default-epub-cover',)
ARGUMENTS = ('--cover', 'cover.jpg')
proc = partial(run, stderr=STDOUT, timeout=TIMEOUT, check=True)

View file

@ -8,15 +8,12 @@
<body>
{%- autoescape false %}
{%- if authors_note_position == 'top' %}
<h1>{{ "Author's Note" | e }}</h1>
<h2>{{ "Author's Note" | e }}</h2>
<div id='authors-note'>{{ authors_note_html }}</div>
<hr/>
{%- endif %}
<h1>{{ title | e }}</h1>
<div id='content'>{{ content_html }}</div>
{%- if authors_note_position == 'bottom' %}
<hr/>
<h1>{{ "Author's Note" | e }}</h1>
<h2>{{ "Author's Note" | e }}</h2>
<div id='authors-note'>{{ authors_note_html }}</div>
{%- endif %}
{%- endautoescape %}

View file

@ -30,7 +30,7 @@ from urllib.parse import unquote
from zipfile import ZipFile
import requests
from bs4 import BeautifulSoup
from bs4 import BeautifulSoup, Tag
from fimfarchive.exceptions import StorySourceError
from fimfarchive.stories import Story
@ -80,6 +80,8 @@ class ImageLoader:
else:
tag.attrs['src'] = self.fetch(url)
tag.wrap(Tag(name='center'))
return dom.decode_contents().encode()
def entries(self) -> Iterator[Tuple[str, bytes]]: