diff --git a/.gitignore b/.gitignore index 45f0c4f21..e3def87da 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ Manifest.toml docs/build docs/site +docs/src/assets/chainrules.css diff --git a/docs/Manifest.toml b/docs/Manifest.toml index c96759de6..c58a79af6 100644 --- a/docs/Manifest.toml +++ b/docs/Manifest.toml @@ -3,11 +3,17 @@ [[Base64]] uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" +[[BinaryProvider]] +deps = ["Libdl", "Logging", "SHA"] +git-tree-sha1 = "ecdec412a9abc8db54c0efc5548c64dfce072058" +uuid = "b99e7846-7c00-51b0-8f62-c81ae34c0232" +version = "0.5.10" + [[ChainRulesCore]] deps = ["MuladdMacro"] path = ".." uuid = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" -version = "0.9.3" +version = "0.9.5" [[Dates]] deps = ["Printf"] @@ -19,15 +25,24 @@ uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b" [[DocStringExtensions]] deps = ["LibGit2", "Markdown", "Pkg", "Test"] -git-tree-sha1 = "88bb0edb352b16608036faadcc071adda068582a" +git-tree-sha1 = "c5714d9bcdba66389612dc4c47ed827c64112997" uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" -version = "0.8.1" +version = "0.8.2" [[Documenter]] -deps = ["Base64", "DocStringExtensions", "InteractiveUtils", "JSON", "LibGit2", "Logging", "Markdown", "REPL", "Test", "Unicode"] -git-tree-sha1 = "d45c163c7a3ae293c15361acc52882c0f853f97c" +deps = ["Base64", "Dates", "DocStringExtensions", "InteractiveUtils", "JSON", "LibGit2", "Logging", "Markdown", "REPL", "Test", "Unicode"] +git-tree-sha1 = "1c593d1efa27437ed9dd365d1143c594b563e138" uuid = "e30172f5-a6a5-5a46-863b-614d45cd2de4" -version = "0.23.4" +version = "0.25.1" + +[[DocumenterTools]] +deps = ["Base64", "DocStringExtensions", "Documenter", "FileWatching", "LibGit2", "Sass"] +git-tree-sha1 = "6fa30234228d9020cbe31e393e9d183e944845bb" +uuid = "35a29f4d-8980-5a13-9543-d66fff28ecb8" +version = "0.1.7" + +[[FileWatching]] +uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee" [[InteractiveUtils]] deps = ["Markdown"] @@ -63,9 +78,9 @@ version = "0.2.2" [[Parsers]] deps = ["Dates", "Test"] -git-tree-sha1 = "0c16b3179190d3046c073440d94172cfc3bb0553" +git-tree-sha1 = "10134f2ee0b1978ae7752c41306e131a684e1f06" uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" -version = "0.3.12" +version = "1.0.7" [[Pkg]] deps = ["Dates", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "UUIDs"] @@ -86,6 +101,12 @@ uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" [[SHA]] uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" +[[Sass]] +deps = ["BinaryProvider", "Libdl", "Test"] +git-tree-sha1 = "de11179555c6363c5a61c4c94376db3498983734" +uuid = "322a6be2-4ae8-5d68-aaf1-3e960788d1d9" +version = "0.1.0" + [[Serialization]] uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" diff --git a/docs/Project.toml b/docs/Project.toml index 67e1adef2..66770708a 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -1,6 +1,8 @@ [deps] ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" +DocumenterTools = "35a29f4d-8980-5a13-9543-d66fff28ecb8" [compat] -Documenter = "~0.23" +Documenter = "0.25" +DocumenterTools = "0.1.6" diff --git a/docs/make.jl b/docs/make.jl index aead8d4bd..8d1012ed1 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,7 +1,6 @@ using ChainRulesCore using Documenter - -@show ENV +using DocumenterTools: Themes DocMeta.setdocmeta!( ChainRulesCore, @@ -19,9 +18,15 @@ DocMeta.setdocmeta!( end ) +Themes.compile(joinpath(@__DIR__, "src/assets/chainrules.scss")) + makedocs( modules=[ChainRulesCore], - format=Documenter.HTML(prettyurls=false, assets=["assets/chainrules.css"]), + format=Documenter.HTML( + prettyurls=false, + assets=["assets/chainrules.css"], + mathengine=MathJax(), + ), sitename="ChainRules", authors="Jarrett Revels and other contributors", pages=[ @@ -40,24 +45,7 @@ makedocs( checkdocs=:exports, ) -const repo = "github.com/JuliaDiff/ChainRulesCore.jl.git" -const PR = get(ENV, "TRAVIS_PULL_REQUEST", "false") -if PR == "false" - # Normal case, only deploy docs if merging to master or release tagged - deploydocs(repo=repo) -else - @info "Deploying review docs for PR #$PR" - # TODO: remove most of this once https://github.com/JuliaDocs/Documenter.jl/issues/1131 is resolved - - # Overwrite Documenter's function for generating the versions.js file - foreach(Base.delete_method, methods(Documenter.Writers.HTMLWriter.generate_version_file)) - Documenter.Writers.HTMLWriter.generate_version_file(_, _) = nothing - # Overwrite necessary environment variables to trick Documenter to deploy - ENV["TRAVIS_PULL_REQUEST"] = "false" - ENV["TRAVIS_BRANCH"] = "master" - - deploydocs( - devurl="preview-PR$(PR)", - repo=repo, - ) -end +deploydocs( + repo = "github.com/JuliaDiff/ChainRulesCore.jl.git", + push_preview=true, +) diff --git a/docs/src/assets/chainrules.css b/docs/src/assets/chainrules.css deleted file mode 100644 index f4b0a164f..000000000 --- a/docs/src/assets/chainrules.css +++ /dev/null @@ -1,78 +0,0 @@ -/* Links */ - -a { - color: #4595D1; -} - -a:hover, a:focus { - color: #194E82; -} - -/* Navigation */ - -nav.toc ul a:hover, -nav.toc ul.internal a:hover { - color: #FFFFFF; - background-color: #4595D1; -} - -nav.toc ul .toctext { - color: #FFFFFF; -} - -nav.toc { - box-shadow: none; - color: #FFFFFF; - background-color: #194E82; -} - -nav.toc li.current > .toctext { - color: #FFFFFF; - background-color: #4595D1; - border-top-width: 0px; - border-bottom-width: 0px; -} - -nav.toc ul.internal a { - color: #194E82; - background-color: #FFFFFF; -} - -/* Text */ - -article#docs a.nav-anchor { - color: #194E82; -} - -article#docs blockquote { - font-style: italic; -} - -/* Terminology Block */ - -div.admonition.terminology div.admonition-title:before { - content: "Terminology: "; - font-family: inherit; - font-weight: bold; -} -div.admonition.terminology div.admonition-title { - background-color: #FFEC8B; -} - -div.admonition.terminology div.admonition-text { - background-color: #FFFEDD; -} - -/* Code */ - -code .hljs-meta { - color: #4595D1; -} - -code .hljs-keyword { - color: #194E82; -} - -pre, code { - font-family: "Liberation Mono", "Consolas", "DejaVu Sans Mono", "Ubuntu Mono", "andale mono", "lucida console", monospace; -} diff --git a/docs/src/assets/chainrules.scss b/docs/src/assets/chainrules.scss new file mode 100644 index 000000000..3e4a02e02 --- /dev/null +++ b/docs/src/assets/chainrules.scss @@ -0,0 +1,109 @@ +// Only for light theme + +html:not(.theme--documenter-dark) body #documenter { + + // Links + + a { + color: #4595D1; + } + + a:hover, a:focus { + color: #194E82; + } + + // Navigation + + .docs-sidebar { + box-shadow: none; + color: #FFFFFF; + background-color: #194E82; + + ul.docs-menu { + border-top: none; + + %nav-hover { + color: #FFFFFF; + background-color: #4595D1; + } + + .tocitem { + color: #FFFFFF; + background: none; + + &:hover { @extend %nav-hover; } + } + + li.is-active { + border-top: none; + border-bottom: none; + + .tocitem { + @extend %nav-hover; + + &:hover { @extend %nav-hover; } + } + + ul.internal { + margin: 0; + border-top: none; + + li { + margin-top: 0; + } + + .tocitem { + color: #194E82; + background-color: #FFFFFF; + padding: 0.5em; + padding-left: 1em; + + &:hover { @extend %nav-hover; } + } + } + } + } + } + + // Text + + article#documenter-page a.docs-heading-anchor { + color: #194E82; + } + + // Code + + code { + color: inherit; + + .hljs-meta { color: #4595D1; } + + .hljs-keyword { color: #194E82; } + } + + pre, code { + font-family: "Liberation Mono", "Consolas", "DejaVu Sans Mono", "Ubuntu Mono", "andale mono", "lucida console", monospace; + } +} + +// Terminology Block + +.admonition.is-category-terminology { + background-color: #FFFEDD; + border-color: #FFEC8B; + + > .admonition-header { + background-color: #FFEC8B; + color: black; + + &:before { + content: "Terminology: "; + font-family: inherit; + font-weight: bold; + } + } +} + +html.theme--documenter-dark .admonition.is-category-terminology { + border-color: #FFEC8B; +}