Skip to content

Commit

Permalink
Add quarto_setup_cell
Browse files Browse the repository at this point in the history
  • Loading branch information
hugetim committed Oct 15, 2024
1 parent a346469 commit 9500899
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion nbs/15_install.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,12 @@
" with open(os.path.join(td, 'kernel.json'), 'w') as f:\n",
" json.dump(kernel_json, f, sort_keys=True)\n",
"\n",
" # Copy logo to tempdir to be installed with kernelspec\n",
" # Copy logo and quarto_startup_cell to tempdir to be installed with kernelspec\n",
" logo_path = resources.files('nbstata').joinpath('logo-64x64.png')\n",
" copyfile(logo_path, os.path.join(td, 'logo-64x64.png'))\n",
" \n",
" qsc_path = resources.files('nbstata').joinpath('quarto_setup_cell')\n",
" copyfile(qsc_path, os.path.join(td, 'quarto_setup_cell'))\n",
"\n",
" print('Installing Jupyter kernel spec')\n",
" KernelSpecManager().install_kernel_spec(td, 'nbstata', user=user, prefix=prefix)"
Expand Down
5 changes: 4 additions & 1 deletion nbstata/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@ def install_kernel_spec(user=True, prefix=None):
with open(os.path.join(td, 'kernel.json'), 'w') as f:
json.dump(kernel_json, f, sort_keys=True)

# Copy logo to tempdir to be installed with kernelspec
# Copy logo and quarto_startup_cell to tempdir to be installed with kernelspec
logo_path = resources.files('nbstata').joinpath('logo-64x64.png')
copyfile(logo_path, os.path.join(td, 'logo-64x64.png'))

qsc_path = resources.files('nbstata').joinpath('quarto_setup_cell')
copyfile(qsc_path, os.path.join(td, 'quarto_setup_cell'))

print('Installing Jupyter kernel spec')
KernelSpecManager().install_kernel_spec(td, 'nbstata', user=user, prefix=prefix)
Expand Down

0 comments on commit 9500899

Please sign in to comment.