Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic website rendering with latest Quarto #59

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
232 changes: 198 additions & 34 deletions _site/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<html xmlns="http://www.w3.org/1999/xhtml" lang="fr" xml:lang="fr"><head>

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

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


<title>R Lille - Groupe des Utilisateurs•rices R de Lille - Qu’est-ce que R Lille&nbsp;?</title>
<title>R Lille - Groupe des Utilisateurs•rices R de Lille Qu’est-ce que R Lille&nbsp;?</title>
<style>
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
Expand Down Expand Up @@ -47,7 +47,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": "Pas de résultats",
"search-matching-documents-text": "documents trouvés",
Expand All @@ -56,6 +62,7 @@
"search-more-match-text": "correspondance de plus dans ce document",
"search-more-matches-text": "correspondances de plus dans ce document",
"search-clear-button-title": "Effacer",
"search-text-placeholder": "",
"search-detached-cancel-button-title": "Annuler",
"search-submit-button-title": "Envoyer",
"search-label": "Recherche"
Expand All @@ -66,27 +73,23 @@
<link rel="stylesheet" href="styles.css">
<meta property="og:title" content="R Lille">
<meta property="og:description" content="Groupe des Utilisateurs•rices de R de Lille">
<meta property="og:image" content="https://rlille.fr/media/social.png">
<meta property="og:site-name" content="R Lille - Groupe des Utilisateurs•rices R de Lille">
<meta property="og:image:height" content="600">
<meta property="og:image:width" content="1200">
<meta property="og:image" content="https://rlille.fr/media/icon.svg">
<meta property="og:site_name" content="R Lille - Groupe des Utilisateurs•rices R de Lille">
<meta name="twitter:title" content="R Lille">
<meta name="twitter:description" content="Groupe des Utilisateurs•rices de R de Lille">
<meta name="twitter:image" content="https://rlille.fr/media/social.png">
<meta name="twitter:image" content="https://rlille.fr/media/icon.svg">
<meta name="twitter:creator" content="@MickaelCanouil">
<meta name="twitter:site" content="@RLilleRUG">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image-height" content="600">
<meta name="twitter:image-width" content="1200">
</head>

<body class="nav-fixed fullcontent">

<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 href="./index.html" class="navbar-brand navbar-brand-logo">
<img src="./media/icon.svg" alt="" class="navbar-logo">
</a>
Expand All @@ -101,33 +104,33 @@
<div class="collapse navbar-collapse" id="navbarCollapse">
<ul class="navbar-nav navbar-nav-scroll ms-auto">
<li class="nav-item">
<a class="nav-link active" href="./about.html" rel="" target="" aria-current="page">
<span class="menu-text">À Propos</span></a>
<a class="nav-link active" href="./about.html" aria-current="page">
<span class="menu-text">À Propos</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://www.meetup.com/R-Lille/" rel="" target="">
<span class="menu-text"><i class="fa-brands fa-meetup" aria-hidden="true"></i></span></a>
<a class="nav-link" href="https://www.meetup.com/R-Lille/">
<span class="menu-text"><i class="fa-brands fa-meetup" aria-hidden="true"></i></span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://github.com/RLille/" rel="" target="">
<span class="menu-text"><i class="fa-brands fa-github" aria-hidden="true"></i></span></a>
<a class="nav-link" href="https://github.com/RLille/">
<span class="menu-text"><i class="fa-brands fa-github" aria-hidden="true"></i></span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://twitter.com/RLille_RUG" rel="" target="">
<span class="menu-text"><i class="fa-brands fa-twitter" aria-hidden="true"></i></span></a>
<a class="nav-link" href="https://twitter.com/RLille_RUG">
<span class="menu-text"><i class="fa-brands fa-twitter" aria-hidden="true"></i></span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://www.youtube.com/c/RLille" rel="" target="">
<span class="menu-text"><i class="fa-brands fa-youtube" aria-hidden="true"></i></span></a>
<a class="nav-link" href="https://www.youtube.com/c/RLille">
<span class="menu-text"><i class="fa-brands fa-youtube" aria-hidden="true"></i></span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://r-grrr.slack.com/archives/C042K6XB34G" rel="" target="">
<span class="menu-text"><i class="fa-brands fa-slack" aria-hidden="true"></i></span></a>
<a class="nav-link" href="https://r-grrr.slack.com/archives/C042K6XB34G">
<span class="menu-text"><i class="fa-brands fa-slack" aria-hidden="true"></i></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 @@ -137,7 +140,7 @@
<!-- margin-sidebar -->

<!-- main -->
<div class="quarto-about-solana column-body">
<div class="quarto-about-solana column-body content">
<div class="about-entity">
<div class="entity-contents">
<header id="title-block-header" class="quarto-title-block default">
Expand Down Expand Up @@ -249,10 +252,9 @@ <h1 class="title">Qu’est-ce que R Lille&nbsp;?</h1>
// 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 @@ -262,8 +264,17 @@ <h1 class="title">Qu’est-ce que R Lille&nbsp;?</h1>
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 @@ -277,6 +288,125 @@ <h1 class="title">Qu’est-ce que R Lille&nbsp;?</h1>
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 @@ -319,6 +449,7 @@ <h1 class="title">Qu’est-ce que R Lille&nbsp;?</h1>
}
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 @@ -344,6 +475,32 @@ <h1 class="title">Qu’est-ce que R Lille&nbsp;?</h1>
});
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 @@ -406,10 +563,16 @@ <h1 class="title">Qu’est-ce que R Lille&nbsp;?</h1>
</div> <!-- /content -->
<footer class="footer">
<div class="nav-footer">
<div class="nav-footer-left">Powered by <a href="https://quarto.org">Quarto</a>.</div>
<div class="nav-footer-center">© 2022 R Lille (R User Group).<br>
License: <a href="https://creativecommons.org/licenses/by-nc-sa/4.0">CC BY NC SA 4.0</a>.<div class="toc-actions"><div><i class="bi bi-github"></i></div><div class="action-links"><p><a href="https://github.com/RLille/rlille.fr/edit/main/about.qmd" class="toc-action">Modifier cette page</a></p><p><a href="https://github.com/RLille/rlille.fr/issues/new" class="toc-action">Faire part d'un problème</a></p></div></div></div>
<div class="nav-footer-right">Supported by <a href="https://www.r-consortium.org/"><img src="./media/RConsortium_Horizontal_Pantone.png" alt="R Consortium Logo" style="height:1.5em;"></a>.</div>
<div class="nav-footer-left">
<p>Powered by <a href="https://quarto.org">Quarto</a>.</p>
</div>
<div class="nav-footer-center">
<p>© 2022 R Lille (R User Group).<br>
License: <a href="https://creativecommons.org/licenses/by-nc-sa/4.0">CC BY NC SA 4.0</a>.</p>
<div class="toc-actions"><ul><li><a href="https://github.com/RLille/rlille.fr/edit/main/about.qmd" class="toc-action"><i class="bi bi-github"></i>Modifier cette page</a></li><li><a href="https://github.com/RLille/rlille.fr/issues/new" class="toc-action"><i class="bi empty"></i>Faire part d'un problème</a></li></ul></div></div>
<div class="nav-footer-right">
<p>Supported by <a href="https://www.r-consortium.org/"><img src="./media/RConsortium_Horizontal_Pantone.png" alt="R Consortium Logo" style="height:1.5em;"></a>.</p>
</div>
</div>
</footer>
<script type="text/javascript">
Expand All @@ -432,4 +595,5 @@ <h1 class="title">Qu’est-ce que R Lille&nbsp;?</h1>




</body></html>
Loading