Skip to content
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

Flatten CrossReferences module #2191

Merged
merged 2 commits into from
Jul 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions docs/src/lib/internals/cross-references.md

This file was deleted.

3 changes: 3 additions & 0 deletions docs/src/lib/internals/documenter.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@
Documenter.gitrm_copy
Documenter.git_push
Documenter.user_host_upstream
Documenter.find_object
Documenter.xrefname
Documenter.crossref
```
3 changes: 1 addition & 2 deletions src/Builder.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ The default document processing "pipeline", which consists of the following acti
- [`SetupBuildDirectory`](@ref)
- [`Doctest`](@ref)
- [`ExpandTemplates`](@ref)
- [`CrossReferences`](@ref)
- [`CheckDocument`](@ref)
- [`Populate`](@ref)
- [`RenderDocument`](@ref)
Expand Down Expand Up @@ -236,7 +235,7 @@ end
function Selectors.runner(::Type{CrossReferences}, doc::Documenter.Document)
is_doctest_only(doc, "CrossReferences") && return
@info "CrossReferences: building cross-references."
Documenter.CrossReferences.crossref(doc)
Documenter.crossref(doc)
end

function Selectors.runner(::Type{CheckDocument}, doc::Documenter.Document)
Expand Down
2 changes: 1 addition & 1 deletion src/Documenter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ include("documents.jl")
include("Expanders.jl")
include("DocTests.jl")
include("Builder.jl")
include("CrossReferences.jl")
include("cross_references.jl")
include("DocChecks.jl")
include("writers.jl")
include("html/HTMLWriter.jl")
Expand Down
18 changes: 0 additions & 18 deletions src/CrossReferences.jl → src/cross_references.jl
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
"""
Provides the [`crossref`](@ref) function used to automatically calculate link URLs.
"""
module CrossReferences

import ..Documenter:
Anchors,
Builder,
Expanders,
Documenter

using DocStringExtensions
using .Documenter: Remotes, @docerror
import Markdown
import AbstractTrees, MarkdownAST

"""
$(SIGNATURES)

Expand Down Expand Up @@ -378,5 +362,3 @@ function issue_xref(node::MarkdownAST.Node, num, meta, page, doc)
node.element.destination = issue_url
end
end

end
46 changes: 23 additions & 23 deletions test/crossreferences.jl
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
module CrossReferencesTests
using Documenter: CrossReferences
import Documenter
using Test

@testset "CrossReferences" begin
@test CrossReferences.xrefname("") === nothing
@test CrossReferences.xrefname("@") === nothing
@test CrossReferences.xrefname("@re") === nothing
@test CrossReferences.xrefname("@refx") === nothing
@test CrossReferences.xrefname("@ref#") === nothing
@test CrossReferences.xrefname("@ref_") === nothing
@test Documenter.xrefname("") === nothing
@test Documenter.xrefname("@") === nothing
@test Documenter.xrefname("@re") === nothing
@test Documenter.xrefname("@refx") === nothing
@test Documenter.xrefname("@ref#") === nothing
@test Documenter.xrefname("@ref_") === nothing
# basic at-refs
@test CrossReferences.xrefname("@ref") == ""
@test CrossReferences.xrefname("@ref ") == ""
@test CrossReferences.xrefname("@ref ") == ""
@test CrossReferences.xrefname("@ref\t") == ""
@test CrossReferences.xrefname("@ref\t ") == ""
@test CrossReferences.xrefname("@ref \t") == ""
@test CrossReferences.xrefname(" @ref") == ""
@test CrossReferences.xrefname(" \t@ref") == ""
@test Documenter.xrefname("@ref") == ""
@test Documenter.xrefname("@ref ") == ""
@test Documenter.xrefname("@ref ") == ""
@test Documenter.xrefname("@ref\t") == ""
@test Documenter.xrefname("@ref\t ") == ""
@test Documenter.xrefname("@ref \t") == ""
@test Documenter.xrefname(" @ref") == ""
@test Documenter.xrefname(" \t@ref") == ""
# named at-refs
@test CrossReferences.xrefname("@ref foo") == "foo"
@test CrossReferences.xrefname("@ref foo") == "foo"
@test CrossReferences.xrefname("@ref foo ") == "foo"
@test CrossReferences.xrefname("@ref \t foo \t ") == "foo"
@test CrossReferences.xrefname("@ref\tfoo") == "foo"
@test CrossReferences.xrefname("@ref foo%bar") == "foo%bar"
@test CrossReferences.xrefname("@ref foo bar \t baz ") == "foo bar \t baz"
@test CrossReferences.xrefname(" \t@ref foo") == "foo"
@test Documenter.xrefname("@ref foo") == "foo"
@test Documenter.xrefname("@ref foo") == "foo"
@test Documenter.xrefname("@ref foo ") == "foo"
@test Documenter.xrefname("@ref \t foo \t ") == "foo"
@test Documenter.xrefname("@ref\tfoo") == "foo"
@test Documenter.xrefname("@ref foo%bar") == "foo%bar"
@test Documenter.xrefname("@ref foo bar \t baz ") == "foo bar \t baz"
@test Documenter.xrefname(" \t@ref foo") == "foo"
end

end
Loading