![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@dwelle/gatsby-embedder-excalidraw
Advanced tools
Custom transformer to embed Excalidraw diagrams
This custom transformer for gatsby-remark-embedder
allows you to embed Excalidraw diagrams in Markdown content simply by pasting an Excalidraw link in the source.
The code for this library is lifted from this directory in the excalidraw-blog
Gatsby site. All credit for this transformer goes to those authors. I was inspired to do this when I saw Alex Luong's tweet about making this functionality into a gatsby-remark-excalidraw
plugin.
npm install gatsby-embedder-excalidraw
// gatsby-config.js
module.exports = {
plugins: [
{
resolve: 'gatsby-transformer-remark',
options: {
plugins: [
{
resolve: 'gatsby-remark-embedder',
options: {
customTransformers: [require('gatsby-embedder-excalidraw')]
}
}
]
}
}
]
};
This guide will show you how to get up and running with gatsby-embedder-excalidraw
in the fewest steps possible. It uses gatsby-plugin-mdx
to take advantage of its awesome default behaviour of automatically creating pages based on MDX files in src/pages
.
First, install gatsby
and its dependencies:
npm install gatsby react react-dom
Next, install gatsby-plugin-mdx
and its dependencies:
npm install gatsby-plugin-mdx @mdx-js/mdx @mdx-js/react
Add gatsby-plugin-mdx
to your Gatsby config:
// gatsby-config.js
module.exports = {
plugins: [
{
resolve: 'gatsby-plugin-mdx'
}
]
};
Install the gatsby-remark-embedder
plugin and this Excalidraw transformer gatsby-embedder-excalidraw
:
npm install gatsby-remark-embedder gatsby-embedder-excalidraw
Add gatsby-remark-embedder
as a Gatsby remark plugin for gatsby-plugin-mdx
. In your gatsby-remark-embedder
options, add gatsby-embedder-excalidraw
as a custom transformer:
// gatsby-config.js
module.exports = {
plugins: [
{
- resolve: 'gatsby-plugin-mdx'
+ resolve: 'gatsby-plugin-mdx',
+ options: {
+ gatsbyRemarkPlugins: [
+ {
+ resolve: 'gatsby-remark-embedder',
+ options: {
+ customTransformers: [require('gatsby-embedder-excalidraw')]
+ }
+ }
+ ]
+ }
}
]
};
Head over to Excalidraw and draw something! Once you're satisfied, you can find a shareable link to your drawing in the export dialog, accesible from the icon in the top left corner of the page.
Create an MDX page at src/pages/index.mdx
and add a link to an Excalidraw diagram:
# Fox grab flowchart
Fox's followups after a grab depend on your opponent's DI:
https://excalidraw.com/#json=5695519967936512,sLhjTgn1_wB1iVLLquX6Fg
Voila! 🎉 https://excalidraw-embed.trevorblades.com
FAQs
Custom transformer to embed Excalidraw diagrams
We found that @dwelle/gatsby-embedder-excalidraw demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.