Skip to content

Commit

Permalink
Upgrade code for Python 3.6+
Browse files Browse the repository at this point in the history
  • Loading branch information
justinmayer committed Apr 11, 2023
1 parent e19daf2 commit ad4d2fd
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions pelican/plugins/pdf/pdf.py
Expand Up @@ -14,10 +14,8 @@
from pelican.generators import Generator
from pelican.readers import MarkdownReader

"""
Workaround until fixed xhtml2pdf import is included in rst2pdf Release
https://github.com/rst2pdf/rst2pdf/commit/6ad348cf5a13ae1b884a86574e48ed1e5f8ca135
"""
# Workaround until fixed xhtml2pdf import is included in rst2pdf Release
# https://github.com/rst2pdf/rst2pdf/commit/6ad348cf5a13ae1b884a86574e48ed1e5f8ca135
import xhtml2pdf.default # NOQA isort:skip
from rst2pdf.createpdf import RstToPdf # NOQA isort:skip

Expand Down Expand Up @@ -78,7 +76,7 @@ def _create_pdf(self, obj, output_path):
if k not in self.supported_md_fields:
del meta[k]

header += "\n".join([":{}: {}".format(k, meta[k]) for k in meta])
header += "\n".join([f":{k}: {meta[k]}" for k in meta])
header += "\n\n.. raw:: html\n\n\t"
text = text.replace("\n", "\n\t")

Expand Down

0 comments on commit ad4d2fd

Please sign in to comment.