""" Custom web interface for Wildfire Environment. This module provides a wildfire-specific web interface with visual grid display and wildfire-specific features, without modifying the base web_interface.py. """ from typing import Optional import json from openenv.core.env_server.types import EnvironmentMetadata from ..models import WildfireAction def get_wildfire_web_interface_html(metadata: Optional[EnvironmentMetadata] = None) -> str: """Generate custom HTML for the wildfire environment web interface.""" # Prepare README markdown and a simple HTML fallback instructions_html = "" instructions_json = "null" if metadata and metadata.readme_content: # Fallback lightweight conversion (in case JS markdown library fails) instructions_html = _markdown_to_html_simple(metadata.readme_content) # Primary: pass raw markdown to the client for proper rendering via marked.js instructions_json = json.dumps(metadata.readme_content) return f"""
Click on a cell to set coordinates for water/break actions
\2', html_content, flags=re.DOTALL)
html_content = re.sub(r'`([^`]+)`', r'\1', html_content)
# Convert bold and italic
html_content = re.sub(r'\*\*(.*?)\*\*', r'\1', html_content)
html_content = re.sub(r'\*(.*?)\*', r'\1', html_content)
# Convert lists
html_content = re.sub(r'^- (.*?)$', r'