Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quarto and webexercises #12

Closed
bwelman opened this issue Oct 15, 2022 · 3 comments
Closed

Quarto and webexercises #12

bwelman opened this issue Oct 15, 2022 · 3 comments
Assignees

Comments

@bwelman
Copy link

bwelman commented Oct 15, 2022

To use webexercises with quarto you need to add the css and js files to the format html option in the _quarto.yml file. For example

format:
  html:
    css: include/webex.css
    include-after-body: include/webex.js

Unfortunately Quarto doesn't support a before_chapter_script. One way to solve this is to use a setup code chunk at the start of each file. {See discussion](quarto-dev/quarto-cli#997)

{r, file = "R/webex.R", include = FALSE}

Maybe it is possible to create a add-to-quarto function.

@debruine
Copy link
Member

Sorry, I keep meaning to update this, but I'm spending a whole week with @Lakens next week to work on an R package for making quarto textbooks in @PsyTeachR style, and this is on my to do list for that.

@debruine debruine self-assigned this Mar 28, 2023
@debruine
Copy link
Member

Add the following code to the .Rprofile file in your project (you may need to make one) to load the webex functions before every chapter:

source("R/webex.R")

Also, you may need to add the following code to the top of include/webex.js, as quarto documents don't always use jquery like rmarkdown documents do.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>

@debruine
Copy link
Member

The newest version of webexercises on CRAN now has quarto support!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants