jupyter-ai icon indicating copy to clipboard operation
jupyter-ai copied to clipboard

Simplify markdown table generation in magic command - %ai list

Open keerthi-swarna opened this issue 9 months ago • 2 comments
trafficstars

Issue Reference: Issue-118

Description

Refactored the code responsible for generating markdown tables by replacing custom imperative logic with the py-markdown-table library.

  • Closes #118.

Changes

  • Updated the _ai_list_command_markdown method in magics.py to generate markdown tables using the py-markdown-table library.
  • Modified the _ai_env_status_for_provider_markdown method to return the env_variable alongside its status in emoji form, replacing the previous approach where the emoji was appended to the env_variable string.
  • Added the py-markdown-table library as a dependency in pyproject.toml.
  • Updated the help text in the aws.py file to address an issue where markdown was not rendering correctly within a markdown table cell. To resolve this, markdown syntax was replaced with HTML tags to ensure proper rendering.

Testing

  • Verified the changes by running Jupyter Lab in a local environment setup.
  • Attached screenshots from the local environment for reference.
Screenshot 2025-02-19 at 6 43 35 PM Screenshot 2025-02-19 at 6 43 44 PM Screenshot 2025-02-19 at 6 43 55 PM

keerthi-swarna avatar Feb 19 '25 13:02 keerthi-swarna