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

Refactor tutorial knitr hooks and set them in the tutorial format #599

Merged
merged 6 commits into from
Oct 15, 2021

Commits on Oct 15, 2021

  1. Refactor knit hooks into prep/install step

    `tutorial_knitr_options()` now prepares a list of knitr options with the knitr options and hooks that are used during the tutorial pre-render. This list is in the same format as the knitr options expected by `rmarkdown::output_format()` so we can set the knitr options directly in the `tutorial` output format.
    
    This ensures that the hooks are set for each `rmarkdown::render()` call. Previously, by only relying on `.onAttach()`, these hooks might be reset at the end of the first `render()` and wouldn't be re-installed for subsequent renders, resulting in the behavior seen in #598. I haven't removed the `.onAttach()` mechanism because it is still useful for catching learnr component usage outside of the `learnr::tutorial()` format.
    gadenbuie committed Oct 15, 2021
    Configuration menu
    Copy the full SHA
    fecefa4 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ea072ac View commit details
    Browse the repository at this point in the history
  3. Don't import {rmarkdown}

    gadenbuie committed Oct 15, 2021
    Configuration menu
    Copy the full SHA
    d320120 View commit details
    Browse the repository at this point in the history
  4. rewrite comment

    gadenbuie committed Oct 15, 2021
    Configuration menu
    Copy the full SHA
    31d3e7e View commit details
    Browse the repository at this point in the history
  5. Ensure knitr hooks are installed in run_tutorial()

    This is now redundant for `learnr::tutorial` documents, but required for tutorials that don't use the tutorial format
    gadenbuie committed Oct 15, 2021
    Configuration menu
    Copy the full SHA
    159fc27 View commit details
    Browse the repository at this point in the history
  6. Add NEWS item for #599

    gadenbuie committed Oct 15, 2021
    Configuration menu
    Copy the full SHA
    3e0fa2c View commit details
    Browse the repository at this point in the history