Recursively outputting panes as JSON