parse_scene_document#
Import |
|
Defined in |
|
Install |
|
Since |
0.10 |
Stability |
Public: follows semantic versioning. Below 1.0, a minor release may change it, and the CHANGELOG says how. |
- scenet.frontends.yaml_front.parse_scene_document(text, *, source=None)[source]#
Parse a scene and the pages it is laid out on.
page:andpages:are not panel defaults, unlike every other key besidepanels:, so they are taken out before the defaults are applied.- Parameters:
- Return type:
- Returns:
The panels and the layout.
- Raises:
PanelSyntaxError – A panel or the layout is malformed. A placement naming a panel that does not exist, or one placed twice, is rule
page-layout.CompositionError – An
over:chain is unresolvable or cyclic.
Note
Composition is resolved and pages validated against the panels, but nothing is laid out.
Example
>>> from scenet import parse_scene_document >>> document = parse_scene_document( ... "cast: {a: {reference: alice}}\n" ... "panels: {one: {}}\n" ... "pages: [{tiers: [{panels: [one]}]}]" ... ) >>> list(document.panels), len(document.layout.pages) (['one'], 1)
See also
compile_book, to compile it.