Skip to content

Commit

Permalink
Add JS code to link python/R buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
vanatteveldt committed Feb 13, 2023
1 parent 7e1e845 commit 7132a7a
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion _quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,26 @@ book:
- content/chapter15.qmd
- content/chapter16.qmd
- content/references.qmd

twitter-card:
creator: "@vanatteveldt"
image: content/img/cover.jpg

bibliography: content/references.bib

format:
html:
theme: cosmo
include-after-body:
text: |
<script>
var python = [];
var r = [];
document.querySelectorAll('a[data-bs-toggle="tab"]').forEach((a) => {
var target = a.textContent == "Python code"?python:r;
target.push(new bootstrap.Tab(a));
a.addEventListener('shown.bs.tab', () => target.forEach((tab) => tab.show()));
});
</script>
editor: visual

Expand Down

0 comments on commit 7132a7a

Please sign in to comment.