Parses HTML content to extract and process Shinylive code blocks for both R and Python
applications. This function identifies code blocks with class 'shinylive-r'
or
'shinylive-python'
and processes their content into structured application data.
Value
A list of parsed Shinylive applications. Each list element contains:
engine
: Character string indicating the application type ("r"
or"python"
)options
: List of parsed YAML-style options from the code blockfiles
: 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
Details
The function performs the following steps:
Parses the HTML content using
rvest
Extracts code blocks with classes
'shinylive-r'
or'shinylive-python'
For each code block:
Determines the engine type from the 'data-engine' attribute
Extracts the code text content
Parses the code block structure using
parse_code_block()
Code blocks should follow the Shinylive format with optional YAML-style
options (prefixed with '#|'
) and file markers (prefixed with '## file:'
).