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

Do not assume node_modules path #449

Open Tronix117 opened 1 year ago

Tronix117 commented 1 year ago

In the following file, it assumes the structure is always known and always the same. It's not always the case, for exemple using pnpm, you have a slightly different node_modules structure

https://github.com/webpro/reveal-md/blob/a92eb579eeadf574721ce0a9cd74e850546a50cc/lib/constants.js#L4

webpro commented 6 months ago

It's not pretty, but I don't see how this could be different across package managers? This is navigating within a single package.

Tronix117 commented 6 months ago

Hello, no it's not, you go up the directories from the highlightjs package location, to get back to the root folder. When we use some other package manager like pnpm or yarn with the plug'n'play mode or non default npm mode, you'll see the structure is quite different and this code does not work out of the box.

You can try by:

webpro commented 6 months ago

Ah yes, PnP. PR is welcome :)