webpro / reveal-md

reveal.js on steroids! Get beautiful reveal.js presentations from any Markdown file
MIT License
3.74k stars 416 forks source link

Update reveal-md to ES modules and updated all dependencies #465

Closed MartenBE closed 11 months ago

MartenBE commented 12 months ago

This is a PR to facilitate the upgrade to Reveal.js 5.0.0 as mentioned in https://github.com/webpro/reveal-md/issues/462 and https://github.com/hakimel/reveal.js/issues/3517 . Although Reveal.js hasn't been updated in this PR, all the rest has.

Normally, there should be no or very small breaking changes. All the unit tests and my personal use case work as expected, but I can't test everything and everyway reveal-md has been used, and many files have been edited in some way in the code base.

webpro commented 11 months ago

Martijn, you're a legend! Thanks a bunch for this 🙏

webpro commented 11 months ago

Didn't catch that we jumped to Node.js v20, tweaked that down a bit to v18 (it's not EOL).

webpro commented 11 months ago

Did a prerelease v6.0.0-next.0 with the next npm dist tag. So things can be tested and verified a bit, perhaps include reveal.js v5 as well, before we release reveal-md v6.

MartenBE commented 11 months ago

Wow, thanks! Didn't expect this so soon!

Unfortunately, as I posted the issue at the repo for reveal.js itself, it seems that we won't be able to call functions on the Markdown plugin anymore. We will probably have to rethink the whole render logic. I have some ideas (such as not calling the render funcxtions ourselves but transpile to https://revealjs.com/markdown/#external-markdown ), but it will take some time and experimentation to get (hopefully) something working.

PS: I also don't come from a frontend background (mainly C++ and Java), so this should definitely be tested through first by people with more uses cases.

webpro commented 11 months ago

Unfortunately, as I posted the issue at the repo for reveal.js itself, it seems that we won't be able to call functions on the Markdown plugin anymore.

More ideas: depending on their output, we might be able to make it easier and still ~hack~ do so using createRequire or even transform using something like jiti

PS: I also don't come from a frontend background (mainly C++ and Java)

That explains the typo in the title of 706394eceed371c7501515660013fae94808cc24 (no worries j/k)

Again, thanks for your work, it is honestly much appreciated.

MartenBE commented 11 months ago

According to https://github.com/hakimel/reveal.js/issues/3517#issuecomment-1795522814 we seem to be able to use the current implementation a bit longer :) This allows us to take our time to cook up a future proof solution.