Parses the content of a Shinylive code block, extracting YAML-style options, file definitions, and content. Handles both single-file and multi-file applications for R and Python.
Value
A list with three components:
engine: Character string indicating the application type ("r"or"python")options: List of parsed YAML-style options from block headersfiles: Named list of file definitions, where each file contains:name: Character string of the file namecontent: Character string of the file contenttype: Character string indicating the file type (defaults to `"text"“)
Code Block Structure
The code block can contain several types of lines:
YAML-style options: Lines starting with `'#|'“
File markers: Lines starting with
'## file:'Type markers: Lines starting with
'## type:'Content: All other non-empty lines
For single-file applications with no explicit file marker, the content is automatically placed in:
"app.R"for R applications"app.py"for Python applications
See also
parse_yaml_options()for YAML-style option parsingfind_shinylive_code()for extracting code blocks from HTML