Skip to content

Commit 9aecdce

Browse files
start a tutorials build
1 parent 058e3b2 commit 9aecdce

File tree

7 files changed

+135
-0
lines changed

7 files changed

+135
-0
lines changed

.github/workflows/Documentation.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags: '*'
8+
pull_request:
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- uses: julia-actions/setup-julia@latest
16+
with:
17+
version: '1'
18+
- name: Install dependencies
19+
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
20+
- name: Build and deploy
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token
23+
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # For authentication with SSH deploy key
24+
run: julia --project=docs/ docs/make.jl

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ Manifest.toml
1111
tutorials/**/*.html
1212
tutorials/**/*.pdf
1313
/*/*/jl_*/
14+
docs/src/*
15+
docs/build/*

Project.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name = "SciMLTutorialsOutput"
2+
uuid = "a6fd76b9-682b-4eeb-9311-f9971b362b20"
3+
authors = ["Chris Rackauckas <[email protected]>"]
4+
version = "1.0.0"
5+
6+
[deps]
7+
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
8+
9+
[compat]
10+
Documenter = "0.27"
11+
julia = "1.6"

docs/Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[deps]
2+
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"

docs/make.jl

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using Documenter, SciMLTutorialsOutput
2+
3+
dir = @__DIR__() * "/.."
4+
5+
@show dir
6+
@show readdir(dir)
7+
8+
include("pages.jl")
9+
10+
makedocs(
11+
sitename="The SciML Tutorials",
12+
authors="Chris Rackauckas",
13+
modules=[SciMLTutorialsOutput],
14+
clean=true, doctest=false,
15+
format=Documenter.HTML(#analytics = "UA-90474609-3",
16+
assets=["assets/favicon.ico"],
17+
canonical="https://tutorials.sciml.ai/stable/"),
18+
pages=pages
19+
)
20+
21+
deploydocs(;
22+
repo="github.com/SciML/SciMLTutorialsOutput",
23+
devbranch="main",
24+
branch="main"
25+
)

docs/pages.jl

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# This file assumes `dir` is the directory for the package! dir = @__DIR__() * "/.."
2+
3+
dir = @__DIR__() * "/.."
4+
5+
cp(joinpath(dir, "markdown"), joinpath(dir, "docs", "src"), force=true)
6+
cp(joinpath(dir, "README.md"), joinpath(dir, "docs", "src", "index.md"), force=true)
7+
tutorialsdir = joinpath(dir, "docs", "src")
8+
9+
pages = Any["SciMLTutorials.jl: Tutorials for Scientific Machine Learning (SciML), Equation Solvers, and AI for Science"=>"index.md"]
10+
11+
for folder in readdir(tutorialsdir)
12+
newpages = Any[]
13+
if folder[end-2:end] != ".md" && folder != "Testing" && folder != "figures"
14+
for file in filter(x -> x[end-2:end] == ".md", readdir(
15+
joinpath(tutorialsdir, folder)))
16+
try
17+
filecontents = readlines(joinpath(tutorialsdir, folder, file))
18+
title = filecontents[3][9:end-1]
19+
20+
# Cut out the first 5 lines from the file to remove the Weave header stuff
21+
open(joinpath(tutorialsdir, folder, file), "w") do output
22+
println(output, "# $title")
23+
for line in Iterators.drop(filecontents, 4)
24+
println(output, line)
25+
end
26+
end
27+
push!(newpages, title => joinpath(folder, file))
28+
catch e
29+
@show folder, file, e
30+
end
31+
end
32+
push!(pages, folder => newpages)
33+
end
34+
end
35+
36+
#=
37+
# The result is in alphabetical order, change to the wanted order
38+
39+
permute!(pages,
40+
[1, 8, 11, 17, 3, 4, 7, 5, 9, 12, 18, 10, 16, 6, 15, 13, 14, 2]
41+
)
42+
43+
names = [
44+
"SciMLBenchmarks.jl: Benchmarks for Scientific Machine Learning (SciML) and Equation Solvers",
45+
"Multi-Language Wrapper Benchmarks",
46+
"Non-Stiff Ordinary Differential Equations",
47+
"Stiff Ordinary Differential Equations",
48+
"Biological Differential Equations",
49+
"Differential-Algebraic Equations (DAEs)",
50+
"Method of Lines Partial Differential Equations (PDEs)",
51+
"Dynamical ODEs (Hamiltonian and Second Order)",
52+
"N-Body Problem Benchmarks",
53+
"Non-Stiff Stochastic Differential Equations",
54+
"Stiff Stochastic Differential Equations",
55+
"Non-Stiff Delay Differential Equations",
56+
"Stiff Delay Differential equations",
57+
"Jump Process Equations (Gillespie Benchmarks)",
58+
"Parameter Estimation and Inverse Problem Benchmarks",
59+
"Physics-Informed Neural Network (Neural Network PDE Solver) Cost Function Benchmarks",
60+
"Physics-Informed Neural Network (Neural Network PDE Solver) Optimizer Benchmarks",
61+
"SDE Adaptivity Benchmarks"]
62+
63+
for i in 1:length(pages)
64+
pages[i] = names[i] => pages[i][2]
65+
end
66+
=#

src/SciMLTutorialsOutput.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module SciMLTutorialsOutput
2+
3+
# Package is just for auto-docs generation
4+
5+
end # module

0 commit comments

Comments
 (0)