Skip to content

Commit 8b83e29

Browse files
authored
docs: add NavBar (#5)
1 parent 7759f10 commit 8b83e29

File tree

3 files changed

+29
-18
lines changed

3 files changed

+29
-18
lines changed

.github/workflows/documentation.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,21 @@ on:
1111
pull_request:
1212
workflow_dispatch:
1313

14+
concurrency:
15+
# Skip intermediate builds: always.
16+
# Cancel intermediate builds: only if it is a pull request build.
17+
group: ${{ github.workflow }}-${{ github.ref }}
18+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
19+
1420
jobs:
1521
build:
1622
permissions:
23+
actions: write # needed to allow julia-actions/cache to proactively delete old caches that it has created
1724
contents: write
1825
pull-requests: read
1926
statuses: write
2027
runs-on: ubuntu-latest
2128
steps:
22-
- uses: actions/checkout@v4
23-
- uses: julia-actions/setup-julia@v2
24-
- uses: julia-actions/cache@v2
2529
- uses: extractions/setup-just@v3
26-
- name: Install LibAACGM.jl
27-
run: just install && just install_lib docs
28-
- name: Build and deploy
29-
env:
30-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # If authenticating with GitHub Actions token
31-
run: julia --project=docs/ docs/make.jl
30+
- name: Build and deploy Documenter.jl docs
31+
uses: JuliaSpacePhysics/actions/DocsDocumenter@main

LibAACGM/src/LibAACGM.jl

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,37 @@ export AACGM_v2_SetDateTime, AACGM_v2_SetNow
1010
export AACGM_v2_Convert, AACGM_v2_Rylm, AACGM_v2_Rylm!
1111
export convert_geo_coord_v2
1212

13+
function set_env()
14+
AACGM_v2_DAT_PREFIX = joinpath(@__DIR__, "../../data/aacgm_coeffs-14/aacgm_coeffs-14-")
15+
ENV["AACGM_v2_DAT_PREFIX"] = AACGM_v2_DAT_PREFIX
16+
ENV["IGRF_COEFFS"] = joinpath(@__DIR__, "../../data/magmodel_1590-2025.txt")
17+
end
18+
1319
# Find the library path
1420
function find_library(name="aacgmlib")
15-
search_paths = [
16-
joinpath(@__DIR__, ".."),
21+
search_paths = (
22+
dirname(@__DIR__),
1723
"/usr/local/lib",
1824
"/usr/lib"
19-
]
25+
)
2026

2127
# Try to find the library
2228
for path in search_paths
2329
aacgmlib = joinpath(path, "$name.so")
2430
isfile(aacgmlib) && return aacgmlib
2531
end
26-
return name
32+
# if not try to install it
33+
@info "AACGM library not found, trying to install" run(`just install`)
34+
for path in search_paths
35+
aacgmlib = joinpath(path, "$name.so")
36+
isfile(aacgmlib) && return aacgmlib
37+
end
38+
error("AACGM library not found")
2739
end
2840

2941
const aacgmlib = find_library()
3042

31-
function __init__()
32-
AACGM_v2_DAT_PREFIX = joinpath(@__DIR__, "../../data/aacgm_coeffs-14/aacgm_coeffs-14-")
33-
ENV["AACGM_v2_DAT_PREFIX"] = AACGM_v2_DAT_PREFIX
34-
ENV["IGRF_COEFFS"] = joinpath(@__DIR__, "../../data/magmodel_1590-2025.txt")
35-
end
43+
__init__() = set_env()
3644

3745
AACGM_v2_SetNow() = @ccall aacgmlib.AACGM_v2_SetNow()::Int
3846
AACGM_v2_SetDateTime(yr, mo, dy, hr, mt, sc) =

docs/Project.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@ Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
55
DocumenterCitations = "daee34ce-89f3-4625-b898-19384cb65244"
66
LibAACGM = "ee618599-6bd6-46be-807e-a23e17005c2b"
77
PrettyPrinting = "54e16d92-306c-5ea0-a30b-337be88ac337"
8+
9+
[sources]
10+
LibAACGM = { path = "../LibAACGM" }

0 commit comments

Comments
 (0)