reveal-run-in-terminal
reveal-run-in-terminal copied to clipboard
Directly copying demo app to new project does not work?
In the beginning, I want to state that I have no experience with JS, but I wanted to play with the Reveal and this plugin. I created new node app, copied it to my repo, and tried to start it, but I encountered some issues - it simply does not produce the same output as in the demo inside this repo. Am I missing something?
Could you elaborate more on the issue? Maybe a screen recording of the presentation with browser console opened would be great.
I run:
~/Repos/shanduur/DockerTutorial next
> npm install
up to date, audited 53 packages in 452ms
2 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
~/Repos/shanduur/DockerTutorial next
> npm start
> [email protected] start
> node src/app.js
And then the output in the browser looks like this:
Safari:
Microsoft Edge:
There are no additional logs in the console, and the html output of the server looks like this:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>reveal-run-in-terminal</title>
<link rel="stylesheet" href="css/reveal.css">
<link rel="stylesheet" href="css/theme/black.css">
<link rel="stylesheet" href="plugin/reveal-run-in-terminal.css">
<!-- Theme used for syntax highlighting of code -->
<link rel="stylesheet" href="lib/css/zenburn.css">
<!-- Printing and PDF exports -->
<script>
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = window.location.search.match( /print-pdf/gi ) ? 'css/print/pdf.css' : 'css/print/paper.css';
document.getElementsByTagName( 'head' )[0].appendChild( link );
</script>
</head>
<body>
<div class="reveal">
<div class="slides">
<section>
<h2>reveal-run-in-terminal</h2>
</section>
<section data-run-in-terminal="code/node-example.js">
<h2>Node (With Time!)</h2>
</section>
<section data-run-in-terminal="code/node-error-example.js">
<h2>Node (With An Error!)</h2>
</section>
<section
data-run-in-terminal="code/ruby-argv-example.rb"
data-run-in-terminal-bin="ruby"
data-run-in-terminal-args="the quick 'brown fox'"
>
<h2>Ruby (With Arguments!)</h2>
</section>
<section
data-run-in-terminal="code/python-example.py"
data-run-in-terminal-bin="python"
>
<h2>Python (Isn't Whitelisted!)</h2>
</section>
<section data-run-in-terminal="../far-away.js">
<h2>Outside Public Directory (Not Allowed!)</h2>
</section>
</div>
</div>
<script src="lib/js/head.min.js"></script>
<script src="js/reveal.js"></script>
<script>
// More info https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
history: true,
// More info https://github.com/hakimel/reveal.js#dependencies
dependencies: [
{ src: 'plugin/reveal-run-in-terminal.js', async: true,
callback: function() {
RunInTerminal.init({defaultBin: 'node'});
} },
{ src: 'plugin/markdown/marked.js' },
{ src: 'plugin/markdown/markdown.js' },
{ src: 'plugin/notes/notes.js', async: true },
{ src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } }
]
});
</script>
</body>
</html>
And the developer's console output:
After some digging, I am able to render basics, but I still have some issues, especially with hljs:
