Yeah - thereās some heavy lifting there if you havenāt spent a lot of time with git, homebrew et al.
The alternate method (which adds or at least changes the complexities involved) would be using their Docker image so that all of the their code is encapsulated into a container so that you donāt need to install and maintain everything into your native environment.
Quick sample method:
docker run --rm -p 1948:1948 -p 35729:35729 -v path-to-your-slides:/slides webpronl/reveal-md:latest /slides --watch
This assumes youāve installed the Docker desktop application.
That will get you the basics running just fine. Pulling the command apart we have:
- docker run (pretty obvious)
- -rm (delete the container when youāre done with it)
- -p (maps a network port from the container to a port on your Mac)
- 1948:1948 publishes the presentation on port 1948, so itās available at http://1948/
- 35729:35729 maps the port that allows you to modify the source files and the presentation in the browser will be updated in real-time
- -v path-to-your-slides:/slides (maps the folder on your Mac where the presentation files are stored to the directory /slides inside the container so the app can use them in the expected place
- webpronl/reveal-md:latest (the name of the docker container in the registry, downloading the latest version)
- /slides --watch (used with the 35729 port to monitor the slides directory for changes
Other useful options to add to the command line:
- ātheme solarized (pick your theme from the available options)
- -v path-to-other-resources:/resources (maps a folder for additional code resources)
- āpreprocessor /resources/reveal-md-pre.js (run a pre processor on your text files)
I had to add the pre processor to help tweak the Obsidian files to a markdown that reveal.js is happier with. This hacked together one makes the following changes:
- Converts Obsidian Wiki style links to markdown links (useful for embedded images)
- handles wiki style links that set the height of an image in pixels with a pipe to the appropriate html for reveal.js
// Checks for Wikilinks for embedded links
// Looking for graphic links with ![[]] - mapped to ![]()
// and then replace size overrides with |xxx pixels to the html .element height parameter
module.exports = (markdown, options) => {
return new Promise((resolve, reject) => {
return resolve(
markdown
.split('\n')
.map((line, index) => {
if (!/\!\[\[/.test(line) || index === 0) return line;
line.replace(/\!\[\[(.*?)\]\]/, "")
if (/\!\[\]\(.*\|.*?\)/.test(line)) {
return line.replace(/\!\[\]\((.+)\|(.+)\)/, " <!-- .element height="$2" -->")
} else {
return line;
}
})
.join('\n')
);
});
};
Quick notes : some of the forum text handling combines double hyphens to an em-dash