From 9efa25576eb9586503c539626e83d9b5ccbe9d28 Mon Sep 17 00:00:00 2001 From: jurgenhaas <juergen@paragon-es.de> Date: Mon, 1 Mar 2021 17:14:53 +0100 Subject: [PATCH] Change default template to use theme from mdshow config instead of dist directory --- .gitignore | 2 + bin/mdshow | 2 +- default.revealjs | 300 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 303 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 default.revealjs diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9e12eaa --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.idea +.archive diff --git a/bin/mdshow b/bin/mdshow index ce86d38..d81adce 100755 --- a/bin/mdshow +++ b/bin/mdshow @@ -116,7 +116,7 @@ $(MDSHOW_CONFIG)/pandoc/templates/metadata.extract: $(MDSHOW_CONFIG)/pandoc/templates/default.revealjs: @[ ! -e $(dir $@) ] && mkdir -p $(dir $@) || true [ ! -e $@ ] && \ - curl -L https://raw.githubusercontent.com/jceb/mdshow/master/assets/pandoc/templates/default.revealjs -o $@ + curl -L https://gitlab.lakedrops.com/docker/mdshow/-/raw/master/default.revealjs -o $@ $(MDSHOW_CONFIG)/reveal.js/dist/Chart.bundle.min.js: @[ ! -e $(dir $@) ] && mkdir -p $(dir $@) || true diff --git a/default.revealjs b/default.revealjs new file mode 100644 index 0000000..ec3a6b7 --- /dev/null +++ b/default.revealjs @@ -0,0 +1,300 @@ +<!DOCTYPE html> +<html$if(lang)$ lang="$lang$"$endif$$if(dir)$ dir="$dir$"$endif$> +<head> + <meta charset="utf-8"> + <meta name="generator" content="pandoc"> +$for(author-meta)$ + <meta name="author" content="$author-meta$"> +$endfor$ +$if(date-meta)$ + <meta name="dcterms.date" content="$date-meta$"> +$endif$ +$if(keywords)$ + <meta name="keywords" content="$for(keywords)$$keywords$$sep$, $endfor$"> +$endif$ + <title>$if(title-prefix)$$title-prefix$ – $endif$$pagetitle$</title> + <meta name="apple-mobile-web-app-capable" content="yes"> + <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"> + <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui"> + <link rel="stylesheet" href="$revealjs-url$/reset.css"> + <link rel="stylesheet" href="$revealjs-url$/reveal.css"> + <link rel="stylesheet" href="$revealjs-url$/plugin/highlight/styles/$highlightStyle$.css"> + <link rel="stylesheet" href="$revealjs-url$/defaults.css"> + <!-- <style> --> + <!-- $styles.html()$ --> + <!-- </style> --> +$if(theme)$ + <link rel="stylesheet" href=".mdshow/theme/$theme$/assets/$theme$.css" id="theme"> +$else$ + <link rel="stylesheet" href=".mdshow/theme/black/assets/black.css" id="theme"> +$endif$ +$for(css)$ + <link rel="stylesheet" href="$css$"/> +$endfor$ + <!--[if lt IE 9]> + <script src="$revealjs-url$/lib/js/html5shiv.js"></script> + <![endif]--> +$if(math)$ + $math$ +$endif$ +$for(header-includes)$ + $header-includes$ +$endfor$ + +</head> +<body> + <script src="$revealjs-url$/reveal.js"></script> + <script src="$revealjs-url$/fontawesome/js/all.min.js"></script> + <script src="$revealjs-url$/Chart.bundle.min.js"></script> +$for(javascript)$ + <script src="$javascript$"></script> +$endfor$ + +$for(include-before)$ +$include-before$ +$endfor$ + <div class="reveal"> + <div class="slides"> + +$if(title)$ +<section id="$idprefix$title-slide"$for(title-slide-attributes/pairs)$ $it.key$="$it.value$"$endfor$> + <h1 class="title">$title$</h1> +$if(subtitle)$ + <p class="subtitle">$subtitle$</p> +$endif$ +$for(author)$ + <p class="author">$author$</p> +$endfor$ +$if(date)$ + <p class="date">$date$</p> +$endif$ +</section> +$endif$ +$if(toc)$ +<section id="$idprefix$TOC"> +$table-of-contents$ +</section> +$endif$ + +$body$ + </div> + </div> + + <script src="$revealjs-url$/plugin/math/math.js"></script> + <script src="$revealjs-url$/plugin/zoom/zoom.js"></script> + <script src="$revealjs-url$/plugin/search/search.js"></script> + <script src="$revealjs-url$/plugin/notes/notes.js"></script> + <script src="$revealjs-url$/plugin/highlight/highlight.js"></script> + + <script> + + // Full list of configuration options available at: + // https://github.com/hakimel/reveal.js#configuration + Reveal.initialize({ + // Display controls in the bottom right corner + controls: ('$controls$' === '' ? false : true), + // Help the user learn the controls by providing hints, for example by + // bouncing the down arrow when they first encounter a vertical slide + controlsTutorial: ('$controlsTutorial$' === '' ? false : true), + // Display a presentation progress bar + progress: ('$progress$' === '' ? false : true), + // Display the page number of the current slide + slideNumber: ('$slideNumber$' === '' ? false : '$slideNumber$' === 'true' ? true : '$slideNumber$'), + // Use 1 based indexing for # links to match slide number (default is zero + // based) + hashOneBasedIndex: ('$hashOneBasedIndex$' === '' ? false : true), + // Add the current slide number to the URL hash so that reloading the + // page/copying the URL will return you to the same slide + hash: ('$hash$' === '' ? false : true), + // Flags if we should monitor the hash and change slides accordingly + respondToHashChanges: ('$respondToHashChanges$' === '' ? false : true), + // Push each slide change to the browser history + history: ('$history$' === '' ? false : true), + // Enable keyboard shortcuts for navigation + keyboard: ('$keyboard$' === '' ? false : true), + // Disables the default reveal.js slide layout (scaling and centering) + // so that you can use custom CSS layout + disableLayout: ('$disableLayout$' === '' ? false : true), + // Enable the slide overview mode + overview: ('$overview$' === '' ? false : true), + // Vertical centering of slides + center: ('$center$' === '' ? false : true), + // Enables touch navigation on devices with touch input + touch: ('$touch$' === '' ? false : true), + // Loop the presentation + loop: ('$loop$' === '' ? false : true), + // Change the presentation direction to be RTL + rtl: ('$rtl$' === '' ? false : true), +$if(navigationMode)$ + // see https://github.com/hakimel/reveal.js/#navigation-mode + navigationMode: '$navigationMode$', +$endif$ + // Randomizes the order of slides each time the presentation loads + shuffle: ('$shuffle$' === '' ? false : true), + // Turns fragments on and off globally + fragments: ('$fragments$' === '' ? false : true), + // Flags whether to include the current fragment in the URL + // so that reloading brings you to the same fragment position + fragmentInURL: ('$fragmentInURL$' === '' ? false : true), + // Flags if the presentation is running in an embedded mode, + // i.e. contained within a limited portion of the screen + embedded: ('$embedded$' === '' ? false : true), + // Flags if we should show a help overlay when the questionmark + // key is pressed + help: ('$help$' === '' ? false : true), + // Flags if it should be possible to pause the presentation (blackout) + pause: ('$pause$' === '' ? false : true), + // Flags if speaker notes should be visible to all viewers + showNotes: ('$showNotes$' === '' ? false : true), + // Global override for autolaying embedded media (video/audio/iframe) + // - null: Media will only autoplay if data-autoplay is present + // - True: All media will autoplay, regardless of individual setting + // - False: No media will autoplay, regardless of individual setting + autoPlayMedia: ('$autoPlayMedia$' === 'null' ? null : '$autoPlayMedia$' === '' ? false : true), + // Global override for preloading lazy-loaded iframes + // - null: Iframes with data-src AND data-preload will be loaded when within + // the viewDistance, iframes with only data-src will be loaded when visible + // - True: All iframes with data-src will be loaded when within the viewDistance + // - False: All iframes with data-src will be loaded only when visible + preloadIframes: ('$preloadIframes$' === 'null' ? null : '$preloadIframes$' === '' ? false : true), + // Can be used to globally disable auto-animation + autoAnimate: ('$autoAnimate$' === '' ? false : true), +$if(autoAnimateMatcher)$ + // Optionally provide a custom element matcher that will be + // used to dictate which elements we can animate between. + autoAnimateMatcher: ('$autoAnimateMatcher$' === 'null' ? null : '$autoAnimateMatcher$'), // none/fade/slide/convex/concave/zoom +$endif$ +$if(autoAnimateEasing)$ + // Default settings for our auto-animate transitions, can be + // overridden per-slide or per-element via data arguments + autoAnimateEasing: '$autoAnimateEasing$', +$endif$ +$if(autoAnimateDuration)$ + autoAnimateDuration: $autoAnimateDuration$, +$endif$ + autoAnimateUnmatched: ('$autoAnimateUnmatched$' === '' ? false : true), + // Number of milliseconds between automatically proceeding to the + // next slide, disabled when set to 0, this value can be overwritten + // by using a data-autoslide attribute on your slides + autoSlide: ('$autoSlide$' === '' ? false : parseInt('$autoSlide$')), + // Stop auto-sliding after user input + autoSlideStoppable: ('$autoSlideStoppable$' === '' ? false : true), +$if(autoSlideMethod)$ + // Use this method for navigation when auto-sliding (defaults to navigateNext) + autoSlideMethod: ('$autoSlideMethod$' === 'null' ? null : '$autoSlideMethod$'), // none/fade/slide/convex/concave/zoom +$endif$ +$if(defaultTiming)$ + // Specify the average time in seconds that you think you will spend + // presenting each slide. This is used to show a pacing timer in the + // speaker view + defaultTiming: $defaultTiming$, +$endif$ + // Enable slide navigation via mouse wheel + mouseWheel: ('$mouseWheel$' === '' ? false : true), + // Opens links in an iframe preview overlay + // Add `data-preview-link` and `data-preview-link="False"` to customise each link + // individually + previewLinks: ('$previewLinks$' === '' ? false : true), + // Exposes the reveal.js API through window.postMessage + postMessage: ('$postMessage$' === '' ? false : true), + // Dispatches all reveal.js events to the parent window through postMessage + postMessageEvents: ('$postMessageEvents$' === '' ? false : true), + // Focuses body when page changes visibility to ensure keyboard shortcuts work + focusBodyOnPageVisibilityChange: ('$focusBodyOnPageVisibilityChange$' === '' ? false : true), + // Apply a 3D roll to links on hover + // TODO check if still in use + rollingLinks: ('$rollingLinks$' === '' ? false : true), + // Hides the address bar on mobile devices + hideAddressBar: ('$controls$' === '' ? false : true), + // Opens links in an iframe preview overlay + previewLinks: ('$controls$' === '' ? false : true)$previewLinks$, +$if(transition)$ + // Transition style + transition: '$transition$', // none/fade/slide/convex/concave/zoom +$endif$ +$if(transitionSpeed)$ + // Transition speed + transitionSpeed: '$transitionSpeed$', // default/fast/slow +$endif$ +$if(backgroundTransition)$ + // Transition style for full page slide backgrounds + backgroundTransition: '$backgroundTransition$', // none/fade/slide/convex/concave/zoom +$endif$ +$if(viewDistance)$ + // Number of slides away from the current that are visible + viewDistance: $viewDistance$, +$endif$ +$if(parallaxBackgroundImage)$ + // Parallax background image + parallaxBackgroundImage: '$parallaxBackgroundImage$', // e.g. "'https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg'" +$else$ +$if(background-image)$ + // Parallax background image + parallaxBackgroundImage: '$background-image$', // e.g. "'https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg'" +$endif$ +$endif$ +$if(parallaxBackgroundSize)$ + // Parallax background size + parallaxBackgroundSize: '$parallaxBackgroundSize$', // CSS syntax, e.g. "2100px 900px" +$endif$ +$if(parallaxBackgroundHorizontal)$ + // Amount to move parallax background (horizontal and vertical) on slide change + // Number, e.g. 100 + parallaxBackgroundHorizontal: $parallaxBackgroundHorizontal$, +$endif$ +$if(parallaxBackgroundVertical)$ + parallaxBackgroundVertical: $parallaxBackgroundVertical$, +$endif$ +$if(width)$ + // The "normal" size of the presentation, aspect ratio will be preserved + // when the presentation is scaled to fit different resolutions. Can be + // specified using percentage units. + width: $width$, +$endif$ +$if(height)$ + height: $height$, +$endif$ +$if(margin)$ + // Factor of the display size that should remain empty around the content + margin: $margin$, +$endif$ +$if(minScale)$ + // Bounds for smallest/largest possible scale to apply to content + minScale: $minScale$, +$endif$ +$if(maxScale)$ + maxScale: $maxScale$, +$endif$ +$if(zoomKey)$ + // Modifier key used to click-zoom to part of the slide + zoomKey: '$zoomKey$', +$endif$ + +$if(mathjax)$ + math: { + mathjax: '$mathjaxurl$', + config: 'TeX-AMS_HTML-full', + tex2jax: { + inlineMath: [['\\(','\\)']], + displayMath: [['\\[','\\]']], + balanceBraces: true, + processEscapes: false, + processRefs: true, + processEnvironments: true, + preview: 'TeX', + skipTags: ['script','noscript','style','textarea','pre','code'], + ignoreClass: 'tex2jax_ignore', + processClass: 'tex2jax_process' + }, + }, +$endif$ + + // Optional reveal.js plugins + plugins: [ RevealHighlight, RevealZoom, RevealNotes, RevealSearch, RevealMath ] + }); + </script> + $for(include-after)$ + $include-after$ + $endfor$ + </body> +</html> -- GitLab