Skip to content

Commit 0ece2d0

Browse files
committed
Switch site to MultiDocumenter.jl and add package docs
1 parent 48e7185 commit 0ece2d0

File tree

129 files changed

+896
-3527
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+896
-3527
lines changed

.github/workflows/Deploy.yml

Lines changed: 24 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,30 @@
1-
name: Build and Deploy
1+
name: Build and deploy
2+
23
on:
4+
schedule:
5+
- cron: "0 */6 * * *" # Run every 6 hours
6+
pull_request:
37
push:
48
branches:
5-
- main
6-
paths:
7-
- 'website/**'
9+
- master
10+
tags: "*"
11+
workflow_dispatch:
12+
13+
permissions:
14+
actions: write
15+
contents: write
16+
817
jobs:
9-
build-and-deploy:
18+
docs:
19+
name: Documentation
1020
runs-on: ubuntu-latest
1121
steps:
12-
- name: Checkout
13-
uses: actions/checkout@v2
14-
with:
15-
persist-credentials: false
16-
# NOTE: Python is necessary for the pre-rendering (minification) step
17-
- name: Install python
18-
uses: actions/setup-python@v2
19-
with:
20-
python-version: '3.8'
21-
# NOTE: Here you can install dependencies such as matplotlib if you use
22-
# packages such as PyPlot.
23-
# - run: pip install matplotlib
24-
- name: Install Julia
25-
uses: julia-actions/setup-julia@v1
26-
with:
27-
version: 1.8
28-
# NOTE
29-
# The steps below ensure that NodeJS and Franklin are loaded then it
30-
# installs highlight.js which is needed for the prerendering step
31-
# (code highlighting + katex prerendering).
32-
# Then the environment is activated and instantiated to install all
33-
# Julia packages which may be required to successfully build your site.
34-
# The last line should be `optimize()` though you may want to give it
35-
# specific arguments, see the documentation or ?optimize in the REPL.
36-
- run: julia -e '
37-
cd("website");
38-
using Pkg; Pkg.activate("."); Pkg.instantiate();
39-
using NodeJS; run(`$(npm_cmd()) install highlight.js`);
40-
run(`$(npm_cmd()) install lunr`);
41-
run(`$(npm_cmd()) install cheerio`);
42-
using Franklin;
43-
lunr();
44-
optimize()'
45-
- name: Build and Deploy
46-
uses: JamesIves/github-pages-deploy-action@releases/v3
47-
with:
48-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49-
BRANCH: gh-pages
50-
FOLDER: website/__site
22+
- uses: actions/checkout@v4
23+
- uses: julia-actions/setup-julia@v2
24+
- uses: julia-actions/cache@v2
25+
- run: |
26+
julia --project=docs -e 'using Pkg; Pkg.instantiate()'
27+
- run: |
28+
git config user.name github-actions
29+
git config user.email github-actions@github.com
30+
julia --project=docs docs/make.jl deploy

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
.DS_Store
22
.vscode/
3-
.ipynb_checkpoints/
3+
.ipynb_checkpoints/
4+
docs/build
5+
docs/clones
6+
*/Manifest.toml

JuliaHPC/Project.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
name = "JuliaHPC"
2+
uuid = "785f4173-1021-4a9f-a8d5-3f9e0cca329a"
3+
authors = ["JamesWrigley <james@puiterwijk.org>"]
4+
version = "0.1.0"

JuliaHPC/src/JuliaHPC.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module JuliaHPC
2+
3+
greet() = print("Hello World!")
4+
5+
end # module JuliaHPC
File renamed without changes.

docs/Project.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[deps]
2+
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
3+
LiveServer = "16fef848-5104-11e9-1b77-fb7a48bbb589"
4+
MultiDocumenter = "87ed4bf0-c935-4a67-83c3-2a03bee4197c"

