forked from Sparrow0hawk/quarto-revealjs-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Quarto GHA Workflow Runner
committed
Mar 22, 2024
1 parent
67dac3d
commit cd9adee
Showing
36 changed files
with
3,465 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
13acbefd | ||
89411d6a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
Creative Commons Legal Code | ||
|
||
CC0 1.0 Universal | ||
|
||
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE | ||
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN | ||
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS | ||
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES | ||
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS | ||
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM | ||
THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED | ||
HEREUNDER. | ||
|
||
Statement of Purpose | ||
|
||
The laws of most jurisdictions throughout the world automatically confer | ||
exclusive Copyright and Related Rights (defined below) upon the creator | ||
and subsequent owner(s) (each and all, an "owner") of an original work of | ||
authorship and/or a database (each, a "Work"). | ||
|
||
Certain owners wish to permanently relinquish those rights to a Work for | ||
the purpose of contributing to a commons of creative, cultural and | ||
scientific works ("Commons") that the public can reliably and without fear | ||
of later claims of infringement build upon, modify, incorporate in other | ||
works, reuse and redistribute as freely as possible in any form whatsoever | ||
and for any purposes, including without limitation commercial purposes. | ||
These owners may contribute to the Commons to promote the ideal of a free | ||
culture and the further production of creative, cultural and scientific | ||
works, or to gain reputation or greater distribution for their Work in | ||
part through the use and efforts of others. | ||
|
||
For these and/or other purposes and motivations, and without any | ||
expectation of additional consideration or compensation, the person | ||
associating CC0 with a Work (the "Affirmer"), to the extent that he or she | ||
is an owner of Copyright and Related Rights in the Work, voluntarily | ||
elects to apply CC0 to the Work and publicly distribute the Work under its | ||
terms, with knowledge of his or her Copyright and Related Rights in the | ||
Work and the meaning and intended legal effect of CC0 on those rights. | ||
|
||
1. Copyright and Related Rights. A Work made available under CC0 may be | ||
protected by copyright and related or neighboring rights ("Copyright and | ||
Related Rights"). Copyright and Related Rights include, but are not | ||
limited to, the following: | ||
|
||
i. the right to reproduce, adapt, distribute, perform, display, | ||
communicate, and translate a Work; | ||
ii. moral rights retained by the original author(s) and/or performer(s); | ||
iii. publicity and privacy rights pertaining to a person's image or | ||
likeness depicted in a Work; | ||
iv. rights protecting against unfair competition in regards to a Work, | ||
subject to the limitations in paragraph 4(a), below; | ||
v. rights protecting the extraction, dissemination, use and reuse of data | ||
in a Work; | ||
vi. database rights (such as those arising under Directive 96/9/EC of the | ||
European Parliament and of the Council of 11 March 1996 on the legal | ||
protection of databases, and under any national implementation | ||
thereof, including any amended or successor version of such | ||
directive); and | ||
vii. other similar, equivalent or corresponding rights throughout the | ||
world based on applicable law or treaty, and any national | ||
implementations thereof. | ||
|
||
2. Waiver. To the greatest extent permitted by, but not in contravention | ||
of, applicable law, Affirmer hereby overtly, fully, permanently, | ||
irrevocably and unconditionally waives, abandons, and surrenders all of | ||
Affirmer's Copyright and Related Rights and associated claims and causes | ||
of action, whether now known or unknown (including existing as well as | ||
future claims and causes of action), in the Work (i) in all territories | ||
worldwide, (ii) for the maximum duration provided by applicable law or | ||
treaty (including future time extensions), (iii) in any current or future | ||
medium and for any number of copies, and (iv) for any purpose whatsoever, | ||
including without limitation commercial, advertising or promotional | ||
purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each | ||
member of the public at large and to the detriment of Affirmer's heirs and | ||
successors, fully intending that such Waiver shall not be subject to | ||
revocation, rescission, cancellation, termination, or any other legal or | ||
equitable action to disrupt the quiet enjoyment of the Work by the public | ||
as contemplated by Affirmer's express Statement of Purpose. | ||
|
||
3. Public License Fallback. Should any part of the Waiver for any reason | ||
be judged legally invalid or ineffective under applicable law, then the | ||
Waiver shall be preserved to the maximum extent permitted taking into | ||
account Affirmer's express Statement of Purpose. In addition, to the | ||
extent the Waiver is so judged Affirmer hereby grants to each affected | ||
person a royalty-free, non transferable, non sublicensable, non exclusive, | ||
irrevocable and unconditional license to exercise Affirmer's Copyright and | ||
Related Rights in the Work (i) in all territories worldwide, (ii) for the | ||
maximum duration provided by applicable law or treaty (including future | ||
time extensions), (iii) in any current or future medium and for any number | ||
of copies, and (iv) for any purpose whatsoever, including without | ||
limitation commercial, advertising or promotional purposes (the | ||
"License"). The License shall be deemed effective as of the date CC0 was | ||
applied by Affirmer to the Work. Should any part of the License for any | ||
reason be judged legally invalid or ineffective under applicable law, such | ||
partial invalidity or ineffectiveness shall not invalidate the remainder | ||
of the License, and in such case Affirmer hereby affirms that he or she | ||
will not (i) exercise any of his or her remaining Copyright and Related | ||
Rights in the Work or (ii) assert any associated claims and causes of | ||
action with respect to the Work, in either case contrary to Affirmer's | ||
express Statement of Purpose. | ||
|
||
4. Limitations and Disclaimers. | ||
|
||
a. No trademark or patent rights held by Affirmer are waived, abandoned, | ||
surrendered, licensed or otherwise affected by this document. | ||
b. Affirmer offers the Work as-is and makes no representations or | ||
warranties of any kind concerning the Work, express, implied, | ||
statutory or otherwise, including without limitation warranties of | ||
title, merchantability, fitness for a particular purpose, non | ||
infringement, or the absence of latent or other defects, accuracy, or | ||
the present or absence of errors, whether or not discoverable, all to | ||
the greatest extent permissible under applicable law. | ||
c. Affirmer disclaims responsibility for clearing rights of other persons | ||
that may apply to the Work or any use thereof, including without | ||
limitation any person's Copyright and Related Rights in the Work. | ||
Further, Affirmer disclaims responsibility for obtaining any necessary | ||
consents, permissions or other rights required for any use of the | ||
Work. | ||
d. Affirmer understands and acknowledges that Creative Commons is not a | ||
party to this document and has no duty or obligation with respect to | ||
this CC0 or use of the Work. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,160 @@ | ||
# Template Quarto Revealjs site | ||
|
||
This template can be used to publish a [RevealJS](https://revealjs.com/) website that has been written in | ||
[Quarto](https://www.quarto.org). It includes a [GitHub Action](https://docs.github.com/en/actions) which will convert | ||
the Quarto source to HTML and publish them via [GitHub Pages](https://pages.github.com/). | ||
|
||
Its a useful way of making slides portable as they are then available via the URL and naturally the slides are version | ||
controlled. | ||
|
||
## Usage | ||
|
||
### Use the Template | ||
|
||
Start by clicking on the "_Use this Template_" button and selecting "_Create a new repository_". You will have to choose | ||
a name for the repository and this should reflect the nature of your talk. When ready click on "_Create repository from | ||
template_" and this will copy all the resources into a new repository under your GitHub account ready for you to start | ||
using. | ||
|
||
### Repository settings | ||
|
||
You **MUST** make sure your repository action settings are configured to allow read and write permissions. | ||
|
||
![image](https://user-images.githubusercontent.com/20887250/216280796-86028c95-76b7-418a-a3eb-e614a8ab874a.png) | ||
|
||
You can find this settings at `https://github.com/[USER]/[repo]/settings/actions`. | ||
|
||
### Clone the repository | ||
|
||
Typically you will work on files on your local computer, staging and committing changes and periodically pushing to | ||
GitHub for backup and publishing. How you clone depends on what client you use but at the command line you can use... | ||
|
||
``` bash | ||
git clone https://github.com/<USERNAME>/<REPOSITORY> | ||
``` | ||
|
||
Substitute `<USERNAME>` and `<REPOSITORY>` appropriately. | ||
|
||
### Edit `_quarto.yaml` | ||
|
||
How you should edit `_quarto.yaml` and change the `site-url` to reflect your GitHub user account and the name of the | ||
repository you have chosen for this project. Its probably wise to modify the `title` and `description` too. The sample | ||
code below shows in capitals the fields you should modify. | ||
|
||
``` yaml | ||
project: | ||
type: website | ||
|
||
website: | ||
title: "<INSERT_TITLE>" | ||
site-url: https://<YOUR_GITHUB_USERNAME>.github.io/<NAME_OF_REPOSITORY> | ||
description: "<INSERT_DESCRIPTION>" | ||
``` | ||
### Install Extensions | ||
This template uses some [extensions](https://quarto.org/docs/extensions/) | ||
([quarto-clean](https://github.com/grantmcdermott/quarto-revealjs-clean), [QR | ||
extension](https://github.com/jmbuhr/quarto-qrcode), [confetti](https://github.com/ArthurData/quarto-confetti)), | ||
[openlinksinnewpage](https://github.com/davidwilby/openlinksinnewpage) and [reveal-header](https://github.com/shafayetShafee/reveal-header) | ||
these need to be installed locally _before_ you can proceed. | ||
``` bash | ||
quarto add --no-prompt jmbuhr/quarto-qrcode | ||
quarto add --no-prompt grantmcdermott/quarto-revealjs-clean | ||
quarto add --no-prompt ArthurData/quarto-confetti | ||
quarto add --no-prompt davidwilby/openlinksinnewpage | ||
quarto add --no-prompt shafayetShafee/reveal-header | ||
``` | ||
|
||
### Publish Locally | ||
|
||
You will need to run `quarto publish gh-pages` once locally before deploying this template. This creates a new branch | ||
`gh-pages` which is where the resulting pages are published to and pushes them to GitHub. | ||
|
||
``` bash | ||
quarto publish gh-pages | ||
``` | ||
|
||
### Write your slides | ||
|
||
You are now ready to create your slides by editing the `index.qmd` in the root of the repository. For more information | ||
on writing RevealJS slides in Quarto see the [RevealJS](https://quarto.org/docs/presentations/revealjs/) guide and the | ||
[Revealjs Reference](https://quarto.org/docs/reference/formats/presentations/revealjs.html). | ||
|
||
When you stage, commit and push your commits to GitHub the `quarto-publish.yaml` will run. | ||
|
||
## pre-commit | ||
|
||
A [pre-commit](https://pre-commit.com) configuration is included (see `.pre-commit-config.yaml`) and includes a hook for | ||
[markdownlint-cli2](https://github.com/DavidAnson/markdownlint-cli2) (see `.markdownlint-cli2.yaml` for | ||
configuration). To use `pre-commit` you will have to install `pre-commit install` in your cloned repository. This requires | ||
`pre-commit` to be installed on your system or within a Python Virtual Environment. To find out more about installing | ||
and configuring `pre-commit` see the article [pre-commit : Protecting your future | ||
self](https://rse.shef.ac.uk/blog/pre-commit/) or refer to the official documentation. | ||
|
||
## Extensions | ||
|
||
There are a growing number of useful [Quarto extensions](https://quarto.org/docs/extensions/). Five are included in this | ||
template and they are also installed during the publishing and deployment of the resulting slides as they are listed in | ||
the `quarto-publish.yml` under the `Install Quarto Extensions` step. You should have installed these locally as | ||
instructed above. | ||
|
||
If you use additional extensions then as well as installing them locally on your computer you **MUST** remember to add | ||
them to the `Install Quarto Extensions` section of `.github/workflows/quarto-publish.yaml` otherwise your pages will not | ||
build and deploy. | ||
|
||
### QR Code generation | ||
|
||
The [quarto-qrcode](https://github.com/jmbuhr/quarto-qrcode) extension is particularly useful as it simplifies | ||
generating and embedding [QR Codes](https://en.wikipedia.org/wiki/QR_code) that link to websites in your slides. | ||
|
||
### Clean Theme | ||
|
||
The [quarto-revealjs-clean](https://github.com/grantmcdermott/quarto-revealjs-clean/) theme is a nice (clean!) | ||
theme. For a full example of all the features of this theme see the authors | ||
[quarto-revealjs-clean-demo](https://github.com/grantmcdermott/quarto-revealjs-clean-demo). | ||
|
||
### Confetti | ||
|
||
The [confetti](https://github.com/ArthurData/quarto-confetti) extension adds some eye-candy and throws confetti over | ||
your slides whenever you press the `c` button. They originate from the mouse location and therefore follow it around. | ||
|
||
### Open Links In New Page | ||
|
||
The [openlinksinnewpage](https://github.com/davidwilby/openlinksinnewpage) extension does what it says on the tin and | ||
ensures that when you click on a link in the resulting slides it will open a new tab/page (this saves you and others who | ||
may not know of the shortcut from having to hold down `Ctrl` to achieve the same effect). | ||
|
||
### Reveal Header | ||
|
||
The [reveal-header](https://github.com/shafayetShafee/reveal-header) extension allows you to add headers as well as | ||
footers to all slides. This template includes a simple text `header:` nested under the `format: <theme>:` YAML header | ||
in `index.qmd`. Please refer to the [documetation](https://github.com/shafayetShafee/reveal-header) for further | ||
customisation such as adding a `header-logo` and other options available with this extension. | ||
|
||
## Embedding Code | ||
|
||
The beauty of Quarto is that it is a literate programming system which means you can embed code that is executed and the | ||
results, whether that is tables, figures, or numbers, can be included in the resulting document. Quarto supports several | ||
languages including perhaps the two of the most popular languages [R](https://www.r-project.org) and | ||
[Python](https://www.python.org). | ||
|
||
### R | ||
|
||
You will likely have [R](https://www.r-project.org) installed locally along with all the packages that are required (and | ||
perhaps even use reproducible environments using [renv](https://rstudio.github.io/renv/) or | ||
[pak](https://pak.r-lib.org)). | ||
|
||
For slides to build and execute your R code correctly you need to enable installation of R and the required packages in | ||
the `.github/workflows/quarto-publish.yaml`. A sample section is already present that should just need un-commenting, | ||
but may need tweaking if you use any packages to manage a reproducible environment. | ||
|
||
### Python | ||
|
||
Similarly with Python you likely have Virtual Environments configured locally to run your Python code, and these should | ||
have be detailed in a `requirements.txt` file so they can be installed when the GitHub Workflow is executed to build | ||
your pages on GitHub. | ||
|
||
You will need to enable installation of Python and these packages in the `.github/workflows/quarto-publish.yaml` and | ||
a sample section is already present that can be un-commented if required. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
title: Confetti | ||
author: Bréant Arthur | ||
version: 1.0.0 | ||
quarto-required: ">=1.2.269" | ||
contributes: | ||
revealjs-plugins: | ||
- name: RevealConfetti | ||
script: | ||
- confetti.js | ||
config: | ||
confetti: | ||
particleCount: 50 | ||
angle: 90 | ||
spread: 45 | ||
startVelocity: 45 | ||
decay: 0.9 | ||
gravity: 1 | ||
drift: 0 | ||
ticks: 200 | ||
colors: null | ||
shapes: null | ||
scalar: 1 | ||
zIndex: 100 | ||
disableForReducedMotion: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
var script = document.createElement("script"); | ||
script.setAttribute("type", "text/javascript"); | ||
script.setAttribute("src", "https://cdn.jsdelivr.net/npm/[email protected]/dist/confetti.browser.min.js"); | ||
document.getElementsByTagName("head")[0].appendChild(script); | ||
|
||
function getPosition(event) { | ||
posX = event.pageX; | ||
posY = event.pageY; | ||
} | ||
|
||
document.addEventListener("mousemove", getPosition, false); | ||
|
||
window.RevealConfetti = function () { | ||
return { | ||
id: "RevealConfetti", | ||
init: function (deck) { | ||
|
||
deck.addKeyBinding({ keyCode: 67, key: "C" }, () => { | ||
const config = deck.getConfig(); | ||
const options = config.confetti || {}; | ||
|
||
confetti({ | ||
particleCount: options.particleCount, | ||
angle: options.angle, | ||
spread: options.spread, | ||
startVelocity: options.startVelocity, | ||
decay: options.decay, | ||
gravity: options.gravity, | ||
drift: options.drift, | ||
ticks: options.ticks, | ||
colors: options.colors, | ||
shapes: options.shapes, | ||
scalar: options.scalar, | ||
zIndex: options.zIndex, | ||
disableForReducedMotion: options.disableForReducedMotion, | ||
origin: { | ||
x: posX / window.innerWidth, | ||
y: posY / window.innerHeight | ||
} | ||
}); | ||
|
||
console.log(`posX: ${posX} | posy: ${posY}`); | ||
console.log(options); | ||
console.log('🎊🎉'); | ||
}); | ||
}, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
title: openlinksinnewpage | ||
author: davidwilby | ||
version: 0.0.1 | ||
quarto-required: ">=1.3.0" | ||
contributes: | ||
filters: | ||
- openlinksinnewpage.lua | ||
|
6 changes: 6 additions & 0 deletions
6
_extensions/davidwilby/openlinksinnewpage/openlinksinnewpage.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
-- As suggested by @cscheid: https://github.com/quarto-dev/quarto-cli/discussions/3169 | ||
|
||
function Link(link) | ||
link.attributes["target"] = "_blank" | ||
return link | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
title: clean | ||
author: Grant McDermott | ||
version: 1.0.0 | ||
quarto-required: ">=1.3.0" | ||
contributes: | ||
formats: | ||
revealjs: | ||
theme: [default, clean.scss] | ||
menu: | ||
side: left | ||
slide-number: true | ||
date-format: long | ||
|
Oops, something went wrong.