Replies: 4 comments 8 replies
-
| This is indeed an unfortunate constraint (and the warning should be an error!). I'd suggest for now just wrapping the rendering of the slides with code that either temporarily renames the  | 
Beta Was this translation helpful? Give feedback.
-
| Small example (source: https://github.com/mcanouil/quarto-issues/tree/main/quarto-cli-1433): 
 
 Note: variables could be used to define shared variables between the two yaml and calling out those variables using shortcodes (see https://quarto.org/docs/authoring/variables.html). | 
Beta Was this translation helpful? Give feedback.
-
| slightly related, is there a way to then combine different chapters into a single slide deck ? | 
Beta Was this translation helpful? Give feedback.
-
| This is very elegant! Will give this a try!… On Wed, Jan 29, 2025 at 12:57 PM Andrew Mitchell ***@***.***> wrote:
 I thought people might be interested in a slightly different way I've done
 this using Quarto profiles. It was inspired by @mcanouil
 <https://github.com/mcanouil> 's bash script method, but trying to
 integrate it more.
 In my directory, I have lectures split into week folders (Week1/, Week2,
 etc), each of which has an index.qmd file and a slides.qmd. Index is a
 standard quarto document as a landing page for the week's chapter, and the
 slides.qmd is a live-revealjs presentation.
 I then have three _quarto.yml type files in the root directory and a
 shared _metadata.yml with title and author info.
    -
    _quarto.yml is almost empty, it just sets up the default profile
    Click to expand _quarto.yml
    profile:
      default: slides
    -
    _quarto-slides.yml sets up a default project with the revealjs format,
    only renders *slides.qmd files, and outputs to _slides
    Click to expand _quarto-slides.yml
    project:
      output-dir: _slides
      render:
        - "*slides.qmd"
    metadata-files:
      - _metadata.yml
    format:
      revealjs:
        theme: [default, clean.scss]
        slide-number: true
        show-slide-number: all
    -
    _quarto-book.yml sets up a book project which outputs to _book.
    Click to expand _quarto-book.yml
    project:
      type: book
      output-dir: _book
      post-render: quarto render --profile slides
    metadata-files:
      - _metadata.yml
    book:
      reader-mode: false
      chapters:
        - index.qmd
        - Week1/age-guessing.qmd
        - Week2/index.qmd
    format:
      html:
        theme: cosmo
      pdf:
        documentclass: scrreprt
 ------------------------------
 So now, I have two profiles available - slides and book.
 In my case, I need the book to render first, then the slides, so I simply
 set a post-render script in _quarto-book.yml which runs the slides
 profile. So compiling the whole thing is quarto render --profile book.
 Within the book pages, I just use a relative link to _slides to embed the
 html:
 Slide embedding in ./Week2/index.qmd
 *yaml header and some content here*
 [Slides](../_slides/Week2/slides.html){.btn .btn-outline-primary .btn role="button" data-toggle="tooltip" title="Here's a tooltip"}
 <style>
 .slide-deck {
     border: 3px solid #dee2e6;
     width: 100%;
     height: 475px;
 }
 </style>
 <div>
 ```{=html}
 <iframe class="slide-deck" src="../_slides/Week2/slides.html"></iframe>
 ```
 While I'm working on my slides, I set the default profile to `slides`, so
 previewing in VS Code works nicely. If I'm working on the other content, I
 could either disable the default profile which will just give a default
 html, or set book as the default and remove the post-render script to not
 bother with rendering the slides too.
 Essentially it works the same as @mcanouil <https://github.com/mcanouil>
 's, but using the built in profiles and without requiring renaming the .yml
 files with a bash script.
 —
 Reply to this email directly, view it on GitHub
 <#1433 (reply in thread)>,
 or unsubscribe
 <https://github.com/notifications/unsubscribe-auth/AALLGHWYL7ZTD3SX6MVV6HT2NAYQ5AVCNFSM53YUPUH2U5DIOJSWCZC7NNSXTOSENFZWG5LTONUW63SDN5WW2ZLOOQ5TCMJZHEYDMNRT>
 .
 You are receiving this because you commented.Message ID:
 ***@***.***>
 | 
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm a university professor. For one of my classes, I like to present my lecture notes as both a presentation (eg, slidy or revealjs, for use in class) and a unified website (eg, gitbook, for students to consult out of class). With Rmarkdown, I could do this by having two different recipes in a Makefile: one that uses
bookdown::render_book()to create the single gitbook, and another that usesrmarkdown::render()to create a presentation for each separate chapterRmdfile.I'm playing around with Quarto, trying to figure out how I might be able to do this. Something like
quarto render chfile --to revealjsin a book project generates a warning:WARNING: The revealjs format is not supported by book projects. (This should probably be an error, because Quarto doesn't go on to executive any code chunks or produce any output files.) Includingrevealjsas aformatin_quarto.ymldoes the same thing. I tried setting up a separate metadata file,_slides.yml, butquarto renderdoesn't seem to have any flags to select which metadata file should be used.So currently the best option seems to be to stick with
rmarkdown::render()for the slides?Beta Was this translation helpful? Give feedback.
All reactions