carpentries / sandpaper

User Interface for The Carpentries Workbench
https://carpentries.github.io/sandpaper
Other
41 stars 26 forks source link

the "IMPORTANT NOTE" callout obscures code boxes in some lessons #456

Closed jlahne closed 1 year ago

jlahne commented 1 year ago

I apologize as I am not including a reprex; I am not sure how to do so with the below issue, which is transferred from the datacarpentry/r-socialsci Issues page:


It seems like the new callout (IMPORTANT NOTE) format is interfering with the content of some code chunks. In line 231 of lesson 6 of the R for Social Scientists of Episode 6 (R Markdown) there should be a setup chunk that pulls in the SAFI_clean.csv file, but in both Firefox and Safari it is obscured in the code chunk, regardless of window size (screenshot attached).

Screenshot 2023-05-15 at 1 19 54 PM

I can't figure out how to fix this (hence no pull request), as it has to do with the HTML/CSS template.

zkamvar commented 1 year ago

This has to do with mixing markdown and HTML in a time when it was not very easy to demonstrate a code chunk using R Markdown without it evaulating (for example, this allowed R Markdown to pass over the chunk unevaluated, see https://github.com/carpentries/lesson-transition/issues/51).

The solution is to convert those demonstrated code chunks to use the verbatim code chunk engine (using four ` characters instead of 3 for the outer fences). This way, they will render as markdown in the final output and they are easier to read in the source:

-<pre>
-&#96;&#96;&#96;{r setup, include = FALSE}
+````{verbatim, lang = "markdown"}
+```{r setup, include = FALSE}
library(tidyverse)
library(here)
interviews <- read_csv(here("data/SAFI_clean.csv"), na = "NULL")
+```
+````
-&#96;&#96;&#96;
-</pre>
jlahne commented 1 year ago

Thanks, @zkamvar! I have gone back to the original thread on datacarpentry/r-socialsci and asked if a more experienced contributor can implement the change.

zkamvar commented 1 year ago

Consider this was addressed in the lesson, I will close this issue as resolved. Feel free to re-open if this is still a problem.