Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Codeblock improvements #739

Merged
merged 12 commits into from
Mar 22, 2023
Merged

Codeblock improvements #739

merged 12 commits into from
Mar 22, 2023

Conversation

robdy
Copy link
Owner

@robdy robdy commented Mar 10, 2023

Related with #732

TODO

  • Remove gatsby-remark-prismjs
  • Apply syntax highlighting in new CodeBlock
  • Check if it works after build
  • If not, perhaps use gatsby-browser.js

Notes

Using custom MDX element cause the items to be converted from AST to HTML elements. Therefore, gatsby-remark-prismjs doesn't pick them up.
gatsby-remark-prismjs transfer nodes to HTML elements, too.
Possible solutions: add prism to CodeBlock or use remark transformer plugin to manipulate HTML element. Or find a way for custom element to return the AST node

Perhaps check this code: https://github.com/zslabs/zslabs-v3

Solution with line wrap and numbering: https://stackoverflow.com/a/41354764/9902555

Helpful guide: https://dev.to/fidelve/the-definitive-guide-for-using-prismjs-in-gatsby-4708

@netlify
Copy link

netlify bot commented Mar 10, 2023

Deploy Preview for robdy-io ready!

Name Link
🔨 Latest commit f3d8757
🔍 Latest deploy log https://app.netlify.com/sites/robdy-io/deploys/641abac0b2521d00087d3173
😎 Deploy Preview https://deploy-preview-739--robdy-io.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@robdy robdy marked this pull request as draft March 10, 2023 12:48
@robdy robdy marked this pull request as ready for review March 22, 2023 08:10
@robdy robdy merged commit a15de57 into src Mar 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant