diff --git a/test/examples/src/index.md b/test/examples/src/index.md index 4f4b590691..e5a552a1a3 100644 --- a/test/examples/src/index.md +++ b/test/examples/src/index.md @@ -483,12 +483,6 @@ julia> x->x # ignore error on 0.7 r = :a ``` -# Bad links (Windows) - -* [Colons not allowed on Windows -- `some:path`](some:path) -* [No "drive" -- `:path`](:path) -* [Absolute Windows paths -- `X:\some\path`](X:\some\path) - # Rendering text/markdown ```@example diff --git a/test/warnings/make.jl b/test/warnings/make.jl index e48d14b1d8..25ccfd6b7f 100644 --- a/test/warnings/make.jl +++ b/test/warnings/make.jl @@ -97,6 +97,51 @@ julia> WarningTests.run_warnings_test("dollar") """ module UnbalancedDollarWarningTests end +@doc raw""" +```jldoctest; setup=:(using ..WarningTests) +julia> WarningTests.run_warnings_test("windows_paths") +[ Info: SetupBuildDirectory: setting up build directory. +[ Info: Doctest: running doctests. +[ Info: ExpandTemplates: expanding markdown templates. +[ Info: CrossReferences: building cross-references. +┌ Warning: invalid local link/image: file does not exist in src/windows_paths.md +│ link = +│ @ast MarkdownAST.Link("some:path", "") do +│ MarkdownAST.Text("Colons not allowed on Windows ") +│ MarkdownAST.Text("–") +│ MarkdownAST.Text(" ") +│ MarkdownAST.Code("some:path") +│ end +│ +└ @ Documenter +┌ Warning: invalid local link/image: file does not exist in src/windows_paths.md +│ link = +│ @ast MarkdownAST.Link(":path", "") do +│ MarkdownAST.Text("No 'drive' ") +│ MarkdownAST.Text("–") +│ MarkdownAST.Text(" ") +│ MarkdownAST.Code(":path") +│ end +│ +└ @ Documenter +┌ Warning: invalid local link/image: file does not exist in src/windows_paths.md +│ link = +│ @ast MarkdownAST.Link("X:\\some\\path", "") do +│ MarkdownAST.Text("Absolute Windows paths ") +│ MarkdownAST.Text("–") +│ MarkdownAST.Text(" ") +│ MarkdownAST.Code("X:\\some\\path") +│ end +│ +└ @ Documenter +[ Info: CheckDocument: running document checks. +[ Info: Populate: populating indices. +[ Info: RenderDocument: rendering document. +[ Info: HTMLWriter: rendering HTML pages. +``` +""" +module WindowsPathSeparatorWarningTests end + fixtests = haskey(ENV, "DOCUMENTER_FIXTESTS") # run the doctests in Julia >= 1.10 (some outputs have minor difference in diff --git a/test/warnings/src/windows_paths.md b/test/warnings/src/windows_paths.md new file mode 100644 index 0000000000..d3c000ae5f --- /dev/null +++ b/test/warnings/src/windows_paths.md @@ -0,0 +1,7 @@ +# Bad links (Windows) + +Added in PR #485. + +* [Colons not allowed on Windows -- `some:path`](some:path) +* [No 'drive' -- `:path`](:path) +* [Absolute Windows paths -- `X:\some\path`](X:\some\path)