Export
Jurassic exports code cells tagged with //| export
comment into corresponding ts
modules. Code cells with Deno tests are grouped into test module (This is likely to change in the future when this gets fixed).
Let's use a few examples to illustrate how exports work assuming we are looking at the cells within foo.ipynb
//| export
export const bar = () => "hey";
converts to foo.ts
with
export const bar = () => "hey";
If you need to share code between different cells, make sure to use //| export
in both:
//| export
const foo = () => "foo";
//| export
export const bar = () => foo();
Notice how both cells are tagges with //| export
to make sure both pieces of code make it to the final foo.ts
module.
Keep in mind, //| export
tag does not automatically export actual ts function/class/type, it merely moves it to the target ts module. You are responsible for managing visibility of the code using export
TS keyword.
exportNb
const exportNb = (notebookPath: string | undefined, config: Config | undefined) => Promise<void>