carpentries / sandpaper

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

Fix callout block CSS classes #574

Closed froggleston closed 4 months ago

froggleston commented 4 months ago

This PR addresses #470 and https://github.com/carpentries/workbench/issues/81.

pandoc2 does not exhibit this behaviour, whereas pandoc3 does.

The fix_callouts function now checks for both divs with specific callout types (discussion, challenge, etc) as well as single class callout types (which represents all basic callouts that are not one of these specific types).

pandoc 2.19:

image image

pandoc 3.1.11:

image image

froggleston commented 4 months ago

Pretty sure this is failing due to R 4.3.3 / unstable...

Edit: seems to be confirmed when looking at a previous failing PR where the latest release Ubuntu tests passed with 4.3.2 https://github.com/carpentries/sandpaper/actions/runs/7834017066/job/21376323560?pr=572 compared with 4.3.3 failing here.

tobyhodges commented 4 months ago

I'm sorry to say that this doesn't seem to have fixed the problem on my local system @froggleston

Screenshot 2024-03-01 at 10 05 17

Session output copied below. My Pandoc version is 3.1.6

``` > sandpaper::serve() ℹ Rebuilding /Users/hodges/Documents/Carpentries/lesson-development-training ── Validating Fenced Divs ──────────────────────────────────────────────────────────── ── Validating Internal Links and Images ────────────────────────────────────────────── ! There were errors in 1/272 links ◌ Links must use HTTPS LICENSE.md:77 [needs HTTPS]: [Community Initiatives](http://communityin.org/) ◉ All files up-to-date; nothing to rebuild! ◉ pandoc found version : 3.1.6 path : /usr/local/bin -- Initialising site ----------------------------------------------------------------- ── Scanning episodes to rebuild ────────────────────────────────────────────────────── Writing 'instructor/CODE_OF_CONDUCT.html' Writing 'CODE_OF_CONDUCT.html' ! No yaml header found in the first 10 lines of /Users/hodges/Documents/Carpentries/lesson-development-training/site/built/GOVERNANCE.md Writing 'instructor/GOVERNANCE.html' Writing 'GOVERNANCE.html' Writing 'instructor/LICENSE.html' Writing 'LICENSE.html' Writing 'instructor/introduction.html' Writing 'introduction.html' Writing 'instructor/lesson-design.html' Writing 'lesson-design.html' Writing 'instructor/audience.html' Writing 'audience.html' Writing 'instructor/short-break1.html' Writing 'short-break1.html' Writing 'instructor/objectives.html' Writing 'objectives.html' Writing 'instructor/episodes.html' Writing 'episodes.html' Writing 'instructor/long-break1.html' Writing 'long-break1.html' Writing 'instructor/infrastructure.html' Writing 'infrastructure.html' Writing 'instructor/short-break2.html' Writing 'short-break2.html' Writing 'instructor/episode-objectives.html' Writing 'episode-objectives.html' Writing 'instructor/short-break3.html' Writing 'short-break3.html' Writing 'instructor/formative-assessment.html' Writing 'formative-assessment.html' Writing 'instructor/wrap-up1.html' Writing 'wrap-up1.html' Writing 'instructor/exercises.html' Writing 'exercises.html' Writing 'instructor/short-break4.html' Writing 'short-break4.html' Writing 'instructor/narrative.html' Writing 'narrative.html' Writing 'instructor/long-break2.html' Writing 'long-break2.html' Writing 'instructor/explanation.html' Writing 'explanation.html' Writing 'instructor/short-break5.html' Writing 'short-break5.html' Writing 'instructor/operations.html' Writing 'operations.html' Writing 'instructor/preparing.html' Writing 'preparing.html' Writing 'instructor/wrap-up2.html' Writing 'wrap-up2.html' Writing 'instructor/reflecting.html' Writing 'reflecting.html' Writing 'instructor/short-break6.html' Writing 'short-break6.html' Writing 'instructor/collaborating-team.html' Writing 'collaborating-team.html' Writing 'instructor/long-break3.html' Writing 'long-break3.html' Writing 'instructor/collaborating-newcomers.html' Writing 'collaborating-newcomers.html' Writing 'instructor/project-management.html' Writing 'project-management.html' Writing 'instructor/wrap-up3.html' Writing 'wrap-up3.html' Writing 'instructor/pilot-description.html' Writing 'pilot-description.html' Writing 'instructor/markdown-github-primer.html' Writing 'markdown-github-primer.html' Writing 'instructor/trial-runs.html' Writing 'trial-runs.html' Writing 'instructor/reference.html' Writing 'reference.html' ── Creating 404 page ───────────────────────────────────────────────────────────────── Writing 'instructor/404.html' Writing '404.html' ── Creating learner profiles ───────────────────────────────────────────────────────── Writing 'instructor/profiles.html' Writing 'profiles.html' ── Creating homepage ───────────────────────────────────────────────────────────────── Writing 'instructor/index.html' Writing 'index.html' ── Creating keypoints summary ──────────────────────────────────────────────────────── Writing 'instructor/key-points.html' Writing 'key-points.html' ── Creating All-in-one page ────────────────────────────────────────────────────────── Writing 'instructor/aio.html' Writing 'aio.html' ── Creating Images page ────────────────────────────────────────────────────────────── Writing 'instructor/images.html' Writing 'images.html' ── Creating Instructor Notes ───────────────────────────────────────────────────────── Writing 'instructor/instructor-notes.html' Writing 'instructor-notes.html' ── Creating sitemap.xml ────────────────────────────────────────────────────────────── Output created: /Users/hodges/Documents/Carpentries/lesson-development-training/site/docs/index.html To stop the server, run servr::daemon_stop(1) or restart your R session Serving the directory /Users/hodges/Documents/Carpentries/lesson-development-training/site/docs at http://127.0.0.1:4321 Warning messages: 1: No section called ‘questions’ 2: No section called ‘questions’ 3: No section called ‘questions’ 4: No section called ‘questions’ 5: No section called ‘questions’ 6: No section called ‘questions’ 7: No section called ‘questions’ 8: No section called ‘questions’ 9: No section called ‘questions’ > session_info() ─ Session info ───────────────────────────────────────────────────────────────────── setting value version R version 4.3.2 (2023-10-31) os macOS Ventura 13.6.1 system aarch64, darwin20 ui RStudio language (EN) collate en_US.UTF-8 ctype en_US.UTF-8 tz Europe/Berlin date 2024-03-01 rstudio 2023.12.0+369 Ocean Storm (desktop) pandoc 3.1.6 @ /usr/local/bin/ (via rmarkdown) ─ Packages ───────────────────────────────────────────────────────────────────────── package * version date (UTC) lib source askpass 1.2.0 2023-09-03 [1] CRAN (R 4.3.0) assertthat 0.2.1 2019-03-21 [1] CRAN (R 4.3.0) cachem 1.0.8 2023-05-01 [1] CRAN (R 4.3.0) callr 3.7.5 2024-02-19 [1] CRAN (R 4.3.1) cli 3.6.2 2023-12-11 [1] CRAN (R 4.3.1) commonmark 1.9.1 2024-01-30 [1] CRAN (R 4.3.1) credentials 2.0.1 2023-09-06 [1] CRAN (R 4.3.0) curl 5.2.0 2023-12-08 [1] CRAN (R 4.3.1) desc 1.4.3 2023-12-10 [1] CRAN (R 4.3.1) devtools * 2.4.5 2022-10-11 [1] CRAN (R 4.3.0) digest 0.6.34 2024-01-11 [1] CRAN (R 4.3.1) downlit 0.4.3 2023-06-29 [1] CRAN (R 4.3.0) dplyr 1.1.4 2023-11-17 [1] CRAN (R 4.3.1) ellipsis 0.3.2 2021-04-29 [1] CRAN (R 4.3.0) evaluate 0.23 2023-11-01 [1] CRAN (R 4.3.1) fansi 1.0.6 2023-12-08 [1] CRAN (R 4.3.1) fastmap 1.1.1 2023-02-24 [1] CRAN (R 4.3.0) fs 1.6.3 2023-07-20 [1] CRAN (R 4.3.0) generics 0.1.3 2022-07-05 [1] CRAN (R 4.3.0) gert 2.0.1 2023-12-04 [1] CRAN (R 4.3.1) glue 1.7.0 2024-01-09 [1] CRAN (R 4.3.1) htmltools 0.5.7 2023-11-03 [1] CRAN (R 4.3.1) htmlwidgets 1.6.4 2023-12-06 [1] CRAN (R 4.3.1) httpuv 1.6.14 2024-01-26 [1] CRAN (R 4.3.1) jsonlite 1.8.8 2023-12-04 [1] CRAN (R 4.3.1) knitr 1.45 2023-10-30 [1] CRAN (R 4.3.1) later 1.3.2 2023-12-06 [1] CRAN (R 4.3.1) lifecycle 1.0.4 2023-11-07 [1] CRAN (R 4.3.1) magrittr 2.0.3 2022-03-30 [1] CRAN (R 4.3.0) memoise 2.0.1 2021-11-26 [1] CRAN (R 4.3.0) mime 0.12 2021-09-28 [1] CRAN (R 4.3.0) miniUI 0.1.1.1 2018-05-18 [1] CRAN (R 4.3.0) openssl 2.1.1 2023-09-25 [1] CRAN (R 4.3.1) pegboard 0.7.3 2024-03-01 [1] Github (carpentries/pegboard@1bc5753) pillar 1.9.0 2023-03-22 [1] CRAN (R 4.3.0) pkgbuild 1.4.3 2023-12-10 [1] CRAN (R 4.3.1) pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.3.0) pkgdown 2.0.7 2022-12-14 [1] CRAN (R 4.3.0) pkgload 1.3.4 2024-01-16 [1] CRAN (R 4.3.1) processx 3.8.3 2023-12-10 [1] CRAN (R 4.3.1) profvis 0.3.8 2023-05-02 [1] CRAN (R 4.3.0) promises 1.2.1 2023-08-10 [1] CRAN (R 4.3.0) ps 1.7.6 2024-01-18 [1] CRAN (R 4.3.1) purrr 1.0.2 2023-08-10 [1] CRAN (R 4.3.0) R6 2.5.1 2021-08-19 [1] CRAN (R 4.3.0) Rcpp 1.0.12 2024-01-09 [1] CRAN (R 4.3.1) remotes 2.4.2.1 2023-07-18 [1] CRAN (R 4.3.0) renv 1.0.4 2024-02-21 [1] CRAN (R 4.3.1) rlang 1.1.3 2024-01-10 [1] CRAN (R 4.3.1) rmarkdown 2.25 2023-09-18 [1] CRAN (R 4.3.1) rprojroot 2.0.4 2023-11-05 [1] CRAN (R 4.3.1) rstudioapi 0.15.0 2023-07-07 [1] CRAN (R 4.3.0) sandpaper * 0.16.2 2024-03-01 [1] Github (carpentries/sandpaper@8092d03) servr 0.29 2024-02-09 [1] CRAN (R 4.3.1) sessioninfo 1.2.2 2021-12-06 [1] CRAN (R 4.3.0) shiny 1.8.0 2023-11-17 [1] CRAN (R 4.3.1) stringi 1.8.3 2023-12-11 [1] CRAN (R 4.3.1) stringr 1.5.1 2023-11-14 [1] CRAN (R 4.3.1) sys 3.4.2 2023-05-23 [1] CRAN (R 4.3.0) tibble 3.2.1 2023-03-20 [1] CRAN (R 4.3.0) tidyselect 1.2.0 2022-10-10 [1] CRAN (R 4.3.0) tinkr 0.2.0 2024-03-01 [1] Github (ropensci/tinkr@a5dd3dd) urlchecker 1.0.1 2021-11-30 [1] CRAN (R 4.3.0) usethis * 2.2.3 2024-02-19 [1] CRAN (R 4.3.1) utf8 1.2.4 2023-10-22 [1] CRAN (R 4.3.1) varnish 1.0.1 2024-02-12 [1] https://carpentries.r-universe.dev (R 4.3.2) vctrs 0.6.5 2023-12-01 [1] CRAN (R 4.3.1) whisker 0.4.1 2022-12-05 [1] CRAN (R 4.3.0) withr 3.0.0 2024-01-16 [1] CRAN (R 4.3.1) xfun 0.42 2024-02-08 [1] CRAN (R 4.3.1) xml2 1.3.6 2023-12-04 [1] CRAN (R 4.3.1) xslt 1.4.4 2023-02-21 [1] CRAN (R 4.3.0) xtable 1.8-4 2019-04-21 [1] CRAN (R 4.3.0) yaml 2.3.8 2023-12-11 [1] CRAN (R 4.3.1) [1] /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library ──────────────────────────────────────────────────────────────────────────────────── ```
froggleston commented 4 months ago

