NotionX / react-notion-x

Fast and accurate React renderer for Notion. TS batteries included. ⚡️
https://react-notion-x-demo.transitivebullsh.it
MIT License
4.69k stars 544 forks source link

Adding the option to show latex code when clicking equation blocks #552

Open Mapaor4 opened 2 months ago

Mapaor4 commented 2 months ago

Description

Change of CSS to allow clicking a block equation and displaying the latex code (just as in Notion)

I am not sure how the repo behaves (I'm quite new here), but could it be that just requires changing the .notion-equation CSS attribute inside packages/react-notion-x/src/styles.css?

Codepen example

I created a minimal working example with codepen to show an example of CSS (and JS) that would allow for this functionality

Try it here: Equation block - click to show code (like Notion)

Forgive me if the code is not quite clean. I am new to both CSS and JS.

I would really appreciate if someone could look into this and tell me if it's possible to implement this function, it would be a game changer for the website I am trying to build. Tanks again :)