boilercv_dev.docs.patch_notebooks#

Patch notebooks.

Module Contents#

Functions#

patch_notebooks

Patch notebooks.

insert_tag

Insert tags to a notebook cell.

patch

Prepend source lines to cell source if not there already.

Data#

EXCLUDE_THEBE

Resourcse-intensive notebooks to exclude adding Thebe buttons to.

SRC

Cell source key.

CODE

Code cell type.

MD

Markdown cell type.

API#

boilercv_dev.docs.patch_notebooks.EXCLUDE_THEBE#

[‘find_tracks’, ‘find_tracks_trackpy’]

Resourcse-intensive notebooks to exclude adding Thebe buttons to.

boilercv_dev.docs.patch_notebooks.SRC#

‘source’

Cell source key.

boilercv_dev.docs.patch_notebooks.CODE#

‘code’

Code cell type.

boilercv_dev.docs.patch_notebooks.MD#

‘markdown’

Markdown cell type.

boilercv_dev.docs.patch_notebooks.patch_notebooks()#

Patch notebooks.

Patch Thebe buttons in. Insert parameters and thebe-init tags to the first code cell. Insert hide-input tags to code cells.

boilercv_dev.docs.patch_notebooks.insert_tag(
cell: nbformat.NotebookNode,
tags_to_insert: list[str],
) nbformat.NotebookNode#

Insert tags to a notebook cell.

Parameters#

  • cell: Notebook cell to insert tags to.

  • tags_to_insert: Tags to insert.

References#

boilercv_dev.docs.patch_notebooks.patch(
src: str,
content: str,
end: str = '\n\n',
) str#

Prepend source lines to cell source if not there already.

Parameters#

  • src: Source to prepend to.

  • content: Content to prepend.

  • end: Ending to append to the content.