ncase / nutshell

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

Making a shareable link icon optional. #25

Closed howardm closed 1 year ago

howardm commented 1 year ago

Hi,

Thanks so much for this great utility! I'm exploring the use of the Quarto extension.

My question: In relation to the image below, is it possible to make the default display of the shareable icon optional ?

Screen Shot 2023-01-25 at 5 07 27 PM

Cheers.

Howard

ncase commented 1 year ago

Thank you for the kind words, Howard! I'm very honored to see Nutshell being used in scientific publishing!

I have implemented your suggestion in the latest release. (which is still at https://cdn.jsdelivr.net/gh/ncase/nutshell/nutshell.js, if you're including it externally) To turn off the share-icon, type:

<script>
Nutshell.setOptions({
    dontEmbedHeadings: true
});
</script>

after including the Nutshell.js file. More details in the updated Advanced Features documentation.

Thank you again! 🎉 Best wishes in helping your readers learn the difference between the various terrifying lung edemas.

howardm commented 1 year ago

Thanks.

I installed it via this extension: https://github.com/schochastics/quarto-nutshell

Please explain in simple terms how to turn off the Share icon given my setup.

FYI -- here is a screenshot of my RStudio setup:

Screen Shot 2023-02-01 at 10 32 23 AM

Howard

ncase commented 1 year ago

Ah, alas, I did not create that extension, so you'd have to ask its creator, schochastics. I also have never worked with RStudio or Quarto before.

A workaround I suggest is adding custom style (CSS) to your app. I've never used RStudio or Quarto before, so I don't know exactly how to do it, but a quick web search of "custom CSS RStudio/Quarto" got me these two links:

The CSS you'd need to add is just one line:

.nutshell-heading-embed{ display:none; }

That should hide the share button. Good luck!

howardm commented 1 year ago

That works!

Thanks so much !