Skip to content

Commit

Permalink
build based on e6eee60
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Jun 29, 2023
1 parent 995edbc commit f38cdd8
Show file tree
Hide file tree
Showing 34 changed files with 633 additions and 303 deletions.
62 changes: 62 additions & 0 deletions dev/assets/collapse.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
* Part of Documenter.jl
* https://github.com/JuliaDocs/Documenter.jl
*
* License: MIT
*/

// Libraries: jquery
// Arguments: $

var isExpanded = true;

$(document).on("click", ".docstring header", function () {
let articleToggleTitle = "Expand docstring";

if ($(this).siblings("section").is(":visible")) {
$(this)
.find(".docstring-article-toggle-button")
.removeClass("fa-chevron-down")
.addClass("fa-chevron-right");
} else {
$(this)
.find(".docstring-article-toggle-button")
.removeClass("fa-chevron-right")
.addClass("fa-chevron-down");

articleToggleTitle = "Collapse docstring";
}

$(this).find(".docstring-article-toggle-button").prop("title", articleToggleTitle);
$(this).siblings("section").slideToggle();
});

$(document).on("click", ".docs-article-toggle-button", function () {
let articleToggleTitle = "Expand docstring";
let navArticleToggleTitle = "Expand all docstrings";

if (isExpanded) {
$(this).removeClass("fa-chevron-up").addClass("fa-chevron-down");
$(".docstring-article-toggle-button")
.removeClass("fa-chevron-down")
.addClass("fa-chevron-right");

isExpanded = false;

$(".docstring section").slideUp();
} else {
$(this).removeClass("fa-chevron-down").addClass("fa-chevron-up");
$(".docstring-article-toggle-button")
.removeClass("fa-chevron-right")
.addClass("fa-chevron-down");

isExpanded = true;
articleToggleTitle = "Collapse docstring";
navArticleToggleTitle = "Collapse all docstrings";

$(".docstring section").slideDown();
}

$(this).prop("title", navArticleToggleTitle);
$(".docstring-article-toggle-button").prop("title", articleToggleTitle);
});
67 changes: 67 additions & 0 deletions dev/assets/copy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
* Part of Documenter.jl
* https://github.com/JuliaDocs/Documenter.jl
*
* License: MIT
*/

function addCopyButtonCallbacks() {
for (const el of document.getElementsByTagName("pre")) {
const button = document.createElement("button");
button.classList.add("copy-button", "fa-solid", "fa-copy");
button.setAttribute("aria-label", "Copy this code block");
button.setAttribute("title", "Copy");

el.appendChild(button);

const success = function () {
button.classList.add("success", "fa-check");
button.classList.remove("fa-copy");
};

const failure = function () {
button.classList.add("error", "fa-xmark");
button.classList.remove("fa-copy");
};

button.addEventListener("click", function () {
copyToClipboard(el.innerText).then(success, failure);

setTimeout(function () {
button.classList.add("fa-copy");
button.classList.remove("success", "fa-check", "fa-xmark");
}, 5000);
});
}
}

function copyToClipboard(text) {
// Clipboard API is only available in secure contexts
if (window.navigator && window.navigator.clipboard) {
return window.navigator.clipboard.writeText(text);
} else {
return new Promise(function (resolve, reject) {
try {
const el = document.createElement("textarea");
el.textContent = text;
el.style.position = "fixed";
el.style.opacity = 0;
document.body.appendChild(el);
el.select();
document.execCommand("copy");

resolve();
} catch (err) {
reject(err);
} finally {
document.body.removeChild(el);
}
});
}
}

if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", addCopyButtonCallbacks);
} else {
addCopyButtonCallbacks();
}
21 changes: 9 additions & 12 deletions dev/assets/documenter.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* License: MIT
*/

