Skip to content

Commit d583153

Browse files
authored
Merge pull request #109 from JuliaAstro/remove-dev-docs
Remove dev docs from build
2 parents 2419098 + f0ce0f9 commit d583153

2 files changed

Lines changed: 25 additions & 48 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 & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,35 +14,25 @@ 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

31-
# This make file compiles the documentation for the JuliaAstro website.
32-
# It consists of the usual documenter structure, but also follows the approach
33-
# of the SciML docs page https://github.com/SciML/SciMLDocs/blob/main/docs/make.jl
34-
# by generating nested documentation for packages under the JuliaAstro organization.
35-
# That way, docs for all packages are browsable and searchable in one place!
36-
37-
clonedir = ("--temp" in ARGS) ? mktempdir(; cleanup=false) : joinpath(@__DIR__, "clones")
38-
outpath = ("--temp" in ARGS) ? mktempdir(; cleanup=false) : joinpath(@__DIR__, "build")
39-
40-
@info """
41-
Cloning packages into: $(clonedir)
42-
Building aggregate site into: $(outpath)
43-
"""
44-
45-
@info "Building MultiDocumenter site for JuliaAstro"
4636
mathengine = MathJax3(Dict(
4737
:loader => Dict("load" => ["[tex]/require", "[tex]/mathtools"]),
4838
:tex => Dict(
@@ -51,6 +41,7 @@ mathengine = MathJax3(Dict(
5141
),
5242
))
5343

44+
@info "Beginning main build for JuliaAstro MultiDocumenter site"
5445
makedocs(
5546
sitename = "JuliaAstro",
5647
authors = "Julia Astro Contributors",
@@ -83,6 +74,7 @@ makedocs(
8374
warnonly = [:missing_docs],
8475
plugins = [links],
8576
)
77+
@info "Initial build complete"
8678

8779
# Differentiate between pure Julia and wrapper packages
8880
wrapper_packages = [
@@ -96,9 +88,7 @@ wrapper_packages = [
9688
"WCS",
9789
]
9890

99-
100-
@info "Building aggregate JuliaAstro site"
101-
function generate_multidoc_refs(p; clonedir=joinpath(@__DIR__, "clones"))
91+
function generate_multidoc_refs(p; clonedir=clonedir)
10292
package_path = string(chopsuffix(p.name, ".jl"))
10393
package_name = if package_path in wrapper_packages
10494
"" * package_path
@@ -126,8 +116,6 @@ function generate_multidoc_refs(p; clonedir=joinpath(@__DIR__, "clones"))
126116
end
127117
end
128118

129-
ecosystem = JuliaAstroDocs.ecosystem()
130-
131119
docs = [
132120
# JuliaAstro's own generated pages
133121
MultiDocumenter.MultiDocRef(
@@ -146,6 +134,17 @@ docs = [
146134
end...,
147135
]
148136

137+
# This make file compiles the documentation for the JuliaAstro website.
138+
# It consists of the usual documenter structure, but also follows the approach
139+
# of the SciML docs page https://github.com/SciML/SciMLDocs/blob/main/docs/make.jl
140+
# by generating nested documentation for packages under the JuliaAstro organization.
141+
# That way, docs for all packages are browsable and searchable in one place!
142+
143+
@info "Beginning aggregate build for JuliaAstro site"
144+
@info """
145+
Documentation clone directory: $(clonedir)
146+
Build directory: $(outpath)
147+
"""
149148
MultiDocumenter.make(
150149
outpath,
151150
docs;
@@ -159,7 +158,10 @@ MultiDocumenter.make(
159158
brand_image = MultiDocumenter.BrandImage(".", joinpath("assets", "logo.svg")),
160159
sitemap = true,
161160
)
162-
@info "Aggregate build done"
161+
@info "Aggregate build complete"
162+
163+
# Remove dev docs from JuliaAstro site
164+
run(`rm -rf docs/build/Spectra/dev/`)
163165

164166
# Download logo
165167
# assets_dir = joinpath(outpath, "assets")

0 commit comments

Comments
 (0)