analyse_python.analyse_block_content

convert.analyse_python.analyse_block_content(
    src_bytes,
    content_node,
    closing_row,
)

Analyse the lines inside a fenced code block.

This scans the content of a fenced Python block, identifying regions with chunk options and cell magic, and the actual code region.

Parameters

Name Type Description Default
src_bytes bytes UTF-8 encoded document source. required
content_node Node or None The code_fence_content node for the block, or None if the block has no content. required
closing_row int Row index of the closing fence delimiter. required

Returns

Name Type Description
dict A dictionary with keys metadata such as the first code row, per-row option indices, and chunk-level flags.