Skip to content

Commit 569a30b

Browse files
committed
lecture 1
1 parent 1b53798 commit 569a30b

File tree

204 files changed

+4899
-32123
lines changed

Some content is hidden

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

204 files changed

+4899
-32123
lines changed

docs/Project.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
[deps]
22
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
33
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
4-
ChainRules = "082447d4-558c-5d27-93f4-14fc19e9eca2"
5-
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
6-
ChainRulesTestUtils = "cdddcdb0-9152-4a09-a978-84456f9df70a"
74
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
85
DocumenterTools = "35a29f4d-8980-5a13-9543-d66fff28ecb8"
6+
DocumenterVitepress = "4710194d-e776-4893-9690-8d956a29c365"
97
GraphRecipes = "bd48cda9-67a9-57be-86fa-5b3c104eda73"
108
IRTools = "7869d1d1-7146-5819-86e3-90919afe41df"
119
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
10+
LiveServer = "16fef848-5104-11e9-1b77-fb7a48bbb589"
1211
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
1312
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
13+
Scientific_Programming_in_Julia = "ff288558-a322-4c39-84bc-85bf6acf7e03"
1414
SoftPosit = "0775deef-a35f-56d7-82da-cfc52f91364d"
1515
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
1616
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

docs/liveserver.jl

100755100644
File mode changed.

docs/make.jl

Lines changed: 72 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -1,130 +1,82 @@
1-
using Documenter
2-
3-
using Downloads: download
4-
using Documenter.Writers: HTMLWriter
5-
using DocumenterTools.Themes
6-
7-
8-
# download and compile theme
9-
assetsdir(args...) = joinpath(@__DIR__, "src", "assets", args...)
10-
site = "https://github.com/JuliaTeachingCTU/JuliaCTUGraphics/raw/main/"
11-
force = true
12-
13-
mkpath(assetsdir("themes"))
14-
mv(download("$(site)logo/CTU-logo-dark.svg"), assetsdir("logo-dark.svg"); force)
15-
mv(download("$(site)logo/CTU-logo.svg"), assetsdir("logo.svg"); force)
16-
mv(download("$(site)icons/favicon.ico"), assetsdir("favicon.ico"); force)
17-
18-
# for theme in ["light", "dark"]
19-
# mktemp(@__DIR__) do path, io
20-
# write(io, join([
21-
# read(joinpath(HTMLWriter.ASSETS_THEMES, "documenter-$(theme).css"), String),
22-
# read(download("$(site)assets/lectures-$(theme).css"), String)
23-
# ], "\n"))
24-
# Themes.compile(
25-
# path,
26-
# joinpath(@__DIR__, assetsdir("themes", "documenter-$(theme).css"))
27-
# )
28-
# end
29-
# end
30-
31-
32-
# documentation
1+
using Documenter, DocumenterVitepress
2+
using Documenter.Remotes
3+
4+
using Scientific_Programming_in_Julia
5+
6+
# This is needed for live preview
7+
if get(ENV, "VITREPRESS_LIVE_PREVIEW", "false") == "true"
8+
VITREPRESS_KWARGS = (;
9+
md_output_path=".",
10+
build_vitepress=false,
11+
)
12+
MAKEDOCS_KWARGS = (; clean=false,)
13+
else
14+
VITREPRESS_KWARGS = (;)
15+
MAKEDOCS_KWARGS = (;)
16+
end
17+
18+
@show VITREPRESS_KWARGS
19+
@show MAKEDOCS_KWARGS
20+
21+
# utilities
22+
function add_prefix(prefix::S, pair::Pair{S,T}) where {S<:AbstractString,T}
23+
key, val = pair
24+
if isa(val, AbstractString)
25+
return key => joinpath(prefix, val)
26+
else
27+
return key => add_prefix(prefix, val)
28+
end
29+
end
30+
31+
function add_prefix(prefix::AbstractString, pairs::AbstractVector{<:Pair})
32+
return add_prefix.(prefix, pairs)
33+
end
34+
35+
# pages
3336
pages = [
3437
"Home" => "index.md",
35-
"Installation" => "installation.md",
36-
"Projects" => "projects.md",
37-
"1: Introduction" => [
38-
"Motivation" => "./lecture_01/motivation.md",
39-
"Basics" => "./lecture_01/basics.md",
40-
"Examples" => "./lecture_01/demo.md",
41-
"Outline" => "./lecture_01/outline.md",
42-
"Lab" => "./lecture_01/lab.md",
43-
"Homework" => "./lecture_01/hw.md",
44-
],
45-
46-
"2: The power of type system & multiple dispatch" => [
47-
"Lecture" => "./lecture_02/lecture.md",
48-
"Lab" => "./lecture_02/lab.md",
49-
"Homework" => "./lecture_02/hw.md",
50-
],
51-
52-
"3: Design patterns" => [
53-
"Lecture" => "./lecture_03/lecture.md",
54-
"Lab" => "./lecture_03/lab.md",
55-
"Homework" => "./lecture_03/hw.md",
56-
],
57-
58-
"4: Package development, unit tests & CI" => [
59-
"Lecture" => "./lecture_04/lecture.md",
60-
"Lab" => "./lecture_04/lab.md",
61-
"Homework" => "./lecture_04/hw.md",
62-
],
63-
64-
"5: Performance benchmarking" => [
65-
"Lecture" => "./lecture_05/lecture.md",
66-
"Lab" => "./lecture_05/lab.md",
67-
"Homework" => "./lecture_05/hw.md",
68-
],
69-
70-
"6: Lanuage introspection" => [
71-
"Lecture" => "./lecture_06/lecture.md",
72-
"Lab" => "./lecture_06/lab.md",
73-
"Homework" => "./lecture_06/hw.md",
74-
],
75-
76-
"7: Macros" => [
77-
"Lecture" => "./lecture_07/lecture.md",
78-
"Lab" => "./lecture_07/lab.md",
79-
"Homework" => "./lecture_07/hw.md",
80-
],
81-
82-
"8: Automatic differentiation" => [
83-
"Lecture" => "./lecture_08/lecture.md",
84-
"Lab" => "./lecture_08/lab.md",
85-
"Homework" => "./lecture_08/hw.md",
86-
],
87-
88-
"9: Intermediate representation" => [
89-
"Lecture v.2 (newest)" => "./lecture_09/lecture.md",
90-
"Lecture v.1 (older)" => "./lecture_09_v1/lecture.md",
91-
"Lab" => "./lecture_09_v1/lab.md",
92-
],
93-
94-
"10: Parallel programming" => [
95-
"Lecture" => "./lecture_10/lecture.md",
96-
"Lab" => "./lecture_10/lab.md",
97-
"Homework" => "./lecture_10/hw.md",
98-
],
99-
100-
"11: GPU programming" => [
101-
"Lecture" => "./lecture_11/lecture.md",
102-
"Lab" => "./lecture_11/lab.md",
103-
],
104-
105-
"12: Ordinary Differential Equations" => [
106-
"Lecture" => "./lecture_12/lecture.md",
107-
"Lab" => "./lecture_12/lab.md",
108-
"Homework" => "./lecture_12/hw.md",
109-
],
38+
"Tutorials" => add_prefix("./tutorials", [
39+
"Installation" => "installation.md",
40+
]),
41+
"Projects" => add_prefix("./projects", [
42+
"Requirements" => "requirements.md",
43+
"Potential projects" => "projects.md",
44+
]),
45+
"Lectures" => add_prefix("./lectures", [
46+
"Outline" => "outline.md",
47+
"1: Introduction" => add_prefix("lecture_01", [
48+
"Motivation" => "motivation.md",
49+
"Basics" => "basics.md",
50+
"Examples" => "demo.md",
51+
"Lab" => "lab.md",
52+
"Homework" => "hw.md",
53+
]),
54+
]),
11055
]
11156

