Skip to content

Commit

Permalink
improve linting
Browse files Browse the repository at this point in the history
  • Loading branch information
lukas committed Sep 4, 2024
1 parent a04ba5f commit 940438c
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions pelican/plugins/lm_pelican_quarto/adapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ def _setup_quarto_project(self):

def run_quarto(self, filename):
"""Run Quarto as a subprocess."""

try:
result = subprocess.run(
["quarto", "render", filename, "--output", "-"],
Expand All @@ -56,13 +55,12 @@ def run_quarto(self, filename):
if result.returncode == 0:
logger.info("Quarto render completed successfully.")
return self._update_image_references(filename, result.stdout)
else:
logger.error(
f"Error while rendering Quarto Markdown File {filename}: {result.stderr}"
)
return result.stderr
logger.error(
f"Error while rendering Quarto Markdown File {filename}: {result.stderr}"
)
return result.stderr
except Exception as e:
logger.error(f"An exception occurred while running Quarto: {str(e)}")
logger.error(f"An exception occurred while running Quarto: {e!s}")
return None

def _update_image_references(self, filename, html_content):
Expand Down

0 comments on commit 940438c

Please sign in to comment.