-
Notifications
You must be signed in to change notification settings - Fork 36
v0.16.5 - Markdown and Code Rendering #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Introduced Prism.js library for enhanced syntax highlighting of code blocks. - Added specific language support for Python and JavaScript. - Included CSS styles for code highlighting. - Updated HTML template to link Prism.js and its CSS. - Adjusted styles for code blocks and text elements for better readability. - Implemented syntax highlighting on dynamically generated code blocks in the AI response.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request introduces comprehensive enhancements to the chatbot application with a focus on markdown rendering, code syntax highlighting, image editing capabilities, and improved static asset management for air-gapped deployments.
Key Changes
Markdown & Code Rendering
- Integrated marked.js for full GitHub-flavored markdown support with streaming rendering
- Added Prism.js syntax highlighting for Python, JavaScript, and HTML
- Implemented raw/rendered toggle and language-aware code copy buttons
Image Editing
- Added support for image+prompt (img2img) workflows in SwarmUI
- New
/image editcommand with configurable noise/strength parameter - Enhanced backend to pass init images and masks as data URLs
Static Assets & Infrastructure
- All frontend libraries now served locally from
/static/directory - Consolidated static file serving with MIME type detection
- Added custom SVG favicon and third-party license documentation
Reviewed Changes
Copilot reviewed 9 out of 16 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| chatbot/app/templates/index.html | Markdown rendering, code highlighting, toggle functionality, and streaming improvements |
| chatbot/app/static/socket.io.js | Local Socket.IO client library (v4.0.1) for air-gapped support |
| chatbot/app/static/prism*.js/css | Prism.js syntax highlighting library and language modules |
| chatbot/app/static/favicon.svg | Custom SVG favicon for browser tab display |
| chatbot/app/image/swarmui_generator.py | Image editing support with init/mask image handling |
| chatbot/app/core/config.py | Version bump to v0.16.5 and IMAGE_EDIT_NOISE configuration |
| chatbot/app/api/routes.py | Static file serving, favicon route, and image edit command implementation |
| chatbot/THIRD-PARTY-LICENSES.md | Comprehensive third-party license attribution |
| chatbot/RELEASE.md, RELEASE.md, README.md | Documentation updates for new features |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This pull request introduces significant enhancements to the chatbot's image editing capabilities, markdown rendering in the chat UI, static asset management, and third-party license documentation. The main updates include support for image editing workflows, comprehensive markdown and code block rendering with syntax highlighting, local serving of all static assets for air-gapped deployments, and improved third-party license attribution.
Image Editing and Generation Improvements
initimageandmaskimageas data-URLs. Introduced a new/image edit {prompt}command for explicit image editing, requiring an uploaded image and using a configurable noise/strength parameter (IMAGE_EDIT_NOISE). The backend now passes image data and edit parameters to generators and exposesIMAGE_EDIT_NOISEin the status page. [1] [2] [3] [4]Markdown and Code Rendering Enhancements
marked.jsfor full GitHub-flavored markdown rendering in chat responses, including support for headers, tables, lists, code blocks, and more. Added real-time streaming markdown rendering with debounced updates, language-aware code block copy buttons, a raw/rendered toggle, and optimized styling for tables and lists. Added syntax highlighting for code blocks using Prism.js with support for Python, JavaScript, and HTML. [1] [2]Static Asset and UI Improvements
marked.js,Prism.js,Socket.IO) are now served locally from the/static/directory to enable air-gapped deployments. Introduced a consolidated static file serving route with MIME type detection, and added a custom SVG favicon. [1] [2] [3]Documentation and Licensing
THIRD-PARTY-LICENSES.mdfile listing all third-party frontend and backend libraries with their licenses and usage. Updated the chatbot README with a credits section and references to license details. [1] [2] [3]General Updates
v0.16.5and updated release notes to document all new features and improvements. [1] [2] [3]References:
[1] [2] [3] [4] [5] [6] [7] [8] [9]