/* fonts */
/* Fonts */
body, input {
font-family: 'Lato', 'Helvetica Neue', Arial, sans-serif;
font-size: 16px;
Expand Down Expand Up @@ -50,7 +50,7 @@ h1 {
font-size: 1.75em;
}

/* Unless the <h1> the is very first thing on the page (i.e. the second element
/* Unless the <h1> is the very first thing on the page (i.e. the second element
* in the <article>, * after the <header>, we add some additional styling to it
* to make it stand out a bit more. This way we get a reasonable fallback if CSS3
* selectors are not supported in the browser.
Expand Down Expand Up @@ -114,7 +114,8 @@ hr {

code {
padding: 0.1em;
background-color: rgba(0,0,0,.04);
background-color: rgba(255, 255, 255, 0.05);
color: #ececec;
border-radius: 3px;
}

Expand Down Expand Up @@ -344,8 +345,6 @@ article {
padding: 2em;
}

article > header {}

article > header div#topbar {
display: none;
}
Expand All @@ -371,8 +370,6 @@ article > header .edit-page {
float: right;
}

article > footer {}

article > footer a.prev {
float: left;
}
Expand Down Expand Up @@ -423,9 +420,9 @@ article section.docstring a.source-link {
* Admonitions
*
* Colors (title, body)
* warning: #f0b37e #ffedcc (orange)
* note: #6ab0de #e7f2fa (blue)
* tip: #1abc9c #dbfaf4 (green)
* Warning: #f0b37e #ffedcc (orange)
* Note: #6ab0de #e7f2fa (blue)
* Tip: #1abc9c #dbfaf4 (green)
*/
.admonition {
border-radius: 3px;
Expand Down Expand Up @@ -482,7 +479,7 @@ article section.docstring a.source-link {
}


/* footnotes */
/* Footnotes */
.footnote {
padding-left: 0.8em;
border-left: 2px solid #ccc;
Expand All @@ -493,7 +490,7 @@ article section.docstring a.source-link {
font-size: smaller;
}

/* Overriding the <code> block style of highligh.js.
/* Overriding the <code> block style of highlight.js.
* We have to override the padding and the background-color, since we style this
* part ourselves. Specifically, we style the <pre> surrounding the <code>, while
* highlight.js applies the .hljs style directly to the <code> tag.
Expand Down
10 changes: 5 additions & 5 deletions dev/assets/documenter.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ require(['jquery', 'highlight', 'highlight-julia', 'highlight-julia-repl'], func

})

// update the version selector with info from the siteinfo.js and ../versions.js files
// Update the version selector with info from the siteinfo.js and ../versions.js files
require(['jquery'], function($) {
$(document).ready(function() {
var version_selector = $("#version-selector");

// add the current version to the selector based on siteinfo.js, but only if the selector is empty
// Add the current version to the selector based on siteinfo.js, but only if the selector is empty
if (typeof DOCUMENTER_CURRENT_VERSION !== 'undefined' && $('#version-selector > option').length == 0) {
var option = $("<option value='#' selected='selected'>" + DOCUMENTER_CURRENT_VERSION + "</option>");
version_selector.append(option);
Expand All @@ -77,7 +77,7 @@ require(['jquery'], function($) {
DOC_VERSIONS.forEach(function(each) {
var version_url = documenterBaseURL + "/../" + each;
var existing_id = $.inArray(each, existing_versions_texts);
// if not already in the version selector, add it as a new option,
// If not already in the version selector, add it as a new option,
// otherwise update the old option with the URL and enable it
if (existing_id == -1) {
var option = $("<option value='" + version_url + "'>" + each + "</option>");
Expand All @@ -90,7 +90,7 @@ require(['jquery'], function($) {
});
}

// only show the version selector if the selector has been populated
// Only show the version selector if the selector has been populated
if ($('#version-selector > option').length > 0) {
version_selector.css("visibility", "visible");
}
Expand All @@ -101,7 +101,7 @@ require(['jquery'], function($) {

})

// mobile
// Mobile
require(['jquery', 'headroom'], function($, Headroom) {
$(document).ready(function() {
var navtoc = $("nav.toc");
Expand Down
File renamed without changes
Loading

0 comments on commit f38cdd8

Please sign in to comment.