Skip to content

Commit

Permalink
Fix Void deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
ararslan committed Dec 22, 2017
1 parent fafd678 commit 611aa82
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion REQUIRE
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
julia 0.6
Compat 0.39
Compat 0.41.0
DocStringExtensions 0.2
2 changes: 1 addition & 1 deletion src/Builder.jl
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ function Selectors.runner(::Type{SetupBuildDirectory}, doc::Documents.Document)

# Finally we populate the .next and .prev fields of the navnodes that point
# to actual pages.
local prev::Union{Documents.NavNode, Void} = nothing
local prev::Union{Documents.NavNode, Nothing} = nothing
for navnode in doc.internal.navlist
navnode.prev = prev
if prev !== nothing
Expand Down
14 changes: 7 additions & 7 deletions src/Documents.jl
Original file line number Diff line number Diff line change
Expand Up @@ -147,17 +147,17 @@ mutable struct NavNode
`nothing` if the `NavNode` is a non-page node of the navigation tree, otherwise
the string should be a valid key in `doc.internal.pages`
"""
page :: Union{String, Void}
page :: Union{String, Nothing}
"""
If not `nothing`, specifies the text that should be displayed in navigation
links etc. instead of the automatically determined text.
"""
title_override :: Union{String, Void}
parent :: Union{NavNode, Void}
title_override :: Union{String, Nothing}
parent :: Union{NavNode, Nothing}
children :: Vector{NavNode}
visible :: Bool
prev :: Union{NavNode, Void}
next :: Union{NavNode, Void}
prev :: Union{NavNode, Nothing}
next :: Union{NavNode, Nothing}
end
NavNode(page, title_override, parent) = NavNode(page, title_override, parent, [], true, nothing, nothing)

Expand Down Expand Up @@ -198,7 +198,7 @@ struct User
version :: String # version string used in the version selector by default
html_prettyurls :: Bool # Use pretty URLs in the HTML build?
html_disable_git :: Bool # Don't call git when exporting HTML
html_edit_branch :: Union{String, Void} # Change how the "Edit on GitHub" links are handled
html_edit_branch :: Union{String, Nothing} # Change how the "Edit on GitHub" links are handled
end

"""
Expand Down Expand Up @@ -253,7 +253,7 @@ function Document(;
version :: AbstractString = "",
html_prettyurls :: Bool = false,
html_disable_git :: Bool = false,
html_edit_branch :: Union{String, Void} = "master",
html_edit_branch :: Union{String, Nothing} = "master",
others...
)
Utilities.check_kwargs(others)
Expand Down
4 changes: 3 additions & 1 deletion src/Utilities/MDFlatten.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ export mdflatten

import ..Utilities

using Compat

import Base.Markdown:
MD, BlockQuote, Bold, Code, Header, HorizontalRule,
Image, Italic, LaTeX, LineBreak, Link, List, Paragraph, Table,
Expand Down Expand Up @@ -80,7 +82,7 @@ mdflatten(io, c::Code, parent) = print(io, c.code)
mdflatten(io, expr::Union{Symbol,Expr}, parent) = print(io, expr)

mdflatten(io, f::Footnote, parent) = footnote(io, f.id, f.text, f)
footnote(io, id, text::Void, parent) = print(io, "[$id]")
footnote(io, id, text::Nothing, parent) = print(io, "[$id]")
function footnote(io, id, text, parent)
print(io, "[$id]: ")
mdflatten(io, text, parent)
Expand Down
6 changes: 3 additions & 3 deletions src/Utilities/Utilities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ filterdocs(other, modules::Set{Module}) = other
Does the given docstring represent actual documentation or a no docs error message?
"""
nodocs(x) = contains(stringmime("text/plain", x), "No documentation found.")
nodocs(::Void) = false
nodocs(::Nothing) = false

header_level(::Markdown.Header{N}) where {N} = N

Expand Down Expand Up @@ -564,7 +564,7 @@ where
* `result` is the value returned from calling function `f`.
* `success` signals whether `f` has thrown an error, in which case `result` stores the
`Exception` that was raised.
* `backtrace` a `Vector{Ptr{Void}}` produced by `catch_backtrace()` if an error is thrown.
* `backtrace` a `Vector{Ptr{Cvoid}}` produced by `catch_backtrace()` if an error is thrown.
* `output` is the combined output of `STDOUT` and `STDERR` during execution of `f`.
"""
Expand All @@ -586,7 +586,7 @@ function withoutput(f)
# Success signals whether the function `f` did or did not throw an exception.
result, success, backtrace =
try
f(), true, Vector{Ptr{Void}}()
f(), true, Vector{Ptr{Cvoid}}()
catch err
err, false, catch_backtrace()
finally
Expand Down
2 changes: 1 addition & 1 deletion src/Writers/HTMLWriter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@ mdconvert(t::Markdown.Table, parent; kwargs...) = Tag(:table)(
mdconvert(expr::Union{Expr,Symbol}, parent; kwargs...) = string(expr)

mdconvert(f::Markdown.Footnote, parent; kwargs...) = footnote(f.id, f.text, parent; kwargs...)
footnote(id, text::Void, parent; kwargs...) = Tag(:a)[:href => "#footnote-$(id)"]("[$id]")
footnote(id, text::Nothing, parent; kwargs...) = Tag(:a)[:href => "#footnote-$(id)"]("[$id]")
function footnote(id, text, parent; kwargs...)
Tag(:div)[".footnote#footnote-$(id)"](
Tag(:a)[:href => "#footnote-$(id)"](Tag(:strong)("[$id]")),
Expand Down
2 changes: 1 addition & 1 deletion test/navnode.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Documenter: Documents, Builder
import Documenter.Documents: NavNode

mutable struct FakeDocumentInternal
pages :: Dict{String, Void}
pages :: Dict{String, Nothing}
navlist :: Vector{NavNode}
FakeDocumentInternal() = new(Dict(), [])
end
Expand Down

0 comments on commit 611aa82

Please sign in to comment.