Skip to content

Allow ignoring specific broken links #133

@jyn514

Description

@jyn514

This is needed to replace src/tools/linkchecker in the rust-lang repo (#105). These are the currently ignored links: https://github.com/rust-lang/rust/blob/e4297ba39ce07a0b0000841b50154ea53783a024/src/tools/linkchecker/main.rs#L31-L91

So we need a way to ignore:

  1. Broken fragments
  2. Intra-doc like links ([<code></code>])
  3. and for both of those, ignore all links within a given file (https://github.com/rust-lang/rust/blob/e4297ba39ce07a0b0000841b50154ea53783a024/src/tools/linkchecker/main.rs#L60-L61)

I'm imagining a setup like this in deadlinks.toml:

[fragments]
"std/io/struct.IoSlice.html" = [
    "#method.as_mut_ptr",
    "#method.sort_by_key",
    "#method.make_ascii_uppercase",
    "#method.make_ascii_lowercase",
    "#method.get_unchecked_mut",
]

[intra_doc_links]
"reference/print.html" = all
"reference/comments.html" = [
     "/</code> <code>!",
     "*</code> <code>!",
]

The reason I don't want to put it in Cargo.toml is that allows it to be used with deadlinks and not just cargo-deadlinks.

As an extension, this could allow ignoring completely missing files, but that wouldn't be necessary for replacing linkchecker. I think it's a useful feature separate from rust-lang/rust, though.

Metadata

Metadata

Assignees

Labels

C-enhancementCategory: This is a new feature

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions