 CreateNotebook - Maple Help

Jupyter

 CreateNotebook
 create a Jupyter notebook Calling Sequence CreateNotebook( nbfile, data,  opts ) Parameters

 nbfile - string data - expression or XML worksheet tree opts - (optional) options as specified below Options

 • base=one of bindir, datadir, homedir, mapledir, tempdir, toolboxdir, worksheetdir.
 The base option specifies a base directory. The parameter nbfile is interpreted as a relative path under this directory. For the meaning of worksheetdir see interface; for any other of these symbols, see kernelopts.
 • source = one of expression, help, or worksheet
 Specifies the source of data to use in populating the newly created notebook. If source=help, the input data is interpreted as a help query and and the resulting page will be translated. If source=worksheet, the input data is interpreted as a string corresponding to the filename of a worksheet. The default, source=expression, interprets data as an expression.
 • target = one of file or string
 Specifies whether the generated notebook should be written to a file or returned as a string. The default is file. Description

 • CreateNotebook(nbfile) creates a Jupyter notebook containing the data data.
 • If data is an parsed worksheet expression, the data is written to a Jupyter notebook using Worksheet:-WorksheetToJupyter. Otherwise, the input is taken to be an ordinary Maple expression and it is entered into the generated worksheet as-is. Examples

Create a notebook wrapping a single expression.

 > $\mathrm{with}\left(\mathrm{Jupyter}\right):$
 > $\mathrm{expr}≔2\mathrm{sin}\left(x+y\right)$
 ${\mathrm{expr}}{≔}{2}{}{\mathrm{sin}}{}\left({x}{+}{y}\right)$ (1)
 > $\mathrm{CreateNotebook}\left("expr.ipynb",\mathrm{expr},\mathrm{base}=\mathrm{homedir}\right)$

Create a notebook from a help page, in this case for the sine function.

 > $\mathrm{CreateNotebook}\left("SineHelp.ipynb","sin",\mathrm{source}=\mathrm{help},\mathrm{base}=\mathrm{homedir}\right)$

Create a notebook from a Maple worksheet.

 > $\mathrm{MatrixExample}≔\mathrm{FileTools}:-\mathrm{JoinPath}\left(\left["example","MatrixExample.mw"\right],\mathrm{base}=\mathrm{datadir}\right)$
 ${\mathrm{MatrixExample}}{≔}{"/maple/cbat/active/234548/data/example/MatrixExample.mw"}$ (2)
 > $\mathrm{CreateNotebook}\left("MatrixExample.ipynb",\mathrm{MatrixExample},\mathrm{source}=\mathrm{worksheet},\mathrm{base}=\mathrm{homedir}\right)$ Compatibility

 • The Jupyter[CreateNotebook] command was introduced in Maple 2022.