Spaces:
Configuration error
Configuration error
| def explain_code(code): | |
| """Provide a simple explanation of the generated code""" | |
| explanation = [] | |
| if "<!DOCTYPE html>" in code: | |
| explanation.append("This is a complete HTML5 document.") | |
| if "<style>" in code or "style=" in code: | |
| explanation.append("The page includes CSS styling.") | |
| if "<script>" in code or "onclick=" in code: | |
| explanation.append("JavaScript functionality is included.") | |
| if "nav" in code or "navbar" in code: | |
| explanation.append("Contains a navigation bar.") | |
| if "dark mode" in code.lower(): | |
| explanation.append("Includes dark/light mode toggle functionality.") | |
| if not explanation: | |
| return "The generated code appears to be a basic HTML page." | |
| return "The website includes:\n- " + "\n- ".join(explanation) |