From 33dd48a206fa72e63fe231c66819c8959d44e7ec Mon Sep 17 00:00:00 2001 From: Simeon Schaub Date: Wed, 5 Aug 2020 00:04:27 +0200 Subject: [PATCH 1/8] use Documenter's built-in push_preview --- docs/Manifest.toml | 16 ++++++++-------- docs/Project.toml | 2 +- docs/make.jl | 25 ++++--------------------- 3 files changed, 13 insertions(+), 30 deletions(-) diff --git a/docs/Manifest.toml b/docs/Manifest.toml index c96759de6..75986a1f5 100644 --- a/docs/Manifest.toml +++ b/docs/Manifest.toml @@ -7,7 +7,7 @@ uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" deps = ["MuladdMacro"] path = ".." uuid = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" -version = "0.9.3" +version = "0.9.5" [[Dates]] deps = ["Printf"] @@ -19,15 +19,15 @@ 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" [[InteractiveUtils]] deps = ["Markdown"] @@ -63,9 +63,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"] diff --git a/docs/Project.toml b/docs/Project.toml index 67e1adef2..784275039 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -3,4 +3,4 @@ ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" [compat] -Documenter = "~0.23" +Documenter = "0.25" diff --git a/docs/make.jl b/docs/make.jl index aead8d4bd..6e747802a 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -40,24 +40,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, +) From 75e7324a251acadfcbbb9cd61c90fe9110c452a7 Mon Sep 17 00:00:00 2001 From: Simeon Schaub Date: Wed, 5 Aug 2020 02:30:51 +0200 Subject: [PATCH 2/8] fix documenter theme for 0.25 --- docs/src/assets/chainrules.css | 59 +++++++++++++++++++++++----------- 1 file changed, 40 insertions(+), 19 deletions(-) diff --git a/docs/src/assets/chainrules.css b/docs/src/assets/chainrules.css index f4b0a164f..603ce7779 100644 --- a/docs/src/assets/chainrules.css +++ b/docs/src/assets/chainrules.css @@ -10,57 +10,78 @@ a:hover, a:focus { /* Navigation */ -nav.toc ul a:hover, -nav.toc ul.internal a:hover { +#documenter .docs-sidebar ul.docs-menu a.tocitem:hover, +#documenter .docs-sidebar ul.docs-menu li.is-active ul.internal .tocitem:hover { color: #FFFFFF; background-color: #4595D1; } -nav.toc ul .toctext { +#documenter .docs-sidebar ul.docs-menu { + border-top: none; +} + +#documenter .docs-sidebar ul.docs-menu .tocitem { color: #FFFFFF; + background: none; } -nav.toc { +#documenter .docs-sidebar { box-shadow: none; color: #FFFFFF; background-color: #194E82; } -nav.toc li.current > .toctext { +#documenter .docs-sidebar ul.docs-menu li.is-active { + border-top: none; + border-bottom: none; +} + +#documenter .docs-sidebar ul.docs-menu li.is-active .tocitem, +#documenter .docs-sidebar ul.docs-menu li.is-active .tocitem:hover { color: #FFFFFF; background-color: #4595D1; - border-top-width: 0px; - border-bottom-width: 0px; } -nav.toc ul.internal a { +#documenter .docs-sidebar ul.docs-menu li.is-active ul.internal { + margin: 0; + border-top: none; +} + +#documenter .docs-sidebar ul.docs-menu li.is-active ul.internal li { + margin-top: 0; +} + +#documenter .docs-sidebar ul.docs-menu li.is-active ul.internal .tocitem { color: #194E82; background-color: #FFFFFF; + padding: 0.5em; + padding-left: 1em; +} +#documenter .docs-sidebar ul.docs-menu li.is-active ul.internal .tocitem code { + color: inherit; } /* Text */ -article#docs a.nav-anchor { +article#documenter-page a.docs-heading-anchor { color: #194E82; } -article#docs blockquote { - font-style: italic; -} - /* Terminology Block */ -div.admonition.terminology div.admonition-title:before { +.admonition.is-category-terminology { + background-color: #FFFEDD; + border-color: #FFEC8B; +} + +.admonition.is-category-terminology > .admonition-header:before { content: "Terminology: "; font-family: inherit; font-weight: bold; } -div.admonition.terminology div.admonition-title { +.admonition.is-category-terminology > .admonition-header { background-color: #FFEC8B; -} - -div.admonition.terminology div.admonition-text { - background-color: #FFFEDD; + color: black; } /* Code */ From 5becbf555bc40915fca33f672c333a87f414de0c Mon Sep 17 00:00:00 2001 From: Simeon Schaub Date: Wed, 5 Aug 2020 02:31:58 +0200 Subject: [PATCH 3/8] use MathJax instead of KaTeX --- docs/make.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/make.jl b/docs/make.jl index 6e747802a..a14037766 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -38,6 +38,7 @@ makedocs( ], strict=true, checkdocs=:exports, + mathengine=MathJax(), ) deploydocs( From 48d8b9531123d54cf13182066044fcf326b7b50e Mon Sep 17 00:00:00 2001 From: Simeon Schaub Date: Thu, 6 Aug 2020 11:54:51 +0200 Subject: [PATCH 4/8] use scss, fix dark theme --- docs/make.jl | 12 ++-- docs/src/assets/chainrules.css | 99 ----------------------------- docs/src/assets/chainrules.scss | 107 ++++++++++++++++++++++++++++++++ 3 files changed, 115 insertions(+), 103 deletions(-) delete mode 100644 docs/src/assets/chainrules.css create mode 100644 docs/src/assets/chainrules.scss diff --git a/docs/make.jl b/docs/make.jl index a14037766..95139481e 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("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=[ @@ -38,7 +43,6 @@ makedocs( ], strict=true, checkdocs=:exports, - mathengine=MathJax(), ) deploydocs( diff --git a/docs/src/assets/chainrules.css b/docs/src/assets/chainrules.css deleted file mode 100644 index 603ce7779..000000000 --- a/docs/src/assets/chainrules.css +++ /dev/null @@ -1,99 +0,0 @@ -/* Links */ - -a { - color: #4595D1; -} - -a:hover, a:focus { - color: #194E82; -} - -/* Navigation */ - -#documenter .docs-sidebar ul.docs-menu a.tocitem:hover, -#documenter .docs-sidebar ul.docs-menu li.is-active ul.internal .tocitem:hover { - color: #FFFFFF; - background-color: #4595D1; -} - -#documenter .docs-sidebar ul.docs-menu { - border-top: none; -} - -#documenter .docs-sidebar ul.docs-menu .tocitem { - color: #FFFFFF; - background: none; -} - -#documenter .docs-sidebar { - box-shadow: none; - color: #FFFFFF; - background-color: #194E82; -} - -#documenter .docs-sidebar ul.docs-menu li.is-active { - border-top: none; - border-bottom: none; -} - -#documenter .docs-sidebar ul.docs-menu li.is-active .tocitem, -#documenter .docs-sidebar ul.docs-menu li.is-active .tocitem:hover { - color: #FFFFFF; - background-color: #4595D1; -} - -#documenter .docs-sidebar ul.docs-menu li.is-active ul.internal { - margin: 0; - border-top: none; -} - -#documenter .docs-sidebar ul.docs-menu li.is-active ul.internal li { - margin-top: 0; -} - -#documenter .docs-sidebar ul.docs-menu li.is-active ul.internal .tocitem { - color: #194E82; - background-color: #FFFFFF; - padding: 0.5em; - padding-left: 1em; -} -#documenter .docs-sidebar ul.docs-menu li.is-active ul.internal .tocitem code { - color: inherit; -} - -/* Text */ - -article#documenter-page a.docs-heading-anchor { - color: #194E82; -} - -/* Terminology Block */ - -.admonition.is-category-terminology { - background-color: #FFFEDD; - border-color: #FFEC8B; -} - -.admonition.is-category-terminology > .admonition-header:before { - content: "Terminology: "; - font-family: inherit; - font-weight: bold; -} -.admonition.is-category-terminology > .admonition-header { - background-color: #FFEC8B; - color: black; -} - -/* 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..720eca64f --- /dev/null +++ b/docs/src/assets/chainrules.scss @@ -0,0 +1,107 @@ +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; + } + + 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; + } +} + + +/* Terminology Block */ + +.admonition.is-category-terminology { + background-color: #FFFEDD; + border-color: #FFEC8B; +} + +.admonition.is-category-terminology > .admonition-header:before { + content: "Terminology: "; + font-family: inherit; + font-weight: bold; +} +.admonition.is-category-terminology > .admonition-header { + background-color: #FFEC8B; + color: black; +} From 69658452969e4120e64587ea9a17c00cea38d303 Mon Sep 17 00:00:00 2001 From: Simeon Schaub Date: Thu, 6 Aug 2020 12:09:17 +0200 Subject: [PATCH 5/8] fix docs build --- docs/Manifest.toml | 21 +++++++++++++++++++++ docs/Project.toml | 2 ++ docs/make.jl | 2 +- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/docs/Manifest.toml b/docs/Manifest.toml index 75986a1f5..c58a79af6 100644 --- a/docs/Manifest.toml +++ b/docs/Manifest.toml @@ -3,6 +3,12 @@ [[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 = ".." @@ -29,6 +35,15 @@ git-tree-sha1 = "1c593d1efa27437ed9dd365d1143c594b563e138" uuid = "e30172f5-a6a5-5a46-863b-614d45cd2de4" 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"] uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" @@ -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 784275039..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.25" +DocumenterTools = "0.1.6" diff --git a/docs/make.jl b/docs/make.jl index 95139481e..8d1012ed1 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -18,7 +18,7 @@ DocMeta.setdocmeta!( end ) -Themes.compile("src/assets/chainrules.scss") +Themes.compile(joinpath(@__DIR__, "src/assets/chainrules.scss")) makedocs( modules=[ChainRulesCore], From 67e91c2652bb8cb19b83ade053bb8ab31c92b482 Mon Sep 17 00:00:00 2001 From: Simeon Schaub Date: Thu, 6 Aug 2020 12:22:50 +0200 Subject: [PATCH 6/8] small coding style tweaks --- docs/src/assets/chainrules.scss | 42 ++++++++++++++++----------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/docs/src/assets/chainrules.scss b/docs/src/assets/chainrules.scss index 720eca64f..996dcfb7f 100644 --- a/docs/src/assets/chainrules.scss +++ b/docs/src/assets/chainrules.scss @@ -1,6 +1,8 @@ +// Only for light theme + html:not(.theme--documenter-dark) body #documenter { - /* Links */ + // Links a { color: #4595D1; @@ -10,7 +12,7 @@ html:not(.theme--documenter-dark) body #documenter { color: #194E82; } - /* Navigation */ + // Navigation .docs-sidebar { box-shadow: none; @@ -63,24 +65,20 @@ html:not(.theme--documenter-dark) body #documenter { } } - /* Text */ + // Text article#documenter-page a.docs-heading-anchor { color: #194E82; } - /* Code */ + // Code code { color: inherit; - } - - code .hljs-meta { - color: #4595D1; - } + + .hljs-meta { color: #4595D1; } - code .hljs-keyword { - color: #194E82; + .hljs-keyword { color: #194E82; } } pre, code { @@ -88,20 +86,20 @@ html:not(.theme--documenter-dark) body #documenter { } } - -/* Terminology Block */ +// Terminology Block .admonition.is-category-terminology { background-color: #FFFEDD; border-color: #FFEC8B; -} -.admonition.is-category-terminology > .admonition-header:before { - content: "Terminology: "; - font-family: inherit; - font-weight: bold; -} -.admonition.is-category-terminology > .admonition-header { - background-color: #FFEC8B; - color: black; + > .admonition-header { + background-color: #FFEC8B; + color: black; + + &:before { + content: "Terminology: "; + font-family: inherit; + font-weight: bold; + } + } } From d4ff2da042ddd7f49790bbbbccb02752992915fb Mon Sep 17 00:00:00 2001 From: Simeon Schaub Date: Thu, 6 Aug 2020 12:30:14 +0200 Subject: [PATCH 7/8] add compiled css to .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) 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 From 0c3b059d136bbac982b66cffde4dd6c855cd2f6f Mon Sep 17 00:00:00 2001 From: Simeon Schaub Date: Thu, 6 Aug 2020 12:49:08 +0200 Subject: [PATCH 8/8] yellow border for methodology when dark --- docs/src/assets/chainrules.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/src/assets/chainrules.scss b/docs/src/assets/chainrules.scss index 996dcfb7f..3e4a02e02 100644 --- a/docs/src/assets/chainrules.scss +++ b/docs/src/assets/chainrules.scss @@ -103,3 +103,7 @@ html:not(.theme--documenter-dark) body #documenter { } } } + +html.theme--documenter-dark .admonition.is-category-terminology { + border-color: #FFEC8B; +}