From c7d3871d404623d7f2a75b994305651925e11075 Mon Sep 17 00:00:00 2001 From: "William S. Moses" Date: Thu, 16 May 2024 11:48:31 -0400 Subject: [PATCH] more remote stuff --- docs/make.jl | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/docs/make.jl b/docs/make.jl index 7c76d2290..18b909c8b 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -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) @@ -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 , Valentin Churavy ", - 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,