boilercore_docs.patch_nbs#

Patch notebooks.

Module Contents#

Functions#

main

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

Notebooks to exclude Thebe buttons from.

SRC

Cell source key.

CODE

Code cell type.

MD

Markdown cell type.

API#

boilercore_docs.patch_nbs.EXCLUDE_THEBE#

None

Notebooks to exclude Thebe buttons from.

boilercore_docs.patch_nbs.SRC#

‘source’

Cell source key.

boilercore_docs.patch_nbs.CODE#

‘code’

Code cell type.

boilercore_docs.patch_nbs.MD#

‘markdown’

Markdown cell type.

boilercore_docs.patch_nbs.main()#
boilercore_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.

boilercore_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#

boilercore_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.