Skip to content
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

[Documentation] Enhance Code Snippet Presentation by Adding Syntax Highlighting and Fix Duplicate Copy Buttons #1104

Open
tonyz0x0 opened this issue Feb 4, 2025 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@tonyz0x0
Copy link

tonyz0x0 commented Feb 4, 2025

Issue Description

There are two UI issues with code snippets in the AWS Neuron documentation(Example) that could be improved for better readability and user experience:

1. Missing Syntax Highlighting

  • Code snippets currently display as plain text without syntax highlighting
  • Python code (and potentially other languages) lacks color coding for keywords, strings, comments, etc.
  • This makes code more difficult to read and understand, especially for longer snippets

2. Duplicate/Problematic Copy Buttons

Current behavior:

  • There are two "Copy" buttons for each code block:
    • One in the top-right corner (standard position)
    • Another that appears on hover in the top-left corner
  • The dual copy buttons are redundant and potentially confusing
  • The hover-triggered left copy button appears to be a UI bug or unintended implementation

Expected Behavior

  1. Syntax Highlighting:

    • Code snippets should have proper syntax highlighting based on the language
    • Python keywords, strings, comments, and other syntax elements should be color-coded
    • This matches industry standard documentation practices and improves readability
  2. Copy Button:

    • A single copy button should be present in the top-right corner of code blocks
    • Remove the hover-triggered copy button from the top-left corner
    • Maintain consistent positioning across all code snippets

Image

@aws-charansg aws-charansg added the documentation Improvements or additions to documentation label Feb 4, 2025
@aws-satyajith
Copy link

Thank you for your documentation format change suggestion and pointing out the duplicate copy button issue. We’ll add your suggestions to the list for future changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants