Skip to content

Commit

Permalink
Remove Documenter dep. (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelHatherly authored May 11, 2022
1 parent a4c7b58 commit 507b7d6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
6 changes: 1 addition & 5 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
name = "PrecompileSignatures"
uuid = "91cefc8d-f054-46dc-8f8c-26e11d7c5411"
authors = ["Rik Huijzer <[email protected]>"]
version = "3.0.2"

[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
version = "3.0.3"

[compat]
Documenter = "0.27"
julia = "1.6"

[extras]
Expand Down
25 changes: 22 additions & 3 deletions src/PrecompileSignatures.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,28 @@
module PrecompileSignatures

using Documenter.Utilities: submodules

export precompile_directives, write_directives, @precompile_signatures

# Taken from https://github.com/JuliaDocs/Documenter.jl/blob/1fcf1de5b0dd3f45a3c17af3d18776a456fe6a12/src/Utilities/Utilities.jl#L213-L231=
function _submodules(modules::Vector{Module})
out = Set{Module}()
for each in modules
_submodules(each, out)
end
out
end
function _submodules(root::Module, seen = Set{Module}())
push!(seen, root)
for name in names(root, all=true)
if Base.isidentifier(name) && isdefined(root, name) && !Base.isdeprecated(root, name)
object = getfield(root, name)
if isa(object, Module) && !(object in seen) && parentmodule(object::Module) == root
_submodules(object, seen)
end
end
end
return seen
end

function _is_macro(f::Function)
text = sprint(show, MIME"text/plain"(), f)
return contains(text, "macro with")
Expand Down Expand Up @@ -194,7 +213,7 @@ end
function _all_submodules(M::Vector{Module})::Vector{Module}
out = Module[]
for m in M
S = submodules(m)
S = _submodules(m)
for s in S
push!(out, s)
end
Expand Down

2 comments on commit 507b7d6

@rikhuijzer
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/60078

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v3.0.3 -m "<description of version>" 507b7d6203083b8965fe6c021d0a6dcc49d7004c
git push origin v3.0.3

Please sign in to comment.