return re.sub('</?blockquote[^>]*>', '', html)
-def transform(wldoc, stylesheet='legacy', options=None, flags=None):
+def transform(wldoc, stylesheet='legacy', options=None, flags=None, css=None):
"""Transforms the WL document to XHTML.
If output_filename is None, returns an XML,
if not options:
options = {}
options.setdefault('gallery', "''")
- result = document.transform(style, **options)
+
+ css = css or 'https://static.wolnelektury.pl/css/compressed/book_text.css'
+ css = "'%s'" % css
+ result = document.transform(style, css=css, **options)
del document # no longer needed large object :)
if html_has_content(result):
<title>Książka z serwisu WolneLektury.pl</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
- <link href="https://static.wolnelektury.pl/css/compressed/book_text.css" rel="stylesheet" type="text/css" />
- <style>
- .animacja {cursor: pointer;}
- </style>
+ <link rel="stylesheet" type="text/css">
+ <xsl:attribute name="href">
+ <xsl:value-of select="$css" />
+ </xsl:attribute>
+ </link>
</head>
<body>
<xsl:call-template name="book-text" />
action='store_false', default=True,
help='output raw text for use in templates')
]
+ transform_options = [
+ Option('--css', dest='css')
+ ]
parser_options = [
Option('-i', '--ignore-dublin-core', dest='parse_dublincore',
action='store_false', default=True,