From 0128da4657e111d3a9ac4ec9ca1b648293670c4a Mon Sep 17 00:00:00 2001 From: Emma Rand Date: Sat, 30 Sep 2023 14:12:03 +0100 Subject: [PATCH] small infrastructure fixes --- _quarto.yml | 5 +- _site/about.html | 138 +- _site/core/core.html | 209 ++- _site/core/week-1/overview.html | 209 ++- _site/core/week-1/study_after_workshop.html | 218 +++- _site/core/week-1/study_before_workshop.html | 209 ++- _site/core/week-1/workshop.html | 603 +++++---- _site/core/week-2/overview.html | 209 ++- _site/core/week-2/study_after_workshop.html | 246 ++-- _site/core/week-2/study_before_workshop.html | 209 ++- _site/core/week-2/workshop.html | 235 +++- _site/core/week-6/overview.html | 209 ++- _site/core/week-6/study_after_workshop.html | 246 ++-- _site/core/week-6/study_before_workshop.html | 209 ++- _site/core/week-6/workshop.html | 230 +++- _site/index.html | 231 +++- _site/omics/omics.html | 209 ++- _site/omics/week-3/overview.html | 209 ++- _site/omics/week-3/study_after_workshop.html | 209 ++- _site/omics/week-3/study_before_workshop.html | 76 +- _site/omics/week-3/workshop.html | 275 ++-- _site/search.json | 331 +++-- _site/site_libs/bootstrap/bootstrap-icons.css | 316 ++++- .../site_libs/bootstrap/bootstrap-icons.woff | Bin 137124 -> 164168 bytes _site/site_libs/bootstrap/bootstrap.min.css | 4 +- _site/site_libs/quarto-html/light-border.css | 1 + .../quarto-syntax-highlighting.css | 32 + _site/site_libs/quarto-html/quarto.js | 372 ++++-- _site/site_libs/quarto-nav/quarto-nav.js | 57 +- .../autocomplete.umd.js | 3 - .../quarto-search-emma-home-2023/fuse.min.js | 9 - .../quarto-search.js | 1140 ----------------- .../quarto-search/autocomplete.umd.js | 4 +- _site/site_libs/quarto-search/fuse.min.js | 6 +- .../site_libs/quarto-search/quarto-search.js | 33 +- .../site_libs/revealjs/dist/theme/quarto.css | 4 +- .../revealjs/plugin/pdf-export/pdfexport.js | 3 + .../revealjs/plugin/quarto-support/footer.css | 1 + .../plugin/reveal-menu/quarto-menu.js | 3 + index.qmd | 9 + renv.lock | 73 ++ update-notes.txt | 5 +- 42 files changed, 4499 insertions(+), 2500 deletions(-) create mode 100644 _site/site_libs/quarto-html/light-border.css delete mode 100644 _site/site_libs/quarto-search-emma-home-2023/autocomplete.umd.js delete mode 100644 _site/site_libs/quarto-search-emma-home-2023/fuse.min.js delete mode 100644 _site/site_libs/quarto-search-emma-home-2023/quarto-search.js diff --git a/_quarto.yml b/_quarto.yml index f2779e4..5e6d8bd 100644 --- a/_quarto.yml +++ b/_quarto.yml @@ -2,10 +2,13 @@ project: type: website output-dir: _site +date: last-modified +date-format: D MMMM, YYYY + website: title: "Data Analysis for Group Project" page-footer: - left: '`r cffr::cff_to_bibtex("CITATION.cff")`' + left: "Rand E (2023). Data Analysis for Group Project. ." right: - icon: twitter href: https://twitter.com/er_13 diff --git a/_site/about.html b/_site/about.html index 5a73041..a6cae22 100644 --- a/_site/about.html +++ b/_site/about.html @@ -2,7 +2,7 @@ - + @@ -18,7 +18,7 @@ ul.task-list{list-style: none;} ul.task-list li input[type="checkbox"] { width: 0.8em; - margin: 0 0.8em 0.2em -1.6em; + margin: 0 0.8em 0.2em -1em; /* quarto-specific, see https://github.com/quarto-dev/quarto-cli/issues/4556 */ vertical-align: middle; } @@ -56,7 +56,8 @@ "search-more-matches-text": "more matches in this document", "search-clear-button-title": "Clear", "search-detached-cancel-button-title": "Cancel", - "search-submit-button-title": "Submit" + "search-submit-button-title": "Submit", + "search-label": "Search" } } @@ -75,25 +76,29 @@ Data Analysis for Group Project + @@ -116,6 +121,12 @@

About

+
+
Published
+
+

21 July, 2023

+
+
@@ -155,9 +166,23 @@

About

