0.2.0 • Published 3 years ago

@rafaelquintanilha/gatsby-transformer-ipynb v0.2.0

Weekly downloads
46
License
MIT
Repository
github
Last release
3 years ago

gatsby-transformer-ipynb

Parses jupyter notebook files.

Install

npm install --save @gatsby-contrib/gatsby-transformer-ipynb

How to use

// In your gatsby-config.js
plugins: [`@gatsby-contrib/gatsby-transformer-ipynb`];

Parsing algorithm

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 component NotebookRender 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 with JSON.parse.
  • internal.content: contains the raw notebook code, it can be used to feed the react component NotebookPreview from @gatsby-contrib/notebook-preview.

How to query

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
          }
        }
      }
    }
  }
}
0.2.0

3 years ago

0.1.21

3 years ago

0.1.20

3 years ago

0.1.18

3 years ago

0.1.16

3 years ago

0.1.17

3 years ago

0.1.15

3 years ago

0.1.14

4 years ago

0.1.13

4 years ago

0.1.12

4 years ago

0.1.11

4 years ago

0.1.10

4 years ago

0.1.9

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago