Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
decker
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
decker
decker
Commits
cb01bd11
Commit
cb01bd11
authored
Oct 29, 2020
by
Mario Botsch
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into mario
parents
3c93e7eb
c13085eb
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
178 additions
and
53 deletions
+178
-53
app/Decker.hs
app/Decker.hs
+2
-2
hie.yaml
hie.yaml
+19
-0
resource/support/css/_titlepage.scss
resource/support/css/_titlepage.scss
+6
-5
resource/support/css/decker.css
resource/support/css/decker.css
+3
-4
resource/support/css/engine.css
resource/support/css/engine.css
+27
-1
resource/support/js/decker.js
resource/support/js/decker.js
+15
-15
resource/support/js/engine.js
resource/support/js/engine.js
+82
-9
resource/support/plugins/thebelab/thebelab.css
resource/support/plugins/thebelab/thebelab.css
+1
-1
resource/template/deck.html
resource/template/deck.html
+6
-4
resource/template/default.yaml
resource/template/default.yaml
+1
-0
src/Text/Decker/Internal/External.hs
src/Text/Decker/Internal/External.hs
+1
-1
test/decks/thebe-lab-binder-deck.md
test/decks/thebe-lab-binder-deck.md
+13
-8
test/decks/vertical-deck.md
test/decks/vertical-deck.md
+0
-1
third-party/jquery
third-party/jquery
+1
-1
users-guide/decker-users-guide.md
users-guide/decker-users-guide.md
+1
-1
No files found.
app/Decker.hs
View file @
cb01bd11
...
...
@@ -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
...
...
hie.yaml
0 → 100644
View file @
cb01bd11
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"
resource/support/css/_titlepage.scss
View file @
cb01bd11
...
...
@@ -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
;
}
...
...
resource/support/css/decker.css
View file @
cb01bd11
...
...
@@ -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
;
}
...
...
resource/support/css/engine.css
View file @
cb01bd11
...
...
@@ -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
;
}
resource/support/js/decker.js
View file @
cb01bd11
...
...
@@ -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
;
}
resource/support/js/engine.js
View file @
cb01bd11
...
...
@@ -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
);
}
resource/support/plugins/thebelab/thebelab.css
View file @
cb01bd11
...
...
@@ -48,7 +48,7 @@ here. */
}
.reveal
.jp-OutputArea
{
max-height
:
70px
;
/* max-height: 70px; This does not make sense to Mario */
overflow
:
auto
;
}
...
...
resource/template/deck.html
View file @
cb01bd11
...
...
@@ -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/thebela
b/index.js"
></script>
<script
src=
"
https://unpkg.com/thebelab@latest/li
b/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$
...
...
resource/template/default.yaml
View file @
cb01bd11
...
...
@@ -15,6 +15,7 @@ menu: true
overview
:
true
progress
:
true
touch
:
true
vertical-slides
:
true
transition
:
"
none"
title
:
"
|title|"
test123
:
"
test123"
...
...
src/Text/Decker/Internal/External.hs
View file @
cb01bd11
...
...
@@ -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"
...
...
test/decks/thebe-lab-binder-deck.md
View file @
cb01bd11
---
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}
...
...
test/decks/vertical-deck.md
View file @
cb01bd11
---
menu
:
true
title
:
Vertical Slides
vertical-slides
:
true
---
# First slide
...
...
jquery
@
e1cffdef
Compare
47835965
...
e1cffdef
Subproject commit
47835965bd100a3661d8299d8b769ceeb8b6ce48
Subproject commit
e1cffdef277fcf543833a20d28cbadcd000ebece
users-guide/decker-users-guide.md
View file @
cb01bd11
...
...
@@ -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
`
fals
e`
)
: allow vertical slides (defaults to
`
tru
e`
)
### Dictionary
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment