Skip to content

Commit

Permalink
Built site for gh-pages
Browse files Browse the repository at this point in the history
Quarto GHA Workflow Runner committed Nov 25, 2024
1 parent 02c9034 commit 654b537
Showing 14 changed files with 4,058 additions and 246 deletions.
2 changes: 1 addition & 1 deletion .nojekyll
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d196b4b8
5191137a
2 changes: 1 addition & 1 deletion contribute.html
Original file line number Diff line number Diff line change
@@ -825,7 +825,7 @@ <h2 class="anchored" data-anchor-id="pull-request">Pull request</h2>
</div>
</div>
</footer>
<script>var lightboxQuarto = GLightbox({"descPosition":"bottom","closeEffect":"zoom","openEffect":"zoom","selector":".lightbox","loop":false});
<script>var lightboxQuarto = GLightbox({"selector":".lightbox","openEffect":"zoom","closeEffect":"zoom","loop":false,"descPosition":"bottom"});
(function() {
let previousOnload = window.onload;
window.onload = () => {
29 changes: 20 additions & 9 deletions index.html
Original file line number Diff line number Diff line change
@@ -188,7 +188,7 @@
<!-- margin-sidebar -->
<div id="quarto-margin-sidebar" class="sidebar margin-sidebar">

<h5 class="quarto-listing-category-title">Categories</h5><div class="quarto-listing-category category-default"><div class="category" data-category="">All <span class="quarto-category-count">(8)</span></div><div class="category" data-category=".renviron">.renviron <span class="quarto-category-count">(1)</span></div><div class="category" data-category="apply">apply <span class="quarto-category-count">(1)</span></div><div class="category" data-category="configuration">configuration <span class="quarto-category-count">(1)</span></div><div class="category" data-category="editor">editor <span class="quarto-category-count">(2)</span></div><div class="category" data-category="function">function <span class="quarto-category-count">(2)</span></div><div class="category" data-category="games">games <span class="quarto-category-count">(1)</span></div><div class="category" data-category="git-bash">git-bash <span class="quarto-category-count">(1)</span></div><div class="category" data-category="home">home <span class="quarto-category-count">(1)</span></div><div class="category" data-category="lapply">lapply <span class="quarto-category-count">(1)</span></div><div class="category" data-category="loop">loop <span class="quarto-category-count">(1)</span></div><div class="category" data-category="python">python <span class="quarto-category-count">(2)</span></div><div class="category" data-category="r">r <span class="quarto-category-count">(3)</span></div><div class="category" data-category="recursive">recursive <span class="quarto-category-count">(1)</span></div><div class="category" data-category="rstudio">rstudio <span class="quarto-category-count">(2)</span></div><div class="category" data-category="secret">secret <span class="quarto-category-count">(1)</span></div><div class="category" data-category="security">security <span class="quarto-category-count">(1)</span></div><div class="category" data-category="shortcut">shortcut <span class="quarto-category-count">(2)</span></div><div class="category" data-category="tapply">tapply <span class="quarto-category-count">(1)</span></div><div class="category" data-category="terminal">terminal <span class="quarto-category-count">(1)</span></div><div class="category" data-category="tutorial">tutorial <span class="quarto-category-count">(2)</span></div><div class="category" data-category="windows">windows <span class="quarto-category-count">(2)</span></div><div class="category" data-category="zsh">zsh <span class="quarto-category-count">(1)</span></div></div></div>
<h5 class="quarto-listing-category-title">Categories</h5><div class="quarto-listing-category category-default"><div class="category" data-category="">All <span class="quarto-category-count">(9)</span></div><div class="category" data-category=".renviron">.renviron <span class="quarto-category-count">(1)</span></div><div class="category" data-category="apply">apply <span class="quarto-category-count">(1)</span></div><div class="category" data-category="compendium">compendium <span class="quarto-category-count">(1)</span></div><div class="category" data-category="configuration">configuration <span class="quarto-category-count">(1)</span></div><div class="category" data-category="description-file">description-file <span class="quarto-category-count">(1)</span></div><div class="category" data-category="documentation">documentation <span class="quarto-category-count">(1)</span></div><div class="category" data-category="editor">editor <span class="quarto-category-count">(2)</span></div><div class="category" data-category="function">function <span class="quarto-category-count">(2)</span></div><div class="category" data-category="games">games <span class="quarto-category-count">(1)</span></div><div class="category" data-category="git-bash">git-bash <span class="quarto-category-count">(1)</span></div><div class="category" data-category="home">home <span class="quarto-category-count">(1)</span></div><div class="category" data-category="lapply">lapply <span class="quarto-category-count">(1)</span></div><div class="category" data-category="loop">loop <span class="quarto-category-count">(1)</span></div><div class="category" data-category="project">project <span class="quarto-category-count">(1)</span></div><div class="category" data-category="python">python <span class="quarto-category-count">(2)</span></div><div class="category" data-category="r">r <span class="quarto-category-count">(4)</span></div><div class="category" data-category="recursive">recursive <span class="quarto-category-count">(1)</span></div><div class="category" data-category="reproducibility">reproducibility <span class="quarto-category-count">(1)</span></div><div class="category" data-category="rstudio">rstudio <span class="quarto-category-count">(2)</span></div><div class="category" data-category="secret">secret <span class="quarto-category-count">(1)</span></div><div class="category" data-category="security">security <span class="quarto-category-count">(1)</span></div><div class="category" data-category="shortcut">shortcut <span class="quarto-category-count">(2)</span></div><div class="category" data-category="tapply">tapply <span class="quarto-category-count">(1)</span></div><div class="category" data-category="terminal">terminal <span class="quarto-category-count">(1)</span></div><div class="category" data-category="tutorial">tutorial <span class="quarto-category-count">(2)</span></div><div class="category" data-category="windows">windows <span class="quarto-category-count">(2)</span></div><div class="category" data-category="zsh">zsh <span class="quarto-category-count">(1)</span></div></div></div>
<!-- main -->
<main class="content quarto-banner-title-block column-page-left" id="quarto-document-content">

@@ -246,7 +246,7 @@ <h2 class="anchored" data-anchor-id="welcome">Welcome!</h2>
</tr>
</thead>
<tbody class="list">
<tr data-index="0" data-categories="r,apply,lapply,tapply,recursive,function,loop" data-listing-date-sort="1731974400000" data-listing-file-modified-sort="1731929802731" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="8" data-listing-word-count-sort="1476" data-listing-title-sort="The apply() function family" data-listing-filename-sort="2024-11-19-the-apply-function-family.qmd">
<tr data-index="0" data-categories="r,apply,lapply,tapply,recursive,function,loop" data-listing-date-sort="1731974400000" data-listing-file-modified-sort="1732514545739" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="8" data-listing-word-count-sort="1476" data-listing-title-sort="The apply() function family" data-listing-filename-sort="2024-11-19-the-apply-function-family.qmd">
<td>
<span class="listing-date">Nov 19, 2024</span>
</td>
@@ -257,7 +257,18 @@ <h2 class="anchored" data-anchor-id="welcome">Welcome!</h2>
<span class="listing-author">Nicolas Casajus</span>
</td>
</tr>
<tr data-index="1" data-categories="python,tutorial,function" data-listing-date-sort="1718064000000" data-listing-file-modified-sort="1731929802731" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="1" data-listing-word-count-sort="18" data-listing-title-sort="Python tutorial - Part 2" data-listing-filename-sort="2024-06-11-python-tutorial-part-2.qmd">
<tr data-index="1" data-categories="r,compendium,project,description-file,reproducibility,documentation" data-listing-date-sort="1727136000000" data-listing-file-modified-sort="1732514545739" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="37" data-listing-word-count-sort="7305" data-listing-title-sort="Research compendium" data-listing-filename-sort="2024-09-24-research-compendium.qmd">
<td>
<span class="listing-date">Sep 24, 2024</span>
</td>
<td>
<a href="./posts/2024-09-24-research-compendium/2024-09-24-research-compendium.html" class="title listing-title">Research compendium</a>
</td>
<td>
<span class="listing-author">Nicolas Casajus</span>
</td>
</tr>
<tr data-index="2" data-categories="python,tutorial,function" data-listing-date-sort="1718064000000" data-listing-file-modified-sort="1732514545739" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="1" data-listing-word-count-sort="18" data-listing-title-sort="Python tutorial - Part 2" data-listing-filename-sort="2024-06-11-python-tutorial-part-2.qmd">
<td>
<span class="listing-date">Jun 11, 2024</span>
</td>
@@ -268,7 +279,7 @@ <h2 class="anchored" data-anchor-id="welcome">Welcome!</h2>
<span class="listing-author">Camille Coux</span>
</td>
</tr>
<tr data-index="2" data-categories="python,tutorial,games" data-listing-date-sort="1712016000000" data-listing-file-modified-sort="1731929802731" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="1" data-listing-word-count-sort="18" data-listing-title-sort="Python tutorial - Part 1" data-listing-filename-sort="2024-04-02-python-tutorial-part-1.qmd">
<tr data-index="3" data-categories="python,tutorial,games" data-listing-date-sort="1712016000000" data-listing-file-modified-sort="1732514545739" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="1" data-listing-word-count-sort="18" data-listing-title-sort="Python tutorial - Part 1" data-listing-filename-sort="2024-04-02-python-tutorial-part-1.qmd">
<td>
<span class="listing-date">Apr 2, 2024</span>
</td>
@@ -279,7 +290,7 @@ <h2 class="anchored" data-anchor-id="welcome">Welcome!</h2>
<span class="listing-author">Camille Coux</span>
</td>
</tr>
<tr data-index="3" data-categories="windows,terminal,git-bash,zsh" data-listing-date-sort="1711411200000" data-listing-file-modified-sort="1731929802731" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="6" data-listing-word-count-sort="1129" data-listing-title-sort="ZSH: an alternative to Bash (Windows)" data-listing-filename-sort="2024-03-26-zsh-an-alternative-to-bash.qmd">
<tr data-index="4" data-categories="windows,terminal,git-bash,zsh" data-listing-date-sort="1711411200000" data-listing-file-modified-sort="1732514545739" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="6" data-listing-word-count-sort="1129" data-listing-title-sort="ZSH: an alternative to Bash (Windows)" data-listing-filename-sort="2024-03-26-zsh-an-alternative-to-bash.qmd">
<td>
<span class="listing-date">Mar 26, 2024</span>
</td>
@@ -290,7 +301,7 @@ <h2 class="anchored" data-anchor-id="welcome">Welcome!</h2>
<span class="listing-author">Nicolas Casajus</span>
</td>
</tr>
<tr data-index="4" data-categories="r,secret,.renviron,security" data-listing-date-sort="1710201600000" data-listing-file-modified-sort="1731929802731" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="3" data-listing-word-count-sort="555" data-listing-title-sort="Storing secrets with the .Renviron file" data-listing-filename-sort="2024-03-12-storing-secrets-with-the-renviron-file.qmd">
<tr data-index="5" data-categories="r,secret,.renviron,security" data-listing-date-sort="1710201600000" data-listing-file-modified-sort="1732514545735" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="3" data-listing-word-count-sort="555" data-listing-title-sort="Storing secrets with the .Renviron file" data-listing-filename-sort="2024-03-12-storing-secrets-with-the-renviron-file.qmd">
<td>
<span class="listing-date">Mar 12, 2024</span>
</td>
@@ -301,7 +312,7 @@ <h2 class="anchored" data-anchor-id="welcome">Welcome!</h2>
<span class="listing-author">Nicolas Casajus</span>
</td>
</tr>
<tr data-index="5" data-categories="r,configuration,home,windows" data-listing-date-sort="1710115200000" data-listing-file-modified-sort="1731929802731" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="3" data-listing-word-count-sort="578" data-listing-title-sort="Windows and the HOME directory" data-listing-filename-sort="2024-03-11-windows-and-the-home-directory.qmd">
<tr data-index="6" data-categories="r,configuration,home,windows" data-listing-date-sort="1710115200000" data-listing-file-modified-sort="1732514545735" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="3" data-listing-word-count-sort="578" data-listing-title-sort="Windows and the HOME directory" data-listing-filename-sort="2024-03-11-windows-and-the-home-directory.qmd">
<td>
<span class="listing-date">Mar 11, 2024</span>
</td>
@@ -312,7 +323,7 @@ <h2 class="anchored" data-anchor-id="welcome">Welcome!</h2>
<span class="listing-author">Nicolas Casajus</span>
</td>
</tr>
<tr data-index="6" data-categories="editor,shortcut,rstudio" data-listing-date-sort="1708992000000" data-listing-file-modified-sort="1731929802723" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="2" data-listing-word-count-sort="296" data-listing-title-sort="Code snippets in RStudio" data-listing-filename-sort="2024-02-27-code-snippets-in-rstudio.qmd">
<tr data-index="7" data-categories="editor,shortcut,rstudio" data-listing-date-sort="1708992000000" data-listing-file-modified-sort="1732514545727" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="2" data-listing-word-count-sort="296" data-listing-title-sort="Code snippets in RStudio" data-listing-filename-sort="2024-02-27-code-snippets-in-rstudio.qmd">
<td>
<span class="listing-date">Feb 27, 2024</span>
</td>
@@ -323,7 +334,7 @@ <h2 class="anchored" data-anchor-id="welcome">Welcome!</h2>
<span class="listing-author">Nicolas Casajus</span>
</td>
</tr>
<tr data-index="7" data-categories="editor,shortcut,rstudio" data-listing-date-sort="1708992000000" data-listing-file-modified-sort="1731929802731" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="21" data-listing-word-count-sort="4035" data-listing-title-sort="RStudio shortcuts: a selection" data-listing-filename-sort="2024-02-27-rstudio-shortcuts-a-selection.qmd">
<tr data-index="8" data-categories="editor,shortcut,rstudio" data-listing-date-sort="1708992000000" data-listing-file-modified-sort="1732514545735" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="21" data-listing-word-count-sort="4035" data-listing-title-sort="RStudio shortcuts: a selection" data-listing-filename-sort="2024-02-27-rstudio-shortcuts-a-selection.qmd">
<td>
<span class="listing-date">Feb 27, 2024</span>
</td>
15 changes: 15 additions & 0 deletions index.xml
Original file line number Diff line number Diff line change
@@ -27,6 +27,21 @@
<pubDate>Tue, 19 Nov 2024 00:00:00 GMT</pubDate>
<media:content url="https://frbcesab.github.io/tips-and-tricks/posts/2024-11-19-the-apply-function-family" medium="image"/>
</item>
<item>
<title>Research compendium</title>
<dc:creator>Nicolas Casajus</dc:creator>
<link>https://frbcesab.github.io/tips-and-tricks/posts/2024-09-24-research-compendium/2024-09-24-research-compendium.html</link>
<description><![CDATA[ This post explains how to work with a <strong>research compendium</strong>. The goal of a research compendium is to provide a standard and easily recognizable way for <strong><em>organizing the digital materials</em></strong> of a project to enable others to inspect, reproduce, and extend the research (Marwick B <em>et al.</em> 2018). A research compendium follows three general principles: ]]></description>
<category>r</category>
<category>compendium</category>
<category>project</category>
<category>description-file</category>
<category>reproducibility</category>
<category>documentation</category>
<guid>https://frbcesab.github.io/tips-and-tricks/posts/2024-09-24-research-compendium/2024-09-24-research-compendium.html</guid>
<pubDate>Tue, 24 Sep 2024 00:00:00 GMT</pubDate>
<media:content url="https://frbcesab.github.io/tips-and-tricks/posts/2024-09-24-research-compendium" medium="image"/>
</item>
<item>
<title>Python tutorial - Part 2</title>
<dc:creator>Camille Coux</dc:creator>
1 change: 1 addition & 0 deletions listings.json
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@
"listing": "/index.html",
"items": [
"/posts/2024-11-19-the-apply-function-family/2024-11-19-the-apply-function-family.html",
"/posts/2024-09-24-research-compendium/2024-09-24-research-compendium.html",
"/posts/2024-06-11-python-tutorial-part-2/2024-06-11-python-tutorial-part-2.html",
"/posts/2024-04-02-python-tutorial-part-1/2024-04-02-python-tutorial-part-1.html",
"/posts/2024-03-26-zsh-an-alternative-to-bash/2024-03-26-zsh-an-alternative-to-bash.html",
1,767 changes: 1,767 additions & 0 deletions posts/2024-09-24-research-compendium/2024-09-24-research-compendium.html

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1059,7 +1059,7 @@ <h2 class="anchored" data-anchor-id="the-tapply-function">The <code>tapply()</co
</div>
</div>
</footer>
<script>var lightboxQuarto = GLightbox({"openEffect":"zoom","selector":".lightbox","closeEffect":"zoom","descPosition":"bottom","loop":false});
<script>var lightboxQuarto = GLightbox({"closeEffect":"zoom","loop":false,"descPosition":"bottom","openEffect":"zoom","selector":".lightbox"});
(function() {
let previousOnload = window.onload;
window.onload = () => {
515 changes: 310 additions & 205 deletions search.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions site_libs/bootstrap/bootstrap.min.css

Large diffs are not rendered by default.

275 changes: 275 additions & 0 deletions site_libs/quarto-diagram/mermaid-init.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,275 @@
// mermaid-init.js
// Initializes the quarto-mermaid JS runtime
//
// Copyright (C) 2022 Posit Software, PBC

/**
* String.prototype.replaceAll() polyfill
* https://gomakethings.com/how-to-replace-a-section-of-a-string-with-another-one-with-vanilla-js/
* @author Chris Ferdinandi
* @license MIT
*/
if (!String.prototype.replaceAll) {
String.prototype.replaceAll = function (str, newStr) {
// If a regex pattern
if (
Object.prototype.toString.call(str).toLowerCase() === "[object regexp]"
) {
return this.replace(str, newStr);
}

// If a string
return this.replace(new RegExp(str, "g"), newStr);
};
}

const mermaidOpts = {
startOnLoad: false,
};
// this CSS is adapted from
// mkdocs-material
// Copyright (c) 2016-2022 Martin Donath <martin.donath@squidfunk.com>

const defaultCSS =
'.label text {fill: var(--mermaid-fg-color);}.node circle, .node ellipse, .node path, .node polygon, .node rect {fill: var(--mermaid-node-bg-color);stroke: var(--mermaid-node-fg-color);}marker {fill: var(--mermaid-edge-color) !important;}.edgeLabel .label rect {fill: #0000;}.label {color: var(--mermaid-label-fg-color);font-family: var(--mermaid-font-family);}.label foreignObject {line-height: normal;overflow: visible;}.label div .edgeLabel {color: var(--mermaid-label-fg-color);}.edgeLabel, .edgeLabel rect, .label div .edgeLabel {background-color: var(--mermaid-label-bg-color);}.edgeLabel, .edgeLabel rect {fill: var(--mermaid-label-bg-color);color: var(--mermaid-edge-color);}.edgePath .path, .flowchart-link {stroke: var(--mermaid-edge-color);}.edgePath .arrowheadPath {fill: var(--mermaid-edge-color);stroke: none;}.cluster rect {fill: var(--mermaid-fg-color--lightest);stroke: var(--mermaid-fg-color--lighter);}.cluster span {color: var(--mermaid-label-fg-color);font-family: var(--mermaid-font-family);}defs #flowchart-circleEnd, defs #flowchart-circleStart, defs #flowchart-crossEnd, defs #flowchart-crossStart, defs #flowchart-pointEnd, defs #flowchart-pointStart {stroke: none;}g.classGroup line, g.classGroup rect {fill: var(--mermaid-node-bg-color);stroke: var(--mermaid-node-fg-color);}g.classGroup text {fill: var(--mermaid-label-fg-color);font-family: var(--mermaid-font-family);}.classLabel .box {fill: var(--mermaid-label-bg-color);background-color: var(--mermaid-label-bg-color);opacity: 1;}.classLabel .label {fill: var(--mermaid-label-fg-color);font-family: var(--mermaid-font-family);}.node .divider {stroke: var(--mermaid-node-fg-color);}.relation {stroke: var(--mermaid-edge-color);}.cardinality {fill: var(--mermaid-label-fg-color);font-family: var(--mermaid-font-family);}.cardinality text {fill: inherit !important;}defs #classDiagram-compositionEnd, defs #classDiagram-compositionStart, defs #classDiagram-dependencyEnd, defs #classDiagram-dependencyStart, defs #classDiagram-extensionEnd, defs #classDiagram-extensionStart {fill: var(--mermaid-edge-color) !important;stroke: var(--mermaid-edge-color) !important;}defs #classDiagram-aggregationEnd, defs #classDiagram-aggregationStart {fill: var(--mermaid-label-bg-color) !important;stroke: var(--mermaid-edge-color) !important;}g.stateGroup rect {fill: var(--mermaid-node-bg-color);stroke: var(--mermaid-node-fg-color);}g.stateGroup .state-title {fill: var(--mermaid-label-fg-color) !important;font-family: var(--mermaid-font-family);}g.stateGroup .composit {fill: var(--mermaid-label-bg-color);}.nodeLabel {color: var(--mermaid-label-fg-color);font-family: var(--mermaid-font-family);}.node circle.state-end, .node circle.state-start, .start-state {fill: var(--mermaid-edge-color);stroke: none;}.end-state-inner, .end-state-outer {fill: var(--mermaid-edge-color);}.end-state-inner, .node circle.state-end {stroke: var(--mermaid-label-bg-color);}.transition {stroke: var(--mermaid-edge-color);}[id^="state-fork"] rect, [id^="state-join"] rect {fill: var(--mermaid-edge-color) !important;stroke: none !important;}.statediagram-cluster.statediagram-cluster .inner {fill: var(--mermaid-bg-color);}.statediagram-cluster rect {fill: var(--mermaid-node-bg-color);stroke: var(--mermaid-node-fg-color);}.statediagram-state rect.divider {fill: var(--mermaid-fg-color--lightest);stroke: var(--mermaid-fg-color--lighter);}defs #statediagram-barbEnd {stroke: var(--mermaid-edge-color);}.entityBox {fill: var(--mermaid-label-bg-color);stroke: var(--mermaid-node-fg-color);}.entityLabel {fill: var(--mermaid-label-fg-color);font-family: var(--mermaid-font-family);}.relationshipLabelBox {fill: var(--mermaid-label-bg-color);fill-opacity: 1;background-color: var(--mermaid-label-bg-color);opacity: 1;}.relationshipLabel {fill: var(--mermaid-label-fg-color);}.relationshipLine {stroke: var(--mermaid-edge-color);}defs #ONE_OR_MORE_END *, defs #ONE_OR_MORE_START *, defs #ONLY_ONE_END *, defs #ONLY_ONE_START *, defs #ZERO_OR_MORE_END *, defs #ZERO_OR_MORE_START *, defs #ZERO_OR_ONE_END *, defs #ZERO_OR_ONE_START * {stroke: var(--mermaid-edge-color) !important;}.actor, defs #ZERO_OR_MORE_END circle, defs #ZERO_OR_MORE_START circle {fill: var(--mermaid-label-bg-color);}.actor {stroke: var(--mermaid-node-fg-color);}text.actor > tspan {fill: var(--mermaid-label-fg-color);font-family: var(--mermaid-font-family);}line {stroke: var(--mermaid-fg-color--lighter);}.messageLine0, .messageLine1 {stroke: var(--mermaid-edge-color);}.loopText > tspan, .messageText, .noteText > tspan {fill: var(--mermaid-edge-color);stroke: none;font-family: var(--mermaid-font-family) !important;}.noteText > tspan {fill: #000;}#arrowhead path {fill: var(--mermaid-edge-color);stroke: none;}.loopLine {stroke: var(--mermaid-node-fg-color);}.labelBox, .loopLine {fill: var(--mermaid-node-bg-color);}.labelBox {stroke: none;}.labelText, .labelText > span {fill: var(--mermaid-node-fg-color);font-family: var(--mermaid-font-family);}';

const mermaidThemeEl = document.querySelector('meta[name="mermaid-theme"]');
if (mermaidThemeEl) {
mermaidOpts.theme = mermaidThemeEl.content;
} else {
mermaidOpts.themeCSS = defaultCSS;
}

mermaid.initialize(mermaidOpts);

const _quartoMermaid = {
// NB: there's effectively a copy of this function
// in `core/svg.ts`.
// if you change something here, you must keep it consistent there as well.
setSvgSize(svg) {
const { widthInPoints, heightInPoints, explicitHeight, explicitWidth } =
this.resolveSize(svg);

if (explicitWidth && explicitHeight) {
svg.setAttribute("width", widthInPoints);
svg.setAttribute("height", heightInPoints);
svg.style.maxWidth = null; // remove mermaid's default max-width
} else {
if (explicitWidth) {
svg.style.maxWidth = `${widthInPoints}px`;
}
if (explicitHeight) {
svg.style.maxHeight = `${heightInPoints}px`;
}
}
},

// NB: there's effectively a copy of this function
// in `core/svg.ts`.
// if you change something here, you must keep it consistent there as well.
makeResponsive(svg) {
const width = svg.getAttribute("width");
if (width === null) {
throw new Error("Couldn't find SVG width");
}
const numWidth = Number(width.slice(0, -2));

if (numWidth > 650) {
changed = true;
svg.setAttribute("width", "100%");
svg.removeAttribute("height");
}
},

// NB: there's effectively a copy of this function
// in `core/svg.ts`.
// if you change something here, you must keep it consistent there as well.
fixupAlignment(svg, align) {
let style = svg.getAttribute("style") || "";

switch (align) {
case "left":
style = `${style}; display: block; margin: auto auto auto 0`;
break;
case "right":
style = `${style}; display: block; margin: auto 0 auto auto`;
break;
case "center":
style = `${style}; display: block; margin: auto auto auto auto`;
break;
}
svg.setAttribute("style", style);
},

resolveOptions(svgEl) {
return svgEl.parentElement.parentElement.parentElement.parentElement
.dataset;
},

// NB: there's effectively a copy of this function
// in our mermaid runtime in `core/svg.ts`.
// if you change something here, you must keep it consistent there as well.
resolveSize(svgEl) {
const inInches = (size) => {
if (size.endsWith("in")) {
return Number(size.slice(0, -2));
}
if (size.endsWith("pt") || size.endsWith("px")) {
// assume 96 dpi for now
return Number(size.slice(0, -2)) / 96;
}
return Number(size);
};

// these are figWidth and figHeight on purpose,
// because data attributes are translated to camelCase by the DOM API
const kFigWidth = "figWidth",
kFigHeight = "figHeight";
const options = this.resolveOptions(svgEl);
let width = svgEl.getAttribute("width");
let height = svgEl.getAttribute("height");
const getViewBox = () => {
const vb = svgEl.attributes.getNamedItem("viewBox").value; // do it the roundabout way so that viewBox isn't dropped by deno_dom and text/html
if (!vb) return undefined;
const lst = vb.trim().split(" ").map(Number);
if (lst.length !== 4) return undefined;
if (lst.some(isNaN)) return undefined;
return lst;
};
if (!width || !height) {
// attempt to resolve figure dimensions via viewBox
const viewBox = getViewBox();
if (viewBox !== undefined) {
const [_mx, _my, vbWidth, vbHeight] = viewBox;
width = `${vbWidth}px`;
height = `${vbHeight}px`;
} else {
throw new Error(
"Mermaid generated an SVG without a viewbox attribute. Without knowing the diagram dimensions, quarto cannot convert it to a PNG"
);
}
}

let svgWidthInInches, svgHeightInInches;

if (
(width.slice(0, -2) === "pt" && height.slice(0, -2) === "pt") ||
(width.slice(0, -2) === "px" && height.slice(0, -2) === "px") ||
(!isNaN(Number(width)) && !isNaN(Number(height)))
) {
// we assume 96 dpi which is generally what seems to be used.
svgWidthInInches = Number(width.slice(0, -2)) / 96;
svgHeightInInches = Number(height.slice(0, -2)) / 96;
}
const viewBox = getViewBox();
if (viewBox !== undefined) {
// assume width and height come from viewbox.
const [_mx, _my, vbWidth, vbHeight] = viewBox;
svgWidthInInches = vbWidth / 96;
svgHeightInInches = vbHeight / 96;
} else {
throw new Error(
"Internal Error: Couldn't resolve width and height of SVG"
);
}
const svgWidthOverHeight = svgWidthInInches / svgHeightInInches;
let widthInInches, heightInInches;

if (options[kFigWidth] && options[kFigHeight]) {
// both were prescribed, so just go with them
widthInInches = inInches(String(options[kFigWidth]));
heightInInches = inInches(String(options[kFigHeight]));
} else if (options[kFigWidth]) {
// we were only given width, use that and adjust height based on aspect ratio;
widthInInches = inInches(String(options[kFigWidth]));
heightInInches = widthInInches / svgWidthOverHeight;
} else if (options[kFigHeight]) {
// we were only given height, use that and adjust width based on aspect ratio;
heightInInches = inInches(String(options[kFigHeight]));
widthInInches = heightInInches * svgWidthOverHeight;
} else {
// we were not given either, use svg's prescribed height
heightInInches = svgHeightInInches;
widthInInches = svgWidthInInches;
}

return {
widthInInches,
heightInInches,
widthInPoints: Math.round(widthInInches * 96),
heightInPoints: Math.round(heightInInches * 96),
explicitWidth: options?.[kFigWidth] !== undefined,
explicitHeight: options?.[kFigHeight] !== undefined,
};
},

postProcess(svg) {
const options = this.resolveOptions(svg);
if (
options.responsive &&
options["figWidth"] === undefined &&
options["figHeight"] === undefined
) {
this.makeResponsive(svg);
} else {
this.setSvgSize(svg);
}
if (options["reveal"]) {
this.fixupAlignment(svg, options["figAlign"] || "center");
}

// forward align attributes to the correct parent dif
// so that the svg figure is aligned correctly
const div = svg.parentElement.parentElement.parentElement;
const align = div.parentElement.parentElement.dataset.layoutAlign;
if (align) {
div.classList.remove("quarto-figure-left");
div.classList.remove("quarto-figure-center");
div.classList.remove("quarto-figure-right");
div.classList.add(`quarto-figure-${align}`);
}
},
};

// deno-lint-ignore no-window-prefix
window.addEventListener(
"load",
async function () {
let i = 0;
// we need pre because of whitespace preservation
for (const el of Array.from(document.querySelectorAll("pre.mermaid-js"))) {
// &nbsp; doesn't appear to be treated as whitespace by mermaid
// so we replace it with a space.
const text = el.textContent.replaceAll("&nbsp;", " ");
const { svg: output } = await mermaid.mermaidAPI.render(
`mermaid-${++i}`,
text,
el
);
el.innerHTML = output;
if (el.dataset.label) {
// patch mermaid's emitted style
const svg = el.firstChild;
const style = svg.querySelector("style");
style.innerHTML = style.innerHTML.replaceAll(
`#${svg.id}`,
`#${el.dataset.label}-mermaid`
);
svg.id = el.dataset.label + "-mermaid";
delete el.dataset.label;
}

const svg = el.querySelector("svg");
const parent = el.parentElement;
parent.removeChild(el);
parent.appendChild(svg);
svg.classList.add("mermaid-js");
}
for (const svgEl of Array.from(
document.querySelectorAll("svg.mermaid-js")
)) {
_quartoMermaid.postProcess(svgEl);
}
},
false
);
13 changes: 13 additions & 0 deletions site_libs/quarto-diagram/mermaid.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.mermaidTooltip {
position: absolute;
text-align: center;
max-width: 200px;
padding: 2px;
font-family: "trebuchet ms", verdana, arial;
font-size: 12px;
background: #ffffde;
border: 1px solid #aaaa33;
border-radius: 2px;
pointer-events: none;
z-index: 1000;
}
1,621 changes: 1,621 additions & 0 deletions site_libs/quarto-diagram/mermaid.min.js

Large diffs are not rendered by default.

58 changes: 31 additions & 27 deletions sitemap.xml
Original file line number Diff line number Diff line change
@@ -1,59 +1,63 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://frbcesab.github.io/tips-and-tricks/posts/2024-04-02-python-tutorial-part-1/2024-04-02-python-tutorial-part-1.html</loc>
<lastmod>2024-11-18T11:36:42.731Z</lastmod>
<loc>https://frbcesab.github.io/tips-and-tricks/posts/2024-09-24-research-compendium/2024-09-24-research-compendium.html</loc>
<lastmod>2024-11-25T06:02:25.739Z</lastmod>
</url>
<url>
<loc>https://frbcesab.github.io/tips-and-tricks/posts/2024-11-19-the-apply-function-family/2024-11-19-the-apply-function-family.html</loc>
<lastmod>2024-11-18T11:36:42.731Z</lastmod>
<loc>https://frbcesab.github.io/tips-and-tricks/posts/2024-06-11-python-tutorial-part-2/2024-06-11-python-tutorial-part-2.html</loc>
<lastmod>2024-11-25T06:02:25.739Z</lastmod>
</url>
<url>
<loc>https://frbcesab.github.io/tips-and-tricks/posts/2024-03-26-zsh-an-alternative-to-bash/2024-03-26-zsh-an-alternative-to-bash.html</loc>
<lastmod>2024-11-18T11:36:42.731Z</lastmod>
<loc>https://frbcesab.github.io/tips-and-tricks/posts/2024-02-27-rstudio-shortcuts-a-selection/2024-02-27-rstudio-shortcuts-a-selection.html</loc>
<lastmod>2024-11-25T06:02:25.735Z</lastmod>
</url>
<url>
<loc>https://frbcesab.github.io/tips-and-tricks/posts/2024-02-27-code-snippets-in-rstudio/2024-02-27-code-snippets-in-rstudio.html</loc>
<lastmod>2024-11-18T11:36:42.723Z</lastmod>
<loc>https://frbcesab.github.io/tips-and-tricks/posts/2024-03-11-windows-and-the-home-directory/2024-03-11-windows-and-the-home-directory.html</loc>
<lastmod>2024-11-25T06:02:25.735Z</lastmod>
</url>
<url>
<loc>https://frbcesab.github.io/tips-and-tricks/index.html</loc>
<lastmod>2024-11-18T11:36:42.723Z</lastmod>
<loc>https://frbcesab.github.io/tips-and-tricks/posts/2024-03-12-storing-secrets-with-the-renviron-file/2024-03-12-storing-secrets-with-the-renviron-file.html</loc>
<lastmod>2024-11-25T06:02:25.735Z</lastmod>
</url>
<url>
<loc>https://frbcesab.github.io/tips-and-tricks/CODE_OF_CONDUCT.html</loc>
<lastmod>2024-11-18T11:36:42.703Z</lastmod>
<loc>https://frbcesab.github.io/tips-and-tricks/LICENSE.html</loc>
<lastmod>2024-11-25T06:02:25.711Z</lastmod>
</url>
<url>
<loc>https://frbcesab.github.io/tips-and-tricks/about.html</loc>
<lastmod>2024-11-18T11:36:42.715Z</lastmod>
<loc>https://frbcesab.github.io/tips-and-tricks/CONTRIBUTING.html</loc>
<lastmod>2024-11-25T06:02:25.711Z</lastmod>
</url>
<url>
<loc>https://frbcesab.github.io/tips-and-tricks/contribute.html</loc>
<lastmod>2024-11-18T11:36:42.715Z</lastmod>
<lastmod>2024-11-25T06:02:25.723Z</lastmod>
</url>
<url>
<loc>https://frbcesab.github.io/tips-and-tricks/CONTRIBUTING.html</loc>
<lastmod>2024-11-18T11:36:42.703Z</lastmod>
<loc>https://frbcesab.github.io/tips-and-tricks/about.html</loc>
<lastmod>2024-11-25T06:02:25.723Z</lastmod>
</url>
<url>
<loc>https://frbcesab.github.io/tips-and-tricks/LICENSE.html</loc>
<lastmod>2024-11-18T11:36:42.703Z</lastmod>
<loc>https://frbcesab.github.io/tips-and-tricks/CODE_OF_CONDUCT.html</loc>
<lastmod>2024-11-25T06:02:25.711Z</lastmod>
</url>
<url>
<loc>https://frbcesab.github.io/tips-and-tricks/posts/2024-03-12-storing-secrets-with-the-renviron-file/2024-03-12-storing-secrets-with-the-renviron-file.html</loc>
<lastmod>2024-11-18T11:36:42.731Z</lastmod>
<loc>https://frbcesab.github.io/tips-and-tricks/index.html</loc>
<lastmod>2024-11-25T06:02:25.727Z</lastmod>
</url>
<url>
<loc>https://frbcesab.github.io/tips-and-tricks/posts/2024-03-11-windows-and-the-home-directory/2024-03-11-windows-and-the-home-directory.html</loc>
<lastmod>2024-11-18T11:36:42.731Z</lastmod>
<loc>https://frbcesab.github.io/tips-and-tricks/posts/2024-02-27-code-snippets-in-rstudio/2024-02-27-code-snippets-in-rstudio.html</loc>
<lastmod>2024-11-25T06:02:25.727Z</lastmod>
</url>
<url>
<loc>https://frbcesab.github.io/tips-and-tricks/posts/2024-02-27-rstudio-shortcuts-a-selection/2024-02-27-rstudio-shortcuts-a-selection.html</loc>
<lastmod>2024-11-18T11:36:42.731Z</lastmod>
<loc>https://frbcesab.github.io/tips-and-tricks/posts/2024-03-26-zsh-an-alternative-to-bash/2024-03-26-zsh-an-alternative-to-bash.html</loc>
<lastmod>2024-11-25T06:02:25.739Z</lastmod>
</url>
<url>
<loc>https://frbcesab.github.io/tips-and-tricks/posts/2024-06-11-python-tutorial-part-2/2024-06-11-python-tutorial-part-2.html</loc>
<lastmod>2024-11-18T11:36:42.731Z</lastmod>
<loc>https://frbcesab.github.io/tips-and-tricks/posts/2024-11-19-the-apply-function-family/2024-11-19-the-apply-function-family.html</loc>
<lastmod>2024-11-25T06:02:25.739Z</lastmod>
</url>
<url>
<loc>https://frbcesab.github.io/tips-and-tricks/posts/2024-04-02-python-tutorial-part-1/2024-04-02-python-tutorial-part-1.html</loc>
<lastmod>2024-11-25T06:02:25.739Z</lastmod>
</url>
</urlset>

0 comments on commit 654b537

Please sign in to comment.