Skip to content

Commit

Permalink
Simplify the link to cloudflare to ensure FontAwesome is able to be e…
Browse files Browse the repository at this point in the history
…mbedded into the document by Quarto using `embed-resources` (#168)
  • Loading branch information
coatless authored Mar 21, 2024
1 parent 1be44e7 commit 91499fa
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion _extensions/webr/webr.lua
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ local function ensureWebRSetup()
-- Note: We're not able to use embed-resources due to the web assembly binary and the potential for additional service worker files.
quarto.doc.include_text("in-header", [[
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/monaco-editor@0.45.0/min/vs/editor/editor.main.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" integrity="sha512-DTOQO9RWCH3ppGqcWaEA1BIZOC6xxalwEsw9c2QQeAIftl+Vegovlnee1c9QX4TctnWMn13TZye+giMm8e2LwA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" />
]])

-- Insert the extension styling for defined elements
Expand Down
25 changes: 25 additions & 0 deletions tests/qwebr-test-self-contained.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
title: "Test: embed-resources"
format:
html:
embed-resources: true
engine: knitr
filters:
- webr
---

Ensure `embed-resources` option correctly puts a copy of FontAwesome in the document.

## Interactive
```{webr-r}
1 + 1
```

## Non-interactive

```{webr-r}
#| context: output
Sys.sleep(3)
print("Sleep successful! Did you see the R logo?")
```

0 comments on commit 91499fa

Please sign in to comment.