docs/make.jl

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
import Documenter
2+
import MultiDocumenter
3+
4+
clonedir = joinpath(@__DIR__, "clones")
5+
deploying = "deploy" in ARGS
6+
7+
# Build local docs
8+
Documenter.makedocs(
9+
sitename = "JuliaHPC",
10+
pages = [
11+
"index.md",
12+
"For Users" => [
13+
"user_gettingstarted.md",
14+
"user_vscode.md",
15+
"user_hpcprofiling/index.md",
16+
"user_hpcsystems.md",
17+
"user_faq.md"
18+
],
19+
"For System Admins" => [
20+
"sysadmin_julia.md"
21+
]
22+
],
23+
format = Documenter.HTML(assets = ["assets/favicon.ico"])
24+
)
25+
26+
# Helper function stolen from DynamicalSystemsDocs.jl
27+
function multidocref(package, descr = "")
28+
name = "$(package).jl"
29+
if !isempty(descr)
30+
name *= " - $(descr)"
31+
end
32+
33+
MultiDocumenter.MultiDocRef(;
34+
upstream = joinpath(clonedir, package),
35+
path = lowercase(package),
36+
name,
37+
giturl = "https://github.com/JuliaParallel/$(name).git",
38+
)
39+
end
40+
41+
link(package) = MultiDocumenter.Link("$(package).jl", "https://github.com/JuliaParallel/$(package).jl")
42+
43+
docs = [
44+
MultiDocumenter.MultiDocRef(
45+
upstream = joinpath(@__DIR__, "build"),
46+
path = "Overview",
47+
name = "Home",
48+
fix_canonical_url = false,),
49+
MultiDocumenter.DropdownNav("HPC packages", [
50+
multidocref("MPI", "Julia bindings to MPI"),
51+
multidocref("Dagger", "DAG-based computing"),
52+
MultiDocumenter.MultiDocRef(;
53+
upstream = joinpath(clonedir, "ParallelProcessingTools"),
54+
path = "parallelprocessingtools",
55+
name = "ParallelProcessingTools.jl - Utilities for doing parallel/distributed computing",
56+
giturl = "https://github.com/oschulz/ParallelProcessingTools.jl.git")
57+
]),
58+
MultiDocumenter.MegaDropdownNav("Distributed packages", [
59+
MultiDocumenter.Column("Implementations", [
60+
MultiDocumenter.Link("Distributed.jl - Stdlib for distributed computing", "https://docs.julialang.org/en/v1/stdlib/Distributed/"),
61+
multidocref("DistributedNext", "Bleeding-edge fork of Distributed.jl")
62+
]),
63+
MultiDocumenter.Column("Cluster managers", [
64+
link("SlurmClusterManager"),
65+
link("MPIClusterManagers"),
66+
link("ElasticClusterManager"),
67+
link("LSFClusterManager")
68+
])
69+
])
70+
]
71+
72+
outpath = deploying ? mktempdir() : joinpath(@__DIR__, "build")
73+
74+
MultiDocumenter.make(
75+
outpath,
76+
docs;
77+
search_engine = MultiDocumenter.SearchConfig(
78+
index_versions = ["stable"],
79+
engine = MultiDocumenter.FlexSearch
80+
),
81+
assets_dir = "docs/src/assets",
82+
brand_image = MultiDocumenter.BrandImage("https://juliahpc.github.io", "assets/logo.png")
83+
)
84+
85+
if "deploy" in ARGS
86+
@info "Deploying to GitHub" ARGS
87+
gitroot = normpath(joinpath(@__DIR__, ".."))
88+
run(`git pull`)
89+
outbranch = "gh-pages"
90+
has_outbranch = true
91+
if !success(`git checkout $outbranch`)
92+
has_outbranch = false
93+
if !success(`git switch --orphan $outbranch`)
94+
@error "Cannot create new orphaned branch $outbranch."
95+
exit(1)
96+
end
97+
end
98+
for file in readdir(gitroot; join = true)
99+
endswith(file, ".git") && continue
100+
rm(file; force = true, recursive = true)
101+
end
102+
for file in readdir(outpath)
103+
cp(joinpath(outpath, file), joinpath(gitroot, file))
104+
end
105+
run(`git add .`)
106+
if success(`git commit -m 'Aggregate documentation'`)
107+
@info "Pushing updated documentation."
108+
if has_outbranch
109+
run(`git push`)
110+
else
111+
run(`git push -u origin $outbranch`)
112+
end
113+
run(`git checkout master`)
114+
else
115+
@info "No changes to aggregated documentation."
116+
end
117+
else
118+
@info "Skipping deployment, 'deploy' not passed. Generated files in $(outpath)." ARGS
119+
end

docs/src/assets/favicon.ico

1.37 KB
Binary file not shown.
File renamed without changes.

docs/src/assets/logo.png

14.6 KB
Loading

0 commit comments

Comments
 (0)