Skip to content

Commit 76133cb

Browse files
Add StochasticDiffEq.jl API documentation integration
Similar to the recent OrdinaryDiffEq.jl API docs addition, this commit: - Adds code to copy StochasticDiffEq.jl documentation to the DiffEqDocs build - Updates pages.jl to include StochasticDiffEq.jl API in navigation - Follows the same pattern as OrdinaryDiffEq.jl integration 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 7bc71f7 commit 76133cb

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

docs/make.jl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,23 @@ if isdir(ordinartdiffeq_docs_path)
2828
cp(common_first_steps_file, common_first_steps_dest, force=true)
2929
end
3030

31+
# Copy StochasticDiffEq.jl documentation
32+
stochasticdiffeq_docs_root = joinpath(dirname(pathof(StochasticDiffEq)), "..", "docs")
33+
stochasticdiffeq_docs_path = joinpath(stochasticdiffeq_docs_root, "src")
34+
if isdir(stochasticdiffeq_docs_path)
35+
# Create the StochasticDiffEq API directory in the docs
36+
stochastic_diffeq_dest = joinpath(@__DIR__, "src", "api", "stochasticdiffeq")
37+
mkpath(dirname(stochastic_diffeq_dest))
38+
39+
# Copy all the docs from StochasticDiffEq.jl
40+
cp(stochasticdiffeq_docs_path, stochastic_diffeq_dest, force=true)
41+
42+
# Copy the pages.jl file from StochasticDiffEq.jl
43+
stochastic_diffeq_pages_dest = joinpath(@__DIR__, "stochasticdiffeq_pages.jl")
44+
stochastic_diffeq_pages_file = joinpath(stochasticdiffeq_docs_root, "pages.jl")
45+
cp(stochastic_diffeq_pages_file, stochastic_diffeq_pages_dest, force=true)
46+
end
47+
3148
ENV["PLOTS_TEST"] = "true"
3249
ENV["GKSwstype"] = "100"
3350

docs/pages.jl

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,33 @@ end
2626

2727
ordinary_diffeq_pages = transform_ordinarydiffeq_pages(pages)
2828

29+
# Load StochasticDiffEq pages - if available
30+
stochastic_diffeq_pages_file = joinpath(@__DIR__, "stochasticdiffeq_pages.jl")
31+
stochastic_diffeq_pages = []
32+
if isfile(stochastic_diffeq_pages_file)
33+
include(stochastic_diffeq_pages_file)
34+
35+
# Transform StochasticDiffEq pages to have the api/stochasticdiffeq prefix
36+
function transform_stochasticdiffeq_pages(pages_array)
37+
transformed = []
38+
for page in pages_array
39+
if isa(page, String)
40+
push!(transformed, "api/stochasticdiffeq/" * page)
41+
elseif isa(page, Pair)
42+
key, value = page
43+
if isa(value, String)
44+
push!(transformed, key => "api/stochasticdiffeq/" * value)
45+
elseif isa(value, Vector)
46+
push!(transformed, key => transform_stochasticdiffeq_pages(value))
47+
end
48+
end
49+
end
50+
return transformed
51+
end
52+
53+
stochastic_diffeq_pages = transform_stochasticdiffeq_pages(pages)
54+
end
55+
2956
pages = Any["index.md",
3057
"getting_started.md",
3158
"Tutorials" => Any["tutorials/faster_ode_example.md",
@@ -94,4 +121,5 @@ pages = Any["index.md",
94121
"External Solver APIs" => Any["api/sundials.md",
95122
"api/daskr.md"],
96123
"OrdinaryDiffEq.jl API" => ordinary_diffeq_pages,
124+
"StochasticDiffEq.jl API" => stochastic_diffeq_pages,
97125
"Extra Details" => Any["extras/timestepping.md"]]

0 commit comments

Comments
 (0)