-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathmake.jl
65 lines (56 loc) · 1.94 KB
/
make.jl
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
using DynamicQuantities
using DynamicQuantities.Units
using DynamicQuantities: constructorof, with_type_parameters, dimension_names
using Documenter
using Documenter.Remotes: GitHub
DocMeta.setdocmeta!(DynamicQuantities, :DocTestSetup, :(using DynamicQuantities); recursive=true)
readme = open(dirname(@__FILE__) * "/../README.md") do io
read(io, String)
end
# We replace every instance of <img src="IMAGE" ...> with .
readme = replace(readme, r"<img src=\"([^\"]+)\"[^>]+>.*" => s"")
# Then, we remove any line with "<div" on it:
readme = replace(readme, r"<[/]?div.*" => s"")
# Finally, we read in file docs/src/index_base.md:
index_base = open(dirname(@__FILE__) * "/src/index_base.md") do io
read(io, String)
end
# And then we create "/src/index.md":
open(dirname(@__FILE__) * "/src/index.md", "w") do io
write(io, readme)
write(io, "\n")
write(io, index_base)
end
makedocs(;
modules=[DynamicQuantities, DynamicQuantities.Units],
authors="MilesCranmer <[email protected]> and contributors",
repo=GitHub("SymbolicML/DynamicQuantities.jl"),
sitename="DynamicQuantities.jl",
format=Documenter.HTML(;
prettyurls=get(ENV, "CI", "false") == "true",
canonical="https://ai.damtp.cam.ac.uk/dynamicquantities/stable",
edit_link="main",
assets=String[]
),
pages=[
"Home" => "index.md",
"Examples" => "examples.md",
"Utilities" => "api.md",
"Units" => "units.md",
"Constants" => "constants.md",
"Symbolic Units" => "symbolic_units.md",
"Types" => "types.md",
],
warnonly = [:missing_docs]
)
deploydocs(;
repo="github.com/SymbolicML/DynamicQuantities.jl",
devbranch="main"
)
# Mirror to DAMTP:
ENV["DOCUMENTER_KEY"] = ENV["DOCUMENTER_KEY_CAM"]
ENV["GITHUB_REPOSITORY"] = "ai-damtp-cam-ac-uk/dynamicquantities.git"
deploydocs(;
repo="github.com/ai-damtp-cam-ac-uk/dynamicquantities.git",
devbranch="main"
)