Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a getting started tutorial #109

Merged
merged 28 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
0b7c8e1
update
SamuelBrand1 Mar 1, 2024
d86b12d
added doc deps
SamuelBrand1 Mar 4, 2024
dfeaf54
started `getting started` notebook
SamuelBrand1 Mar 4, 2024
2ce57b4
Update getting_started.jl
SamuelBrand1 Mar 4, 2024
9089270
Getting started example
SamuelBrand1 Mar 5, 2024
e163b15
Add generated Pluto notebooks to gitignore
SamuelBrand1 Mar 5, 2024
5774a21
remove old version of example
SamuelBrand1 Mar 5, 2024
e7c60ce
add Pluto and PlutoStaticHTML as deps
SamuelBrand1 Mar 5, 2024
ee9e1ca
Adapt make and build files to generate Pluto notebooks statically and…
SamuelBrand1 Mar 5, 2024
fd5d554
Merge branch 'main' into add-doc-examples
SamuelBrand1 Mar 5, 2024
359a3c2
include build step for rendering Pluto notebooks
SamuelBrand1 Mar 5, 2024
ca2707e
remove old version of the getting started example
SamuelBrand1 Mar 5, 2024
f7816de
update
SamuelBrand1 Mar 1, 2024
0b4bfe2
added doc deps
SamuelBrand1 Mar 4, 2024
36fd0ea
started `getting started` notebook
SamuelBrand1 Mar 4, 2024
58e9744
Update getting_started.jl
SamuelBrand1 Mar 4, 2024
6513caf
Getting started example
SamuelBrand1 Mar 5, 2024
1c740db
Add generated Pluto notebooks to gitignore
SamuelBrand1 Mar 5, 2024
a37c77a
remove old version of example
SamuelBrand1 Mar 5, 2024
66782b8
add Pluto and PlutoStaticHTML as deps
SamuelBrand1 Mar 5, 2024
6853614
Adapt make and build files to generate Pluto notebooks statically and…
SamuelBrand1 Mar 5, 2024
2fbe618
include build step for rendering Pluto notebooks
SamuelBrand1 Mar 5, 2024
d97c92a
remove old version of the getting started example
SamuelBrand1 Mar 5, 2024
6019674
Merge branch 'main' into add-doc-examples
SamuelBrand1 Mar 6, 2024
e805792
Update EpiAware/docs/src/examples/getting_started.jl
seabbs Mar 6, 2024
0189ac1
Merge branch 'add-doc-examples' of https://github.com/CDCgov/Rt-witho…
SamuelBrand1 Mar 6, 2024
14b5d30
Remove unnecessary `CSV` dep in test
SamuelBrand1 Mar 6, 2024
f825d38
fix getting started
SamuelBrand1 Mar 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -381,3 +381,6 @@ docs/site/
/Manifest.toml
.DS_Store
.vscode/settings.json

#Ignore generated Pluto notebooks
EpiAware/docs/src/examples/*.md
9 changes: 9 additions & 0 deletions EpiAware/docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
[deps]
Changelog = "5217a498-cd5d-4ec6-b8c2-9b85a09b6e3e"
DataFramesMeta = "1313f7d8-7da2-5740-9ea0-a2ca25f37964"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DynamicPPL = "366bfd00-2699-11ea-058f-f148b4cae6d8"
EpiAware = "b2eeebe4-5992-4301-9193-7ebc9f62c855"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Pluto = "c3e4b0f8-55cb-11ea-2926-15256bba5781"
PlutoStaticHTML = "359b1769-a58e-495b-9770-312e911026ad"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
StatsPlots = "f3b207a7-027a-5e70-b257-86293d7955fd"
Turing = "fce5fe82-541a-59a6-adf8-730c64b5f9a0"
24 changes: 24 additions & 0 deletions EpiAware/docs/build.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

"""Run all Pluto notebooks (".jl" files) in `tutorials_dir` and write outputs to HTML files."""
function build(target_subdir; _module = EpiAware)
target_dir = joinpath(pkgdir(_module), "docs", "src", target_subdir)

@info "Building notebooks in $target_subdir"
# Evaluate notebooks in the same process to avoid having to recompile from scratch each time.
# This is similar to how Documenter and Franklin evaluate code.
# Note that things like method overrides and other global changes may leak between notebooks!
use_distributed = false
output_format = documenter_output
bopts = BuildOptions(target_dir; use_distributed, output_format)
build_notebooks(bopts)
return nothing
end

"Return Markdown file links which can be passed to Documenter.jl."
function markdown_files(notebook_titles, target_subdir)
md_files = map(notebook_titles) do title
file = lowercase(replace(title, " " => '_'))
return joinpath(target_subdir, "$file.md")
end
return md_files
end
10 changes: 9 additions & 1 deletion EpiAware/docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
using Documenter
using EpiAware
using Pluto: Configuration.CompilerOptions
using PlutoStaticHTML

include("changelog.jl")
include("pages.jl")
include("build.jl")

build("examples")

makedocs(; sitename = "EpiAware.jl",
authors = "Samuel Brand, Zachary Susswein, Sam Abbott, and contributors",
Expand All @@ -11,7 +16,10 @@ makedocs(; sitename = "EpiAware.jl",
modules = [EpiAware],
pages = pages,
format = Documenter.HTML(
prettyurls = get(ENV, "CI", nothing) == "true"
prettyurls = get(ENV, "CI", nothing) == "true",
mathengine = Documenter.MathJax3(),
size_threshold = 600 * 2^10,
size_threshold_warn = 200 * 2^10
)
)

Expand Down
2 changes: 1 addition & 1 deletion EpiAware/docs/pages.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pages = [
"Manual" => Any[
"Guide" => "man/guide.md",
"Examples" => [
"Getting started" => "man/getting-started.md"
"Getting started" => "examples/getting_started.md"
]
],
"Reference" => Any[
Expand Down
Loading
Loading