icon: icon }; anchorJS.add('.anchored'); + const isCodeAnnotation = (el) => { + for (const clz of el.classList) { + if (clz.startsWith('code-annotation-')) { + return true; + } + } + return false; + } const clipboard = new window.ClipboardJS('.code-copy-button', { - target: function(trigger) { - return trigger.previousElementSibling; + text: function(trigger) { + const codeEl = trigger.previousElementSibling.cloneNode(true); + for (const childEl of codeEl.children) { + if (isCodeAnnotation(childEl)) { + childEl.remove(); + } + } + return codeEl.innerText; } }); clipboard.on('success', function(e) { @@ -222,6 +247,92 @@

About

return note.innerHTML; }); } + let selectedAnnoteEl; + const selectorForAnnotation = ( cell, annotation) => { + let cellAttr = 'data-code-cell="' + cell + '"'; + let lineAttr = 'data-code-annotation="' + annotation + '"'; + const selector = 'span[' + cellAttr + '][' + lineAttr + ']'; + return selector; + } + const selectCodeLines = (annoteEl) => { + const doc = window.document; + const targetCell = annoteEl.getAttribute("data-target-cell"); + const targetAnnotation = annoteEl.getAttribute("data-target-annotation"); + const annoteSpan = window.document.querySelector(selectorForAnnotation(targetCell, targetAnnotation)); + const lines = annoteSpan.getAttribute("data-code-lines").split(","); + const lineIds = lines.map((line) => { + return targetCell + "-" + line; + }) + let top = null; + let height = null; + let parent = null; + if (lineIds.length > 0) { + //compute the position of the single el (top and bottom and make a div) + const el = window.document.getElementById(lineIds[0]); + top = el.offsetTop; + height = el.offsetHeight; + parent = el.parentElement.parentElement; + if (lineIds.length > 1) { + const lastEl = window.document.getElementById(lineIds[lineIds.length - 1]); + const bottom = lastEl.offsetTop + lastEl.offsetHeight; + height = bottom - top; + } + if (top !== null && height !== null && parent !== null) { + // cook up a div (if necessary) and position it + let div = window.document.getElementById("code-annotation-line-highlight"); + if (div === null) { + div = window.document.createElement("div"); + div.setAttribute("id", "code-annotation-line-highlight"); + div.style.position = 'absolute'; + parent.appendChild(div); + } + div.style.top = top - 2 + "px"; + div.style.height = height + 4 + "px"; + let gutterDiv = window.document.getElementById("code-annotation-line-highlight-gutter"); + if (gutterDiv === null) { + gutterDiv = window.document.createElement("div"); + gutterDiv.setAttribute("id", "code-annotation-line-highlight-gutter"); + gutterDiv.style.position = 'absolute'; + const codeCell = window.document.getElementById(targetCell); + const gutter = codeCell.querySelector('.code-annotation-gutter'); + gutter.appendChild(gutterDiv); + } + gutterDiv.style.top = top - 2 + "px"; + gutterDiv.style.height = height + 4 + "px"; + } + selectedAnnoteEl = annoteEl; + } + }; + const unselectCodeLines = () => { + const elementsIds = ["code-annotation-line-highlight", "code-annotation-line-highlight-gutter"]; + elementsIds.forEach((elId) => { + const div = window.document.getElementById(elId); + if (div) { + div.remove(); + } + }); + selectedAnnoteEl = undefined; + }; + // Attach click handler to the DT + const annoteDls = window.document.querySelectorAll('dt[data-target-cell]'); + for (const annoteDlNode of annoteDls) { + annoteDlNode.addEventListener('click', (event) => { + const clickedEl = event.target; + if (clickedEl !== selectedAnnoteEl) { + unselectCodeLines(); + const activeEl = window.document.querySelector('dt[data-target-cell].code-annotation-active'); + if (activeEl) { + activeEl.classList.remove('code-annotation-active'); + } + selectCodeLines(clickedEl); + clickedEl.classList.add('code-annotation-active'); + } else { + // Unselect the line + unselectCodeLines(); + clickedEl.classList.remove('code-annotation-active'); + } + }); + } const findCites = (el) => { const parentEl = el.parentElement; if (parentEl) { @@ -260,12 +371,12 @@

About

} } var localhostRegex = new RegExp(/^(?:http|https):\/\/localhost\:?[0-9]*\//); - var filterRegex = new RegExp(/^(?:http:|https:)\/\/3mmarand\.github\.io\/BIO00088H-data/); + var filterRegex = new RegExp("^(?:http:|https:)\/\/3mmarand\.github\.io\/BIO00088H-data"); var isInternal = (href) => { return filterRegex.test(href) || localhostRegex.test(href); } // Inspect non-navigation links and adorn them if external - var links = window.document.querySelectorAll('a:not(.nav-link):not(.navbar-brand):not(.toc-action):not(.sidebar-link):not(.sidebar-item-toggle):not(.pagination-link):not(.no-external):not([aria-hidden]):not(.dropdown-item)'); + var links = window.document.querySelectorAll('a[href]:not(.nav-link):not(.navbar-brand):not(.toc-action):not(.sidebar-link):not(.sidebar-item-toggle):not(.pagination-link):not(.no-external):not([aria-hidden]):not(.dropdown-item)'); for (var i=0; iAbout