carpentries / lesson-transition

Workflow for transitioning lessons to The Carpentries Workbench
https://carpentries.github.io/workbench/transition-schedule.html
MIT License
2 stars 6 forks source link

librarycarpentry/lc-marcedit #64

Closed zkamvar closed 1 year ago

zkamvar commented 1 year ago

tracking issue for https://github.com/librarycarpentry/lc-marcedit

✔ Converting 'librarycarpentry/lc-marcedit/_episodes/09-regular-expressions.md' to sandpaper ... done

! Some math could not be parsed... likely because of shell variable examples
ℹ Below is the error
! Inline math delimiters are not balanced.

HINT: If you are writing BASIC code, make sure you wrap variable
      names and code in backtics like so: `INKEY$`.

Below are the pairs that were found:
                                                                                                                                                                                                                                                                                                                                                                                                                             start...end
                                                                                                                                                                                                                                                                                                                                                                                                                             -----...---
                                                                                                                                                                                                                                                                                                                                  For example:  =035  \\$a(SFUonline)638023 would have become =035  \\$a(SFU(OCoLC)line)638023...
                                                                                                                                                                                                                                                                                                                                                                                                                     (=090  \\$a...
                                                                                                                                                                                                                                                                                                                                                                                                                     (=090  \\$a...
                                                                                                                                                                                                      will match the literal string =090  \$a (the additional backslashes are used to escape the regex metacharacters \ and $ so that they will be read as literals) followed by any single capital letter in the range A to Z (...
                                                                                                                                                                                                                                                                                                                                                                                                                             $1 $2...
This regular expression refers back to the groups we defined and captured in the Find box. $1 refers to the group defined in the first set of brackets, and $2 refers to the group defined in the second set of brackets. If we had defined additional groups they would be referred to chronologically as $3, $4 etc. The regular expression $1 $2 will output the contents of the two captured groups with a space between them....
                                                                                                                                                                                                                                                                                In this example we want to add the electronic journals genre form (655  \\4$aElectronic journals) to our electronic continuing resource records....
                                                                                                                                                                                                                                       Now that we've isolated our continuing resource records, we can add a field for the electronic journals genre form (655  \4$aElectronic journals) to the electronic records in our subset....
                                                                                                                                                                                       In the Batch Editing window, enter 655 in the Field box and enter \4$aElectronic journals in the Field Data Box. Under General Options select Use Regular Expression, and under Add Field Options select Add Field If Present/NOT Present....
ℹ Writing ''sandpaper/librarycarpentry/lc-marcedit/episodes'/'09-regular-expressions.md''
✔ Writing ''sandpaper/librarycarpentry/lc-marcedit/episodes'/'09-regular-expressions.md'' ... done

ℹ Committing...
ℹ Running '/home/zhian/Documents/Carpentries/Git/carpentries/lesson-transition/librarycarpentry/lc-marcedit.R'
ℹ Consent for package cache revoked. Use `use_package_cache()` to undo.
── Validating Fenced Divs ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
── Validating Internal Links and Images ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
! There were errors in 12/92 links
◌ Some linked internal files do not exist
◌ Images need alt-text <https://webaim.org/techniques/hypertext/link_text#alt_link>

episodes/04-layout-of-the-MarcEditor.md:29 [image missing alt-text]: fig/topLevelFeatures_marcEditor.PNG
episodes/06-manipulating-MARC-data.md:31 [missing file]: [](../fig/addDeleteField.png) [image missing alt-text]: ../fig/addDeleteField.png
episodes/06-manipulating-MARC-data.md:32 [missing file]: [](../fig/example_addDelete.png) [image missing alt-text]: ../fig/example_addDelete.png
episodes/06-manipulating-MARC-data.md:88 [missing file]: [](../fig/editSubfield.png) [image missing alt-text]: ../fig/editSubfield.png
episodes/06-manipulating-MARC-data.md:88 [missing file]: [](../fig/example_Subfield.png) [image missing alt-text]: ../fig/example_Subfield.png
episodes/06-manipulating-MARC-data.md:120 [image missing alt-text]: https://github.com/LibraryCarpentry/lc-marcedit/blob/gh-pages/fig/buildNewField.png
episodes/06-manipulating-MARC-data.md:145 [missing file]: [](../fig/editIndicators.png) [image missing alt-text]: ../fig/editIndicators.png
episodes/06-manipulating-MARC-data.md:145 [missing file]: [](../fig/example_editIndicators.png) [image missing alt-text]: ../fig/example_editIndicators.png
episodes/06-manipulating-MARC-data.md:166 [missing file]: [](../fig/rdaHelper.png) [image missing alt-text]: ../fig/rdaHelper.png
episodes/06-manipulating-MARC-data.md:186 [missing file]: [](../fig/fixedFields.png) [image missing alt-text]: ../fig/fixedFields.png
episodes/06-manipulating-MARC-data.md:201 [missing file]: [](../fig/selectRecordsForEdit.png) [image missing alt-text]: ../fig/selectRecordsForEdit.png
episodes/06-manipulating-MARC-data.md:201 [missing file]: [](../fig/example_selectRecordsForEdit.png) [image missing alt-text]: ../fig/example_selectRecordsForEdit.png
zkamvar commented 1 year ago

no longer active. can delete

zkamvar commented 1 year ago

@tobyhodges can you confirm that this lesson is not to be processed? it's on the LC website and it was last updated in Feburary.

tobyhodges commented 1 year ago

This one should be converted.

tobyhodges commented 1 year ago

I am taking care of wrapping regexs in backticks

ostephens commented 1 year ago

I've done a PR for the alt text but I'm unclear about the missing file issues as these look OK to me (and render fine with make serve locally)

@zkamvar @tobyhodges do you have any ideas why those missing file issues are generated?

I've added to the PR to change some of the image file extensions from upper to lower case as I seem to remember that can cause some issues sometimes - but the ones affected don't seem to be the ones generating errors

zkamvar commented 1 year ago

I've done a PR for the alt text but I'm unclear about the missing file issues as these look OK to me (and render fine with make serve locally)

@zkamvar @tobyhodges do you have any ideas why those missing file issues are generated?

Hi @ostephens, this is due to the way these images were placed in the lesson: they use HTML <img> tags instead of markdown. The images for The Workbench live inside of the episodes/fig/ directory, so the path ../fig/ is changed to fig/ in the transition. However, my parser did not anticipate raw HTML tags for images and thus, did not catch those.

That being said, it is not too difficult for me to process these in my workflow, so you shouldn't have to manually update these if you do not want to.

I've added to the PR to change some of the image file extensions from upper to lower case as I seem to remember that can cause some issues sometimes - but the ones affected don't seem to be the ones generating errors

These actually do not cause problems. As long as you correctly name them in the lesson text, they will be found.

ostephens commented 1 year ago

Thanks @zkamvar - I can fix those to use markdown but currently the <img> seems to be used to enable setting a width on the images. Not sure why tbh

What's the usual practice on images (should we be sizing the images to a particular size?)

zkamvar commented 1 year ago

What's the usual practice on images (should we be sizing the images to a particular size?)

Don't worry about converting these. I can do so in my workflow. Thank you for adding the alt text. That was something I could not automatically do.

zkamvar commented 1 year ago

And WRT to usual practice for image sizes: set a width to a percentage of the viewport, not a particular number of pixels (e.g. width="66%"), this allows the image to scale for tablet and mobile devices.

That being said, the Workbench is pretty good about width, so I'm going to remove the width parameter when I transform them.

If you want to re-add width after the transition, you there are instructions in the workbench documentation: https://carpentries.github.io/sandpaper-docs/example.html#figures

ostephens commented 1 year ago

I've actually gone ahead and created a PR anyway https://github.com/LibraryCarpentry/lc-marcedit/pull/66

That's merged - so hopefully that fixes the remaining issues for you

zkamvar commented 1 year ago

Thank you. I will check it later today.

zkamvar commented 1 year ago

@ostephens, I re-ran, but I ran into errors in Episodes 6 and 7 (which should be fixed by https://github.com/LibraryCarpentry/lc-marcedit/pull/67). The episodes ended up being untransitioned and I think that's why we saw the link errors. Once https://github.com/LibraryCarpentry/lc-marcedit/pull/67 is merged, I will try again.

zkamvar commented 1 year ago

I can confirm that https://github.com/LibraryCarpentry/lc-marcedit/pull/67 fixed the link issues

zkamvar commented 1 year ago

this has been completed in 122c8d6a04425badf273d9d0f1bd982f8bda0cd5