Skip to main content

Module document_schema_processor

Module document_schema_processor 

Source

MacrosΒ§

attributes

StructsΒ§

GutenbergBlock

ConstantsΒ§

COURSE_OBJECTIVE_PLACEHOLDERS
The heading and description of each objective in GutenbergBlock::course_objective_section, placeholder text for the teacher to replace.
DISALLOWED_BLOCKS_IN_TOP_LEVEL_PAGES πŸ”’
Blocks that are not allowed in top-level pages (pages without chapter_id). Note: This is NOT for chapter front pages. Chapter front pages can contain these blocks.
EXERCISE_BLOCK
The name of the block that embeds an exercise; its id attribute is the exercise id.

FunctionsΒ§

all_client_ids
The clientId of every block in the tree, in walk order.
blocks_not_allowed_in_top_level_pages
The blocks, at any depth, that aren’t allowed in top-level pages (pages without chapter_id). Note: This is NOT for chapter front pages. Chapter front pages can contain these blocks.
blocks_text_content πŸ”’
The text a block and everything nested inside it carries, one entry per block that has any.
centred_text_style πŸ”’
The style attribute Gutenberg stores for centred text in blocks with the text-align support.
collect_heading_anchors πŸ”’
collect_learning_objectives πŸ”’
contains_blocks_not_allowed_in_top_level_pages
Checks if blocks, at any depth, contain any that are not allowed in top-level pages (pages without chapter_id). See blocks_not_allowed_in_top_level_pages.
filter_lock_chapter_blocks
Filters lock-chapter blocks’ inner blocks based on whether the chapter is locked. If the chapter is not locked, inner blocks are removed to prevent unauthorized access. This function recursively processes all blocks to handle nested structures.
get_learning_objectives
The learning objectives declared anywhere in blocks, one per line, or None when the page declares none.
heading_anchor πŸ”’
remap_ids_in_content
remove_sensitive_attributes
Removes the private spec from exercise tasks.
replace_duplicate_client_ids
Replaces duplicate client IDs with new unique IDs in Gutenberg blocks.
replace_duplicate_client_ids_inner πŸ”’
suffix_duplicate_heading_anchors
Gives repeated heading anchors a -2, -3, … suffix so that every heading on the page renders a unique id. Duplicating a heading block copies its anchor, which is the usual way repeats end up on a page.
suffix_duplicate_heading_anchors_inner πŸ”’
validate_unique_client_ids
Validates that all client IDs in the Gutenberg blocks are unique. Returns an error if duplicate client IDs are found.
validate_unique_client_ids_inner πŸ”’
walk
Depth-first, pre-order visit of every block with its index path ([2, 0] is the first child of the third top-level block).
walk_mut
Depth-first, pre-order visit of every block.