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

Create separate method for rendering exercise HTML #673

Open
gadenbuie opened this issue Mar 11, 2022 · 0 comments
Open

Create separate method for rendering exercise HTML #673

gadenbuie opened this issue Mar 11, 2022 · 0 comments

Comments

@gadenbuie
Copy link
Member

I'm moving this to its own issue because it's a larger task than where I originally proposed it. In short, we could reduce complexity and improve extensibility and maintainability of the exercise components by

  1. Using the knitr hooks to create the exercise object and set required knitr chunk options
  2. Using a separate function to format the exercise component into its initial HTML format

Originally posted by @gadenbuie in #548 (comment)

I think the solution here is to remove the complexity around the knitr hooks. Instead of individually writing the tutorial support chunks, we should have the exercise chunk write all of the HTML for the exercise and then we'll disable any kind of output from the support chunks. In addition to simplifying the logic, this would let us re-use chunks between exercises.

Alternatively, if we decouple hints and solutions and let the shiny app control whether the solution button is present (and what that solution is), then we wouldn't even need to write the solution chunk html into the document.

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

1 participant