Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

swcarpentry/python-novice-inflammation #22

Closed
8 tasks done
zkamvar opened this issue Mar 28, 2023 · 5 comments
Closed
8 tasks done

swcarpentry/python-novice-inflammation #22

zkamvar opened this issue Mar 28, 2023 · 5 comments
Labels
early transition Lesson maintainers have indicated that this lesson can transition early lesson A Carpentries Lesson To Transition status: ready This label is for lessons that are ready for transition to the workbench

Comments

@zkamvar
Copy link
Contributor

zkamvar commented Mar 28, 2023

This is an issue to track the parsing problems of swcarpentry/python-novice-inflammation as I build its R script.

  • alt text with two sets of quote types ([transformation] alt text with both single and double quotes has double-escaped double quotes pegboard#112) (fixed manually:
    # fix bum quotation
    numpy <- readLines(to("episodes/02-numpy.md"))
    numpy <- sub('[\\]{2}["]data[\\]{2}["]', "'data'", numpy)
    writeLines(numpy, to("episodes/02-numpy.md"))
  • unparsed links in setup.md (fixed maunally via [workbench transition] Update setup.md swcarpentry/python-novice-inflammation#1031)
  • hanging setup blocks in setup.md fixed manually:
    # fix wonky setup fields
    stp <- pegboard::Episode$new(to("learners/setup.md"))$confirm_sandpaper()
    cols <- paste(rep(":", 40), collapse = "")
    open <- paste(cols, '{.empty-div style="margin-bottom: 50px"}')
    empty_div <- c(open, "<!-- This div is intentionally empty to allow the solution to float alone-->", cols, "\n")
    find_node_position <- function(node, body) {
    children <- xml2::xml_children(body)
    which(purrr::map_lgl(children, identical, node))
    }
    solutions <- stp$get_divs() |>
    purrr::map(1) |>
    purrr::map_int(find_node_position, stp$body)
    positions <- solutions + (1L:length(solutions) - 1L) * 3
    purrr::walk(positions, function(i) stp$add_md(empty_div, where = i - 1L))
    write_out_md(stp, "learners")
  • missing episode links for 01-numpy and 04-files (changed to 02-numpy and 06-files)
  • some python-generated image files (grid-{01,02,03}.png) get caught by the filter (fixed in 42c51ae):
    # generated image files
    regex:^fig/.*[-][0-9]{1,2}.png$
    regex:^img/.*[-][0-9]{1,2}.png$
  • definition lists lose automatic linking. fixed manually:
    # add definition list links back into reference -----------------
    ref_lines <- readLines(to("learners/reference.md"))
    defs <- which(startsWith(ref_lines, ":")) - 1L
    # get identifiers from pandoc
    headings <- pandoc::pandoc_convert(text = paste("#", ref_lines[defs]), to = "html")
    ids <- paste(headings, collapse = "\n")
    ids <- xml2::xml_text(xml2::xml_find_all(xml2::read_html(ids), ".//h1/@id"))
    ref_lines[defs] <- sprintf("[%s]{#%s}", ref_lines[defs], ids)
    writeLines(ref_lines, to("learners/reference.md"))

After the updates to the link processing (which invalidated the fixes I made earlier)

  • missing file (04-files.html) moved to 06-files.html
  • missing file (01-numpy.html) moved to 02-numpy.html
episodes/11-debugging.md:93 [missing file]: [opening lesson](01-numpy.html)
episodes/12-cmdline.md:707 [missing file]: [earlier](04-files.html)
index.md:34 [missing file]: [](fig/lesson-overview.svg)
index.md:39 [missing file]: [comma-separated values](reference.html#comma-separated-values)
instructors/instructor-notes.md:102 [missing file]: [NumPy topic](01-numpy.html)
learners/discuss.md:310 [image missing alt-text]: fig/ipythonblocks_show_color_example.png
learners/reference.md:286 [missing anchor]: [floating-point](#float)
@zkamvar
Copy link
Contributor Author

zkamvar commented Mar 30, 2023

Note about the unparsed links in the setup.md: this is a symptom of the fact that pegboard:::fix_links() will detect a link properly in a situation where the URL is on the same line as the closing square bracket and opening round bracket (think of situations where one would need multi-line alt text). The reason why we do this is because the authors may use liquid variables outside of image or link contexts and I did not want to hoover those up.

Unfortunately, I missed this situation where the URL appeared on the line after opening round bracket: swcarpentry/python-novice-inflammation#912

zkamvar added a commit that referenced this issue Mar 31, 2023
@zkamvar
Copy link
Contributor Author

zkamvar commented Mar 31, 2023

I have set up the repo at https://github.com/fishtree-attempt/python-novice-inflammation/

@zkamvar
Copy link
Contributor Author

zkamvar commented Mar 31, 2023

Hello @ineelhere and @noatgnu, I have created a test transition of your lesson and have invited you to collaborate on it on GitHub.

Please browse through it and let me know here if there are any issues we need to fix before we set the date to transition your lesson next month.

Thank you both!

@zkamvar
Copy link
Contributor Author

zkamvar commented Mar 31, 2023

zkamvar added a commit that referenced this issue Apr 4, 2023
This will create automatic IDs for definition lists as originally done
in #22

This also addresses
#25
@zkamvar zkamvar added the status: ready This label is for lessons that are ready for transition to the workbench label Apr 10, 2023
@zkamvar zkamvar added lesson A Carpentries Lesson To Transition early transition Lesson maintainers have indicated that this lesson can transition early labels Apr 11, 2023
@zkamvar
Copy link
Contributor Author

zkamvar commented Apr 21, 2023

fixed in c54e338

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
early transition Lesson maintainers have indicated that this lesson can transition early lesson A Carpentries Lesson To Transition status: ready This label is for lessons that are ready for transition to the workbench
Projects
None yet
Development

No branches or pull requests

1 participant