Skip to content

Commit

Permalink
Rework demo architecture to use Pluto notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
dahong67 committed Jun 14, 2024
1 parent b341054 commit 12c94a7
Show file tree
Hide file tree
Showing 12 changed files with 1,805 additions and 21 deletions.
314 changes: 313 additions & 1 deletion docs/Manifest.toml

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
GCPDecompositions = "f59fb95b-1bc8-443b-b347-5e445a549f37"
LiveServer = "16fef848-5104-11e9-1b77-fb7a48bbb589"
Pluto = "c3e4b0f8-55cb-11ea-2926-15256bba5781"
PlutoStaticHTML = "359b1769-a58e-495b-9770-312e911026ad"

[compat]
Documenter = "1.4"
LiveServer = "1.3"
Pluto = "0.19"
PlutoStaticHTML = "6.0"
julia = "1.10"
24 changes: 19 additions & 5 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
using Documenter, GCPDecompositions
using PlutoStaticHTML
using InteractiveUtils

# Render demos
DEMO_DIR = joinpath(pkgdir(GCPDecompositions), "docs", "src", "demos")
DEMO_DICT = build_notebooks(
BuildOptions(DEMO_DIR; previous_dir = DEMO_DIR, output_format = documenter_output),
OutputOptions(; append_build_context = true),
)
DEMO_FILES = keys(DEMO_DICT)

# Make docs
makedocs(;
modules = [GCPDecompositions],
sitename = "GCPDecompositions.jl",
Expand All @@ -14,11 +24,14 @@ makedocs(;
"Algorithms" => "man/algorithms.md",
],
"Demos" => [
hide("Social network data" => "demos/uci-social-network.md"),
hide("Mouse neuron data" => "demos/mouse-neuron.md"),
hide("India rainfall data" => "demos/india-rainfall.md"),
hide("Gas sensor data" => "demos/chemo-sensing.md"),
hide("Chicago crime data" => "demos/chicago-crime.md"),
"Overview" => "demos/main.md",
[
get(
PlutoStaticHTML.Pluto.frontmatter(joinpath(DEMO_DIR, FILE)),
"title",
FILE,
) => joinpath("demos", "$(splitext(FILE)[1]).md") for FILE in DEMO_FILES
]...,
],
"Developer Docs" =>
["Tensor Kernels" => "dev/kernels.md", "Private functions" => "dev/private.md"],
Expand All @@ -28,4 +41,5 @@ makedocs(;
),
)

# Deploy docs
deploydocs(; repo = "github.com/dahong67/GCPDecompositions.jl.git")
9 changes: 9 additions & 0 deletions docs/serve.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using GCPDecompositions
using LiveServer

# Make list of demos to ignore
DEMO_DIR = joinpath(pkgdir(GCPDecompositions), "docs", "src", "demos")
DEMO_FILES = ["$(splitext(f)[1]).md" for f in readdir(DEMO_DIR) if splitext(f)[2] == ".jl"]

# Serve the docs
servedocs(; launch_browser = true, skip_files = joinpath.(DEMO_DIR, DEMO_FILES))
2 changes: 2 additions & 0 deletions docs/src/demos/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.md
!main.md
3 changes: 0 additions & 3 deletions docs/src/demos/chemo-sensing.md

This file was deleted.

3 changes: 0 additions & 3 deletions docs/src/demos/chicago-crime.md

This file was deleted.

3 changes: 0 additions & 3 deletions docs/src/demos/india-rainfall.md

This file was deleted.

6 changes: 6 additions & 0 deletions docs/src/demos/main.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Overview of demos

!!! warning "Work-in-progress"

This page of the docs is still a work-in-progress. Check back later!

3 changes: 0 additions & 3 deletions docs/src/demos/mouse-neuron.md

This file was deleted.

Loading

0 comments on commit 12c94a7

Please sign in to comment.