-
Notifications
You must be signed in to change notification settings - Fork 94
Expand file tree
/
Copy pathmake.jl
More file actions
67 lines (57 loc) · 2.07 KB
/
make.jl
File metadata and controls
67 lines (57 loc) · 2.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
pushfirst!(LOAD_PATH, joinpath(@__DIR__, "..")) # add Enzyme to environment stack
pushfirst!(LOAD_PATH, joinpath(@__DIR__, "..", "lib")) # add EnzymeCore to environment stack
using Enzyme
using EnzymeCore
using EnzymeTestUtils
using Documenter
DocMeta.setdocmeta!(Enzyme, :DocTestSetup, :(using Enzyme); recursive=true)
DocMeta.setdocmeta!(EnzymeCore, :DocTestSetup, :(using EnzymeCore); recursive=true)
DocMeta.setdocmeta!(EnzymeTestUtils, :DocTestSetup, :(using EnzymeTestUtils); recursive=true)
@eval EnzymeCore begin
const Enzyme = $(Enzyme)
end
# Generate examples
using Literate
const EXAMPLES_DIR = joinpath(@__DIR__, "..", "examples")
const OUTPUT_DIR = joinpath(@__DIR__, "src/generated")
examples = Pair{String,String}[
"Box model" => "box"
"AutoDiff API" => "autodiff"
"Custom rules" => "custom_rule"
]
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=[Enzyme, EnzymeCore, EnzymeTestUtils],
authors="William Moses <wmoses@mit.edu>, Valentin Churavy <vchuravy@mit.edu>",
repo="https://github.com/EnzymeAD/Enzyme.jl/blob/{commit}{path}#{line}",
sitename="Enzyme.jl",
format=Documenter.HTML(;
prettyurls=get(ENV, "CI", "false") == "true",
canonical="https://enzyme.mit.edu/julia/",
assets = [
asset("https://plausible.io/js/plausible.js",
class=:js,
attributes=Dict(Symbol("data-domain") => "enzyme.mit.edu", :defer => "")
)
],
),
pages = [
"Home" => "index.md",
"Examples" => examples,
"API" => "api.md",
"Implementing pullbacks" => "pullbacks.md",
"For developers" => "dev_docs.md",
"Internal API" => "internal_api.md",
],
doctest = true,
strict = true,
)
deploydocs(;
repo="github.com/EnzymeAD/Enzyme.jl",
devbranch = "main",
push_preview = true,
)