carpentries / sandpaper

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

Empty learners/setup.md causes Error in UseMethod("xml_find_all") #339

Open SaraMorsy opened 1 year ago

SaraMorsy commented 1 year ago

Hi there, I hope you are fine. GitHub page Deployment failed and here is the error message. I was trying to change summary and setup to the title of the course image

Error in UseMethod("xml_find_all") : no applicable method for 'xml_find_all' applied to an object of class "xml_document"

How to solve this problem? Here is the full report https://github.com/SaraMorsy/FAIR/actions/runs/3098953110/jobs/5017496308

Thank you in advance!

zkamvar commented 1 year ago

Hi Sara,

For my own future context, here is the output of the run (because they disappear in a month)

error output ``` Build Lesson Website ◉ pandoc found version : 2.11.4 path : '/usr/bin' -- Initialising site ----------------------------------------------------------- ── Scanning episodes to rebuild ──────────────────────────────────────────────── Writing 'instructor/01-ep.html' Writing '01-ep.html' ── Creating learner profiles ─────────────────────────────────────────────────── ── Creating homepage ─────────────────────────────────────────────────────────── Error in UseMethod("xml_find_all") : no applicable method for 'xml_find_all' applied to an object of class "xml_document" Calls: ... build_home -> fix_nodes -> fix_headings -> In addition: Warning message: No section called ‘questions’ Running git worktree remove --force /home/runner/work/FAIR/FAIR/site/docs Running git worktree remove --force /home/runner/work/FAIR/FAIR/site/built Execution halted Error: Process completed with exit code 1. ```

Thank you for this report! It turns out that there was a bug if the setup document had no content. The current workaround is to put some content in the setup document. Moving the "prerequisites" section into the setup document would work. I will open an issue to fix this to at least make the error message more clear.

I was trying to change summary and setup to the title of the course

at the moment, these titles are hard-coded (as shown in build_home()) into the navbar since the setup document is appended to the index:

https://github.com/carpentries/sandpaper/blob/3a9ec4676a92167108c4c447cdb98cdc6bc6ebc6/R/build_home.R#L26-L33

The reason for this is that I want to provide a clear signpost for the setup instructions and the title already exists on the top navigation.

That being said, I'm open to having a custom title in the index affect the title of the index page, but I want to make sure it will include the relevant information for the appended pages, so for example, if you set your title in the index to "FAIR Data in the Life Sciences", the title on the navigation bar will be "FAIR Data in the Life Sciences Setup." What do you think?

SaraMorsy commented 1 year ago

Thank you for your response! It is fixed. :partying_face: I edited the sandpaper and it also worked.

My point here for library carpentry format
usually, no need for setup instructions because it is more related to data management principles, not coding.

Summary and setup can be confusing here for our audience (biologists) that's why I wanted to change it so instead of summary and setup it would be the title of the course showing the objectives and outlines of the course What do you think?

image

zkamvar commented 1 year ago

Thank you for your response! It is fixed. :partying_face: I edited the sandpaper and it also worked.

Glad to hear it!

My point here for library carpentry format usually, no need for setup instructions because it is more related to data management principles, not coding.

Summary and setup can be confusing here for our audience (biologists) that's why I wanted to change it so instead of summary and setup it would be the title of the course showing the objectives and outlines of the course What do you think?

This is a good point (which also highlights one of the reasons why we are doing a beta phase of this instead of launching it unilaterally across our lessons immediately) and is also a perfect task for the future lesson infrastructure committee! There are a couple of ways to go about this:

  1. change the setup for Library Carpentry lessons to read "Objectives and Outlines"
  2. allow the title for index.md to have precedence over "Summary and Setup" (e.g if you write title: "Fair Data in Life Science" or title: "Objectives and Outlines", then it will appear on your page as you wish).
  3. allow custom titles for both index.md and learners/setup.md so that they are combined to [index title] and [setup title]

The first option runs into the same problem as the original problem: the prescribed method does not fit with the cases needed (e.g. lc-git still needs a setup).

The second and third options work, but the third takes a bit more explaining, so I'm happy to go with the second.

The reason I did not put the title of the lesson in that slot in the first place is because it is a duplicate of the pagetitle and does not clearly state what the purpose of that particular page is.

SaraMorsy commented 1 year ago

I agree with you, I like the second option as well, I will try it and show you the results. Thank you!