Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/workflows/deploy_slides.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# workflow to build and deploy slides to github pages

name: BuildPages

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for "main" branch
pull_request:
branches: [ "main" ]
paths:
- '.github/workflows/deploy_slides.yml'
- 'slides/*'
push:
branches: [ "main" ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:


# Cancel jobs running if new commits are pushed
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

# Workflow run - one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build" that builds pages site and slides
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2

- name: Render Quarto Project
run: |
cd slides
quarto render intermediate_git.qmd
cd ../

- name: Test pages build
if: github.ref != 'refs/heads/main' && github.head_ref == 'slides'
uses: JamesIves/github-pages-deploy-action@d92aa235d04922e8f08b40ce78cc5442fcfbfa2f # v4.8.0
with:
branch: pages-test # The branch the action should deploy to.
folder: slides # The folder the action should deploy.
dry-run: true # Don't actually push to pages, just test if we can

- name: Deploy pages for main branch or PR from slides branch
if: github.ref == 'refs/heads/main' || github.head_ref == 'slides'
uses: JamesIves/github-pages-deploy-action@d92aa235d04922e8f08b40ce78cc5442fcfbfa2f # v4.8.0
with:
branch: gh-pages # The branch the action should deploy to.
folder: slides # The folder the action should deploy.
3 changes: 3 additions & 0 deletions slides/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/.quarto/
**/*.quarto_ipynb
index.html
14 changes: 14 additions & 0 deletions slides/_extensions/quarto-ext/attribution/_extension.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
title: Attribution
author: Roland Schmehl
version: 0.1.1
quarto-required: ">=1.2.198"
contributes:
revealjs-plugins:
- name: RevealAttribution
script:
- attribution.js
stylesheet:
- attribution.css



19 changes: 19 additions & 0 deletions slides/_extensions/quarto-ext/attribution/attribution.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/* Attribution plugin: text along the right edge of the viewport */
.attribution{
position: absolute;
top: 50%;
bottom: auto;
left: 50%;
right: auto;
font-size: 0.4em;
pointer-events: none;
text-align: center;
writing-mode: vertical-lr;
transform: translate( -50%, -50% ) scale( 100% ) rotate(-180deg);
text-orientation: sideways;
}

/* Attribution plugin: activate pointer events for attribution text only */
.attribution .content{
pointer-events: auto;
}
75 changes: 75 additions & 0 deletions slides/_extensions/quarto-ext/attribution/attribution.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/*****************************************************************
** Author: Roland Schmehl, r.schmehl@tudelft.nl
**
** A plugin for displaying attribution texts sideways along the right
** edge of the viewport. When resizing the viewport or toggling full
** screen mode, the attribution text sticks persistently to the right
** edge of the viewport.
**
** The dynamic scaling of the attribution text via CSS transform
** is adopted from the fullscreen plugin.
**
** Version: 1.0
**
** License: MIT license (see file LICENSE)
**
******************************************************************/

window.RevealAttribution = window.RevealAttribution || {
id: 'RevealAttribution',
init: function(deck) {
initAttribution(deck);
}
};

const initAttribution = function(Reveal){

var ready = false;
var resize = false;
var scale = 1;

window.addEventListener( 'ready', function( event ) {

var content;

// Remove configured margin of the presentation
var attribution = document.getElementsByClassName("attribution");
var width = window.innerWidth;
var configuredWidth = Reveal.getConfig().width;
var configuredHeight = Reveal.getConfig().height;

scale = 1/(1-Reveal.getConfig().margin);

for (var i = 0; i < attribution.length; i++) {
content = attribution[i].innerHTML;
attribution[i].style.width = configuredWidth + "px";
attribution[i].style.height = configuredHeight + "px";
attribution[i].innerHTML = "<span class='content'>" + content + "</span>";
attribution[i].style.transform = 'translate( -50%, -50% ) scale( ' + scale*100 + '% ) rotate(-180deg)';
}

// Scale with cover class to mimic backgroundSize cover
resizeCover();

});

window.addEventListener( 'resize', resizeCover );

function resizeCover() {

// Scale to mimic backgroundSize cover
var attribution = document.getElementsByClassName("attribution");
var xScale = window.innerWidth / Reveal.getConfig().width;
var yScale = window.innerHeight / Reveal.getConfig().height;
var s = 1;

if (xScale > yScale) {
// The div fits perfectly in x axis, stretched in y
s = xScale/yScale;
}
for (var i = 0; i < attribution.length; i++) {
attribution[i].style.transform = 'translate( -50%, -50% ) scale( ' + s*scale*100 + '% ) rotate(-180deg)';
}
}

};
7 changes: 7 additions & 0 deletions slides/_extensions/quarto-ext/fontawesome/_extension.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
title: Font Awesome support
author: Carlos Scheidegger
version: 1.2.0
quarto-required: ">=1.2.269"
contributes:
shortcodes:
- fontawesome.lua
Loading