|
| 1 | +using MultiDocumenter |
| 2 | + |
| 3 | +clonedir = mktempdir() |
| 4 | + |
| 5 | +docs = [ |
| 6 | + MultiDocumenter.DropdownNav("Debugging", [ |
| 7 | + MultiDocumenter.MultiDocRef( |
| 8 | + upstream = joinpath(clonedir, "Infiltrator"), |
| 9 | + path = "inf", |
| 10 | + name = "Infiltrator", |
| 11 | + giturl = "https://github.com/JuliaDebug/Infiltrator.jl.git", |
| 12 | + ), |
| 13 | + MultiDocumenter.MultiDocRef( |
| 14 | + upstream = joinpath(clonedir, "JuliaInterpreter"), |
| 15 | + path = "debug", |
| 16 | + name = "JuliaInterpreter", |
| 17 | + giturl = "https://github.com/JuliaDebug/JuliaInterpreter.jl.git", |
| 18 | + ), |
| 19 | + ]), |
| 20 | + MultiDocumenter.MultiDocRef( |
| 21 | + upstream = joinpath(clonedir, "DataSets"), |
| 22 | + path = "data", |
| 23 | + name = "DataSets", |
| 24 | + giturl = "https://github.com/JuliaComputing/DataSets.jl.git", |
| 25 | + # or use ssh instead for private repos: |
| 26 | + # giturl = "[email protected]:JuliaComputing/DataSets.jl.git", |
| 27 | + ), |
| 28 | +] |
| 29 | + |
| 30 | +outpath = mktempdir() |
| 31 | + |
| 32 | +MultiDocumenter.make( |
| 33 | + outpath, |
| 34 | + docs; |
| 35 | + search_engine = MultiDocumenter.SearchConfig( |
| 36 | + index_versions = ["stable"], |
| 37 | + engine = MultiDocumenter.FlexSearch |
| 38 | + ) |
| 39 | +) |
| 40 | + |
| 41 | +gitroot = normpath(joinpath(@__DIR__, "..")) |
| 42 | +try |
| 43 | + run(`git checkout gh-pages`) |
| 44 | +catch err |
| 45 | + # branch probably doesn't exist |
| 46 | + run(`git checkout -b gh-pages`) |
| 47 | +end |
| 48 | +for file in readdir(gitroot; join = true) |
| 49 | + endswith(file, ".git") && continue |
| 50 | + rm(file; force = true, recursive = true) |
| 51 | +end |
| 52 | +for file in readdir(outpath) |
| 53 | + cp(joinpath(outpath, file), joinpath(gitroot, file)) |
| 54 | +end |
| 55 | +run(`git add .`) |
| 56 | +run(`git commit -m 'Aggregate documentation'`) |
| 57 | +run(`git push`) |
| 58 | +run(`git checkout main`) |
0 commit comments