-
-
Notifications
You must be signed in to change notification settings - Fork 153
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
Select Markdown links based on their tag #270
Comments
Somehow similar to #259. What you call "tag" here, is the link text EDIT: I'm just collecting a few probably dump ideas below about how to combine both requests, and probably more similar ones that may arise. But I'm too tired to come up with a clever one, I guess. I'll leave it and review tomorrow, maybe some approach is useful after all 😄 😴. Using an attribute or class to exclude would be great IMO, but in Markdown such does not exist without extensions. Using the attribute extension allows to do something like I'm thinking about a single option which covers HTML and Markdown (and probably all types of) documents, else it might get a never ending list of options...
And you ask for an include option, while my request was for an exclude option. Probably it could be merged by using an inversion flag. Something like calling the options |
@MichaIng There could be a similar |
CSS selector syntax would be awesome indeed. But I wouldn't want to put to burden onto the devs for implementing such a complex parser, so I guess it depends on whether there is a reliable library which can do it nicely. |
The implementation is not hard. |
Grabbing specifc links aids automation immensely. It really makes using this in a GitHub Action environment more favorable. |
In CI the normal use case is to blindly check any links if found, with optional filtering based on link pattern (that's already supported). Adding the suggested function just doesn't add extra utility to normal CI users. |
There's an alternative solution which probably can suit your needs. |
Other utilities can be used to do that though. My point is that some level of taking away the "blindness" would be good in general. The reason that use case is the most you've seen is b/c anyone who needs just that picks up this utility. Anyone else who needs something different will immediately try to find a better solution. I haven't been able to find another All-In-One utility that can just pick out links that match a specific Markdown or HTML tag. |
But is it really the link text that you want to match against? I mean to you have a lot of "Read more" links, and need to check those exclusively? I also can't really imagine a use case without at least a more generic identifier, like a class other other kind of mark, like mentioned above, which indeed is difficult in pure Markdown. This is also the reason why we do not check the Markdown files but the resulting HTML file, after generated. But that's not done in everyone's case, I agree. So it would be interesting to hear or see an example about where and how you'd use this feature, to better understand a possible pattern of use cases. |
The link text wouldn't be what's matched: it'd be the tags. Another cool thing I thought of could be mixing the
Would select all Markdown links in the |
this doesn't fit into standard *nix CLI style. |
Yes I'm aware. However it can be handled is fine w/ me, just so long as there can be some level that links can be selected at. Idk if this program parses raw Markdown or converts it into HTML first. |
I'm quite sure that Markdown is not converted by
IMO it does not make sense to implement a feature only until another/better feature has been added, that would be a waste of development time. Without a convincing example of a document where selecting Markdown links by link text makes sense, I would vote against this, as there are IMO features with a wider use case requested. Adding an option to select and/or exclude links in HTML documents based on tags or CSS selectors would find more use, and can help in case of Markdown documents as well, when those are translated into HTML within the CI/CD pipeline with a defined Markdown parser and extensions. |
You can't see that the use cases are similar? A lot of assumptions are being made on either end about how this program works, so let the developers make their assessments on our respective recommendations. |
@MichaIng |
An alternative approach would be to use a Markdown command-line processor for extracting the tags and only use lychee on its output:
Note that |
Today I heard of mdq, which is helpful for this task. https://github.com/yshavit/mdq Perhaps people can try it out to see if they can extract links based on tags and feed that into lychee. |
Something like:
Would then exclusively select all links formatted as such:
The text was updated successfully, but these errors were encountered: