Skip to content

Commit afdf5d8

Browse files
committed
Merge branch 'main' into case-studies
2 parents 7f0f26f + d583153 commit afdf5d8

2 files changed

Lines changed: 25 additions & 33 deletions

File tree

.github/workflows/Documentation.yml

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,3 @@ jobs:
1919
env:
2020
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
2121
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22-
dev-docs-cleanup:
23-
needs: docs
24-
name: dev docs cleanup
25-
runs-on: ubuntu-latest
26-
steps:
27-
- name: Checkout gh-pages branch
28-
uses: actions/checkout@v4
29-
with:
30-
ref: gh-pages
31-
32-
- uses: julia-actions/setup-julia@v2
33-
with:
34-
version: '1'
35-
- uses: julia-actions/cache@v2
36-
37-
- name: Delete dev docs
38-
run: |
39-
git rm -rf ./Spectra/dev/
40-
- name: Push changes
41-
run: |
42-
git config user.name "Documenter.jl"
43-
git config user.email "[email protected]"
44-
git commit -m "delete dev docs"
45-
git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree})
46-
git push --force origin gh-pages-new:gh-pages

docs/make.jl

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,22 @@ JuliaAstroDocs.page_ecosystem(ecosystem)
1414
# Sync comparison.md
1515
JuliaAstroDocs.page_compare(ecosystem_t)
1616

17+
# Aggregate documentation location
18+
clonedir = ("--temp" in ARGS) ? mktempdir(; cleanup=false) : joinpath(@__DIR__, "clones")
19+
# Build location
20+
outpath = ("--temp" in ARGS) ? mktempdir(; cleanup=false) : joinpath(@__DIR__, "build")
21+
1722
# Prefer online docs, use local as fallback
1823
links = InterLinks(
1924
"AstroImages" => (
2025
"https://juliaastro.org/AstroImages/dev/",
2126
"https://juliaastro.org/AstroImages/dev/objects.inv",
22-
joinpath(@__DIR__, "clones", "AstroImages", "dev", "objects.inv"),
27+
joinpath(clonedir, "AstroImages", "dev", "objects.inv"),
2328
),
2429
"AstroLib" => (
2530
"https://juliaastro.org/AstroLib.jl/stable/",
2631
"https://juliaastro.org/AstroLib.jl/stable/objects.inv",
27-
joinpath(@__DIR__, "clones", "AstroLib", "dev", "objects.inv"),
32+
joinpath(clonedir, "AstroLib", "dev", "objects.inv"),
2833
)
2934
)
3035

@@ -54,6 +59,7 @@ mathengine = MathJax3(Dict(
5459
),
5560
))
5661

62+
@info "Beginning main build for JuliaAstro MultiDocumenter site"
5763
makedocs(
5864
sitename = "JuliaAstro",
5965
authors = "Julia Astro Contributors",
@@ -88,6 +94,7 @@ makedocs(
8894
warnonly = [:missing_docs],
8995
plugins = [links],
9096
)
97+
@info "Initial build complete"
9198

9299
postprocess_cb()
93100

@@ -103,9 +110,7 @@ wrapper_packages = [
103110
"WCS",
104111
]
105112

106-
107-
@info "Building aggregate JuliaAstro site"
108-
function generate_multidoc_refs(p; clonedir=joinpath(@__DIR__, "clones"))
113+
function generate_multidoc_refs(p; clonedir=clonedir)
109114
package_path = string(chopsuffix(p.name, ".jl"))
110115
package_name = if package_path in wrapper_packages
111116
"" * package_path
@@ -133,8 +138,6 @@ function generate_multidoc_refs(p; clonedir=joinpath(@__DIR__, "clones"))
133138
end
134139
end
135140

136-
ecosystem = JuliaAstroDocs.ecosystem()
137-
138141
docs = [
139142
# JuliaAstro's own generated pages
140143
MultiDocumenter.MultiDocRef(
@@ -153,6 +156,17 @@ docs = [
153156
end...,
154157
]
155158

159+
# This make file compiles the documentation for the JuliaAstro website.
160+
# It consists of the usual documenter structure, but also follows the approach
161+
# of the SciML docs page https://github.com/SciML/SciMLDocs/blob/main/docs/make.jl
162+
# by generating nested documentation for packages under the JuliaAstro organization.
163+
# That way, docs for all packages are browsable and searchable in one place!
164+
165+
@info "Beginning aggregate build for JuliaAstro site"
166+
@info """
167+
Documentation clone directory: $(clonedir)
168+
Build directory: $(outpath)
169+
"""
156170
MultiDocumenter.make(
157171
outpath,
158172
docs;
@@ -166,7 +180,10 @@ MultiDocumenter.make(
166180
brand_image = MultiDocumenter.BrandImage(".", joinpath("assets", "logo.svg")),
167181
sitemap = true,
168182
)
169-
@info "Aggregate build done"
183+
@info "Aggregate build complete"
184+
185+
# Remove dev docs from JuliaAstro site
186+
run(`rm -rf docs/build/Spectra/dev/`)
170187

171188
# Download logo
172189
# assets_dir = joinpath(outpath, "assets")

0 commit comments

Comments
 (0)