Make a function acceptable for :skip_code_autolink_to option #1878
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, the
:skip_code_autolink_to
option only accepts a list.This approach becomes impractical when dealing with a large number of terms.
For example, I'm working on a project where some hidden modules are automatically defined, and some documentation tries to link to those modules (to be precise, types defined in those modules).
My problem there is that the number of those terms is too many to list in
:skip_code_autolink_to
option.So it is useful if
:skip_code_autolink_to
option accepts regular expressions or, more flexibly, a function.I choose the function approach as it aligns with the discussion in #1759 (comment).
(I'm pleased to implement the same feature for
:skip_undefined_reference_warnings_on
option if this PR is approved.)As a caveat, because
ExDoc.Autolink
is internal (@moduledoc false
), I just removed code that expects a list for theskip_code_autolink_to
field.Should I keep backward compatibility at
ExDoc.Autolink
level too?