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

cmark links should be handled #44

Open
3 tasks
drahnr opened this issue Jun 18, 2020 · 11 comments · May be fixed by #175
Open
3 tasks

cmark links should be handled #44

drahnr opened this issue Jun 18, 2020 · 11 comments · May be fixed by #175
Assignees
Labels
enhancement 🦚 New feature or request good first issue 🔰 Good for newcomers
Projects
Milestone

Comments

@drahnr
Copy link
Owner

drahnr commented Jun 18, 2020

Summary

There are multiple variants here

[https://ahoi.io](https://ahoi.io)
[fun](../fun.html)
[struct Foo](super::Foo)
  • detect valid urls in [] so spell checkings can be ignored in that span [https://ahoi.io](https://ahoi.io)
  • links to struct items should be ignored in spell checks
  • add a flag to verify the linked to destinations exist
@drahnr drahnr added bug Something isn't working enhancement 🦚 New feature or request good first issue 🔰 Good for newcomers labels Jun 18, 2020
@drahnr drahnr added this to To Do in Overview Jul 8, 2020
@drahnr drahnr added this to the v0.4.0 milestone Jul 14, 2020
@drahnr
Copy link
Owner Author

drahnr commented Jul 14, 2020

There is already something similar for mdbook https://github.com/Michael-F-Bryan/mdbook-linkcheck

@drahnr drahnr modified the milestones: v0.4.0, v0.5.0 Aug 17, 2020
@drahnr drahnr closed this as completed Aug 31, 2020
Overview automation moved this from To Do to Done Aug 31, 2020
@drahnr drahnr reopened this Aug 31, 2020
Overview automation moved this from Done to To Do Aug 31, 2020
@drahnr drahnr removed the bug Something isn't working label Aug 31, 2020
@laysauchoa
Copy link
Collaborator

cc @drahnr
I guess this still TODO, right? Would be fine if I work on this? Thanks

@drahnr
Copy link
Owner Author

drahnr commented Sep 1, 2020

Sure @laysauchoa feel free!

@drahnr
Copy link
Owner Author

drahnr commented Sep 9, 2020

Is there anything that's blocking you and that I could help with?

@laysauchoa
Copy link
Collaborator

@drahnr sorry for the delay, it was just really full those last days. I aim to start this week+weekend.

@drahnr
Copy link
Owner Author

drahnr commented Sep 9, 2020

No rush, it's a pet project and should be a fun and learning experience, just making sure there are no road blocks :)

@laysauchoa
Copy link
Collaborator

@drahnr thanks, you are great!

@laysauchoa
Copy link
Collaborator

CC @drahnr
I have some questions so I will do it as follow the description:

There are multiple variants here
https://ahoi.io
fun
struct Foo
detect valid urls in [] so spell checking can be ignored in that span https://ahoi.io

What does valid means here?

  1. to check if the string inside the [] is a URL string such as https://ahoi.io
  2. to check if this website is reachable

links to struct items should be ignored in spell checks

I have not yet found any reference for scanning struct and validating them. Only for local files and web links, should this be checked if it a struct present in the file or just any struct should be ignored?

add a flag to verify the linked to destinations exist
can you write an example of what those flags would look like or what can I check about it?

By the way, seems like doing it with regex is not that simple as I thought. Is it using external crates something to be thought here or should regex be used? Or maybe you meant to use mdbook for that. or linkify.

Please, share your thoughts about it. Thank you!

@drahnr
Copy link
Owner Author

drahnr commented Sep 14, 2020

CC @drahnr

I am automatically notified if I am subscribed (which I am always for this repo :) ) - feel free to CC me explicitly on third party repos which are relevant!

There are multiple variants here https://ahoi.io fun struct Foo detect valid urls in [] so spell checking can be ignored in that span https://ahoi.io

What does valid means here?

1. to check if the string inside the `[]` is a URL string such as https://ahoi.io

2. to check if this website is reachable

I think we should carve out two definitions:

  1. valid as Url::parse(..) returns an Ok(_).
  2. reachable see the next points :)

Now we should try to check if the link text is an url too, so 1. applies.
Example:

[http://ahoi.io](http://ahoi.io/sub/topic) would succeed for the first check, it's a valid url and should thus not be spell checked.

Number two should be only done explicitly on user request, and would fail in this case - it does not exists, further details below.

links to struct items should be ignored in spell checks

I have not yet found any reference for scanning struct and validating them. Only for local files and web links, should this be checked if it a struct present in the file or just any struct should be ignored?

In rust doc comments, you can specify a link like this [yada yada](crate::module::x) which can not be checked easily, it requires resolving all modules and their paths which is a bit out of scope for cargo-spellcheck at this point.

add a flag to verify the linked to destinations exist
can you write an example of what those flags would look like or what can I check about it?

By the way, seems like doing it with regex is not that simple as I thought. Is it using external crates something to be thought here or should regex be used? Or maybe you meant to use mdbook for that. or linkify.

My usual brevity.. apologies, verify the link destination exists means the querying it with GET request must return a 200 or 30x (permanently moved or such, which is a common thing to forward i.e. http -> https). But that would require network access and hence is not really possible in continuous integration setups. So I would like this to be only enabled explicitly via commandline flag.

If there is still something fuzzy, feel free to ask me to elaborate so you get a concise picture :)

@drahnr
Copy link
Owner Author

drahnr commented Sep 26, 2020

I guess it makes sense for you to land this as part of hacktober?

@drahnr drahnr removed this from the v0.5.0 milestone Nov 17, 2020
@drahnr drahnr added this to the v0.6.0 milestone Nov 17, 2020
@drahnr drahnr mentioned this issue Dec 15, 2020
3 tasks
@drahnr drahnr modified the milestones: v0.8.0, 0.9.0 Apr 19, 2021
@drahnr
Copy link
Owner Author

drahnr commented Apr 27, 2021

For md-book there is a plugin that works rather well, which could be taken as an inspiration - https://github.com/Michael-F-Bryan/mdbook-linkcheck

At this point I think it's mostly doing and deciding which way to go for: Either with or without lychee, rebasing that branch today exposed some significant compilation time increment even on a strong~ish machine.

@drahnr drahnr linked a pull request Apr 27, 2021 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 🦚 New feature or request good first issue 🔰 Good for newcomers
Projects
Overview
  
To Do
Development

Successfully merging a pull request may close this issue.

2 participants