neo4j-contrib / graphgist-portal-v3

GraphGist Portal v3 (JavaScript)
Apache License 2.0
5 stars 4 forks source link

Generate Jupyter Notebooks #29

Open ggrossetie opened 3 years ago

ggrossetie commented 3 years ago

If we want to generate a Jupyter Notebook from an AsciiDoc file on https://portal.graphgist.org we can use https://github.com/neo4j-documentation/asciidoctor-jupyter

In addition, we can use a Tree Processor extension to automatically generate icypher setup instructions: https://github.com/neo4j-documentation/developer-site-generator/blob/graphgists/lib/graphgists/icypher-instruction-extension.js

Sample code:

const asciidoctor = require('asciidoctor.js')()
const JupyterConverter = require('asciidoctor-jupyter')
const icypherInstructionExtension = require('./icypher-instruction-extension')

const registry = asciidoctor.Extensions.create()
icypherInstructionExtension.register(registry)

const input = '...'
asciidoctor.convert(input, { backend: 'jupyter', extension_registry: registry })