Add HTML and PDF conversation export
Top item on the roadmap ranking from 2026-07-27 — multi-modal export alongside the existing Markdown/JSON. New ConversationExportService consolidates the two previously-duplicated Markdown builders (ChatViewModel and ConversationListView had separate copies of the same **User**/**Assistant** + --- format) and adds: - A hand-rolled Markdown->HTML renderer scoped to what actually shows up in chat messages (headers, bold/italic, inline code, fenced code blocks, lists, blockquotes, links, horizontal rules) rather than full CommonMark/GFM — no existing markdown-to-HTML utility existed in the codebase, and swift-markdown-ui is SwiftUI-view-only with no HTML-string export API. Content is HTML-escaped before any markdown substitution so example code containing "<div>" etc renders as visible text, not live markup. - PDF via an offscreen WKWebView loading that same HTML and calling the official createPDF(configuration:) API (macOS 11+) — no new project/framework linkage needed, WebKit is a system framework. Wired into every place Markdown export already existed: File menu (Export as HTML.../PDF...), /export slash command (now md|html|pdf|json), and a new Export submenu (Markdown/HTML/PDF) on each conversation row's context menu in the advanced conversation list, replacing the old single-format swipe-only export. Help docs and InputBar autocomplete updated to match.
This commit is contained in:
@@ -260,8 +260,8 @@
|
||||
<dt>/delete <name></dt>
|
||||
<dd>Delete a saved conversation</dd>
|
||||
|
||||
<dt>/export md|json</dt>
|
||||
<dd>Export conversation as Markdown or JSON</dd>
|
||||
<dt>/export md|html|pdf|json</dt>
|
||||
<dd>Export conversation as Markdown, HTML, PDF, or JSON</dd>
|
||||
</dl>
|
||||
|
||||
<h3>MCP Commands</h3>
|
||||
@@ -567,10 +567,12 @@
|
||||
</ol>
|
||||
|
||||
<h3>Exporting Conversations</h3>
|
||||
<p>Export to Markdown or JSON format:</p>
|
||||
<p>Export to Markdown, HTML, PDF, or JSON format:</p>
|
||||
<code class="command">/export md</code>
|
||||
<code class="command">/export html</code>
|
||||
<code class="command">/export pdf</code>
|
||||
<code class="command">/export json</code>
|
||||
<p class="note">Files are saved to your Downloads folder.</p>
|
||||
<p class="note">Files are saved to your Downloads folder. HTML and PDF export are also available from File → Export as HTML…/PDF…, and per-conversation from the Export submenu in the conversation list's context menu.</p>
|
||||
</section>
|
||||
|
||||
<!-- Git Sync -->
|
||||
|
||||
Reference in New Issue
Block a user