diff --git a/.nojekyll b/.nojekyll index 6b610b0..efe3965 100644 --- a/.nojekyll +++ b/.nojekyll @@ -1 +1 @@ -53c2aaae \ No newline at end of file +a9ee8e93 \ No newline at end of file diff --git a/documents/icons/index.html b/documents/icons/index.html index 97c2a79..5696f95 100644 --- a/documents/icons/index.html +++ b/documents/icons/index.html @@ -2,7 +2,7 @@ - + @@ -24,7 +24,7 @@ } /* CSS for syntax highlighting */ pre > code.sourceCode { white-space: pre; position: relative; } -pre > code.sourceCode > span { display: inline-block; line-height: 1.25; } +pre > code.sourceCode > span { line-height: 1.25; } pre > code.sourceCode > span:empty { height: 1.2em; } .sourceCode { overflow: visible; } code.sourceCode > span { color: inherit; text-decoration: inherit; } @@ -88,7 +88,13 @@ "collapse-after": 3, "panel-placement": "start", "type": "textbox", - "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", @@ -97,6 +103,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" @@ -202,6 +209,7 @@

On this page

+

The complete version of this document is available at https://github.com/rich-iannone/quarto-icons-examples.

1 FontAwesome

@@ -212,7 +220,7 @@

1.2 Usage

Syntax

-

{{< fa [brands] <icon-name> [additional args] >}}

+

{< fa [brands] <icon-name> [additional args] >}

Any of the free icons from Font Awesome Version 5 can be used. Some of free icons are in the ‘brands’ set (e.g., "apple", "uber", "github", etc.) and these need to use the sequence of fa brands <icon-name>. Here are some examples:

{{< fa star >}}
{{< fa image >}}
@@ -263,7 +271,7 @@

2.2 Usage

Syntax

-

{{< ai <icon-name> [additional args] >}}

+

{< ai <icon-name> [additional args] >}

Some examples

{{< ai jstor >}}
{{< ai orcid >}}
@@ -294,7 +302,7 @@

3.2 Usage

Syntax

-

{{< bi <icon-name> [additional args] >}}

+

{< bi <icon-name> [additional args] >}

Examples

{{< bi box-seam >}}
{{< bi trophy >}}
@@ -353,7 +361,7 @@

4.2 Usage

Syntax

-

{{< mi <icon-name> [additional args] >}}

+

{< mi <icon-name> [additional args] >}

Examples

{{< mi bar_chart >}}

bar_chart

@@ -411,7 +419,7 @@

5.2 Usage

Syntax

-

{{< iconify <set> <icon-name> [additional args] >}}

+

{< iconify <set> <icon-name> [additional args] >}

Any of the icons from Iconify v1.0.7 can be used. Icons are split into sets and the default set is "fluent-emoji". Explore all of the icons at:

https://icon-sets.iconify.design

Examples

@@ -454,7 +462,7 @@

6.2 Usage

Syntax

-

{{< li <icon-name> [additional args] >}}

+

{< li <icon-name> [additional args] >}

To find icon codes, go to Lordicon website, hit the Explore Library button and select the Free Icons filter on the left-hand side. You can choose a style for the icon (possiblities are flat, gradient, lineal, and outline).

