Skip to content

Commit 26dd096

Browse files
committed
rendering pages for PTM
1 parent 0a2212e commit 26dd096

9 files changed

Lines changed: 1159 additions & 198 deletions

File tree

docs/Download_Installation.html

Lines changed: 144 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
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.433">
5+
<meta name="generator" content="quarto-1.4.315">
66

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

@@ -101,6 +101,11 @@
101101
"panel-placement": "end",
102102
"type": "overlay",
103103
"limit": 20,
104+
"keyboard-shortcut": [
105+
"f",
106+
"/",
107+
"s"
108+
],
104109
"language": {
105110
"search-no-results-text": "No results",
106111
"search-matching-documents-text": "matching documents",
@@ -127,7 +132,7 @@
127132
<header id="quarto-header" class="headroom fixed-top">
128133
<nav class="navbar navbar-expand-lg navbar-dark ">
129134
<div class="navbar-container container-fluid">
130-
<div class="navbar-brand-container">
135+
<div class="navbar-brand-container mx-auto">
131136
<a href="./index.html" class="navbar-brand navbar-brand-logo">
132137
<img src="./Figures/coxlab_logo2.png" alt="" class="navbar-logo">
133138
</a>
@@ -139,47 +144,47 @@
139144
<div class="collapse navbar-collapse" id="navbarCollapse">
140145
<ul class="navbar-nav navbar-nav-scroll me-auto">
141146
<li class="nav-item">
142-
<a class="nav-link" href="./index.html" rel="" target="">
143-
<span class="menu-text">HOME</span></a>
147+
<a class="nav-link" href="./index.html">
148+
<span class="menu-text">HOME</span></a>
144149
</li>
145150
<li class="nav-item">
146-
<a class="nav-link" href="./maxquant_instructions.html" rel="" target="">
147-
<span class="menu-text">MaxQuant</span></a>
151+
<a class="nav-link" href="./maxquant_instructions.html">
152+
<span class="menu-text">MaxQuant</span></a>
148153
</li>
149154
<li class="nav-item">
150-
<a class="nav-link" href="./perseus_instructions.html" rel="" target="">
151-
<span class="menu-text">Perseus</span></a>
155+
<a class="nav-link" href="./perseus_instructions.html">
156+
<span class="menu-text">Perseus</span></a>
152157
</li>
153158
<li class="nav-item">
154-
<a class="nav-link" href="./andromeda_instructions.html" rel="" target="">
155-
<span class="menu-text">Andromeda</span></a>
159+
<a class="nav-link" href="./andromeda_instructions.html">
160+
<span class="menu-text">Andromeda</span></a>
156161
</li>
157162
</ul>
158163
<ul class="navbar-nav navbar-nav-scroll ms-auto">
159164
<li class="nav-item compact">
160-
<a class="nav-link" href="./contact.html" rel="" target=""><i class="bi bi-envelope" role="img">
165+
<a class="nav-link" href="./contact.html"> <i class="bi bi-envelope" role="img">
161166
</i>
162-
<span class="menu-text"></span></a>
167+
<span class="menu-text"></span></a>
163168
</li>
164169
<li class="nav-item compact">
165-
<a class="nav-link" href="https://github.com/cox-labs/CoxLab_Bug_Reporting" rel="" target=""><i class="bi bi-github" role="img">
170+
<a class="nav-link" href="https://github.com/cox-labs/CoxLab_Bug_Reporting"> <i class="bi bi-github" role="img">
166171
</i>
167-
<span class="menu-text"></span></a>
172+
<span class="menu-text"></span></a>
168173
</li>
169174
<li class="nav-item compact">
170-
<a class="nav-link" href="https://twitter.com/TheCoxLab" rel="" target=""><i class="bi bi-twitter" role="img">
175+
<a class="nav-link" href="https://twitter.com/TheCoxLab"> <i class="bi bi-twitter" role="img">
171176
</i>
172-
<span class="menu-text"></span></a>
177+
<span class="menu-text"></span></a>
173178
</li>
174179
<li class="nav-item compact">
175-
<a class="nav-link" href="https://www.linkedin.com/in/juergen-cox-2437ba17/" rel="" target=""><i class="bi bi-fa-linkedin fa-lg" role="img">
180+
<a class="nav-link" href="https://www.linkedin.com/in/juergen-cox-2437ba17/"> <i class="bi bi-fa-linkedin fa-lg" role="img">
176181
</i>
177-
<span class="menu-text"></span></a>
182+
<span class="menu-text"></span></a>
178183
</li>
179184
</ul>
180-
<div class="quarto-navbar-tools">
181-
</div>
182185
</div> <!-- /navcollapse -->
186+
<div class="quarto-navbar-tools">
187+
</div>
183188
</div> <!-- /container-fluid -->
184189
</nav>
185190
</header>
@@ -244,6 +249,7 @@ <h1 class="title">Download &amp; Installation</h1>
244249
</div>
245250

246251

252+
247253
</header>
248254

249255
<section id="download" class="level1" data-number="1">
@@ -505,10 +511,9 @@ <h3 data-number="3.0.3" class="anchored" data-anchor-id="monster-pc"><span class
505511
// clear code selection
506512
e.clearSelection();
507513
});
508-
function tippyHover(el, contentFn) {
514+
function tippyHover(el, contentFn, onTriggerFn, onUntriggerFn) {
509515
const config = {
510516
allowHTML: true,
511-
content: contentFn,
512517
maxWidth: 500,
513518
delay: 100,
514519
arrow: false,
@@ -518,8 +523,17 @@ <h3 data-number="3.0.3" class="anchored" data-anchor-id="monster-pc"><span class
518523
interactive: true,
519524
interactiveBorder: 10,
520525
theme: 'quarto',
521-
placement: 'bottom-start'
526+
placement: 'bottom-start',
522527
};
528+
if (contentFn) {
529+
config.content = contentFn;
530+
}
531+
if (onTriggerFn) {
532+
config.onTrigger = onTriggerFn;
533+
}
534+
if (onUntriggerFn) {
535+
config.onUntrigger = onUntriggerFn;
536+
}
523537
window.tippy(el, config);
524538
}
525539
const noterefs = window.document.querySelectorAll('a[role="doc-noteref"]');
@@ -533,6 +547,81 @@ <h3 data-number="3.0.3" class="anchored" data-anchor-id="monster-pc"><span class
533547
const note = window.document.getElementById(id);
534548
return note.innerHTML;
535549
});
550+
}
551+
const xrefs = window.document.querySelectorAll('a.quarto-xref');
552+
const processXRef = (id, note) => {
553+
// Strip column container classes
554+
const stripColumnClz = (el) => {
555+
el.classList.remove("page-full", "page-columns");
556+
if (el.children) {
557+
for (const child of el.children) {
558+
stripColumnClz(child);
559+
}
560+
}
561+
}
562+
stripColumnClz(note)
563+
if (id.startsWith('sec-')) {
564+
// Special case sections, only their first couple elements
565+
const container = document.createElement("div");
566+
if (note.children && note.children.length > 2) {
567+
for (let i = 0; i < 2; i++) {
568+
container.appendChild(note.children[i].cloneNode(true));
569+
}
570+
return container.innerHTML
571+
} else {
572+
return note.innerHTML;
573+
}
574+
} else {
575+
// Remove any anchor links if they are present
576+
const anchorLink = note.querySelector('a.anchorjs-link');
577+
if (anchorLink) {
578+
anchorLink.remove();
579+
}
580+
return note.innerHTML;
581+
}
582+
}
583+
for (var i=0; i<xrefs.length; i++) {
584+
const xref = xrefs[i];
585+
tippyHover(xref, undefined, function(instance) {
586+
instance.disable();
587+
let url = xref.getAttribute('href');
588+
let hash = undefined;
589+
if (url.startsWith('#')) {
590+
hash = url;
591+
} else {
592+
try { hash = new URL(url).hash; } catch {}
593+
}
594+
if (hash) {
595+
const id = hash.replace(/^#\/?/, "");
596+
const note = window.document.getElementById(id);
597+
if (note !== null) {
598+
try {
599+
const html = processXRef(id, note.cloneNode(true));
600+
instance.setContent(html);
601+
} finally {
602+
instance.enable();
603+
instance.show();
604+
}
605+
} else {
606+
// See if we can fetch this
607+
fetch(url.split('#')[0])
608+
.then(res => res.text())
609+
.then(html => {
610+
const parser = new DOMParser();
611+
const htmlDoc = parser.parseFromString(html, "text/html");
612+
const note = htmlDoc.getElementById(id);
613+
if (note !== null) {
614+
const html = processXRef(id, note);
615+
instance.setContent(html);
616+
}
617+
}).finally(() => {
618+
instance.enable();
619+
instance.show();
620+
});
621+
}
622+
}
623+
}, function(instance) {
624+
});
536625
}
537626
let selectedAnnoteEl;
538627
const selectorForAnnotation = ( cell, annotation) => {
@@ -575,6 +664,7 @@ <h3 data-number="3.0.3" class="anchored" data-anchor-id="monster-pc"><span class
575664
}
576665
div.style.top = top - 2 + "px";
577666
div.style.height = height + 4 + "px";
667+
div.style.left = 0;
578668
let gutterDiv = window.document.getElementById("code-annotation-line-highlight-gutter");
579669
if (gutterDiv === null) {
580670
gutterDiv = window.document.createElement("div");
@@ -600,6 +690,33 @@ <h3 data-number="3.0.3" class="anchored" data-anchor-id="monster-pc"><span class
600690
});
601691
selectedAnnoteEl = undefined;
602692
};
693+
// Handle positioning of the toggle
694+
window.addEventListener(
695+
"resize",
696+
throttle(() => {
697+
console.log("RESIZE");
698+
elRect = undefined;
699+
if (selectedAnnoteEl) {
700+
selectCodeLines(selectedAnnoteEl);
701+
}
702+
}, 10)
703+
);
704+
function throttle(fn, ms) {
705+
let throttle = false;
706+
let timer;
707+
return (...args) => {
708+
if(!throttle) { // first call gets through
709+
fn.apply(this, args);
710+
throttle = true;
711+
} else { // all the others get throttled
712+
if(timer) clearTimeout(timer); // cancel #2
713+
timer = setTimeout(() => {
714+
fn.apply(this, args);
715+
timer = throttle = false;
716+
}, ms);
717+
}
718+
};
719+
}
603720
// Attach click handler to the DT
604721
const annoteDls = window.document.querySelectorAll('dt[data-target-cell]');
605722
for (const annoteDlNode of annoteDls) {
@@ -665,7 +782,9 @@ <h3 data-number="3.0.3" class="anchored" data-anchor-id="monster-pc"><span class
665782
<div class="nav-footer-left">
666783
&nbsp;
667784
</div>
668-
<div class="nav-footer-center">© 2023, created by and maintained by Cox lab</div>
785+
<div class="nav-footer-center">
786+
<p>© 2023, created by and maintained by Cox lab</p>
787+
</div>
669788
<div class="nav-footer-right">
670789
&nbsp;
671790
</div>
@@ -674,4 +793,5 @@ <h3 data-number="3.0.3" class="anchored" data-anchor-id="monster-pc"><span class
674793

675794

676795

796+
677797
</body></html>

0 commit comments

Comments
 (0)