Macrosยง
Structsยง
Staticsยง
- 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.
Functionsยง
- blocks_
text_ ๐content - The text a block and everything nested inside it carries, one entry per block that has any.
- collect_
learning_ ๐objectives - contains_
blocks_ not_ allowed_ in_ top_ level_ pages - Checks if blocks contain any 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.
- 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, orNonewhen the page declares none. - 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 - 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