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

Update all URLs inside HTML files to reflect new folder structure #13

Open
gschare opened this issue May 25, 2021 · 0 comments
Open

Update all URLs inside HTML files to reflect new folder structure #13

gschare opened this issue May 25, 2021 · 0 comments
Assignees

Comments

@gschare
Copy link
Collaborator

gschare commented May 25, 2021

With the new folder structure established in the mapping, it is necessary to update the <a> tag href links in every file to reflect the new locations of the files they point to.
I imagine the simplest algorithm to do this would be:

1. Iterate over the files in the second column of mapping.csv.
2. For each file, parse the HTML content for <a> tags with href attributes pointing to any string in the first column of mapping.csv.
3. For each of those tags, replace the href attribute value with the corresponding new value implied by mapping.csv.

The biggest question is how to parse and update the HTML safely, quickly, and elegantly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant