Commit cb01bd11 authored by Mario Botsch's avatar Mario Botsch

Merge branch 'master' into mario

parents 3c93e7eb c13085eb
......@@ -198,7 +198,7 @@ run = do
putNormal $ "# chrome started ... (for " <> out <> ")"
result <- liftIO $ launchChrome url out
case result of
Right msg -> putNormal $ "# chrome finished (for " <> out <> ")"
Right _ -> putNormal $ "# chrome finished (for " <> out <> ")"
Left msg -> error msg
--
publicDir <//> "*-handout.html" %> \out -> do
......@@ -249,7 +249,7 @@ run = do
"**/*.gnuplot.svg" %> \out -> do
let src = dropExtension out
need [src]
gnuplot ["-e", "'set output \"" ++ out ++ "\"'", src]
gnuplot ["-e", "\"set output '" ++ out ++ "'\"", src]
--
"**/*.tex.svg" %> \out -> do
let src = dropExtension out
......
cradle:
stack:
- path: "./src"
component: "decker:lib"
- path: "./src-win"
component: "decker:lib"
- path: "./src-unix"
component: "decker:lib"
- path: "./app/Decker.hs"
component: "decker:exe:decker"
- path: "./app/Paths_decker.hs"
component: "decker:exe:decker"
- path: "./test"
component: "decker:test:decker-test"
......@@ -33,7 +33,6 @@
}
.teaser-img {
margin: 20px auto;
height: 10%;
width: auto;
display: block;
img {
......@@ -41,9 +40,11 @@
// Center horizontally
display: block;
margin: auto;
// Make the image as max 250px high retaining aspect ratio
// Make the image as max 25vh high retaining aspect ratio
// Max height 25vh means the image will take at max one fourth of the title page viewport
object-fit: contain;
max-height: 250px;
max-height: 25vh;
max-width: 100%;
width: auto;
}
}
......@@ -59,7 +60,7 @@
}
.affiliation-logo img {
margin: 0px 0 0 0;
height: 70px;
height: 10vh;
width: auto;
object-fit: contain;
display: block;
......@@ -78,7 +79,7 @@
}
.valign-block:before {
content: '';
display: inline-block;
// display: inline-block;
height: 100%;
vertical-align: middle;
}
......
......@@ -681,7 +681,6 @@
.reveal .title-page .teaser-img {
margin: 20px auto;
height: 10%;
width: auto;
display: block;
}
......@@ -691,7 +690,8 @@
display: block;
margin: auto;
object-fit: contain;
max-height: 250px;
max-height: 25vh;
max-width: 100%;
width: auto;
}
......@@ -709,7 +709,7 @@
.reveal .title-page .affiliation-logo img {
margin: 0px 0 0 0;
height: 70px;
height: 10vh;
width: auto;
object-fit: contain;
display: block;
......@@ -731,7 +731,6 @@
.reveal .title-page .valign-block:before {
content: '';
display: inline-block;
height: 100%;
vertical-align: middle;
}
......
......@@ -261,7 +261,7 @@ div.q-panel div.q-input textarea {
padding: 0.3em;
height: 6em;
width: calc(100% - 0.6em);
border: none;
border-radius: var(--border-radius);
outline: none;
......@@ -400,3 +400,29 @@ div.q-panel div.content img {
width: 100%;
image-rendering: pixelated;
}
section#questions-overview div.scroll-y {
height: 500px;
overflow-y: scroll;
}
section#questions-overview table {
font-size: 70%;
}
section#questions-overview table h1 {
font-weight: bold;
font-size: 120%;
}
section#questions-overview table h2 {
font-weight: bold;
font-size: 110%;
}
section#questions-overview table tr td:first-child {
max-width: 6em;
overflow-x: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
......@@ -44,9 +44,9 @@ function fixAutoplayWithStart() {
// Replace date string on title slide with current date
// if string provided for date in yaml header is "today"
function currentDate() {
var date = document.getElementById("date");
var date = document.querySelector(".date");
if (!date) return;
var dateString = date.textContent;
var dateString = date.textContent.trim();
var today = new Date().toISOString().substr(0, 10);
......@@ -189,20 +189,20 @@ function prepareFullscreenIframes() {
function isElectron() {
// Renderer process
if (typeof window !== 'undefined' && typeof window.process === 'object' && window.process.type === 'renderer') {
return true;
}
// Renderer process
if (typeof window !== 'undefined' && typeof window.process === 'object' && window.process.type === 'renderer') {
return true;
}
// Main process
if (typeof process !== 'undefined' && typeof process.versions === 'object' && !!process.versions.electron) {
return true;
}
// Main process
if (typeof process !== 'undefined' && typeof process.versions === 'object' && !!process.versions.electron) {
return true;
}
// Detect the user agent when the `nodeIntegration` option is set to true
if (typeof navigator === 'object' && typeof navigator.userAgent === 'string' && navigator.userAgent.indexOf('Electron') >= 0) {
return true;
}
// Detect the user agent when the `nodeIntegration` option is set to true
if (typeof navigator === 'object' && typeof navigator.userAgent === 'string' && navigator.userAgent.indexOf('Electron') >= 0) {
return true;
}
return false;
return false;
}
......@@ -7,7 +7,7 @@ const DEBUG_AUTH = false;
var timeout = 100; // ms
function contactEngine(base) {
async function contactEngine(base) {
import(base + "/decker-util.js")
.then(engine => {
prepareEngine(engine.buildApi(base));
......@@ -26,9 +26,11 @@ async function prepareEngine(api) {
serverToken = token;
if (Reveal.isReady()) {
buildInterface(api, serverToken);
buildOverview(api, serverToken);
} else {
Reveal.addEventListener("ready", _ => {
buildInterface(api, serverToken);
buildOverview(api, serverToken);
});
}
})
......@@ -40,7 +42,16 @@ async function prepareEngine(api) {
});
}
async function buildInterface(api, initialToken) {
function deckId() {
let url = new URL(window.location);
url.hash = "";
url.query = "";
url.username = "";
url.password = "";
return url.toString();
}
function buildInterface(api, initialToken) {
var serverToken = initialToken;
if (DEBUG) {
......@@ -176,15 +187,9 @@ async function buildInterface(api, initialToken) {
const hashCode = s =>
s.split("").reduce((a, b) => ((a << 5) - a + b.charCodeAt(0)) | 0, 0);
let url = new URL(window.location);
url.hash = "";
url.query = "";
url.username = "";
url.password = "";
let getContext = () => {
return {
deck: url,
deck: deckId(),
slide: Reveal.getCurrentSlide().id,
token: user.value
};
......@@ -436,3 +441,71 @@ async function buildInterface(api, initialToken) {
updateComments();
updateIds();
}
function buildOverview(api, initialToken) {
var serverToken = initialToken;
let slides = document.querySelector("div.reveal div.slides");
let slide = document.createElement("section");
slide.setAttribute("id", "questions-overview")
slide.classList.add("slide", "level1", "questions", "overview");
let h1 = document.createElement("h1");
h1.textContent = "Questions Overview";
let scroll = document.createElement("div");
scroll.classList.add("scroll-y");
let table = document.createElement("table");
table.classList.add("questions");
scroll.appendChild(table)
slide.appendChild(h1);
slide.appendChild(scroll);
slides.appendChild(slide);
let updateList = list => {
console.log(list);
let tr = document.createElement("tr");
let th1 = document.createElement("th");
th1.textContent = "Slide";
let th2 = document.createElement("th");
th2.innerHTML = "<i class=\"far fa-thumbs-up\"></i>";
let th3 = document.createElement("th");
th3.textContent = "Question";
tr.appendChild(th1);
tr.appendChild(th2);
tr.appendChild(th3);
table.appendChild(tr);
for (let comment of list) {
let tr = document.createElement("tr");
let td1 = document.createElement("td");
let link = document.createElement("a");
link.setAttribute("href", `#${comment.slide}`);
link.textContent = comment.slide;
td1.appendChild(link);
let td2 = document.createElement("td");
td2.textContent = comment.votes;
let td3 = document.createElement("td");
td3.innerHTML = comment.html;
tr.appendChild(td1);
tr.appendChild(td2);
tr.appendChild(td3);
table.appendChild(tr);
}
};
api
.getComments(deckId())
.then(updateList)
.catch(console.log);
}
......@@ -48,7 +48,7 @@ here. */
}
.reveal .jp-OutputArea {
max-height: 70px;
/* max-height: 70px; This does not make sense to Mario */
overflow: auto;
}
......
......@@ -162,7 +162,8 @@ $else$
repoProvider: "$thebelab.repoProvider$",
},
kernelOptions: {
name: "$thebelab.language$"
name: "$thebelab.language$",
kernelName: "$thebelab.language$"
},
$endif$
selector: "[data-executable]",
......@@ -172,7 +173,7 @@ $endif$
}
}
</script>
<script src="$decker-support-dir$/vendor/thebelab/index.js"></script>
<script src="https://unpkg.com/thebelab@latest/lib/index.js"></script>
$endif$
$for(header-includes)$
$header-includes$
......@@ -243,7 +244,7 @@ $if(title)$
$else$
<section id="$idprefix$title-slide" class="title-page">
$endif$
<div class="valign-block" style="height:550px">
<div class="valign-block">
<div class="valigned">
<div class="title"> $title$</div>
$if(subtitle)$
......@@ -301,7 +302,8 @@ $body$
$if(decker-engine-base-url)$
<script type="module" crossorigin>
import {contactEngine} from "./$decker-support-dir$/js/engine.js";
contactEngine("$decker-engine-base-url$");
contactEngine("$decker-engine-base-url$")
.then(() => Reveal.sync());
</script>
$endif$
......
......@@ -15,6 +15,7 @@ menu: true
overview: true
progress: true
touch: true
vertical-slides: true
transition: "none"
title: "|title|"
test123: "test123"
......
......@@ -63,7 +63,7 @@ programs =
, ExternalProgram
[]
"gnuplot"
["-d", "-e", "'set terminal svg'"]
["-d", "-e", "\"set terminal svg\""]
["-V"]
(helpText "Gnuplot (http://gnuplot.sourceforge.net)"))
, ( "pdflatex"
......
---
title: ThebeLab Test
subtitle: Haskell Kernel
width: 960.0
height: 500.0
margin: 0.0
maxScale: 1.0
minScale: 1.0
subtitle: Haskell Kernel
thebelab:
baseUrl: 'http://localhost:8192/'
binderUrl: 'https://mybinder.org'
enable: true
binderUrl: 'https://mybinder.org'
language: haskell
ref: master
repo: 'monofon/plc-notebooks'
token: plc
title: ThebeLab Test
width: 960.0
ref: master
repoProvider: github
---
# ThebeLab Binder Deck
......@@ -41,7 +40,13 @@ from a custom Docker image on GitHub.
## {.left grow="2"}
``` {.haskell data-executable="true" data-language="haskell"}
print "Hallo!"
print "Was Gauss konnte, kann Haskell auch"
sumtorial :: Integer -> Integer
sumtorial 0 = 0
sumtorial n = n + sumtorial (n-1)
sumtorial 100
```
## Usage {.right}
......
---
menu: true
title: Vertical Slides
vertical-slides: true
---
# First slide
......
Subproject commit 47835965bd100a3661d8299d8b769ceeb8b6ce48
Subproject commit e1cffdef277fcf543833a20d28cbadcd000ebece
......@@ -209,7 +209,7 @@ control various aspects of the generated slide sets.
: mark overrflowing slides with a red border (defaults to `false`)
`vertical-slides`
: allow vertical slides (defaults to `false`)
: allow vertical slides (defaults to `true`)
### Dictionary
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment