Skip to content

Commit f20d64f

Browse files
committed
make file
1 parent 64c0a0c commit f20d64f

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

docs/make.jl

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
using Documenter
2+
using Literate
3+
using ShallowWaters
4+
5+
EXAMPLE = joinpath(@__DIR__, "assets", "swm_equations.jl")
6+
OUTPUT = joinpath(@__DIR__, "src")
7+
8+
# Generate markdown
9+
binder_badge = "# [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/milankl/ShallowWaters.jl/gh-pages?labpath=dev%2Fswm_equations.ipynb)"
10+
function preprocess_docs(content)
11+
return string(binder_badge, "\n\n", content)
12+
end
13+
14+
Literate.markdown(EXAMPLE, OUTPUT; preprocess=preprocess_docs, codefence="```julia" => "```")
15+
Literate.notebook(EXAMPLE, OUTPUT)
16+
17+
pages = [
18+
"Introduction" => "index.md",
19+
"Tutorial" => "swm_equations.md",
20+
"Reference" => "reference.md",
21+
]
22+
23+
makedocs(
24+
sitename = "ShallowWaters.jl",
25+
format = Documenter.HTML(prettyurls = get(ENV, "CI", nothing) == "true"),
26+
modules = [ShallowWaters],
27+
pages = pages,
28+
)
29+
30+
deploydocs(
31+
repo = "github.com/milankl/ShallowWaters.jl.git",
32+
push_preview = true,
33+
devbranch = "main",
34+
)

0 commit comments

Comments
 (0)