paritytech / polkadot-sdk

The Parity Polkadot Blockchain SDK
https://polkadot.network/
1.77k stars 634 forks source link

Fix all broken links #134

Open ggwpez opened 1 year ago

ggwpez commented 1 year ago

Using lychee link checker finds a few things. We should also add this to CI (https://github.com/paritytech/polkadot-sdk/issues/993).
cc @sacha-l

The list of broken links is in the CI https://github.com/paritytech/polkadot-sdk/blob/a70617124b4c0c730016a210e2b8b343c829d784/.config/lychee.toml#L29

sacha-l commented 1 year ago

Most of these are links from the auto-generated READMEs from years ago. I think the tool used was https://github.com/livioribeiro/cargo-readme. We should regenerate them as part of the upcoming docs work to improve the pallet rust docs / ensure they're updated with some CI job.

Anything to do before the repo merge though?

ggwpez commented 1 year ago

Anything to do before the repo merge though?

Depends on how fast it merges :laughing: maybe just try with a single pallet first if it works?
But it could also be done after the monorepo.

ggwpez commented 1 year ago

We are in the monorepo now @sacha-l

kianenigma commented 1 year ago

We should first install link checker (https://github.com/paritytech/polkadot-sdk/issues/993) to make sure this fix is worthwhile.

sacha-l commented 1 year ago

@kianenigma part of the issue to address here is that what's currently in the READMEs is outdated from some point in time when cargo-readme was being used to auto-generate the READMEs from the Rust docs.

My suggestion is to start doing that again so that the READMEs for each pallet will be consistent with the Rust docs.

But having just tried that locally, the issue with using cargo-readme is that the links it takes from the Rust docs don't work as they are not URLs (they're inter-rustdoc-links). For e.g. the "See the [pallet] module for more information..." is not a valid link.

Screenshot 2023-09-13 at 11 16 45 AM

Another issue with using this tool is that none of the code generated by docify gets rendered. It may be worth customizing it for our needs here or rethinking how we want these READMEs to be generated altogether.

ggwpez commented 10 months ago

We should first install link checker (#993) to make sure this fix is worthwhile.

The link checker is added. All the broken links are not fixed in the CI (see issue).

mrcnski commented 8 months ago

I ran lychee for fun, FWIW here's a random selection of broken links (non-exhaustive):

[./docs/contributor/DOCUMENTATION_GUIDELINES.md]:
✗ [ERR] file:///Users/marcin/Repos/github.com/paritytech/polkadot-sdk/docs/contributor/CODEOWNERS | Failed: Cannot find file
✗ [ERR] file:///Users/marcin/Repos/github.com/paritytech/polkadot-sdk/docs/rustfmt.toml | Failed: Cannot find file

[./polkadot/roadmap/implementers-guide/src/messaging.md]:
✗ [404] https://research.web3.foundation/en/latest/polkadot/XCMP.html | Failed: Network error: Not Found

[./bridges/docs/high-level-overview.md]:
✗ [ERR] file:///Users/marcin/Repos/github.com/paritytech/polkadot-sdk/bridges/relays/bin-substrate/src/cli/relay_headers_and_messages | Failed: Cannot find file
✗ [ERR] file:///Users/marcin/Repos/github.com/paritytech/polkadot-sdk/bridges/relays/finality | Failed: Cannot find file
✗ [ERR] file:///Users/marcin/Repos/github.com/paritytech/polkadot-sdk/bridges/relays/messages | Failed: Cannot find file
✗ [ERR] file:///Users/marcin/Repos/github.com/paritytech/polkadot-sdk/bridges/relays/parachains | Failed: Cannot find file

[./substrate/frame/sudo/README.md]:
⧖ [TIMEOUT] https://docs.rs/pallet-sudo/latest/pallet_sudo/struct.GenesisConfig.html | Timeout