Skip to content

Commit 8887bb2

Browse files
committed
Merge branch 'source' into multidoc-auto-highlevels
2 parents 76e9fad + 21801c3 commit 8887bb2

4 files changed

Lines changed: 148 additions & 10 deletions

File tree

.github/workflows/DocPreviewCleanup.yml

Lines changed: 60 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ name: Doc Preview Cleanup
33
on:
44
pull_request:
55
types: [closed]
6+
schedule:
7+
- cron: "0 0 */14 * *"
68

79
jobs:
810
doc-preview-cleanup:
@@ -13,16 +15,65 @@ jobs:
1315
with:
1416
ref: gh-pages
1517

16-
- name: Delete preview and history
18+
- uses: julia-actions/setup-julia@v2
19+
with:
20+
version: '1'
21+
- uses: julia-actions/cache@v2
22+
23+
- name: Check for stale PR previews
24+
shell: julia {0}
1725
run: |
18-
git config user.name "Documenter.jl"
19-
git config user.email "documenter@juliadocs.github.io"
20-
git rm -rf "previews/PR$PRNUM"
21-
git commit -m "delete preview"
22-
git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree})
23-
env:
24-
PRNUM: ${{ github.event.number }}
26+
using Pkg
27+
Pkg.activate(temp = true)
28+
Pkg.add(["HTTP", "JSON3"])
29+
30+
using HTTP
31+
using JSON3
32+
using Dates
33+
34+
repo = ENV["GITHUB_REPOSITORY"]
35+
retention_days = 14
36+
37+
pr_previews = map(filter(startswith("PR"), readdir("previews"))) do dir
38+
parse(Int, match(r"PR(\d*)", dir)[1])
39+
end
40+
41+
function all_prs()
42+
url = "https://api.github.com/repos/$repo/pulls?per_page=100;page=$(page)"
43+
query_prs(page) = JSON3.read(HTTP.get(url).body)
44+
prs = []
45+
page = 1
46+
while true
47+
page_prs = query_prs(page)
48+
isempty(page_prs) && break
49+
append!(prs, page_prs)
50+
page += 1
51+
end
52+
return prs
53+
end
54+
prs = all_prs()
55+
open_within_threshold = map(x -> x.number, filter(prs) do pr
56+
time = DateTime(pr.updated_at[1:19], ISODateTimeFormat)
57+
return pr.state == "open" && Dates.days(now() - time) <= retention_days
58+
end)
59+
60+
stale_previews = setdiff(pr_previews, open_within_threshold)
61+
@info "Found $(length(stale_previews)) stale previews"
62+
63+
if isempty(stale_previews)
64+
@info "No stale previews"
65+
exit(1)
66+
end
2567
68+
for pr in stale_previews
69+
path = joinpath("previews", "PR$pr")
70+
@info "Removing $path"
71+
run(`git rm -rf $path`)
72+
end
2673
- name: Push changes
2774
run: |
28-
git push --force origin gh-pages-new:gh-pages
75+
git config user.name "Documenter.jl"
76+
git config user.email "documenter@juliadocs.github.io"
77+
git commit -m "delete preview"
78+
git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree})
79+
git push --force origin gh-pages-new:gh-pages

docs/make.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Building aggregate site into: $(outpath)
1717

1818
@info "Building MultiDocumenter site for JuliaAstro"
1919

20+
include("pages.jl")
2021
mathengine = MathJax3(Dict(
2122
:loader => Dict("load" => ["[tex]/require", "[tex]/mathtools"]),
2223
:tex => Dict(
@@ -187,7 +188,7 @@ deploydocs(;
187188
repo = "github.com/JuliaAstro/JuliaAstro.github.io",
188189
push_preview = true,
189190
branch = "master",
190-
devbranch = "multidocumenter",
191+
devbranch = "source",
191192
versions = nothing,
192193
)
193194
@info "Deploy complete"

docs/pages.jl

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# This file specifies what packages to document
2+
3+
# Plain documenter pages
4+
fullpages = Any[
5+
"Home"=>"index.md",
6+
# "Ecosystem" => "ecosystem.md";
7+
"Tutorials" => [
8+
"tutorials/index.md",
9+
"General" => [
10+
"tutorials/jwst-image-scale-bar.md",
11+
"tutorials/tabular-data.md",
12+
"tutorials/curve-fit.md",
13+
]
14+
],
15+
"Time, Coordinates, & Units" => "highlevels/timecoords.md",
16+
"Images" => "highlevels/images.md",
17+
"Data I/O" => "highlevels/dataio.md",
18+
"Cosmology" => "highlevels/cosmology.md",
19+
"Orbits & Emphemerides" => "highlevels/orb-ephem.md",
20+
"Numerical Utilities" => "highlevels/numerical-utils.md",
21+
"Statistics" => "highlevels/stats.md",
22+
]

docs/src/highlevels/timecoords.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Time, Coordinates, & Units Overview
2+
3+
### AstroAngles.jl
4+
5+
[![curly braces](../assets/code.png) Repository](https://github.com/JuliaAstro/AstroAngles.jl)
6+
7+
[![book icon](../assets/book.png) Documentation](https://juliaastro.org/AstroAngles.jl/dev/)
8+
9+
**String parsing and representation of angles**
10+
11+
- Parse and represent sexagesimal angles with a variety of delimiters
12+
- Methods for converting to hour-minute-second angles from degrees and radians, and vice-versa
13+
14+
### AstroTime.jl
15+
16+
[![curly braces](../assets/code.png) Repository](https://github.com/JuliaAstro/AstroTime.jl)
17+
18+
[![book icon](../assets/book.png) Documentation](https://juliaastro.github.io/AstroTime.jl/stable/)
19+
20+
**Astronomical time keeping**
21+
22+
- High-precision, time-scale aware, DateTime-like data type
23+
- Support all commonly used astronomical time scales
24+
25+
### ERFA.jl
26+
27+
[![curly braces](../assets/code.png) Repository](https://github.com/JuliaAstro/ERFA.jl)
28+
29+
[![book icon](../assets/book.png) Documentation](https://juliaastro.org/ERFA.jl/stable/)
30+
31+
**Time systems conversions**
32+
33+
- Low-level wrapper for [liberfa](https://github.com/liberfa/erfa)
34+
35+
### SkyCoords.jl
36+
37+
[![curly braces](../assets/code.png) Repository](https://github.com/JuliaAstro/SkyCoords.jl)
38+
39+
[![book icon](../assets/book.png) Documentation](https://juliaastro.org/SkyCoords.jl/stable/)
40+
41+
**Astronomical coordinate systems**
42+
43+
- Supports ICRS, galactic, and FK5 coordinate systems
44+
- Fast conversion of coordinates between different systems
45+
46+
### UnitfulAstro.jl
47+
48+
[![curly braces](../assets/code.png) Repository](https://github.com/JuliaAstro/UnitfulAstro.jl)
49+
50+
[![book icon](../assets/book.png) Documentation](https://juliaastro.github.io/UnitfulAstro.jl/stable/)
51+
52+
**Astronomical units**
53+
54+
- Extension of [Unitful.jl](https://github.com/painterqubits/Unitful.jl)
55+
56+
### WCS.jl
57+
58+
[![curly braces](../assets/code.png) Repository](https://github.com/JuliaAstro/WCS.jl)
59+
60+
[![book icon](../assets/book.png) Documentaiton](https://juliaastro.github.io/WCS.jl/stable/)
61+
62+
**World Coordinate System transformations**
63+
64+
- Wrapper for [wcslib](https://www.atnf.csiro.au/people/mcalabre/WCS/wcslib/)

0 commit comments

Comments
 (0)