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

Add start to Coursera stuffs #171

Merged
merged 17 commits into from
Sep 2, 2021
Merged

Add start to Coursera stuffs #171

merged 17 commits into from
Sep 2, 2021

Conversation

cansavvy
Copy link
Collaborator

@cansavvy cansavvy commented Aug 31, 2021

Purpose/implementation Section

What changes are being implemented in this Pull Request?

This isn't quite working yet. It doesn't like the footer for some reason and the image file paths aren't what it wants either. Presumably it doesn't like the leanbuild::set_knitr_image_path() and I will need to adjust

Edit: Nope it wasn't this, it was that the css file I was referencing had file paths that were not relevant because the coursera renders have no TOC.

Describe your approach:

I borrowed a script I wrote for https://github.com/AlexsLemonade/refinebio-examples/blob/staging/scripts/render-notebooks.R
But adapted it to our needs in this repo.

The goal of the two scripts here is to output rendered htmls docs/coursera that can be linked from the github pages in Coursera.

Usage:

All that needs to happen is this command:

Rscript --vanilla scripts/render_all_coursera.R

This is related to #123

@cansavvy cansavvy mentioned this pull request Aug 31, 2021
@cansavvy
Copy link
Collaborator Author

Only problem left to resolve (that I know of) is that the darn videos aren't rendering properly.

@cansavvy
Copy link
Collaborator Author

cansavvy commented Aug 31, 2021

coursera.zip

Here's a preview of the output.

I'm also adding this to the render-bookdown.yml so github actions updates it automatically.

@carriewright11
Copy link
Member

Not bad, seems like a good start. :) I wonder why the videos aren't rendering...

@carriewright11
Copy link
Member

if it helps we could have these rendered in the leanpub repo - to avoid messing up the bookdown version, although I see that it seems to be ok

@cansavvy
Copy link
Collaborator Author

if it helps we could have these rendered in the leanpub repo - to avoid messing up the bookdown version, although I see that it seems to be ok

I thought about that but I think it's easier to do it here since we already set up GitHub pages.

@cansavvy
Copy link
Collaborator Author

I think I need to add a youtube conversion step so the url is the youtube "watch" url just like we do in leanbuild.

@cansavvy
Copy link
Collaborator Author

I think I need to add a youtube conversion step so the url is the youtube "watch" url just like we do in leanbuild.

I might just functionalize this step in leanbuild and then use it here.

@cansavvy
Copy link
Collaborator Author

cansavvy commented Sep 1, 2021

So the watch links make it take forever to load. As in I clicked on the html locally and it still is trying to load. 😱 5 minutes later.

@cansavvy
Copy link
Collaborator Author

cansavvy commented Sep 1, 2021

So I think the solution here is figure out what renders reliably in an html link and just have the converting function do that.

@cansavvy cansavvy removed the request for review from carriewright11 September 1, 2021 13:31
@cansavvy cansavvy self-assigned this Sep 1, 2021
@cansavvy
Copy link
Collaborator Author

cansavvy commented Sep 1, 2021

So in the html output files from Bookdown (which youtube works) vs the Coursera script one (which youtube doesn't) they look very different.

Whereas Coursera script output has something super long and jumbly nonsense:
Screen Shot 2021-09-01 at 12 13 15 PM

Bookdown render has something that is more intelligible:

<iframe src="https://www.youtube.com/embed/VOCYL-FNbr0" width="672" height="400px">
</iframe>

Just have to figure out what quirky thing is happening to make the coursera script output so jumbly.

@cansavvy
Copy link
Collaborator Author

cansavvy commented Sep 2, 2021

I've been fighting with these videos and have gotten some really weird renders. It's not clear to me what voodoo bookdown is doing different to get these videos to turn out right. I might just do something kinda hacky to get it work and call it a day. Then if I figure out a more elegant solution later I can come back to it.

@cansavvy
Copy link
Collaborator Author

cansavvy commented Sep 2, 2021

I've tried working with the bookdown render voodoo to just make a duplicate bookdown that doesn't have a TOC but they make it very hard to not have a TOC:

There are a few arguments of html_document() that have been hard-coded in gitbook() and you cannot change them: toc = TRUE (there must be a table of contents),
From: https://bookdown.org/yihui/bookdown/html.html

And I don't know enough CSS and Java to have it edit the end product myself. Seems like it should be simple but it is not so far.

My attempt of this strategy is on this branch: https://github.com/jhudsl/DaSL_Course_Template_Bookdown/tree/cansavvy/coursera-render-II

@cansavvy cansavvy changed the title In progress: Add start to Coursera stuffs Add start to Coursera stuffs Sep 2, 2021
@cansavvy cansavvy removed their assignment Sep 2, 2021
@cansavvy
Copy link
Collaborator Author

cansavvy commented Sep 2, 2021

This is as good as it will get until #174 is resolved but I've spent so much time on this that the bandaid fix from #175 will have to do for now.

…d with youtub (#175)

* Videos still broken

* It's not a great solution but it is a solution

* Get rid of stray file
@cansavvy cansavvy merged commit a405def into main Sep 2, 2021
@cansavvy cansavvy deleted the cansavvy/coursera-machinery branch September 9, 2021 18:44
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

Successfully merging this pull request may close these issues.

2 participants