57+
# documentation
58+
organisation = "JuliaTeachingCTU"
59+
repository = "Scientific-Programming-in-Julia"
60+
repo = Remotes.GitHub(organisation, repository)
11261

11362
makedocs(;
114-
authors = "JuliaTeachingCTU",
115-
# repo = "https://github.com/JuliaTeachingCTU/Scientific-Programming-in-Julia/blob/{commit}{path}#{line}",
116-
sitename = "Scientific Programming in Julia",
117-
pagesonly = true,
118-
format = Documenter.HTML(;
119-
prettyurls = true,
120-
canonical = "https://JuliaTeachingCTU.github.io/Scientific-Programming-in-Julia",
121-
assets = ["assets/favicon.ico"],
122-
collapselevel = 1,
123-
ansicolor=true,
124-
mathengine=Documenter.MathJax3(),
63+
modules=[Scientific_Programming_in_Julia],
64+
authors=organisation,
65+
repo=repo,
66+
sitename="Scientific Programming in Julia",
67+
format=DocumenterVitepress.MarkdownVitepress(;
68+
repo=Remotes.repourl(repo),
69+
VITREPRESS_KWARGS...,
12570
),
126-
pages
71+
pages=pages,
72+
warnonly=true,
73+
MAKEDOCS_KWARGS...,
12774
)
75+
12876
deploydocs(;
129-
repo = "github.com/JuliaTeachingCTU/Scientific-Programming-in-Julia",
77+
repo=repo,
78+
target="build",
79+
devbranch="main",
80+
branch="gh-pages",
81+
push_preview=true,
13082
)

0 commit comments

Comments
 (0)