Skip to content

Commit 5b8720b

Browse files
authored
update to Documenter 0.25 (#200)
* use Documenter's built-in push_preview * fix documenter theme for 0.25 * use MathJax instead of KaTeX * use scss, fix dark theme * fix docs build * small coding style tweaks * add compiled css to .gitignore * yellow border for methodology when dark
1 parent 36b0449 commit 5b8720b

File tree

6 files changed

+154
-111
lines changed

6 files changed

+154
-111
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
Manifest.toml
66
docs/build
77
docs/site
8+
docs/src/assets/chainrules.css

docs/Manifest.toml

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,17 @@
33
[[Base64]]
44
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
55

6+
[[BinaryProvider]]
7+
deps = ["Libdl", "Logging", "SHA"]
8+
git-tree-sha1 = "ecdec412a9abc8db54c0efc5548c64dfce072058"
9+
uuid = "b99e7846-7c00-51b0-8f62-c81ae34c0232"
10+
version = "0.5.10"
11+
612
[[ChainRulesCore]]
713
deps = ["MuladdMacro"]
814
path = ".."
915
uuid = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
10-
version = "0.9.3"
16+
version = "0.9.5"
1117

1218
[[Dates]]
1319
deps = ["Printf"]
@@ -19,15 +25,24 @@ uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"
1925

2026
[[DocStringExtensions]]
2127
deps = ["LibGit2", "Markdown", "Pkg", "Test"]
22-
git-tree-sha1 = "88bb0edb352b16608036faadcc071adda068582a"
28+
git-tree-sha1 = "c5714d9bcdba66389612dc4c47ed827c64112997"
2329
uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
24-
version = "0.8.1"
30+
version = "0.8.2"
2531

2632
[[Documenter]]
27-
deps = ["Base64", "DocStringExtensions", "InteractiveUtils", "JSON", "LibGit2", "Logging", "Markdown", "REPL", "Test", "Unicode"]
28-
git-tree-sha1 = "d45c163c7a3ae293c15361acc52882c0f853f97c"
33+
deps = ["Base64", "Dates", "DocStringExtensions", "InteractiveUtils", "JSON", "LibGit2", "Logging", "Markdown", "REPL", "Test", "Unicode"]
34+
git-tree-sha1 = "1c593d1efa27437ed9dd365d1143c594b563e138"
2935
uuid = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
30-
version = "0.23.4"
36+
version = "0.25.1"
37+
38+
[[DocumenterTools]]
39+
deps = ["Base64", "DocStringExtensions", "Documenter", "FileWatching", "LibGit2", "Sass"]
40+
git-tree-sha1 = "6fa30234228d9020cbe31e393e9d183e944845bb"
41+
uuid = "35a29f4d-8980-5a13-9543-d66fff28ecb8"
42+
version = "0.1.7"
43+
44+
[[FileWatching]]
45+
uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee"
3146

3247
[[InteractiveUtils]]
3348
deps = ["Markdown"]
@@ -63,9 +78,9 @@ version = "0.2.2"
6378

6479
[[Parsers]]
6580
deps = ["Dates", "Test"]
66-
git-tree-sha1 = "0c16b3179190d3046c073440d94172cfc3bb0553"
81+
git-tree-sha1 = "10134f2ee0b1978ae7752c41306e131a684e1f06"
6782
uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0"
68-
version = "0.3.12"
83+
version = "1.0.7"
6984

7085
[[Pkg]]
7186
deps = ["Dates", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "UUIDs"]
@@ -86,6 +101,12 @@ uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
86101
[[SHA]]
87102
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"
88103

104+
[[Sass]]
105+
deps = ["BinaryProvider", "Libdl", "Test"]
106+
git-tree-sha1 = "de11179555c6363c5a61c4c94376db3498983734"
107+
uuid = "322a6be2-4ae8-5d68-aaf1-3e960788d1d9"
108+
version = "0.1.0"
109+
89110
[[Serialization]]
90111
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
91112

docs/Project.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
[deps]
22
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
33
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
4+
DocumenterTools = "35a29f4d-8980-5a13-9543-d66fff28ecb8"
45

56
[compat]
6-
Documenter = "~0.23"
7+
Documenter = "0.25"
8+
DocumenterTools = "0.1.6"

docs/make.jl

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using ChainRulesCore
22
using Documenter
3-
4-
@show ENV
3+
using DocumenterTools: Themes
54

65
DocMeta.setdocmeta!(
76
ChainRulesCore,
@@ -19,9 +18,15 @@ DocMeta.setdocmeta!(
1918
end
2019
)
2120

21+
Themes.compile(joinpath(@__DIR__, "src/assets/chainrules.scss"))
22+
2223
makedocs(
2324
modules=[ChainRulesCore],
24-
format=Documenter.HTML(prettyurls=false, assets=["assets/chainrules.css"]),
25+
format=Documenter.HTML(
26+
prettyurls=false,
27+
assets=["assets/chainrules.css"],
28+
mathengine=MathJax(),
29+
),
2530
sitename="ChainRules",
2631
authors="Jarrett Revels and other contributors",
2732
pages=[
@@ -40,24 +45,7 @@ makedocs(
4045
checkdocs=:exports,
4146
)
4247

43-
const repo = "github.com/JuliaDiff/ChainRulesCore.jl.git"
44-
const PR = get(ENV, "TRAVIS_PULL_REQUEST", "false")
45-
if PR == "false"
46-
# Normal case, only deploy docs if merging to master or release tagged
47-
deploydocs(repo=repo)
48-
else
49-
@info "Deploying review docs for PR #$PR"
50-
# TODO: remove most of this once https://github.com/JuliaDocs/Documenter.jl/issues/1131 is resolved
51-
52-
# Overwrite Documenter's function for generating the versions.js file
53-
foreach(Base.delete_method, methods(Documenter.Writers.HTMLWriter.generate_version_file))
54-
Documenter.Writers.HTMLWriter.generate_version_file(_, _) = nothing
55-
# Overwrite necessary environment variables to trick Documenter to deploy
56-
ENV["TRAVIS_PULL_REQUEST"] = "false"
57-
ENV["TRAVIS_BRANCH"] = "master"
58-
59-
deploydocs(
60-
devurl="preview-PR$(PR)",
61-
repo=repo,
62-
)
63-
end
48+
deploydocs(
49+
repo = "github.com/JuliaDiff/ChainRulesCore.jl.git",
50+
push_preview=true,
51+
)

docs/src/assets/chainrules.css

Lines changed: 0 additions & 78 deletions
This file was deleted.

docs/src/assets/chainrules.scss

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
// Only for light theme
2+
3+
html:not(.theme--documenter-dark) body #documenter {
4+
5+
// Links
6+
7+
a {
8+
color: #4595D1;
9+
}
10+
11+
a:hover, a:focus {
12+
color: #194E82;
13+
}
14+
15+
// Navigation
16+
17+
.docs-sidebar {
18+
box-shadow: none;
19+
color: #FFFFFF;
20+
background-color: #194E82;
21+
22+
ul.docs-menu {
23+
border-top: none;
24+
25+
%nav-hover {
26+
color: #FFFFFF;
27+
background-color: #4595D1;
28+
}
29+
30+
.tocitem {
31+
color: #FFFFFF;
32+
background: none;
33+
34+
&:hover { @extend %nav-hover; }
35+
}
36+
37+
li.is-active {
38+
border-top: none;
39+
border-bottom: none;
40+
41+
.tocitem {
42+
@extend %nav-hover;
43+
44+
&:hover { @extend %nav-hover; }
45+
}
46+
47+
ul.internal {
48+
margin: 0;
49+
border-top: none;
50+
51+
li {
52+
margin-top: 0;
53+
}
54+
55+
.tocitem {
56+
color: #194E82;
57+
background-color: #FFFFFF;
58+
padding: 0.5em;
59+
padding-left: 1em;
60+
61+
&:hover { @extend %nav-hover; }
62+
}
63+
}
64+
}
65+
}
66+
}
67+
68+
// Text
69+
70+
article#documenter-page a.docs-heading-anchor {
71+
color: #194E82;
72+
}
73+
74+
// Code
75+
76+
code {
77+
color: inherit;
78+
79+
.hljs-meta { color: #4595D1; }
80+
81+
.hljs-keyword { color: #194E82; }
82+
}
83+
84+
pre, code {
85+
font-family: "Liberation Mono", "Consolas", "DejaVu Sans Mono", "Ubuntu Mono", "andale mono", "lucida console", monospace;
86+
}
87+
}
88+
89+
// Terminology Block
90+
91+
.admonition.is-category-terminology {
92+
background-color: #FFFEDD;
93+
border-color: #FFEC8B;
94+
95+
> .admonition-header {
96+
background-color: #FFEC8B;
97+
color: black;
98+
99+
&:before {
100+
content: "Terminology: ";
101+
font-family: inherit;
102+
font-weight: bold;
103+
}
104+
}
105+
}
106+
107+
html.theme--documenter-dark .admonition.is-category-terminology {
108+
border-color: #FFEC8B;
109+
}

0 commit comments

Comments
 (0)