jhudsl / ottrpal

Tools for converting OTTR courses into Leanpub or Coursera courses :otter:
https://jhudatascience.org/ottrpal/
GNU General Public License v3.0
3 stars 1 forks source link

Images are smaller than they used to be #64

Closed carriewright11 closed 2 years ago

carriewright11 commented 2 years ago

We think fullbleed argument got changed resulting in smaller images on Leanpub from our slides.

Old: Screen Shot 2021-09-24 at 2 55 38 PM

New: Screen Shot 2021-09-24 at 2 55 26 PM

carriewright11 commented 2 years ago

I think this part (highlighted as code) might just need to be added back to the build image function:

This is the old version: build_image = function(src, ..., caption = NULL, embed = NULL, fullbleed = FALSE, remove_resources_start = TRUE) { if (remove_resources_start) { src = gsub("^resources/", "", src) }

myenv = list(..., caption = caption, embed = embed, src = src) myenv = as.environment(myenv) x = c('alt: "{alt}",', 'height: "{height}",', 'width: "{width}",', 'align: "{align}"', 'embed: "{embed}"' ) if (is.null(fullbleed) || length(fullbleed) == 0 || fullbleed == "" || is.na(fullbleed)) { fullbleed = FALSE }

  x = sapply(x, glue::glue, .envir = myenv)
  x = unlist(sapply(x, as.character))
  x = c(x, if (fullbleed) 'fullbleed: true')
  x = paste(x, collapse = " ")
  x = paste0("{", x, "}\n")
  x = paste0(x, paste0("![", myenv$caption, "](", myenv$src, ")"))
  x

}

carriewright11 commented 2 years ago

or we could just decide to always do fullbleed = TRUE... but that seems like it might not work for Candace's icons that are really large already - but important for people to be able to see large enough versions of images that are more involved

carriewright11 commented 2 years ago

checking further in my old files with big images in Leanpub... images looked like this: {alt: "Learning Objectives:1)Know why diversity has been shown to be beneficial 2)Recognition about how certain groups are underrepresented in computational biology both as research participants and researchers 3)Research strategies to better support health equity 4) Know management strategies to better support a more diverse team of employees, mentees, and collaborators", width: "100%", align: "middle"}

Now it looks like this with the current leanbuild and looks smaller in leanpub. {alt: "Learning Objectives:1)Know why diversity has been shown to be beneficial 2)Recognition about how certain groups are underrepresented in computational biology both as research participants and researchers 3)Research strategies to better support health equity 4) Know management strategies to better support a more diverse team of employees, mentees, and collaborators", width: "100%", align: "middle",}

hmmm so otherwise this could be about the extra comma?

carriewright11 commented 2 years ago

I am going to try manually deleting the comma to test this.

carriewright11 commented 2 years ago

OK! commas are fine, order is fine. But the period at the end is not fine.

cansavvy commented 2 years ago

Looks like this is fixed? https://leanpub.com/courses/jhu/jhudsl_course_template/read/preview/3?preview=true#leanpub-auto-topic-of-section