Can you double check your sandpaper version @tobyhodges ? My local build seems to work:

image

> pandoc::pandoc_activate("3.1.11")
> devtools::install_github("carpentries/varnish@1.0.1", force = TRUE)
> library(varnish)
> devtools::install_github("carpentries/sandpaper@8092d03", force = TRUE)
> library(sandpaper)
> sandpaper::serve("./lesson-development-training/")
session_info() ``` bash ─ Session info ─────────────────────────────────────────── setting value version R version 4.3.2 (2023-10-31) os Ubuntu 20.04.6 LTS system x86_64, linux-gnu ui X11 language (EN) collate C.UTF-8 ctype C.UTF-8 tz Europe/London date 2024-03-01 pandoc 3.1.11 @ /home/froggleston/.local/share/r-pandoc/3.1.11/ (via rmarkdown) ─ Packages ──────────────────────────────────────────── package * version date (UTC) lib source assertthat 0.2.1 2019-03-21 [1] CRAN (R 4.3.0) cachem 1.0.8 2023-05-01 [1] CRAN (R 4.3.0) callr 3.7.5 2024-02-19 [1] CRAN (R 4.3.0) cli 3.6.2 2023-12-11 [1] RSPM (R 4.3.0) curl 5.2.0 2023-12-08 [1] RSPM (R 4.3.0) desc 1.4.3 2023-12-10 [1] RSPM (R 4.3.0) devtools * 2.4.5.9000 2023-06-23 [1] Github (r-lib/devtools@69d6104) digest 0.6.34 2024-01-11 [1] RSPM (R 4.3.0) ellipsis 0.3.2 2021-04-29 [1] CRAN (R 4.3.0) evaluate 0.23 2023-11-01 [1] RSPM (R 4.3.0) fansi 1.0.6 2023-12-08 [1] RSPM (R 4.3.0) fastmap 1.1.1 2023-02-24 [1] CRAN (R 4.3.0) fs 1.6.3 2023-07-20 [1] RSPM (R 4.3.0) glue 1.7.0 2024-01-09 [1] RSPM (R 4.3.0) htmltools 0.5.7 2023-11-03 [1] RSPM (R 4.3.0) htmlwidgets 1.6.4 2023-12-06 [1] RSPM (R 4.3.0) httpuv 1.6.14 2024-01-26 [1] RSPM (R 4.3.0) knitr 1.45 2023-10-30 [1] RSPM (R 4.3.0) later 1.3.2 2023-12-06 [1] RSPM (R 4.3.0) lifecycle 1.0.4 2023-11-07 [1] RSPM (R 4.3.0) magrittr 2.0.3 2022-03-30 [1] CRAN (R 4.3.0) memoise 2.0.1 2021-11-26 [1] CRAN (R 4.3.0) mime 0.12 2021-09-28 [1] CRAN (R 4.3.0) miniUI 0.1.1.1 2018-05-18 [1] CRAN (R 4.3.0) pandoc 0.2.0 2023-08-24 [1] RSPM (R 4.3.0) pillar 1.9.0 2023-03-22 [1] CRAN (R 4.3.0) pkgbuild 1.4.3 2023-12-10 [1] RSPM (R 4.3.0) pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.3.0) pkgload 1.3.4 2024-01-16 [1] RSPM (R 4.3.0) processx 3.8.3 2023-12-10 [1] RSPM (R 4.3.0) profvis 0.3.8 2023-05-02 [1] CRAN (R 4.3.0) promises 1.2.1 2023-08-10 [1] RSPM (R 4.3.0) ps 1.7.6 2024-01-18 [1] RSPM (R 4.3.0) purrr 1.0.2 2023-08-10 [1] CRAN (R 4.3.0) R6 2.5.1 2021-08-19 [1] CRAN (R 4.3.0) rappdirs 0.3.3 2021-01-31 [1] CRAN (R 4.3.0) Rcpp 1.0.12 2024-01-09 [1] RSPM (R 4.3.0) remotes 2.4.2.1 2023-07-18 [1] RSPM (R 4.3.0) rlang 1.1.3 2024-01-10 [1] RSPM (R 4.3.0) rmarkdown 2.25 2023-09-18 [1] RSPM (R 4.3.0) sandpaper * 0.16.2 2024-03-01 [1] Github (carpentries/sandpaper@8092d03) sessioninfo 1.2.2 2021-12-06 [1] CRAN (R 4.3.0) shiny 1.8.0 2023-11-17 [1] RSPM (R 4.3.0) stringi 1.8.3 2023-12-11 [1] RSPM (R 4.3.0) stringr 1.5.1 2023-11-14 [1] RSPM (R 4.3.0) tibble 3.2.1 2023-03-20 [1] CRAN (R 4.3.0) urlchecker 1.0.1 2021-11-30 [1] CRAN (R 4.3.0) usethis * 2.2.3 2024-02-19 [1] CRAN (R 4.3.0) utf8 1.2.4 2023-10-22 [1] RSPM (R 4.3.0) varnish * 1.0.1 2024-03-01 [1] Github (carpentries/varnish@3079f59) vctrs 0.6.5 2023-12-01 [1] RSPM (R 4.3.0) withr 3.0.0 2024-01-16 [1] RSPM (R 4.3.0) xfun 0.42 2024-02-08 [1] RSPM (R 4.3.0) xtable 1.8-4 2019-04-21 [1] CRAN (R 4.3.0) ```
tobyhodges commented 4 months ago

