Skip to content

feat(export): add HTML output format for session export#302

Open
jongio wants to merge 1 commit into
mainfrom
idea/export-html
Open

feat(export): add HTML output format for session export#302
jongio wants to merge 1 commit into
mainfrom
idea/export-html

Conversation

@jongio

@jongio jongio commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Adds an HTML output format to dispatch export so a session can be saved as a web page you can open directly in a browser.

What changed

  • New --format html option for dispatch export (md and json still work as before).
  • RenderHTML in internal/data mirrors the Markdown renderer: title, metadata table, conversation turns, checkpoints, files touched, and references.
  • The stylesheet is inlined in a <style> block, so the export is a single self-contained file with no external requests or sidecar assets.
  • All session and conversation text is escaped with html.EscapeString, so stored content cannot inject markup. Message bodies use white-space: pre-wrap to keep their original line breaks without a Markdown renderer.
  • README documents the new format.

Tests

  • Unit tests for RenderHTML: full detail, minimal detail, nil, dedup of files/refs, and escaping of <script>/<b>/&.
  • Command tests: --format html to stdout, escaping end to end, .html file extension via --out, and a parse case for --format html.
  • Full suite green: go build, go vet, go test ./..., golangci-lint (0 issues), and deadcode all pass.

Closes #297

Add `--format html` to `dispatch export`, alongside the existing md and
json formats. It writes a single self-contained HTML document with the
stylesheet inlined, so the file opens in any browser with no external
requests or accompanying assets.

RenderHTML mirrors the RenderMarkdown structure (metadata table,
conversation, checkpoints, files, references) and escapes every piece of
session and conversation text with html.EscapeString so stored content
cannot inject markup. Message bodies use white-space: pre-wrap to keep
their original formatting without a markdown renderer.

Closes #297

Co-authored-by: Copilot App <[email protected]>
@jongio jongio added the idea Feature idea from the idea pipeline label Jul 12, 2026
@jongio jongio self-assigned this Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

idea Feature idea from the idea pipeline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add HTML output to dispatch export

1 participant