ncase / nutshell

Make expandable explanations!
https://ncase.me/nutshell/
Creative Commons Zero v1.0 Universal
504 stars 30 forks source link

Unable to change Nutshell options #29

Closed cs-mshah closed 4 months ago

cs-mshah commented 1 year ago

I tried to include nutshell using the script tag, but inside it, even after changing the options, they don't reflect in the webpage.

<script src="https://cdn.jsdelivr.net/gh/ncase/nutshell/nutshell.js">
    Nutshell.setOptions({
        startOnLoad: true, // Start Nutshell on load? (default: true)
        lang: 'en', // Language (default: 'en', which is English)
        dontEmbedHeadings: true // If 'true', removes the "embed this as a nutshell" option on headings
    });
</script>

The dontEmbedHeadings still shows the nutshell logo next to headings.

mr4tt commented 6 months ago

Hi, I think it works if you split it into two script tags, like this:

<script src="https://cdn.jsdelivr.net/gh/ncase/nutshell/nutshell.js"> </script>
<script>
    Nutshell.setOptions({
        startOnLoad: true, // Start Nutshell on load? (default: true)
        lang: 'en', // Language (default: 'en', which is English)
        dontEmbedHeadings: true // If 'true', removes the "embed this as a nutshell" option on headings
    });
</script>
cs-mshah commented 4 months ago

Thanks. This indeed worked!