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

Migration to intra-doc links #1781

Closed
realaravinth opened this issue Nov 9, 2020 · 2 comments
Closed

Migration to intra-doc links #1781

realaravinth opened this issue Nov 9, 2020 · 2 comments
Labels
C-docs Category: docs

Comments

@realaravinth
Copy link
Member

realaravinth commented Nov 9, 2020

When working on #1771, I was also checking feasibility for our migration to intra-doc links and I'd like to share my findings and ask for suggestions:

Motivation

At the time of writing this, intra-doc is a nightly only feature but the standard library folks are aggressively migrating to it. So it might land in stable soon.

Problem

Running cargo doc in nightly breaks existing documentation at multiple places(441), at least that's what cargo deadlinks is reporting. I manually checked files at random but I couldn't find any breakage though. tracing::span::Span was correctly linked, please read next section for context.

cargo-deadlinks report analysis:

  • Broken links:
 ➜  actix-web git:(master) ✗ cat broken-links | sort -u
	Linked file at path client/struct.Span.html does not exist!
	Linked file at path dev/fn.fn_service.html does not exist!
	Linked file at path dev/struct.JsonConfig.html does not exist!
	Linked file at path futures_core::stream::Stream does not exist!
	Linked file at path h1/futures_sink::Sink does not exist!
	Linked file at path /home/aravinth/code/actix-web/target/doc/std/primitive.u8.html does not exist!
	Linked file at path /home/aravinth/code/actix-web/target/doc/struct.Span.html does not exist!
	Linked file at path http/struct@GetAll does not exist!
	Linked file at path http/struct.Span.html does not exist!
	Linked file at path middleware/struct.Span.html does not exist!
	Linked file at path struct.JsonConfig.html does not exist!
	Linked file at path struct.PayloadConfig.html does not exist!
	Linked file at path struct.Span.html does not exist!
	Linked file at path ws/futures_sink::Sink does not exist!
  • Total number of broken links:
➜  actix-web git:(master) ✗ cat  broken-links | wc -l
441
  • Most number of duplicates:
  actix-web git:(master) ✗ rg "Span" broken-links | wc -l
426

Span is from tracing::span::Span that we are using in impl Instrument for logging purposes(?)

Conclusion:

We should be fine making the switch to nightly temporarily. There's at least one place where we can benefit from intra-doc links and tracing::span::Span seems like something that the end user might never use(?).

So do we start migrating now or wait for it to land in stable?

@realaravinth realaravinth added the C-docs Category: docs label Nov 9, 2020
@robjtede
Copy link
Member

robjtede commented Nov 9, 2020

Yes, we should start using intra doc links for all new references. In fact, we've already started:

@realaravinth
Copy link
Member Author

Huh, I didn't notice! :D

In that case, we should make changes our upload-doc CI workflow as it's using stable. The same page on master API doc has broken links.

I'll submit a PR to this effect and begin migration.

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

No branches or pull requests

2 participants