Skip to content

Commit 5ab0fb5

Browse files
author
Quarto GHA Workflow Runner
committed
Built site for gh-pages
1 parent 1861fb8 commit 5ab0fb5

File tree

38 files changed

+10039
-4504
lines changed

38 files changed

+10039
-4504
lines changed

.nojekyll

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
dde62fe1
1+
cebb054b

R/readme.html

+208-13
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>
33

44
<meta charset="utf-8">
5-
<meta name="generator" content="quarto-1.3.450">
5+
<meta name="generator" content="quarto-1.4.549">
66

77
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
88

99

10-
<title>Pharmaverse Blog – readme</title>
10+
<title>Pharmaverse Blog</title>
1111
<style>
1212
code{white-space: pre-wrap;}
1313
span.smallcaps{font-variant: small-caps;}
@@ -47,7 +47,13 @@
4747
"collapse-after": 3,
4848
"panel-placement": "end",
4949
"type": "overlay",
50-
"limit": 20,
50+
"limit": 50,
51+
"keyboard-shortcut": [
52+
"f",
53+
"/",
54+
"s"
55+
],
56+
"show-item-context": false,
5157
"language": {
5258
"search-no-results-text": "No results",
5359
"search-matching-documents-text": "matching documents",
@@ -56,6 +62,7 @@
5662
"search-more-match-text": "more match in this document",
5763
"search-more-matches-text": "more matches in this document",
5864
"search-clear-button-title": "Clear",
65+
"search-text-placeholder": "",
5966
"search-detached-cancel-button-title": "Cancel",
6067
"search-submit-button-title": "Submit",
6168
"search-label": "Search"
@@ -64,15 +71,18 @@
6471

6572

6673
<link rel="stylesheet" href="../styles.css">
74+
<meta property="og:title" content="Pharmaverse Blog">
75+
<meta property="og:description" content="">
76+
<meta property="og:site_name" content="Pharmaverse Blog">
6777
</head>
6878

6979
<body class="nav-fixed fullcontent">
7080

7181
<div id="quarto-search-results"></div>
7282
<header id="quarto-header" class="headroom fixed-top">
73-
<nav class="navbar navbar-expand-lg navbar-dark ">
83+
<nav class="navbar navbar-expand-lg " data-bs-theme="dark">
7484
<div class="navbar-container container-fluid">
75-
<div class="navbar-brand-container">
85+
<div class="navbar-brand-container mx-auto">
7686
<a class="navbar-brand" href="../index.html">
7787
<span class="navbar-title">Pharmaverse Blog</span>
7888
</a>
@@ -84,15 +94,15 @@
8494
<div class="collapse navbar-collapse" id="navbarCollapse">
8595
<ul class="navbar-nav navbar-nav-scroll ms-auto">
8696
<li class="nav-item compact">
87-
<a class="nav-link" href="https://github.com/pharmaverse/blog" rel="" target=""><i class="bi bi-github" role="img" aria-label="github">
97+
<a class="nav-link" href="https://github.com/pharmaverse/blog"> <i class="bi bi-github" role="img" aria-label="github">
8898
</i>
89-
<span class="menu-text"></span></a>
99+
<span class="menu-text"></span></a>
90100
</li>
91101
</ul>
92-
<div class="quarto-navbar-tools">
102+
</div> <!-- /navcollapse -->
103+
<div class="quarto-navbar-tools">
93104
<a href="" class="quarto-color-scheme-toggle quarto-navigation-tool px-1" onclick="window.quartoToggleColorScheme(); return false;" title="Toggle dark mode"><i class="bi"></i></a>
94105
</div>
95-
</div> <!-- /navcollapse -->
96106
</div> <!-- /container-fluid -->
97107
</nav>
98108
</header>
@@ -106,6 +116,7 @@
106116

107117

108118

119+
109120
<section id="files-in-this-folder" class="level1">
110121
<h1>Files in this folder</h1>
111122
<p>Some of these files help in creating/developing blog-posts, others are used by our CICD pipeline.</p>
@@ -168,6 +179,33 @@ <h2 class="anchored" data-anchor-id="development-files">development files</h2>
168179
}
169180
}
170181
}
182+
const toggleGiscusIfUsed = (isAlternate, darkModeDefault) => {
183+
const baseTheme = document.querySelector('#giscus-base-theme')?.value ?? 'light';
184+
const alternateTheme = document.querySelector('#giscus-alt-theme')?.value ?? 'dark';
185+
let newTheme = '';
186+
if(darkModeDefault) {
187+
newTheme = isAlternate ? baseTheme : alternateTheme;
188+
} else {
189+
newTheme = isAlternate ? alternateTheme : baseTheme;
190+
}
191+
const changeGiscusTheme = () => {
192+
// From: https://github.com/giscus/giscus/issues/336
193+
const sendMessage = (message) => {
194+
const iframe = document.querySelector('iframe.giscus-frame');
195+
if (!iframe) return;
196+
iframe.contentWindow.postMessage({ giscus: message }, 'https://giscus.app');
197+
}
198+
sendMessage({
199+
setConfig: {
200+
theme: newTheme
201+
}
202+
});
203+
}
204+
const isGiscussLoaded = window.document.querySelector('iframe.giscus-frame') !== null;
205+
if (isGiscussLoaded) {
206+
changeGiscusTheme();
207+
}
208+
}
171209
const toggleColorMode = (alternate) => {
172210
// Switch the stylesheets
173211
const alternateStylesheets = window.document.querySelectorAll('link.quarto-color-scheme.quarto-color-alternate');
@@ -234,13 +272,15 @@ <h2 class="anchored" data-anchor-id="development-files">development files</h2>
234272
return localAlternateSentinel;
235273
}
236274
}
237-
let localAlternateSentinel = 'default';
275+
const darkModeDefault = false;
276+
let localAlternateSentinel = darkModeDefault ? 'alternate' : 'default';
238277
// Dark / light mode switch
239278
window.quartoToggleColorScheme = () => {
240279
// Read the current dark / light value
241280
let toAlternate = !hasAlternateSentinel();
242281
toggleColorMode(toAlternate);
243282
setStyleSentinel(toAlternate);
283+
toggleGiscusIfUsed(toAlternate, darkModeDefault);
244284
};
245285
// Ensure there is a toggle, if there isn't float one in the top right
246286
if (window.document.querySelector('.quarto-color-scheme-toggle') === null) {
@@ -319,10 +359,9 @@ <h2 class="anchored" data-anchor-id="development-files">development files</h2>
319359
// clear code selection
320360
e.clearSelection();
321361
});
322-
function tippyHover(el, contentFn) {
362+
function tippyHover(el, contentFn, onTriggerFn, onUntriggerFn) {
323363
const config = {
324364
allowHTML: true,
325-
content: contentFn,
326365
maxWidth: 500,
327366
delay: 100,
328367
arrow: false,
@@ -332,8 +371,17 @@ <h2 class="anchored" data-anchor-id="development-files">development files</h2>
332371
interactive: true,
333372
interactiveBorder: 10,
334373
theme: 'quarto',
335-
placement: 'bottom-start'
374+
placement: 'bottom-start',
336375
};
376+
if (contentFn) {
377+
config.content = contentFn;
378+
}
379+
if (onTriggerFn) {
380+
config.onTrigger = onTriggerFn;
381+
}
382+
if (onUntriggerFn) {
383+
config.onUntrigger = onUntriggerFn;
384+
}
337385
window.tippy(el, config);
338386
}
339387
const noterefs = window.document.querySelectorAll('a[role="doc-noteref"]');
@@ -347,6 +395,125 @@ <h2 class="anchored" data-anchor-id="development-files">development files</h2>
347395
const note = window.document.getElementById(id);
348396
return note.innerHTML;
349397
});
398+
}
399+
const xrefs = window.document.querySelectorAll('a.quarto-xref');
400+
const processXRef = (id, note) => {
401+
// Strip column container classes
402+
const stripColumnClz = (el) => {
403+
el.classList.remove("page-full", "page-columns");
404+
if (el.children) {
405+
for (const child of el.children) {
406+
stripColumnClz(child);
407+
}
408+
}
409+
}
410+
stripColumnClz(note)
411+
if (id === null || id.startsWith('sec-')) {
412+
// Special case sections, only their first couple elements
413+
const container = document.createElement("div");
414+
if (note.children && note.children.length > 2) {
415+
container.appendChild(note.children[0].cloneNode(true));
416+
for (let i = 1; i < note.children.length; i++) {
417+
const child = note.children[i];
418+
if (child.tagName === "P" && child.innerText === "") {
419+
continue;
420+
} else {
421+
container.appendChild(child.cloneNode(true));
422+
break;
423+
}
424+
}
425+
if (window.Quarto?.typesetMath) {
426+
window.Quarto.typesetMath(container);
427+
}
428+
return container.innerHTML
429+
} else {
430+
if (window.Quarto?.typesetMath) {
431+
window.Quarto.typesetMath(note);
432+
}
433+
return note.innerHTML;
434+
}
435+
} else {
436+
// Remove any anchor links if they are present
437+
const anchorLink = note.querySelector('a.anchorjs-link');
438+
if (anchorLink) {
439+
anchorLink.remove();
440+
}
441+
if (window.Quarto?.typesetMath) {
442+
window.Quarto.typesetMath(note);
443+
}
444+
// TODO in 1.5, we should make sure this works without a callout special case
445+
if (note.classList.contains("callout")) {
446+
return note.outerHTML;
447+
} else {
448+
return note.innerHTML;
449+
}
450+
}
451+
}
452+
for (var i=0; i<xrefs.length; i++) {
453+
const xref = xrefs[i];
454+
tippyHover(xref, undefined, function(instance) {
455+
instance.disable();
456+
let url = xref.getAttribute('href');
457+
let hash = undefined;
458+
if (url.startsWith('#')) {
459+
hash = url;
460+
} else {
461+
try { hash = new URL(url).hash; } catch {}
462+
}
463+
if (hash) {
464+
const id = hash.replace(/^#\/?/, "");
465+
const note = window.document.getElementById(id);
466+
if (note !== null) {
467+
try {
468+
const html = processXRef(id, note.cloneNode(true));
469+
instance.setContent(html);
470+
} finally {
471+
instance.enable();
472+
instance.show();
473+
}
474+
} else {
475+
// See if we can fetch this
476+
fetch(url.split('#')[0])
477+
.then(res => res.text())
478+
.then(html => {
479+
const parser = new DOMParser();
480+
const htmlDoc = parser.parseFromString(html, "text/html");
481+
const note = htmlDoc.getElementById(id);
482+
if (note !== null) {
483+
const html = processXRef(id, note);
484+
instance.setContent(html);
485+
}
486+
}).finally(() => {
487+
instance.enable();
488+
instance.show();
489+
});
490+
}
491+
} else {
492+
// See if we can fetch a full url (with no hash to target)
493+
// This is a special case and we should probably do some content thinning / targeting
494+
fetch(url)
495+
.then(res => res.text())
496+
.then(html => {
497+
const parser = new DOMParser();
498+
const htmlDoc = parser.parseFromString(html, "text/html");
499+
const note = htmlDoc.querySelector('main.content');
500+
if (note !== null) {
501+
// This should only happen for chapter cross references
502+
// (since there is no id in the URL)
503+
// remove the first header
504+
if (note.children.length > 0 && note.children[0].tagName === "HEADER") {
505+
note.children[0].remove();
506+
}
507+
const html = processXRef(null, note);
508+
instance.setContent(html);
509+
}
510+
}).finally(() => {
511+
instance.enable();
512+
instance.show();
513+
});
514+
}
515+
}, function(instance) {
516+
});
350517
}
351518
let selectedAnnoteEl;
352519
const selectorForAnnotation = ( cell, annotation) => {
@@ -389,6 +556,7 @@ <h2 class="anchored" data-anchor-id="development-files">development files</h2>
389556
}
390557
div.style.top = top - 2 + "px";
391558
div.style.height = height + 4 + "px";
559+
div.style.left = 0;
392560
let gutterDiv = window.document.getElementById("code-annotation-line-highlight-gutter");
393561
if (gutterDiv === null) {
394562
gutterDiv = window.document.createElement("div");
@@ -414,6 +582,32 @@ <h2 class="anchored" data-anchor-id="development-files">development files</h2>
414582
});
415583
selectedAnnoteEl = undefined;
416584
};
585+
// Handle positioning of the toggle
586+
window.addEventListener(
587+
"resize",
588+
throttle(() => {
589+
elRect = undefined;
590+
if (selectedAnnoteEl) {
591+
selectCodeLines(selectedAnnoteEl);
592+
}
593+
}, 10)
594+
);
595+
function throttle(fn, ms) {
596+
let throttle = false;
597+
let timer;
598+
return (...args) => {
599+
if(!throttle) { // first call gets through
600+
fn.apply(this, args);
601+
throttle = true;
602+
} else { // all the others get throttled
603+
if(timer) clearTimeout(timer); // cancel #2
604+
timer = setTimeout(() => {
605+
fn.apply(this, args);
606+
timer = throttle = false;
607+
}, ms);
608+
}
609+
};
610+
}
417611
// Attach click handler to the DT
418612
const annoteDls = window.document.querySelectorAll('dt[data-target-cell]');
419613
for (const annoteDlNode of annoteDls) {
@@ -477,4 +671,5 @@ <h2 class="anchored" data-anchor-id="development-files">development files</h2>
477671

478672

479673

674+
480675
</body></html>

_redirects

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
/point /posts/2023-10-30_floating_point
1515
/order /posts/2023-11-27_higher_order
1616
/0 /posts/2023-12-18_admiral_1_0
17+
/examples /posts/2023-12-20_p_k__examples
1718
/up... /posts/2024-01-04_end_of__year__up...
1819
/category/r /#category=R
1920
/category/shiny /#category=shiny

0 commit comments

Comments
 (0)