Skip to content

Commit

Permalink
adds Literate.jl in Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
navidcy committed Jan 7, 2020
1 parent 658f82c commit cfe6ee0
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 5 deletions.
1 change: 1 addition & 0 deletions docs/Project.toml
@@ -1,3 +1,4 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
GeophysicalFlows = "44ee3b1c-bc02-53fa-8355-8e347616e15e"
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
43 changes: 38 additions & 5 deletions docs/make.jl
@@ -1,12 +1,42 @@
# Workaround for JuliaLang/julia/pull/28625
if Base.HOME_PROJECT[] !== nothing
Base.HOME_PROJECT[] = abspath(Base.HOME_PROJECT[])
end
push!(LOAD_PATH, "..")

using
Documenter,
Literate,
GeophysicalFlows

#####
##### Generate examples
#####

const EXAMPLES_DIR = joinpath(@__DIR__, "..", "examples")
const OUTPUT_DIR = joinpath(@__DIR__, "src/generated")

examples = [
"twodturb_mcwilliams1984.jl"
]

for example in examples
example_filepath = joinpath(EXAMPLES_DIR, example)
Literate.markdown(example_filepath, OUTPUT_DIR, documenter=true)
end


#####
##### Build and deploy docs
#####

# Set up a timer to print a dot '.' every 60 seconds. This is to avoid Travis CI
# timing out when building demanding Literate.jl examples.
Timer(t -> println("."), 0, interval=60)

format = Documenter.HTML(
collapselevel = 1,
prettyurls = get(ENV, "CI", nothing) == "true",
canonical = "https://fourierflows.github.io/GeophysicalFlows.jl/dev/"
)


makedocs(
modules = [GeophysicalFlows],
doctest = false,
Expand All @@ -16,13 +46,16 @@ checkdocs = :all,
authors = "Navid C. Constantinou and Gregory L. Wagner",
sitename = "GeophysicalFlows.jl",
pages = Any[
"Home" => "index.md",
"Home" => "index.md",
"Modules" => Any[
"modules/twodturb.md",
"modules/barotropicqg.md",
"modules/barotropicqgql.md",
"modules/multilayerqg.md"
],
"Examples" => [
"Two-dimensional turbulence" => "generated/twodturb_mcwilliams1984.md"
],
"DocStrings" => Any[
"man/types.md",
"man/functions.md"]
Expand Down

0 comments on commit cfe6ee0

Please sign in to comment.