nceas-learning-hub / coreRlessons

What the Package Does (Title Case)
Other
0 stars 0 forks source link

Lesson titles #2

Closed oharac closed 2 weeks ago

oharac commented 1 month ago

Currently, it looks like in the session_XX.qmd file, the YAML header includes a title for the lesson, e.g., session_01.qmd for the recent coreR looks like:

---
title: "Course Introduction"
title-block-banner: true
format:
  html:
    code-overflow: wrap
---

{{< include /sections/reproducibility-intro.qmd >}}

But, that title is nowhere to be found in reproducibility-intro.qmd so it looks like it has to be manually written for each session_XX.qmd document. To automate this, I think there are a few options, not sure exactly which will work best:

In any case, this would require updating most or all of the lesson qmds to explicitly include a title (and perhaps other metadata) - which I think is a good thing!

oharac commented 1 month ago

For the sample lessons, I simply added a YAML header (or modified if there already was one) to include a title: XXX field. When rendering the book, that title shows up in the nav bar and the top of the lesson. A nice clean solution!

I removed the title from the session_XX.qmd templates, since it is redundant.

camilavargasp commented 1 month ago

I successfully created a mock book! However, some of the titles are not working when I render the book using quarto preview Issues I'm seeing:

Example pic

image
oharac commented 1 month ago

Hmm, it didn't show up like that on mine... let me see if I can replicate here, otherwise we can take a look at yours on Monday?

camilavargasp commented 1 month ago

You can try cloning the repo I created and then run quarto preview on the terminal and see what happens.

oharac commented 1 month ago

I cloned your repo and get those same issues... It seems to be related to the YAML header if it has more than one line in it. Weird that it is inconsistent from one platform to another! I should try it on my Macbook instead of Windows to see if it's specific to Mac

oharac commented 1 month ago

Try updating your packages - devtools::install_github('nceas-learning-hub/coreR') and devtools::install_github('nceas-learning-hub/coreRlessons') - I can't get the problem to replicate when running my own repo, so maybe there's something hiding in one of the older .yml files or whatnot inside your repo if created from an older version of the package.

Once you've updated packages, you can delete the lessons, images, data folders, and then run coreR::setup_lessons(lessons = <selected lessons>, overwrite = TRUE) - see if it still happens for you!

oharac commented 2 weeks ago

Closing this for now - but will open a separate issue for important formatting things