Skip to content

Instantly share code, notes, and snippets.

@BobyMCbobs
Last active July 19, 2023 08:59
Show Gist options
  • Save BobyMCbobs/d10dbc1922dd32350267daecd5d03668 to your computer and use it in GitHub Desktop.
Save BobyMCbobs/d10dbc1922dd32350267daecd5d03668 to your computer and use it in GitHub Desktop.
org-mode reveal snippet
# -*- mode: snippet -*-
# name: reveal
# key: <reveal
# --
* LOCAL VARS :noexport:
Local Variables:
eval: (setenv "MULTIPLEX_URL" (or (getenv "MULTIPLEX_URL") "https://reveal-multiplex.rnd-wtf.islive.xyz/"))
eval: (set-variable 'org-re-reveal-root (getenv "MULTIPLEX_URL"))
eval: (set-variable 'org-re-reveal-multiplex-url (getenv "MULTIPLEX_URL"))
eval: (set-variable 'org-re-reveal-multiplex-socketio-url (concat (getenv "MULTIPLEX_URL") "/socket.io/socket.io.js"))
End:
#+REVEAL_MULTIPLEX_SECRET: 16303595814587938032
#+REVEAL_MULTIPLEX_ID: 1ea00b34ec29b2a6
#+REVEAL_VERSION: 4
#+REVEAL_EXTRA_CSS: ./style.css
#+NOREVEAL_DEFAULT_FRAG_STYLE: YY
#+NOREVEAL_EXTRA_JS: YY
#+REVEAL_HLEVEL: 2
#+REVEAL_MARGIN: 0
#+REVEAL_WIDTH: 5000
#+REVEAL_HEIGHT: 800
#+REVEAL_MAX_SCALE: 0.9
#+REVEAL_MIN_SCALE: 0.2
#+REVEAL_PLUGINS: (markdown notes highlight multiplex)
#+REVEAL_SLIDE_NUMBER: ""
#+REVEAL_PROGRESS: f
#+REVEAL_SPEED: 5
#+REVEAL_THEME: serif
#+REVEAL_THEME_OPTIONS: beige|black|blood|league|moon|night|serif|simple|sky|solarized|white
#+REVEAL_TRANS: slide
#+REVEAL_TRANS_OPTIONS: none|cube|fade|concave|convex|page|slide|zoom
#+REVEAL_TITLE_SLIDE: <h1>%t</h1>
#+REVEAL_TITLE_SLIDE: <h3>%s</h3>
#+REVEAL_TITLE_SLIDE: <p>%a</p>
#+REVEAL_PREAMBLE: <script defer src="remote-coolthing.js"></script>
#+OPTIONS: num:nil
#+OPTIONS: toc:nil
#+OPTIONS: mathjax:Y
#+OPTIONS: reveal_single_file:nil
#+OPTIONS: reveal_control:t
#+OPTIONS: reveal_progress:nil
#+OPTIONS: reveal_history:nil
#+OPTIONS: reveal_center:t
#+OPTIONS: reveal_rolling_links:nil
#+OPTIONS: reveal_keyboard:t
#+OPTIONS: reveal_overview:t
#+OPTIONS: reveal_width:1200
#+OPTIONS: reveal_height:800
#+OPTIONS: reveal_fragmentinurl:t
#+OPTIONS: timestamp:nil
#+OPTIONS: reveal_title_slide:nil
* Extra stuff :noexport:
#+begin_src css :tangle ./style.css :comments none
img {
border-radius: 30px;
}
.reveal .code-wrapper code {
border-radius: 20px;
}
.reveal .code-wrapper {
border-radius: 30px;
}
.reveal p {
font-size: 2rem;
}
#+end_src
#+begin_src javascript :tangle ./remote-coolthing.js :comments none
document.addEventListener('DOMContentLoaded',() => {
const isMonitor = window.location.pathname.includes("_client.html");
if (isMonitor) {
return
}
const controls = document.querySelector(".controls");
const slides = document.querySelector(".slides");
slides.style.filter = "opacity(30%)";
controls.style.fontSize = "calc(100vh / 16)";
controls.dataset.controlsLayout = "edges";
controls.dataset.controls = "false";
})
#+end_src
* Set up :noexport:
Run reveal-multiplex locally
#+begin_src tmate :window reveal-multiplex
docker run -it --rm -p 1948:1948 registry.gitlab.com/bobymcbobs/container-images/reveal-multiplex:88453c1f@sha256:4bc549a56edc375315af224ba3d50f2b617849f0f90c34cd85992ca074dfc370
#+end_src
Set env for local reveal-multiplex server
#+begin_src elisp
(setenv "MULTIPLEX_URL" "http://localhost:1948")
(normal-mode)
#+end_src
Link up this folder to the web
#+begin_src tmate :window serve
go-http-server
#+end_src
Generate a token
#+begin_src shell
curl -s \${MULTIPLEX_URL:-reveal-multiplex.glitch.me}/token | jq .
#+end_src
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment