Skip to content

Add export chat as Markdown feature#370

Open
erkin98 wants to merge 1 commit intojupyterlab:mainfrom
erkin98:feat/export-chat-button
Open

Add export chat as Markdown feature#370
erkin98 wants to merge 1 commit intojupyterlab:mainfrom
erkin98:feat/export-chat-button

Conversation

@erkin98
Copy link
Contributor

@erkin98 erkin98 commented Feb 24, 2026

Summary

  • Adds a download button to the chat section toolbar that exports the conversation as a .md file
  • Adds an exportChat command accessible from the command palette
  • Introduces downloadChatAsMarkdown and formatChatAsMarkdown utility functions in @jupyter/chat

The exported Markdown includes sender names, timestamps, and preserves message formatting. The file downloads directly to the user's machine via a temporary anchor element.

Changes

Package File Change
@jupyter/chat src/utils.ts New formatChatAsMarkdown and downloadChatAsMarkdown functions
@jupyter/chat src/index.ts Re-export downloadChatAsMarkdown
@jupyter/chat src/widgets/multichat-panel.tsx Export button in ChatSection toolbar
jupyterlab-chat src/token.ts exportChat command ID
jupyterlab-chat-extension src/index.ts Command registration + palette entry

Test plan

  • Open a chat with several messages, click the download icon — verify .md file downloads
  • Open command palette, run "Export chat as Markdown" — same behavior
  • Verify exported Markdown has correct sender names and timestamps
  • Verify the command is disabled when no chat widget is focused

Closes #145

@github-actions
Copy link
Contributor

Binder 👈 Launch a Binder on branch erkin98/jupyter-chat/feat%2Fexport-chat-button

@brichet brichet added the enhancement New feature or request label Mar 12, 2026
@brichet
Copy link
Collaborator

brichet commented Mar 12, 2026

Thanks @erkin98 for working on this, it looks great.

Looks like it picked up some conflicts with main.

Also, the related issue should probably be #145 instead.

Adds a download button to the chat section toolbar and a command palette
entry that exports the current chat conversation as a Markdown file.

The export formats messages with sender names, timestamps, and proper
Markdown structure. The file is downloaded directly to the user's machine.

Changes:
- Add `downloadChatAsMarkdown` and `formatChatAsMarkdown` utilities
- Add export button to `ChatSection` toolbar (download icon)
- Add `exportChat` command to the command palette
- Export `downloadChatAsMarkdown` from `@jupyter/chat` public API

Closes jupyterlab#328
@erkin98 erkin98 force-pushed the feat/export-chat-button branch from afd50fe to 5b47122 Compare March 12, 2026 14:23
@erkin98
Copy link
Contributor Author

erkin98 commented Mar 12, 2026

Rebased on main, conflicts are resolved. Fixed the linked issue to #145 too, good catch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add functionality to export chats

2 participants