Skip to content

Render fails when specifying both revealjs and html formats in _quarto.yml #4470

Closed

Description

@MattF-NSIDC

Bug description

I'm using Quarto 1.2.335 via conda-forge on Ubuntu 20 LTS. I'm not using the RStudio IDE, just editing with vi.

This is related to #4469 somewhat: I encountered these two separate problems trying to accomplish the same goal: Render a webpage which displays a list of links to RevealJS presentations from the same build.

Render works fine until specifying a format.revealjs option, e.g. toc: true, in _quarto.yml, at which point render fails with the following error:

ERROR: NotFound: No such file or directory (os error 2), rename
'/path/to/quarto/project/index.html' -> '/path/to/quarto/project/_site/index.html'

Steps to reproduce:

  1. Create project template
    quarto create-project sscce-quarto-slides-in-website --type website
    
  2. Create slides/index.qmd with format: 'revealjs' in front-matter.
  3. Add link from index.qmd to slides/index.qmd
  4. Add the following to the format section of _quarto.yml (I believe other settings will also trigger this):
    revealjs:
        toc: true
    
  5. quarto render, observe the NotFound error
  6. Note that an index.html file has been created outside of the _site directory

This issue can also be reproduced from the reveals-config-breaks-preview branch in the repo I created for #4469: https://github.com/MattF-NSIDC/sscce-quarto-slides-in-website/tree/revealjs-config-breaks-preview

Checklist

  • Please include a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
  • Please format your issue so it is easier for us to read the bug report.
  • Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
  • Please document the operating system you're running. If on Linux, please provide the specific distribution.

Activity

  1. added
    bug
    on Feb 22, 2023
  2. MattF-NSIDC commented on Feb 23, 2023

    @MattF-NSIDC
    Author

    I just installed the preview quarto-1.3.217-linux-amd64.deb distribution and re-tested this issue. It still occurs.

  3. cscheid commented on Feb 23, 2023

    @cscheid
    Member

    The issue here is that html and revealjs both emit a .html file. Ideally, we'd issue a warning before overwriting those files, but we don't do that right now.

    If you're working on a single file, the easiest solution is to change the name of the output file inside one of the formats with output-file: new-name.html.

    If I understand your usecase correctly, you'd like a website where every file is rendered both as HTML and revealjs. I can't think of a simple way to make quarto work well in this scenario. (Edit: my hack doesn't work, see below)

  4. MattF-NSIDC commented on Feb 23, 2023

    @MattF-NSIDC
    Author

    If I understand your usecase correctly, you'd like a website where every file is rendered both as HTML and revealjs.

    That's not quite what I'm looking for. I want each .qmd file to render as either a slide or as a HTML page, never both. All the pages I want to render as slides include format: revealjs in the front-matter and are in the slides directory, and I'd like everything else to render as a webpage!

  5. cscheid commented on Feb 23, 2023

    @cscheid
    Member

    Render works fine until specifying a format.revealjs option, e.g. toc: true, in _quarto.yml

    The problem here is that when you add something to _quarto.yml, that does something different from what you're expecting. It's not only adding a default configuration. It's actually requesting quarto to render your website in that format.

    I suspect you're trying to say "please set toc: true any time you see a revealjs format". We don't support that quite yet, but we do support a _metadata.yml in any directory which will be respected. So all you need to do is add

    format:
      revealjs:
        toc: true

    to slides/_metadata.yml.

  6. MattF-NSIDC commented on Feb 23, 2023

    @MattF-NSIDC
    Author

    Thank you so much for clarifying this! That makes perfect sense, and it works beautifully. I think this can be closed as "user error". I have pushed a branch correctly-specify-revealjs-config to my repo which demonstrates how this should be done.

    FWIW I also tried the hack you specified before you set my straight in your latest post, but when I clicked on a link (specified as [Slides](slides/index.qmd in my markdown), the link generated after render includes the extension twice: slides/index..reveal.html..reveal.html; I removed the leading dot and still got slides/index.reveal.html.reveal.html in both pre-release and 1.2.335.

  7. added a commit that references this issue on Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions