tldr-pages / tldr-python-client

:snake: Python command-line client for tldr pages 📚
https://pypi.org/project/tldr/
MIT License
603 stars 95 forks source link

feat: stylize text inside backticks when appearing in example description #254

Closed kyluca closed 2 months ago

kyluca commented 2 months ago

Closes #253

Hoping I've understood the brief correctly :)

This change will check for the presence of backticks (`) and replace them with the ANSI escape characters for italics (and a matching reset to close the pairs).

This appears to match the desired output from the Rust CLI from the issue.

Example output: screenshot_from_2024_10_02_16_50_05

kyluca commented 2 months ago

Ah of course, good catch 👍

kyluca commented 2 months ago

Updated to reapply default or user styles, as well as a hardcoded yellow for further emphasis (matching Rust client output).

Default style: screenshot_from_2024_10_02_23_40_43

Custom style: To show I didn't cheat and use "green" as the reset haha screenshot_from_2024_10_02_23_41_03

kyluca commented 2 months ago

I noted the builds are failing due to an unrelated error, so have put up a separate PR to fix them first: https://github.com/tldr-pages/tldr-python-client/pull/256