Indeed I had the correct version of sandpaper installed, but it looks like it was a caching issue. Everything looking good on my end now.

Screenshot 2024-03-01 at 13 34 47
Bisaloo commented 4 months ago

I have deployed this fix on our internal fork and it seems to be working perfectly! Thanks!

https://epiverse-trace.github.io/tutorials-late/

Before

Screenshot 2024-03-05 at 16-54-02 Scenario modelling for outbreak analytics with R Summary and Setup

Now

Screenshot 2024-03-05 at 17-00-00 Scenario modelling for outbreak analytics with R Summary and Setup

froggleston commented 4 months ago

Awesome - I'll get these PRs merged and a hotfix release pushed out today or tomorrow! Thanks again for the help and testing!

froggleston commented 4 months ago

This still fails due to the r-hub resolver resolving the Windows 3.6.3 release to an incorrect URL (it should redirect to the CRAN archive, but doesn't).

ndporter commented 4 months ago

I'm still seeing the problem throughout the instructor training as rendered, even after refreshing the page. Do we need to do something on Git to force the site to rebuild and resolve this? And if so, do we need to send something out to maintainers on all lessons to ensure it's implemented?

Apologies if I'm missing something obvious about sandpaper and the update. I readily admit that though I write and teach a lot of code, my skills are very hacky and as-needed.