Click on any icon, hit the </> HTML button on the bottom of that info listing and a popover will appear with the eight-letter code. You need to transpose that to lowercase as using uppercase letters won’t work :( .

{{< li xxdqfhbi >}}

@@ -637,10 +645,9 @@

{ + if (window.MathJax) { + // MathJax Typeset + window.MathJax.typeset([el]); + } else if (window.katex) { + // KaTeX Render + var mathElements = el.getElementsByClassName("math"); + var macros = []; + for (var i = 0; i < mathElements.length; i++) { + var texText = mathElements[i].firstChild; + if (mathElements[i].tagName == "SPAN") { + window.katex.render(texText.data, mathElements[i], { + displayMode: mathElements[i].classList.contains('display'), + throwOnError: false, + macros: macros, + fleqn: false + }); + } + } + } + } + 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; + } + } + typesetMath(container); + return container.innerHTML + } else { + 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(); + } + typesetMath(note); + return note.innerHTML; + } + } + for (var i=0; i 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) => { @@ -707,6 +852,7 @@

{ + 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) { @@ -875,7 +1047,7 @@

Manually inserting icons using html -`<i class="fa-brands fa-r-project"></i>` <i class="fa-brands fa-r-project"></i> +`<i class="fa-brands fa-r-project"></i>` <i class="fa-brands fa-r-project"></i> With custom css style: @@ -1001,7 +1173,7 @@

<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-cake" viewBox="0 0 16 16"><path d="m7.994.013-.595.79a.747.747 0 0 0 .101 1.01V4H5a2 2 0 0 0-2 2v3H2a2 2 0 0 0-2 2v4a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-4a2 2 0 0 0-2-2h-1V6a2 2 0 0 0-2-2H8.5V1.806A.747.747 0 0 0 8.592.802l-.598-.79ZM4 6a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v.414a.911.911 0 0 1-.646-.268 1.914 1.914 0 0 0-2.708 0 .914.914 0 0 1-1.292 0 1.914 1.914 0 0 0-2.708 0A.911.911 0 0 1 4 6.414V6Zm0 1.414c.49 0 .98-.187 1.354-.56a.914.914 0 0 1 1.292 0c.748.747 1.96.747 2.708 0a.914.914 0 0 1 1.292 0c.374.373.864.56 1.354.56V9H4V7.414ZM1 11a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v.793l-.354.354a.914.914 0 0 1-1.293 0 1.914 1.914 0 0 0-2.707 0 .914.914 0 0 1-1.292 0 1.914 1.914 0 0 0-2.708 0 .914.914 0 0 1-1.292 0 1.914 1.914 0 0 0-2.708 0 .914.914 0 0 1-1.292 0L1 11.793V11Zm11.646 1.854a1.915 1.915 0 0 0 2.354.279V15H1v-1.867c.737.452 1.715.36 2.354-.28a.914.914 0 0 1 1.292 0c.748.748 1.96.748 2.708 0a.914.914 0 0 1 1.292 0c.748.748 1.96.748 2.707 0a.914.914 0 0 1 1.293 0Z"/></svg> ``` -<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-cake" viewBox="0 0 16 16"><path d="m7.994.013-.595.79a.747.747 0 0 0 .101 1.01V4H5a2 2 0 0 0-2 2v3H2a2 2 0 0 0-2 2v4a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-4a2 2 0 0 0-2-2h-1V6a2 2 0 0 0-2-2H8.5V1.806A.747.747 0 0 0 8.592.802l-.598-.79ZM4 6a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v.414a.911.911 0 0 1-.646-.268 1.914 1.914 0 0 0-2.708 0 .914.914 0 0 1-1.292 0 1.914 1.914 0 0 0-2.708 0A.911.911 0 0 1 4 6.414V6Zm0 1.414c.49 0 .98-.187 1.354-.56a.914.914 0 0 1 1.292 0c.748.747 1.96.747 2.708 0a.914.914 0 0 1 1.292 0c.374.373.864.56 1.354.56V9H4V7.414ZM1 11a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v.793l-.354.354a.914.914 0 0 1-1.293 0 1.914 1.914 0 0 0-2.707 0 .914.914 0 0 1-1.292 0 1.914 1.914 0 0 0-2.708 0 .914.914 0 0 1-1.292 0 1.914 1.914 0 0 0-2.708 0 .914.914 0 0 1-1.292 0L1 11.793V11Zm11.646 1.854a1.915 1.915 0 0 0 2.354.279V15H1v-1.867c.737.452 1.715.36 2.354-.28a.914.914 0 0 1 1.292 0c.748.748 1.96.748 2.708 0a.914.914 0 0 1 1.292 0c.748.748 1.96.748 2.707 0a.914.914 0 0 1 1.293 0Z"/></svg> +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-cake" viewBox="0 0 16 16"><path d="m7.994.013-.595.79a.747.747 0 0 0 .101 1.01V4H5a2 2 0 0 0-2 2v3H2a2 2 0 0 0-2 2v4a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-4a2 2 0 0 0-2-2h-1V6a2 2 0 0 0-2-2H8.5V1.806A.747.747 0 0 0 8.592.802l-.598-.79ZM4 6a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v.414a.911.911 0 0 1-.646-.268 1.914 1.914 0 0 0-2.708 0 .914.914 0 0 1-1.292 0 1.914 1.914 0 0 0-2.708 0A.911.911 0 0 1 4 6.414V6Zm0 1.414c.49 0 .98-.187 1.354-.56a.914.914 0 0 1 1.292 0c.748.747 1.96.747 2.708 0a.914.914 0 0 1 1.292 0c.374.373.864.56 1.354.56V9H4V7.414ZM1 11a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v.793l-.354.354a.914.914 0 0 1-1.293 0 1.914 1.914 0 0 0-2.707 0 .914.914 0 0 1-1.292 0 1.914 1.914 0 0 0-2.708 0 .914.914 0 0 1-1.292 0 1.914 1.914 0 0 0-2.708 0 .914.914 0 0 1-1.292 0L1 11.793V11Zm11.646 1.854a1.915 1.915 0 0 0 2.354.279V15H1v-1.867c.737.452 1.715.36 2.354-.28a.914.914 0 0 1 1.292 0c.748.748 1.96.748 2.708 0a.914.914 0 0 1 1.292 0c.748.748 1.96.748 2.707 0a.914.914 0 0 1 1.293 0Z"/></svg> Styling up @@ -1235,4 +1407,5 @@

- + @@ -24,7 +24,7 @@ } /* CSS for syntax highlighting */ pre > code.sourceCode { white-space: pre; position: relative; } -pre > code.sourceCode > span { display: inline-block; line-height: 1.25; } +pre > code.sourceCode > span { line-height: 1.25; } pre > code.sourceCode > span:empty { height: 1.2em; } .sourceCode { overflow: visible; } code.sourceCode > span { color: inherit; text-decoration: inherit; } @@ -80,7 +80,13 @@ "collapse-after": 3, "panel-placement": "start", "type": "textbox", - "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", @@ -89,6 +95,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" @@ -158,10 +165,11 @@

On this page

+

Read CSV

-
+
Code
data = FileAttachment("diamonds.csv").csv({ typed: true})
 data
@@ -185,7 +193,7 @@

Read CSV

Table

-
+
Code
viewof raw_table = Inputs.table(data)
@@ -200,7 +208,7 @@

Table

Scatterplot

Pick the variable for point color.

-
+
Code
viewof col = Inputs.select(["carat","cut","color","clarity","depth","table","price"],{value: "cut", multiple: false, label: "Color variable"})
@@ -214,7 +222,7 @@

Scatterplot

-
+
Code
viewof x1 = Inputs.select(["carat","depth","table","price"], {value: "carat", multiple: false, label: "X1 axis"})
 viewof y1 = Inputs.select(["carat","depth","table","price"], {value: "depth", multiple: false, label: "Y1 axis"})
@@ -235,7 +243,7 @@

Scatterplot

-
+
Code
Plot.plot({
   color: {legend: true},
@@ -251,19 +259,23 @@ 

Scatterplot

grid: true })
-
-
+
+
+
-
Figure 1: Scatterplot A.
+
+
+Figure 1: Scatterplot A. +
-
+
Code
viewof x2 = Inputs.select(["carat","depth","table","price"], {value: "carat", multiple: false, label: "X2 axis"})
 viewof y2 = Inputs.select(["carat","depth","table","price"], {value: "price", multiple: false, label: "Y2 axis"})
@@ -284,7 +296,7 @@

Scatterplot

-
+
Code
Plot.plot({
   color: {legend: true},
@@ -300,12 +312,16 @@ 

Scatterplot

grid: true })
-
-
+
+
+
-
Figure 2: Scatterplot B.
+
+
+Figure 2: Scatterplot B. +
@@ -320,9 +336,8 @@

Scatterplot

- - @@ -185,6 +191,7 @@

On this page

+

This is recreated from here.

@@ -264,7 +271,11 @@

Scatterplot

geom_text(nudge_x = 0.05)
-

+
+
+

+
+
@@ -305,7 +316,11 @@

With categorical c geom_text(aes(colour = factor(cyl)))
-

+
+
+

+
+
@@ -353,7 +368,11 @@

Barplot

geom_bar()
-

+
+
+

+
+
@@ -414,7 +433,11 @@

With categorical geom_bar(aes(fill = drv))
-

+
+
+

+
+
@@ -459,7 +482,11 @@

Boxplot

geom_boxplot()
-

+
+
+

+
+
@@ -504,7 +531,11 @@

Regression

`geom_smooth()` using formula = 'y ~ x'
-

+
+
+

+
+
@@ -551,7 +582,11 @@

Tile/Raster

geom_tile(aes(fill = density))
-

+
+
+

+
+
@@ -613,7 +648,11 @@

2D density

geom_density_2d()
-

+
+
+

+
+
@@ -660,7 +699,11 @@

Hex

geom_hex()
-

+
+
+

+
+
@@ -728,7 +771,11 @@

Line

geom_line()
-

+
+
+

+
+
@@ -790,7 +837,11 @@

With categorical geom_line()
-

+
+
+

+
+
@@ -836,7 +887,11 @@

Path

geom_path()
-

+
+
+

+
+
@@ -873,9 +928,8 @@

Path

- +

- + + + + + + + + + + + + RevealJS + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+

WebR in Quarto presentation

+

Live R code in RevealJS

+ +
+
+
+Roy Francis +
+
+
+ +

2023-12-07

+
+
+

Load packages

+
+ +
+
+
+

+    
+
+
+
+
+ +
+
+

Table

+
+ +
+
+
+

+    
+
+
+
+
+ + +
+
+

Plot

+

This is ggplot2.

+
+ +
+
+
+

+    
+
+
+
+
+ +
+
+

Image

+

This is an image.

+ +

+Figure 1: This is iris species. +

+
+

Code highlighting

+
+ +
+
+
+

+    
+
+
+
+
+ + +
+
+

Session

+
+ +
+
+
+

+    
+
+
+
+
+ + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/documents/revealjs/index.html b/documents/revealjs/index.html index a9169b8..4b5dc52 100644 --- a/documents/revealjs/index.html +++ b/documents/revealjs/index.html @@ -8,7 +8,7 @@ - + @@ -32,7 +32,7 @@ } /* CSS for syntax highlighting */ pre > code.sourceCode { white-space: pre; position: relative; } - pre > code.sourceCode > span { display: inline-block; line-height: 1.25; } + pre > code.sourceCode > span { line-height: 1.25; } pre > code.sourceCode > span:empty { height: 1.2em; } .sourceCode { overflow: visible; } code.sourceCode > span { color: inherit; text-decoration: inherit; } @@ -222,7 +222,8 @@ } .callout.callout-titled .callout-body > .callout-content > :last-child { - margin-bottom: 0.5rem; + padding-bottom: 0.5rem; + margin-bottom: 0; } .callout.callout-titled .callout-icon::before { @@ -430,10 +431,14 @@

Layout

-
-
-

-
Figure 1: Scatterplot of setosa species.
+
+
+
+ +
+
+Figure 1: Scatterplot of setosa species. +
@@ -442,9 +447,13 @@

Layout

-
-

-
Figure 2: Photograph of setosa species.
+
+
+ +
+
+Figure 2: Photograph of setosa species. +
@@ -460,7 +469,9 @@

Code highlighting

labs(title=params$name)
-

Figure 3: Scatterplot of setosa species.