How do I specify which show.js presentation to run from the local web server?

In accordance with the installation instructions for opens.js , for some of the available functions (for example, for external notes of Markdown and speakers) it is necessary for the presentation to run from the local web server.

However, if I follow the instructions, there is no way to indicate which presentation to start, and all I get is a presentation containing two slides labeled "Slide 1" and "Slide 2". If you look in the section above , it looks like this is a presentation of "index.html" in the opens.js repository that is presented, that is, not the presentation that I want to present.

How to make a presentation from the local web server without copying or moving the contents of the opens.js folder to the folder where my presentation is located, and without copying, moving or renaming the presentation?

+5
source share
1 answer

Use symbolic links .

Suppose you have a catalog under your house where you hold all your presentations. From the directory in which you installed show.js, do:

ln -s ~/presentations presentations 

Then in your browser, visit http: // localhost: 8000 / presentations to get a list of all your presentation files (except, of course, if one of them is named index.html). Click any of them to show it.

Note. If your presentations are located outside the server’s root directory (the directory in which you installed to open .js), the resource.js resource links must be absolute and relative. Thus, they will be perceived as relative to the root directory (where show.js is located) instead of the current directory (where presentations are located).

eg. in the example presentation file you will need to rotate these lines:

 <link rel="stylesheet" href="css/reveal.css"> <link rel="stylesheet" href="css/theme/black.css"> <link rel="stylesheet" href="lib/css/zenburn.css"> <script src="lib/js/head.min.js"></script> <script src="js/reveal.js"></script> { 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(); } } 

in

 <link rel="stylesheet" href="/css/reveal.css"> <link rel="stylesheet" href="/css/theme/black.css"> <link rel="stylesheet" href="/lib/css/zenburn.css"> <script src="/lib/js/head.min.js"></script> <script src="/js/reveal.js"></script> { 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(); } } 
+2
source

Source: https://habr.com/ru/post/1269621/


All Articles