|
| 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 | +=# |
0 commit comments