Parses jupyter notebook files.
npm install --save @gatsby-contrib/gatsby-transformer-ipynb
// In your gatsby-config.js
plugins: [`@gatsby-contrib/gatsby-transformer-ipynb`];
It recognizes files with the ipynb
extension.
Each notebook file is parsed into a node of type JupyterNotebook
.
This plugin adds additional fields to the JupyterNotebook
GraphQL type
including:
html
: html string created using the react componentNotebookRender
from@gatsby-contrib/notebook-render
.metadata
: jupyter notebooks can embed metadata to indicate authors, titles...json
: the json notebook code converted into a javascript object withJSON.parse
.internal.content
: contains the raw notebook code, it can be used to feed the react componentNotebookPreview
from@gatsby-contrib/notebook-preview
.
A sample GraphQL query to get JupyterNotebook nodes:
{
query
JupyterQuery {
allJupyterNotebook {
edges {
node {
id
metadata {
kernelspec {
name
language
display_name
}
}
html
json {
nbformat
nbformat_minor
cells {
cell_type
execution_count
}
}
internal {
content
}
}
}
}
}
}