{"record":{"id":"bb9555604ae8f826","repo":"iOfficeAI/OfficeCLI","slug":"unsupported-type-bb9555","errorCode":"unsupported_type","errorMessage":"HTML preview is only supported for .pptx, .xlsx, and .docx files.","messagePattern":"HTML preview is only supported for \\.pptx, \\.xlsx, and \\.docx files\\.","errorType":"exception","errorClass":"CliException","httpStatus":null,"severity":"error","filePath":"src/officecli/CommandBuilder.View.cs","lineNumber":199,"sourceCode":"                        if (browser)\n                        {\n                            try\n                            {\n                                var psi = new System.Diagnostics.ProcessStartInfo(htmlPath) { UseShellExecute = true };\n                                System.Diagnostics.Process.Start(psi);\n                            }\n                            catch { /* silently ignore if browser can't be opened */ }\n                        }\n                    }\n                    else\n                    {\n                        // Default: output HTML to stdout\n                        Console.Write(html);\n                    }\n                }\n                else\n                {\n                    throw new OfficeCli.Core.CliException(\"HTML preview is only supported for .pptx, .xlsx, and .docx files.\")\n                    {\n                        Code = \"unsupported_type\",\n                        Suggestion = \"Use a .pptx, .xlsx, or .docx file, or use mode 'text' or 'annotated' for other formats.\",\n                        ValidValues = [\"text\", \"annotated\", \"outline\", \"stats\", \"issues\"]\n                    };\n                }\n                return 0;\n            }\n\n            if (mode.ToLowerInvariant() is \"screenshot\" or \"p\")\n            {\n                // Screenshot mode: render the same HTML preview as `view html`, then\n                // headless-screenshot the temp HTML to a PNG. Mirrors svg's pattern of\n                // a dedicated mode that produces a file + prints the path.\n                // --grid N tiles slides into an N-column thumbnail grid (pptx only).\n                //\n                // CONSISTENCY(screenshot-default-first-page): screenshot mode defaults\n                // to a single bounded visual unit (pptx → slide 1, docx → page 1, xlsx","sourceCodeStart":181,"sourceCodeEnd":217,"githubUrl":"https://github.com/iOfficeAI/OfficeCLI/blob/1ced45e900782c5083ed550ddf328ee974e425e7/src/officecli/CommandBuilder.View.cs#L181-L217","documentation":"HTML preview mode renders a document to HTML. It only works when the document's handler can produce HTML — PptxHandler, ExcelHandler, WordHandler, or a FormatHandlerProxy. This fires when the handler returned null HTML, i.e. the file format has no HTML renderer.","triggerScenarios":"'officecli view <unsupported-format> html' where the format's handler cannot emit HTML (e.g. an exotic/foreign format loaded via a non-html-capable handler).","commonSituations":"Pointing 'view html' at a format officecli can read but not render to HTML; assuming html works for every supported format.","solutions":["Use a .pptx, .xlsx, or .docx file for html preview.","For other formats, use mode text, annotated, outline, stats, or issues."],"exampleFix":"// before\nofficecli view data.csv html\n// after\nofficecli view data.docx html\n# or for non-renderable formats:\nofficecli view data.csv text","handlingStrategy":"validation","validationCode":"static readonly HashSet<string> HtmlCapable = new() { \".pptx\", \".xlsx\", \".docx\" };\nif (mode == \"html\" && !HtmlCapable.Contains(Path.GetExtension(file).ToLowerInvariant()))\n    throw new ArgumentException(\"html preview needs .pptx/.xlsx/.docx; use 'text' otherwise.\");","typeGuard":"static bool SupportsHtmlPreview(string f) =>\n    Path.GetExtension(f).ToLowerInvariant() is \".pptx\" or \".xlsx\" or \".docx\";","tryCatchPattern":null,"preventionTips":["html preview is limited to pptx/xlsx/docx (and html-capable plugin proxies).","For other formats, switch the view mode to text/annotated/outline.","Check the extension before choosing mode html."],"tags":["view","html","unsupported-type","preview"],"backgroundTag":null,"analyzedSha":"1ced45e900782c5083ed550ddf328ee974e425e7","analyzedAt":"2026-08-13T13:01:07.193Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}