-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #67 from neonWhiteout/StyleAdherence
Style adherence
- Loading branch information
Showing
7 changed files
with
258 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
build/ | ||
src/generated/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
using Documenter | ||
using Literate | ||
|
||
const literate_dir = joinpath(@__DIR__, "literate") | ||
const generated_dir = joinpath(@__DIR__, "src", "generated") | ||
|
||
@info "Loading StockFlow.jl" | ||
using StockFlow | ||
|
||
const no_literate = "--no-literate" in ARGS | ||
if !no_literate | ||
@info "Building Literate.jl docs" | ||
|
||
# XXX: Work around old LaTeX distribution in GitHub CI. | ||
if haskey(ENV, "GITHUB_ACTIONS") | ||
import TikzPictures | ||
TikzPictures.standaloneWorkaround(true) | ||
end | ||
|
||
# Set Literate.jl config if not being compiled on recognized service. | ||
config = Dict{String,String}() | ||
if !(haskey(ENV, "GITHUB_ACTIONS") || haskey(ENV, "GITLAB_CI")) | ||
config["nbviewer_root_url"] = "https://nbviewer.jupyter.org/github/AlgebraicJulia/StockFlow.jl/blob/gh-pages/dev" | ||
config["repo_root_url"] = "https://github.com/AlgebraicJulia/StockFlow.jl/blob/main/docs" | ||
end | ||
|
||
for (root, dirs, files) in walkdir(literate_dir) | ||
out_dir = joinpath(generated_dir, relpath(root, literate_dir)) | ||
for file in files | ||
if last(splitext(file)) == ".jl" | ||
Literate.markdown(joinpath(root, file), out_dir; | ||
config=config, documenter=true, credit=false) | ||
Literate.notebook(joinpath(root, file), out_dir; | ||
execute=true, documenter=true, credit=false) | ||
end | ||
end | ||
end | ||
end | ||
|
||
@info "Building Documenter.jl docs" | ||
makedocs( | ||
modules = [StockFlow], | ||
format = Documenter.HTML( | ||
assets = ["assets/analytics.js"], | ||
), | ||
sitename = "StockFlow.jl", | ||
doctest = false, | ||
checkdocs = :none, | ||
pages = Any[ | ||
"StockFlow.jl" => "index.md", | ||
] | ||
) | ||
|
||
@info "Deploying docs" | ||
deploydocs( | ||
target = "build", | ||
repo = "github.com/AlgebraicJulia/StockFlow.jl.git", | ||
branch = "gh-pages" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# [StockFlow](@id StockFlow) | ||
|
||
```@autodocs | ||
Modules = [ | ||
StockFlow, | ||
StockFlow.Syntax, | ||
StockFlow.PremadeModels | ||
] | ||
Private = false | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.