Extract
sereto.extract
¶
extract_block_from_jinja(content, name)
¶
Extracts the full content of a Jinja block by name, including the tags.
Returns:
Type | Description |
---|---|
tuple[str, int, int]
|
The full block content, start index and end index. |
Source code in sereto/extract.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
|
extract_blocks(node_list)
¶
Extracts static text from a list of nodes inside a block.
Source code in sereto/extract.py
41 42 43 44 45 46 47 48 49 |
|
extract_text_from_jinja(ast)
¶
Extracts static text content from all blocks in a Jinja2 template.
Source code in sereto/extract.py
28 29 30 31 32 33 34 35 36 37 38 |
|