NotionX / NotionX/react-notion-x

Adding the option to show latex code when clicking equation blocks

Open
#552 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
5.4k
Forks
645
PR merge metrics
No merged PRs in 30d

Description

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 :)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with packages/react-notion-x/src/styles.css and compare the CodePen example linked in the issue. Trace how equation blocks are rendered to determine where the click interaction belongs; the work is done when clicking an equation displays its LaTeX code as described, with the behavior verified in the relevant UI.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, javascript, react
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.