quarto-dev / quarto-cli

Open-source scientific and technical publishing system built on Pandoc.
https://quarto.org
Other
3.98k stars 328 forks source link

email+revealjs overwrites slides HTML #10740

Open aronatkins opened 2 months ago

aronatkins commented 2 months ago

Bug description

Rendering a document containing two formats (revealjs and email) overwrites the first HTML file with the second format. In this example, we want the email-preview/ and .output_metadata.json but do not want the HTML file it produces.

Steps to reproduce

---
title: email and slides
format:
  revealjs: {}
  email: {}
---

## important

Your analysis might be best presented by using a slide show.

::: {.email}

::: {.subject}
email from slides
:::

It may be important to email key metrics.

:::

Expected behavior

A revealjs document is allowed to produce slides HTML alongside email metadata.

Actual behavior

A vanilla HTML document overwrites the slides HTML and also produces email metadata.

Your environment

No response

Quarto check output

Quarto 1.5.57
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.2.0: OK
      Dart Sass version 1.70.0: OK
      Deno version 1.41.0: OK
      Typst version 0.11.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.5.57
      Path: /Users/aron/quarto/quarto-1.5.57-macos/bin

[✓] Checking tools....................OK
      TinyTeX: (not installed)
      Chromium: (not installed)

[✓] Checking LaTeX....................OK
      Using: Installation From Path
      Path: /Library/TeX/texbin
      Version: 2024

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
      Version: 3.12.2
      Path: /opt/homebrew/opt/python@3.12/bin/python3.12
      Jupyter: (None)

      Jupyter is not available in this Python installation.
      Install with python3 -m pip install jupyter

[✓] Checking R installation...........OK
      Version: 4.3.3
      Path: /Library/Frameworks/R.framework/Resources
      LibPaths:
        - /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library
      knitr: 1.48
      rmarkdown: 2.27

[✓] Checking Knitr engine render......OK
cderv commented 2 months ago

Thanks for the report.

This is a mis-designed of the email format. It applies only on HTML.

BTW this is not a revealjs related issue, it will be the same with any other HTML format

Two problems I see

I believe this specific issue is a variant of those above. Email definitely needs some work !

aronatkins commented 2 months ago

@cderv - Email is only processed with format: email, today, which feels like it leads to both of the problems you describe.

Because email is a format, Quarto renders twice and produces two outputs. It feels like email should not be a format, but should be an always-available filter.

My current thinking: An email div should cause its files to be written alongside the target file format regardless of format. That email div should never appear in the target file output.

This is part of a series of email issues filed ahead of planned discussions with the Quarto team.

aronatkins commented 2 months ago

One other note: I used revealjs+email in this example, but it also applies to other formats. For example, I might want to produce email when rendering to PDF with Typst.

format:
  typst: {}
  email: {}

In this instance, we should produce a PDF, the extraction of an email message, and no HTML.

cderv commented 2 months ago

It feels like email should not be a format, but should be an always-available filter.

yes I think this is the main design problem we have here.