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

Fixed links in ERCS markdown files #42

Closed

Conversation

cfries
Copy link
Contributor

@cfries cfries commented Oct 27, 2023

The HTML Proofer currently fails because all .md files in ERC reference eip-nnnn.md file but these files have been renamed to erc-nnnn.md. This PR just renames the links in the ERCS md files.
Please check if you find this PR reasonable:

  • Replaced (regexp) \(eip-(\d\d+)\.md\) by (erc-$1.md)
  • Replaced (regexp) \(\./eip-(\d\d+)\.md\) by (./erc-$1.md)
  • Replaced (regexp) \.\./assets/eip-(\d\d+)\/by ../assets/erc-$1/
  • Replaced (regexp) \: \./eip-(\d\d+)\.mdby : ./erc-$1.md
  • Replaced (regexp) \((\./|\.\./EIPS/)eip-(\d\d+)(\.md|)((#[\w\-]*|))\) by (erc-$2$3$4)
  • Replaced (regexp) \./eip-(\d\d+)\.md by ./erc-$1.md

Note: The HTML Proofer will still fail because there are links to EIPs that are no longer in this repository (cross-linking is required). The above will also rename the EIPs to ERCs that are EIPs. Those likely require cross linking as there are no files in the ERCS folder. For those one could consider using abolute links:

  • Replaced (regexp) \(\./(eip|erc)-155(\.md|)(#.*|)\) by (https\://eips.ethereum.org/EIPS/eip-155$3)
  • Replaced (regexp) \(\./(eip|erc)-712(\.md|)(#.*|)\) by (https\://eips.ethereum.org/EIPS/eip-712$3)
  • ... and so on for the numbers 86, 101, 170, 658, 1014, 1102, 1153, 1193, 1559, 2255, 2938, 3074, 3085, 3220, 3855, 5069, 5757

(I am using this PR to find our if there is a set of reg exp that will fix all or most of the broken links - I hope you don't mind)

The above regexps reduce the number of errors reported by the HTMLProofer from

HTML-Proofer found 1807 failures!

to

HTML-Proofer found 27 failures!

(There is maybe a one regexp for all - the list above is a result from step by step carefully fixing issues)

@tbergmueller
Copy link
Contributor

Thx for doing this @cfries!

@github-actions github-actions bot added w-ci and removed w-ci labels Oct 27, 2023
@cfries cfries mentioned this pull request Oct 27, 2023
10 tasks
@github-actions github-actions bot added w-ci and removed w-ci labels Oct 27, 2023
…s.ethereum.org/EIPS/eip-712$3)`

Where 712 is replaced by the following numbers: 86, 101, 170, 658, 1014, 1102, 1153, 1193, 1559, 2255, 2938, 3074, 3085, 3220, 3855, 5069, 5757
@cfries
Copy link
Contributor Author

cfries commented Oct 27, 2023

@lightclient - I managed to compile a few regexp fixing the links.

I manage to get the broken links down from 1800 to 27. Would it make sense to merge this one now? I could try to fix the others if time permits. It would maybe make sense to merge this one first and let the owners of the PRs merge the fixes.
Alternatively, this PR needs to be recreated (scripting the regexps).

(the regexp could be more fancy, but I wanted to go slowly step by step).

@lightclient
Copy link
Member

Thanks for this @cfries. In general this makes sense, unfortunately it overlooks the issue of building the eips.ethereum.org website. That occurs in the ethereum/eips repo:

https://github.com/ethereum/EIPs/blob/25cdf1d059778236e28bf22d752ca48a35af91f6/.github/workflows/jekyll.yml#L46-L57

This PR will cause all the relative ERC links to fail.

@cfries
Copy link
Contributor Author

cfries commented Oct 27, 2023

https://github.com/ethereum/EIPs/blob/25cdf1d059778236e28bf22d752ca48a35af91f6/.github/workflows/jekyll.yml#L46-L57

This PR will cause all the relative ERC links to fail.

Thanks for this link. I did not know that. However, if I understand this correctly all relative ERC links will work if they are done via (erc-xxxx.md) or via (./erc-xxxx.md), but they will fail if they are done via (../ERCS/erc-xxxx.md) (which some markdown files do, but many don't do). I could modify the regexp - recreating a new PR to standardize the links to be of (./erc-xxxx.md or to refrence ../assets/erc-xxxx. If I unserstand this correctly merging the web pages will then work.

The remaining issues are links from ERC to EIP - these could work realatively after merge but let the validator fail. Two options here:

  1. let the validator ignore links to eip
  2. use the regexp above to convert all links to eips to absolute paths.

It this correct? If you like I could recreate this PR with modified regexps to at least fix all ERC links in the way above - if this is useful for you.

@cfries
Copy link
Contributor Author

cfries commented Oct 29, 2023

@lightclient How about the following idea:

  • Use a set of regexp (as in this PR) to fix all ERC links and replace all EIP links with external links.
  • (Optional:) Let the script that performs the merge of the web-site replace the external EIP links with relative links.

Alternatively one could modify the HTMLProofer script to replace links with external ones before doing the proofing, but this solution is a bit strange, because the local markdowns will not render correctly (it has broken links). This makes it harder to check ones markdown before submitting the PR.

Maybe you can discuss this in the meeting and if you like, I could compile the set of useful regexps.

@Pandapip1
Copy link
Member

@eth-bot rerun

@Pandapip1
Copy link
Member

Also, please resolve the merge conflicts

@eip-review-bot
Copy link
Collaborator

eip-review-bot commented Oct 30, 2023

🛑 eip-review-bot failed for an unknown reason. Please see logs for more details, and report this issue at the eip-review-bot repository.

@cfries
Copy link
Contributor Author

cfries commented Oct 30, 2023

Also, please resolve the merge conflicts

Done. Should I try to fix the remaining broken links in other ERCs too? (Not sure if I have enough time for this today).

@cfries cfries mentioned this pull request Nov 3, 2023
@cfries cfries changed the title Draft: Fixed links in ERCS markdown files Fixed links in ERCS markdown files Nov 3, 2023
Copy link

github-actions bot commented Nov 3, 2023

The commit 4d091eb (as a parent of 9c5db08) contains errors.
Please inspect the Run Summary for details.

Copy link

There has been no activity on this pull request for 2 weeks. It will be closed after 3 months of inactivity. If you would like to move this PR forward, please respond to any outstanding feedback or add a comment indicating that you have addressed all required feedback and are ready for a review.

Copy link

This pull request was closed due to inactivity. If you are still pursuing it, feel free to reopen it and respond to any feedback or request a review in a comment.

@github-actions github-actions bot closed this Dec 31, 2023
@cfries cfries deleted the feature/fixed-eip-links-in-md-files branch March 25, 2024 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants