Skip to content

Commit

Permalink
more remote stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses committed May 16, 2024
1 parent 338f8ac commit c7d3871
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ pushfirst!(LOAD_PATH, joinpath(@__DIR__, "..")) # add Enzyme to environment stac

using Reactant
using Documenter
using Reactant_jll

struct TestRemote <: Remotes.Remote end
Remotes.repourl(::TestRemote) = "https://github.com/JuliaBinaryWrappers/Reactant_jll.jl"
function Remotes.fileurl(::TestRemote, ::Any, filename, linerange)
L1, L2 = first(linerange), last(linerange)
return "https://github.com/JuliaBinaryWrappers/Reactant_jll.jl/$(filename)#L$(L1)-$(L2)"
end
Remotes.issueurl(::TestRemote, issue) = "https://github.com/EnzymeAD/Reactant.jl/blob/$(issue)"

DocMeta.setdocmeta!(Reactant, :DocTestSetup, :(using Reactant); recursive=true)

Expand All @@ -19,16 +28,29 @@ for (_, name) in examples
Literate.markdown(example_filepath, OUTPUT_DIR, documenter = true)
end

run(Cmd(`rm -rf .git`, dir=Reactant_jll.artifact_dir))
run(Cmd(`git init`, dir=Reactant_jll.artifact_dir))
run(Cmd(`git remote add origin https://github.com/EnzymeAD/Reactant.jl`, dir=Reactant_jll.artifact_dir))
run(Cmd(`git add -A`, dir=Reactant_jll.artifact_dir))
run(Cmd(`git commit -m "Initial commit"`, dir=Reactant_jll.artifact_dir))

examples = [title => joinpath("generated", string(name, ".md")) for (title, name) in examples]

gh = Documenter.Remotes.GitHub("EnzymeAD", "Reactant.jl")

makedocs(;
modules=[Reactant, Reactant.XLA, Reactant.MLIR, Reactant.MLIR.API, Reactant.MLIR.IR, Reactant.MLIR.Dialects.chlo, Reactant.MLIR.Dialects.vhlo, Reactant.MLIR.Dialects.stablehlo, Reactant.MLIR.Dialects.enzyme, Reactant.MLIR.Dialects.arith, Reactant.MLIR.Dialects.func, Reactant.MLIR.Dialects.affine, Reactant.MLIR.Dialects.builtin],
authors="William Moses <[email protected]>, Valentin Churavy <[email protected]>",
repo="https://github.com/EnzymeAD/Reactant.jl/blob/{commit}{path}#{line}",
remotes=Dict(
# Just non-repository directories
joinpath(@__DIR__, "..") => gh,
Reactant_jll.artifact_dir => TestRemote(),
),
sitename="Reactant.jl",
format=Documenter.HTML(;
prettyurls=get(ENV, "CI", "false") == "true",
canonical="https://enzymead.github.io/Reactant.jl/",
size_threshold_ignore = ["api.md"],
assets = [
asset("https://plausible.io/js/plausible.js",
class=:js,
Expand Down

0 comments on commit c7d3871

Please sign in to comment.