Skip to content

Implement Markdown Compiler for User and Bot Chat Bubbles #6

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

Open
rifkybujana opened this issue Oct 22, 2024 · 2 comments
Open

Implement Markdown Compiler for User and Bot Chat Bubbles #6

rifkybujana opened this issue Oct 22, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@rifkybujana
Copy link
Collaborator

Implement Markdown Compiler for User and Bot Chat Bubbles

Description:
We need to implement a Markdown compiler to handle basic formatting (bold, italics, code blocks, etc.) for the user and bot chat bubbles. The goal is to allow messages in the chat bubbles to support Markdown syntax and render the formatted text appropriately.

Tasks:

  1. Research and choose a lightweight Markdown parsing library compatible with C++.
    • Ensure the library integrates well with ImGui and the existing project.
    • The library should support basic Markdown features (bold, italics, code, links).
  2. Integrate the chosen Markdown compiler with the chat system.
    • Ensure user and bot messages are passed through the Markdown compiler.
    • Render the output with the correct formatting in the chat bubbles (e.g., bold text, italic text, code blocks).
  3. Update chat bubble rendering logic to handle Markdown-specific elements.
    • Modify the existing ImGui-based chat bubble to display formatted text.
    • Ensure correct spacing, text wrapping, and alignment of formatted content.
  4. Add unit tests to verify that Markdown is correctly rendered in various scenarios:
    • Test bold, italic, and code block rendering.
    • Ensure multiline messages with Markdown are handled correctly.
  5. Update documentation:
    • Add instructions for using Markdown syntax in chat messages.
    • Describe which Markdown features are supported and any limitations.
  6. Perform testing on all platforms (Linux, macOS, Windows) to ensure consistent Markdown rendering in chat bubbles.

Acceptance Criteria:

  • User and bot messages can include Markdown, and the chat bubbles will render the text with proper formatting.
  • The implementation should not affect performance or cause any visual glitches in the chat interface.
  • The chat bubbles should support text wrapping and multiline Markdown content.
  • The documentation is updated with Markdown usage instructions.

Additional Context:

  • The project currently uses ImGui for chat rendering. The Markdown compiler should work seamlessly with ImGui text rendering without requiring major changes to the layout.
  • Some Markdown elements (e.g., images, tables) might not be needed at this time and can be excluded.
@rifkybujana rifkybujana added the enhancement New feature or request label Oct 22, 2024
@rifkybujana rifkybujana self-assigned this Oct 23, 2024
@rifkybujana
Copy link
Collaborator Author

reference:
imgui_markdown

problem:

  • Issue with the chat bubble dynamic height handling. Require to make a custom function to calculate the number of lines of the input text to approximate height.

@rifkybujana
Copy link
Collaborator Author

focusing on 7 components for now:

  • Header (dealing #, ##, ###, and ####) as the same (bold + some fixed size font)
  • normal text
  • inline code
  • bold
  • italic
  • code
  • table

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

When branches are created from issues, their pull requests are automatically linked.

1 participant