Skip to content

Commit

Permalink
quarto render
Browse files Browse the repository at this point in the history
  • Loading branch information
remlapmot committed Jan 27, 2024
1 parent 1c19be0 commit a7331a5
Show file tree
Hide file tree
Showing 87 changed files with 11,558 additions and 1,865 deletions.
229 changes: 196 additions & 33 deletions docs/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>

<meta charset="utf-8">
<meta name="generator" content="quarto-1.3.450">
<meta name="generator" content="quarto-1.4.549">

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

Expand Down Expand Up @@ -45,7 +45,13 @@
"collapse-after": 3,
"panel-placement": "end",
"type": "overlay",
"limit": 20,
"limit": 50,
"keyboard-shortcut": [
"f",
"/",
"s"
],
"show-item-context": false,
"language": {
"search-no-results-text": "No results",
"search-matching-documents-text": "matching documents",
Expand All @@ -54,6 +60,7 @@
"search-more-match-text": "more match in this document",
"search-more-matches-text": "more matches in this document",
"search-clear-button-title": "Clear",
"search-text-placeholder": "",
"search-detached-cancel-button-title": "Cancel",
"search-submit-button-title": "Submit",
"search-label": "Search"
Expand All @@ -68,9 +75,9 @@

<div id="quarto-search-results"></div>
<header id="quarto-header" class="headroom fixed-top">
<nav class="navbar navbar-expand-lg navbar-dark ">
<nav class="navbar navbar-expand-lg " data-bs-theme="dark">
<div class="navbar-container container-fluid">
<div class="navbar-brand-container">
<div class="navbar-brand-container mx-auto">
<a class="navbar-brand" href="./index.html">
<span class="navbar-title">ivonesamplemr</span>
</a>
Expand All @@ -82,102 +89,102 @@
<div class="collapse navbar-collapse" id="navbarCollapse">
<ul class="navbar-nav navbar-nav-scroll me-auto">
<li class="nav-item">
<a class="nav-link" href="./index.html" rel="" target="">
<span class="menu-text">Home</span></a>
<a class="nav-link" href="./index.html">
<span class="menu-text">Home</span></a>
</li>
<li class="nav-item dropdown ">
<a class="nav-link dropdown-toggle" href="#" id="nav-menu-helpfile-examples" role="button" data-bs-toggle="dropdown" aria-expanded="false" rel="" target="">
<a class="nav-link dropdown-toggle" href="#" id="nav-menu-helpfile-examples" role="button" data-bs-toggle="dropdown" aria-expanded="false">
<span class="menu-text">Helpfile examples</span>
</a>
<ul class="dropdown-menu" aria-labelledby="nav-menu-helpfile-examples">
<li>
<a class="dropdown-item" href="./ivasmm-examples.html" rel="" target="">
<a class="dropdown-item" href="./ivasmm-examples.html">
<span class="dropdown-text">ivasmm</span></a>
</li>
<li>
<a class="dropdown-item" href="./ivlsmm-examples.html" rel="" target="">
<a class="dropdown-item" href="./ivlsmm-examples.html">
<span class="dropdown-text">ivlsmm</span></a>
</li>
<li>
<a class="dropdown-item" href="./ivmsmm-examples.html" rel="" target="">
<a class="dropdown-item" href="./ivmsmm-examples.html">
<span class="dropdown-text">ivmsmm</span></a>
</li>
<li>
<a class="dropdown-item" href="./ivmw-examples.html" rel="" target="">
<a class="dropdown-item" href="./ivmw-examples.html">
<span class="dropdown-text">ivmw</span></a>
</li>
<li>
<a class="dropdown-item" href="./ivtsps-examples.html" rel="" target="">
<a class="dropdown-item" href="./ivtsps-examples.html">
<span class="dropdown-text">ivtsps</span></a>
</li>
<li>
<a class="dropdown-item" href="./ivtsri-examples.html" rel="" target="">
<a class="dropdown-item" href="./ivtsri-examples.html">
<span class="dropdown-text">ivtsri</span></a>
</li>
<li>
<a class="dropdown-item" href="./ivxtile-examples.html" rel="" target="">
<a class="dropdown-item" href="./ivxtile-examples.html">
<span class="dropdown-text">ivxtile</span></a>
</li>
</ul>
</li>
<li class="nav-item dropdown ">
<a class="nav-link dropdown-toggle" href="#" id="nav-menu-helpfiles" role="button" data-bs-toggle="dropdown" aria-expanded="false" rel="" target="">
<a class="nav-link dropdown-toggle" href="#" id="nav-menu-helpfiles" role="button" data-bs-toggle="dropdown" aria-expanded="false">
<span class="menu-text">Helpfiles</span>
</a>
<ul class="dropdown-menu" aria-labelledby="nav-menu-helpfiles">
<li>
<a class="dropdown-item" href="./ivonesamplemr-helpfile.html" rel="" target="">
<a class="dropdown-item" href="./ivonesamplemr-helpfile.html">
<span class="dropdown-text">ivonesamplemr</span></a>
</li>
<li>
<a class="dropdown-item" href="./ivasmm-helpfile.html" rel="" target="">
<a class="dropdown-item" href="./ivasmm-helpfile.html">
<span class="dropdown-text">ivasmm</span></a>
</li>
<li>
<a class="dropdown-item" href="./ivlsmm-helpfile.html" rel="" target="">
<a class="dropdown-item" href="./ivlsmm-helpfile.html">
<span class="dropdown-text">ivlsmm</span></a>
</li>
<li>
<a class="dropdown-item" href="./ivmsmm-helpfile.html" rel="" target="">
<a class="dropdown-item" href="./ivmsmm-helpfile.html">
<span class="dropdown-text">ivmsmm</span></a>
</li>
<li>
<a class="dropdown-item" href="./ivmw-helpfile.html" rel="" target="">
<a class="dropdown-item" href="./ivmw-helpfile.html">
<span class="dropdown-text">ivmw</span></a>
</li>
<li>
<a class="dropdown-item" href="./ivtsps-helpfile.html" rel="" target="">
<a class="dropdown-item" href="./ivtsps-helpfile.html">
<span class="dropdown-text">ivtsps</span></a>
</li>
<li>
<a class="dropdown-item" href="./ivtsri-helpfile.html" rel="" target="">
<a class="dropdown-item" href="./ivtsri-helpfile.html">
<span class="dropdown-text">ivtsri</span></a>
</li>
<li>
<a class="dropdown-item" href="./ivxtile-helpfile.html" rel="" target="">
<a class="dropdown-item" href="./ivxtile-helpfile.html">
<span class="dropdown-text">ivxtile</span></a>
</li>
<li>
<a class="dropdown-item" href="./iv-helpfile.html" rel="" target="">
<a class="dropdown-item" href="./iv-helpfile.html">
<span class="dropdown-text">iv</span></a>
</li>
</ul>
</li>
<li class="nav-item">
<a class="nav-link active" href="./about.html" rel="" target="" aria-current="page">
<span class="menu-text">About</span></a>
<a class="nav-link active" href="./about.html" aria-current="page">
<span class="menu-text">About</span></a>
</li>
</ul>
<ul class="navbar-nav navbar-nav-scroll ms-auto">
<li class="nav-item compact">
<a class="nav-link" href="https://github.com/remlapmot/ivonesamplemr" rel="" target=""><i class="bi bi-github" role="img" aria-label="GitHub">
<a class="nav-link" href="https://github.com/remlapmot/ivonesamplemr"> <i class="bi bi-github" role="img" aria-label="GitHub">
</i>
<span class="menu-text"></span></a>
<span class="menu-text"></span></a>
</li>
</ul>
<div class="quarto-navbar-tools">
</div>
</div> <!-- /navcollapse -->
<div class="quarto-navbar-tools">
</div>
</div> <!-- /container-fluid -->
</nav>
</header>
Expand All @@ -193,6 +200,7 @@




<p>This is the website for the <strong>ivonesamplemr</strong> Stata package.</p>
<p>The GitHub repository is <a href="https://github.com/remlapmot/ivonesamplemr">here</a>.</p>
<p>It is maintained by <a href="https://remlapmot.github.io/">Tom Palmer</a>.</p>
Expand Down Expand Up @@ -279,10 +287,9 @@
// clear code selection
e.clearSelection();
});
function tippyHover(el, contentFn) {
function tippyHover(el, contentFn, onTriggerFn, onUntriggerFn) {
const config = {
allowHTML: true,
content: contentFn,
maxWidth: 500,
delay: 100,
arrow: false,
Expand All @@ -292,8 +299,17 @@
interactive: true,
interactiveBorder: 10,
theme: 'quarto',
placement: 'bottom-start'
placement: 'bottom-start',
};
if (contentFn) {
config.content = contentFn;
}
if (onTriggerFn) {
config.onTrigger = onTriggerFn;
}
if (onUntriggerFn) {
config.onUntrigger = onUntriggerFn;
}
window.tippy(el, config);
}
const noterefs = window.document.querySelectorAll('a[role="doc-noteref"]');
Expand All @@ -307,6 +323,125 @@
const note = window.document.getElementById(id);
return note.innerHTML;
});
}
const xrefs = window.document.querySelectorAll('a.quarto-xref');
const processXRef = (id, note) => {
// Strip column container classes
const stripColumnClz = (el) => {
el.classList.remove("page-full", "page-columns");
if (el.children) {
for (const child of el.children) {
stripColumnClz(child);
}
}
}
stripColumnClz(note)
if (id === null || id.startsWith('sec-')) {
// Special case sections, only their first couple elements
const container = document.createElement("div");
if (note.children && note.children.length > 2) {
container.appendChild(note.children[0].cloneNode(true));
for (let i = 1; i < note.children.length; i++) {
const child = note.children[i];
if (child.tagName === "P" && child.innerText === "") {
continue;
} else {
container.appendChild(child.cloneNode(true));
break;
}
}
if (window.Quarto?.typesetMath) {
window.Quarto.typesetMath(container);
}
return container.innerHTML
} else {
if (window.Quarto?.typesetMath) {
window.Quarto.typesetMath(note);
}
return note.innerHTML;
}
} else {
// Remove any anchor links if they are present
const anchorLink = note.querySelector('a.anchorjs-link');
if (anchorLink) {
anchorLink.remove();
}
if (window.Quarto?.typesetMath) {
window.Quarto.typesetMath(note);
}
// TODO in 1.5, we should make sure this works without a callout special case
if (note.classList.contains("callout")) {
return note.outerHTML;
} else {
return note.innerHTML;
}
}
}
for (var i=0; i<xrefs.length; i++) {
const xref = xrefs[i];
tippyHover(xref, undefined, function(instance) {
instance.disable();
let url = xref.getAttribute('href');
let hash = undefined;
if (url.startsWith('#')) {
hash = url;
} else {
try { hash = new URL(url).hash; } catch {}
}
if (hash) {
const id = hash.replace(/^#\/?/, "");
const note = window.document.getElementById(id);
if (note !== null) {
try {
const html = processXRef(id, note.cloneNode(true));
instance.setContent(html);
} finally {
instance.enable();
instance.show();
}
} else {
// See if we can fetch this
fetch(url.split('#')[0])
.then(res => res.text())
.then(html => {
const parser = new DOMParser();
const htmlDoc = parser.parseFromString(html, "text/html");
const note = htmlDoc.getElementById(id);
if (note !== null) {
const html = processXRef(id, note);
instance.setContent(html);
}
}).finally(() => {
instance.enable();
instance.show();
});
}
} else {
// See if we can fetch a full url (with no hash to target)
// This is a special case and we should probably do some content thinning / targeting
fetch(url)
.then(res => res.text())
.then(html => {
const parser = new DOMParser();
const htmlDoc = parser.parseFromString(html, "text/html");
const note = htmlDoc.querySelector('main.content');
if (note !== null) {
// This should only happen for chapter cross references
// (since there is no id in the URL)
// remove the first header
if (note.children.length > 0 && note.children[0].tagName === "HEADER") {
note.children[0].remove();
}
const html = processXRef(null, note);
instance.setContent(html);
}
}).finally(() => {
instance.enable();
instance.show();
});
}
}, function(instance) {
});
}
let selectedAnnoteEl;
const selectorForAnnotation = ( cell, annotation) => {
Expand Down Expand Up @@ -349,6 +484,7 @@
}
div.style.top = top - 2 + "px";
div.style.height = height + 4 + "px";
div.style.left = 0;
let gutterDiv = window.document.getElementById("code-annotation-line-highlight-gutter");
if (gutterDiv === null) {
gutterDiv = window.document.createElement("div");
Expand All @@ -374,6 +510,32 @@
});
selectedAnnoteEl = undefined;
};
// Handle positioning of the toggle
window.addEventListener(
"resize",
throttle(() => {
elRect = undefined;
if (selectedAnnoteEl) {
selectCodeLines(selectedAnnoteEl);
}
}, 10)
);
function throttle(fn, ms) {
let throttle = false;
let timer;
return (...args) => {
if(!throttle) { // first call gets through
fn.apply(this, args);
throttle = true;
} else { // all the others get throttled
if(timer) clearTimeout(timer); // cancel #2
timer = setTimeout(() => {
fn.apply(this, args);
timer = throttle = false;
}, ms);
}
};
}
// Attach click handler to the DT
const annoteDls = window.document.querySelectorAll('dt[data-target-cell]');
for (const annoteDlNode of annoteDls) {
Expand Down Expand Up @@ -437,4 +599,5 @@




</body></html>
2 changes: 1 addition & 1 deletion docs/helpfiles/iv.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-type" content="text/html; charset=utf8">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css">
BODY{background-color: ffffff;
Expand Down
Loading

0 comments on commit a7331a5

Please sign in to comment.