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

Include learnr in Shiny Application #528

Closed
C4caesar opened this issue May 17, 2021 · 6 comments
Closed

Include learnr in Shiny Application #528

C4caesar opened this issue May 17, 2021 · 6 comments

Comments

@C4caesar
Copy link

Dear all,

I'm creating a shiny application. I want to include a learnr tutorial in my shiny application, however, I got an error of "Tutorial exercises require the use of 'runtime: shiny_prerendered'". My rMarkdown for the learnr already use runtime: shinyprerendered.
Could someone explain what happen here and what is the solution? Thank you very much.

Best regards,
C4caesar

@schloerke
Copy link
Collaborator

How are you trying to include the tutorial?

I would recommend an iframe of the tutorial within your shiny application. While the tutorial can not communicate with the shiny app, it is the easiest way to get the tutorial within the application.

@C4caesar
Copy link
Author

C4caesar commented May 17, 2021

Hi Schloerke, thanks for the reply.

I'm including the tutorial by firstly converting the Rmd file into md file.

image

And it raise the error requiring the use of shiny_prerendered (which the Rmd already set the runtime as shiny_prerendered).

For your suggestion using iframe, are you suggesting to first deploy the tutorial in an location and access it using the URL?

Thank you very much for your comment.

@schloerke
Copy link
Collaborator

includeMarkdown()

This is a function to render raw markdown, not .Rmd files.


are you suggesting to first deploy the tutorial in an location and access it using the URL

Correct.

If you'd like a dynamic tutorial location, you can use a shiny::uiOutput() definition that renders a dynamic tutorial url within an iframe tag.

@C4caesar
Copy link
Author

Thanks for your advice, appreciate that.

@C4caesar C4caesar closed this as completed Jun 4, 2022
@WickM
Copy link

WickM commented Oct 6, 2023

Hi @C4caesar,
I'm attempting to achieve a similar goal. I want to create a Shiny App with embedded learnr::tutorials. Instead of using an iframe, I'd prefer to deploy both the app and the tutorial seamlessly.
Have you succeeded in doing this? If so, could you please explain the process you followed? I'd greatly appreciate your insights.
Thank you!

@gadenbuie
Copy link
Member

gadenbuie commented Oct 6, 2023

I want to create a Shiny App with embedded learnr::tutorials. Instead of using an iframe, I'd prefer to deploy both the app and the tutorial seamlessly.

You can certainly make the tutorial appear to be included seamlessly by styling the <iframe>, but, unfortunately, you cannot directly include the components or logic of a learnr tutorial in a Shiny app. learnr tutorials are inherently tied to the learnr R Markdown format and rmarkdown's runtime: shinyrmd.

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

4 participants