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

feat: show a warning message when md links are broken #1116

Merged
merged 3 commits into from
Nov 23, 2018
Merged

feat: show a warning message when md links are broken #1116

merged 3 commits into from
Nov 23, 2018

Conversation

gianlucadonato
Copy link
Contributor

@gianlucadonato gianlucadonato commented Nov 15, 2018

🚀 Feature

Show a warning message in the console that outputs a log when an internal link inside the documentation is broken.

Fix #1111

Have you read the Contributing Guidelines on issues?

Yes.

Motivation

It can happen to have brokens links in the documentation that are caused by a change in the file id/path (e.g. a file is renamed, moved or simply there's a typo in the link) and then forgetting to update the link that points to it.
It's very hard discovering where they are in the docs and fix it.

Pitch

It would be nice to introduce a check (maybe flaggable in the options) when running docusaurus start or docusaurus build that shows a warning message if a link in the markdown has an unresolved path.

@facebook-github-bot
Copy link
Contributor

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@docusaurus-bot
Copy link
Contributor

docusaurus-bot commented Nov 15, 2018

Deploy preview for docusaurus-preview ready!

Built with commit a6d6e8c

https://deploy-preview-1116--docusaurus-preview.netlify.com

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Nov 15, 2018
@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@endiliey
Copy link
Contributor

This needs more discussion, because technically some docusaurus user might actually want to link to some url with .md file extension.

@JoelMarcey @yangshun are u guys good with the proposed changes ?

It warns if any unresolved .md link

@endiliey endiliey changed the title Show a warning message when links are broken feat: show a warning message when md links are broken Nov 23, 2018
@endiliey endiliey merged commit 711c15d into facebook:master Nov 23, 2018
@endiliey
Copy link
Contributor

endiliey commented Nov 23, 2018

Thanks @gianlucadonato 😄

@charpeni
Copy link

charpeni commented Apr 18, 2019

This needs more discussion, because technically some docusaurus user might actually want to link to some url with .md file extension.

This is correct, we link to .md files within React Native website and we now have a bunch of warnings during the build process.

Edit: Actually we have a bunch of warnings because versioned_docs is referencing some docs that do not exist anymore in docs, but they still exist in versioned_docs 🤔.

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

Successfully merging this pull request may close these issues.

Show a warning message when links are broken
5 participants