From b3940c0e4402ccaa717dd2ab59eb81fb5e27d9dd Mon Sep 17 00:00:00 2001 From: Michael Goerz Date: Tue, 27 Feb 2024 23:21:51 -0500 Subject: [PATCH] Warn that ExternalFallbacks requires Documenter 1.3 --- docs/src/fallback.md | 2 +- src/fallback.jl | 3 ++- test/test_expand_extrefs.jl | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/src/fallback.md b/docs/src/fallback.md index 58024b2..328c90d 100644 --- a/docs/src/fallback.md +++ b/docs/src/fallback.md @@ -1,7 +1,7 @@ # Fallback Resolution !!! warning - The [`ExternalFallbacks`](@ref) plugin described here is experimental. + The [`ExternalFallbacks`](@ref) plugin described here is available only with `Documenter >= v1.3.0` and should be considered experimental. In some situations, you may need to include a docstring from an external package in your documentation – for example, you you are extending a function from that package, you may want to show the function docstring. If that docstrings contains an `@ref` link, you have a problem: that link is resolvable in the external documentation, but not in *your* documentation. diff --git a/src/fallback.jl b/src/fallback.jl index 88946db..0a2b833 100644 --- a/src/fallback.jl +++ b/src/fallback.jl @@ -4,7 +4,8 @@ import Documenter: XRefResolvers, Selectors, xref_unresolved """Plugin for letting `@ref` links fall back to `@extref` links. !!! warning - This plugin is experimental. + This plugin is available only with `Documenter >= v1.3.0` and should be + considered as experimental. ```julia fallbacks = ExternalFallbacks(pairs...) diff --git a/test/test_expand_extrefs.jl b/test/test_expand_extrefs.jl index 7dded28..3902a03 100644 --- a/test/test_expand_extrefs.jl +++ b/test/test_expand_extrefs.jl @@ -12,14 +12,14 @@ function parse_md_link(text) mdpage = Markdown.parse(text) paragraph = first(convert(MarkdownAST.Node, mdpage).children) if length(paragraph.children) != 1 - @error "citation $(repr(text)) must parse into a single MarkdownAST.Link" ast = + @error "link text $(repr(text)) must parse into a single MarkdownAST.Link" ast = collect(paragraph.children) - error("Invalid citation: $(repr(text))") + error("Invalid link text: $(repr(text))") end link = first(paragraph.children) if !(link.element isa MarkdownAST.Link) @error "citation $(repr(text)) must parse into MarkdownAST.Link" ast = link - error("Invalid citation: $(repr(text))") + error("Invalid link text: $(repr(text))") end return link end