Skip to content

linkchecker + mdbook = :frown: #39856

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

Closed
steveklabnik opened this issue Feb 15, 2017 · 5 comments
Closed

linkchecker + mdbook = :frown: #39856

steveklabnik opened this issue Feb 15, 2017 · 5 comments
Labels
T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@steveklabnik
Copy link
Member

/cc @azerupi @rust-lang/docs

Right now, linkchecker reads the HTML of rendered pages directly. It seems that mdBook adds anchors through javascript. This means that linkchecker can't validate links to the book, which is unfortunate.

We could replicate mdBook's logic, but I wonder if that's the best way. Let's figure it out here, and then close this bug out by implementing the solution.

@steveklabnik steveklabnik added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Feb 15, 2017
@azerupi
Copy link
Contributor

azerupi commented Feb 15, 2017

I think, but I am not sure anymore, that I implemented it in the JS because it was easier. If there is no other reason, I suppose it would be better to implement this at the generation time.

@ollie27
Copy link
Member

ollie27 commented Feb 15, 2017

It would be better to generate the anchors when generating the HTML. While you're at it, it would be nice if the anchors were generated the same way as rustdoc so links on external websites to the rust docs don't break.

@azerupi
Copy link
Contributor

azerupi commented Feb 15, 2017

@ollie27 How are anchors generated by rustdoc?
Lowercase, strip special characters and replace blank space by a hyphen?

@ollie27
Copy link
Member

ollie27 commented Feb 15, 2017

That sounds about right, here is the code that does it.

@steveklabnik
Copy link
Member Author

This has been addressed upstream 🎊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

No branches or pull requests

3 participants