dev.docs.patch_nbs#

Patch notebooks.

Module Contents#

Functions#

patch_nbs

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#

dev.docs.patch_nbs.EXCLUDE_THEBE#

[‘find_tracks’, ‘find_tracks_trackpy’]

Resourcse-intensive notebooks to exclude adding Thebe buttons to.

dev.docs.patch_nbs.SRC#

‘source’

Cell source key.

dev.docs.patch_nbs.CODE#

‘code’

Code cell type.

dev.docs.patch_nbs.MD#

‘markdown’

Markdown cell type.

dev.docs.patch_nbs.patch_nbs()#

Patch notebooks.

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

dev.docs.patch_nbs.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#

dev.docs.patch_nbs.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.