Source: factory.core/ObjDocumentCode.py
Delegate for generating syntax-highlighted code icons.
Renders the first lines of a source file as a pygments-highlighted
image using the monokai theme. Supported languages: HTML, JS, CSS,
SCSS, PY, TS, JSON, XML, YAML, SQL, MD, TXT, LOG.
| Method | Signature | Description |
|---|---|---|
| load_code | load_code(file_path: str, max_lines: int = 25) -> str |
Read the first N lines of a code file. |
| generate_preview | generate_preview(code: str, language: str, output_path: str) -> bool |
Render syntax-highlighted code as an image |