diff --git a/Project.toml b/Project.toml index d675affe1..44554c6d8 100644 --- a/Project.toml +++ b/Project.toml @@ -18,6 +18,10 @@ NNlib = "872c559c-99b0-510c-b3b7-b6c96a88d5cd" ReactantNNlibExt = "NNlib" [compat] -CEnum = "0.4" +Cassette = "0.3" +CEnum = "0.4, 0.5" Enzyme = "0.11, 0.12" Reactant_jll = "0.0.5" +Preferences = "1.4" +julia = "1" + diff --git a/docs/Project.toml b/docs/Project.toml new file mode 100644 index 000000000..1fa467423 --- /dev/null +++ b/docs/Project.toml @@ -0,0 +1,7 @@ +[deps] +Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" +Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[compat] +Documenter = "0.27.8" diff --git a/docs/make.jl b/docs/make.jl new file mode 100644 index 000000000..5d1ac49c7 --- /dev/null +++ b/docs/make.jl @@ -0,0 +1,50 @@ +pushfirst!(LOAD_PATH, joinpath(@__DIR__, "..")) # add Enzyme to environment stack + +using Reactant +using Documenter + +DocMeta.setdocmeta!(Reactant, :DocTestSetup, :(using Reactant); recursive=true) + +# Generate examples + +using Literate + +const EXAMPLES_DIR = joinpath(@__DIR__, "..", "examples") +const OUTPUT_DIR = joinpath(@__DIR__, "src/generated") + +examples = Pair{String,String}[] + +for (_, name) in examples + example_filepath = joinpath(EXAMPLES_DIR, string(name, ".jl")) + Literate.markdown(example_filepath, OUTPUT_DIR, documenter = true) +end + +examples = [title => joinpath("generated", string(name, ".md")) for (title, name) in examples] + +makedocs(; + modules=[Reactant], + authors="William Moses , Valentin Churavy ", + repo="https://github.com/EnzymeAD/Reactant.jl/blob/{commit}{path}#{line}", + sitename="Reactant.jl", + format=Documenter.HTML(; + prettyurls=get(ENV, "CI", "false") == "true", + canonical="https://enzymead.github.io/Reactant.jl/", + assets = [ + asset("https://plausible.io/js/plausible.js", + class=:js, + attributes=Dict(Symbol("data-domain") => "enzyme.mit.edu", :defer => "") + ) + ], + ), + pages = [ + "Home" => "index.md", + ], + doctest = true, + strict = true, +) + +deploydocs(; + repo="github.com/EnzymeAD/Reactant.jl", + devbranch = "main", + push_preview = true, +) diff --git a/docs/src/assets/logo.svg b/docs/src/assets/logo.svg new file mode 100644 index 000000000..8a78ccf44 --- /dev/null +++ b/docs/src/assets/logo.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/src/index.md b/docs/src/index.md new file mode 100644 index 000000000..54fe39eb2 --- /dev/null +++ b/docs/src/index.md @@ -0,0 +1,13 @@ +```@meta +CurrentModule = Reactant +DocTestSetup = quote + using Reactant +end +``` + +# Reactant + +Documentation for [Reactant.jl](https://github.com/EnzymeAD/Reactant.jl). + +This is truly something which we should write docs for. +