forked from resilientscale/reveal.js
-
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.
run in docker for fast preso switching
- Loading branch information
1 parent
a1193b2
commit c6ec1dd
Showing
8 changed files
with
113 additions
and
131 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
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,18 @@ | ||
#!/bin/bash | ||
|
||
if [ "$1" = "" ] || [ "$2" = "" ]; then | ||
echo $0: usage: $0 path-to-local-reveal-clone path-to-slides-dir | ||
exit | ||
fi | ||
|
||
if [ ! -e $1 ]; then | ||
echo $0: Local reveal clone does not exist: $1 | ||
exit | ||
fi | ||
|
||
if [ ! -e $2 ]; then | ||
echo $0: Slides directory does not exist: $2 | ||
exit | ||
fi | ||
|
||
docker run -v $1:/home/user/reveal.js -v $2:/home/user/reveal.js/slides/ -p 8000:8000 -p 35729:35729 -it --rm rscale/node /bin/bash |
Binary file not shown.
Binary file not shown.
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
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,22 @@ | ||
(function(){ | ||
|
||
function setSlides() { | ||
$("section.markdown-slides").attr("data-markdown", "slides/" + getQueryParamValue('pres') + "/slides.md"); | ||
window.presentation = getQueryParamValue('pres'); | ||
} | ||
|
||
function getQueryParamValue(paramName) { | ||
var query = window.location.search.substring(1); | ||
var vars = query.split("&"); | ||
for (var i=0;i<vars.length;i++) { | ||
var pair = vars[i].split("="); | ||
if(pair[0] == paramName) { | ||
return pair[1]; | ||
} | ||
} | ||
return ""; | ||
} | ||
|
||
setSlides(); | ||
|
||
})(); |
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,33 @@ | ||
(function(){ | ||
|
||
function resolveImages() { | ||
resolveBackgrounds(); | ||
resolveSlideImages(); | ||
} | ||
|
||
function resolveBackgrounds() { | ||
var sections = document.querySelectorAll( '[data-background-image]'), section; | ||
|
||
for( var i = 0, len = sections.length; i < len; i++ ) { | ||
section = sections[i]; | ||
if (section.getAttribute('data-background-image').length) { | ||
var image = $(section).attr('data-background-image'); | ||
if ( image.startsWith("images/") ) { | ||
$(section).attr('data-background-image', 'slides/' + window.presentation + "/" + image); | ||
} | ||
} | ||
} | ||
} | ||
|
||
function resolveSlideImages() { | ||
var images = $("img[src^='images/']"); | ||
for( var i = 0, len = images.length; i < len; i++ ) { | ||
image = images[i]; | ||
src = $(image).attr("src"); | ||
$(image).attr("src", "slides/" + window.presentation + "/" + src); | ||
} | ||
} | ||
|
||
resolveImages(); | ||
|
||
})(); |