Skip to content

Commit

Permalink
Make the "show source" buttons in the docs work again
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens committed Feb 16, 2024
1 parent 81ee4a5 commit 5d60918
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
22 changes: 21 additions & 1 deletion docs/make_work.jl
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,20 @@ function doit(
end
end

function get_rev(uuid::Base.UUID)
deps = Documenter.Pkg.dependencies()
@assert haskey(deps, uuid)
if !isnothing(deps[uuid].git_revision)
return deps[uuid].git_revision
else
return "v$(deps[uuid].version)"
end
end
aarev = get_rev(Base.UUID("c3fe647b-3220-5bb0-a1ea-a7954cac585d"))
nemorev = get_rev(Base.UUID("2edaba10-b0f1-5616-af89-8c11ac63239a"))
heckerev = get_rev(Base.UUID("3e1990a7-5d81-5526-99ce-9ba3ff248f21"))
singularrev = get_rev(Base.UUID("bcd08a7b-43d2-5ff7-b6d4-c458787f915c"))

cd(joinpath(Oscar.oscardir, "docs")) do
DocMeta.setdocmeta!(Oscar, :DocTestSetup, Oscar.doctestsetup(); recursive=true)
DocMeta.setdocmeta!(Oscar.Hecke, :DocTestSetup, :(using Hecke); recursive=true)
Expand All @@ -184,6 +198,7 @@ function doit(

makedocs(;
format=Documenter.HTML(;
edit_link=nothing, # TODO: make work for imported pages
prettyurls=!local_build,
collapselevel=1,
size_threshold=409600,
Expand All @@ -197,7 +212,12 @@ function doit(
warnonly=warnonly,
checkdocs=:none,
pages=doc,
remotes=nothing, # TODO: make work with Hecke, Nemo, AbstractAlgebra, see https://github.com/oscar-system/Oscar.jl/issues/588
remotes=Dict(
Oscar.aadir => (Remotes.GitHub("Nemocas", "AbstractAlgebra.jl"), aarev),
Oscar.nemodir => (Remotes.GitHub("Nemocas", "Nemo.jl"), nemorev),
Oscar.heckedir => (Remotes.GitHub("thofma", "Hecke.jl"), heckerev),
Oscar.singulardir => (Remotes.GitHub("oscar-system", "Singular.jl"), singularrev),
),
plugins=[bib],
)
end
Expand Down
1 change: 1 addition & 0 deletions src/utils/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const jll_deps = String["Antic_jll", "Arb_jll", "Calcium_jll", "FLINT_jll", "GAP
const aadir = Base.pkgdir(AbstractAlgebra)
const nemodir = Base.pkgdir(Nemo)
const heckedir = Base.pkgdir(Hecke)
const singulardir = Base.pkgdir(Singular)

include("versioninfo.jl")
include("docs.jl")
Expand Down

0 comments on commit 5d60918

Please sign in to comment.