Skip to content

Commit a3b7e80

Browse files
update
1 parent ea6126b commit a3b7e80

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

.github/workflows /documentation.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ jobs:
2121
- uses: julia-actions/cache@v2
2222
- name: Install dependencies
2323
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
24+
- name: Setup symlink
25+
run: ln -s ../../class01/class01.md class01.md
26+
working-directory: docs/src
2427
- name: Build and deploy
2528
env:
2629
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

docs/make.jl

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,14 @@ using Pluto
33

44
include("definitions.jl")
55

6+
repo_dir = dirname(@__DIR__)
7+
build_dir = joinpath(repo_dir, "docs", "build")
8+
9+
plutos = [
10+
joinpath(repo_dir, "class01", "background_materials", "basics_math.jl"),
11+
]
12+
613
makedocs(
7-
modules=[LearningToControlClass],
814
sitename = "LearningToControlClass",
915
format = Documenter.HTML(;
1016
assets = ["assets/wider.css", "assets/redlinks.css"],
@@ -16,11 +22,24 @@ makedocs(
1622
),
1723
)),
1824
),
19-
pages = [
20-
"Home" => "index.md",
25+
pages = [
26+
"Home" => "index.md",
27+
"Class 1" => "class01.md",
2128
],
2229
)
2330

31+
s = Pluto.ServerSession();
32+
for pluto in plutos
33+
nb = Pluto.SessionActions.open(s, pluto; run_async=false)
34+
html_contents = Pluto.generate_html(nb; binder_url_js="undefined")
35+
filename = replace(pluto, repo_dir => build_dir)
36+
html_path = replace(filename, r"\.jl$" => ".html")
37+
mkpath(dirname(html_path))
38+
open(html_path, "w") do f
39+
write(f, html_contents)
40+
end
41+
end
42+
2443
# Documenter can also automatically deploy documentation to gh-pages.
2544
# See "Hosting Documentation" and deploydocs() in the Documenter manual
2645
# for more information.

0 commit comments

Comments
 (0)