Rewrite diff code using Rich
See original GitHub issueThe code in diff.py
is pretty much the final location in Ward that isn’t using Rich for terminal output. We should update it to use Rich, which should also allow us to more easily add test coverage around this area.
I’ve put this as a “Good First Issue” because the diff code is fairly de-coupled from the rest of Ward.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Styles — Rich 12.6.0 documentation
Rich provides a Theme class which you can use to define custom styles that you can refer to by name.
Read more >How to Use the Rich Library with Python - freeCodeCamp
Rich is a Python library for writing rich text (with color and style) to the terminal. It lets you display advanced content such...
Read more >Set different background color using Rich - python
Use the word "on" to introduce the background color. For example: print("[bold green on blue]Fear is the mind-killer[/]").
Read more >Using the rich text editor for content - Shopify Help Center
Using the rich text editor to format and style content, text, images, and ... Click a color or enter a hex code to...
Read more >Create or delete a Rich Text field - Microsoft Support
You can store rich, formatted text in an Access database by using a Long Text (also called Memo) field and setting the field's...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Happy to help! I did have an idea to implement a diff renderable, but it wouldn’t happen for a while.
You probably want to use the console protocol to create a renderable Diff object. So you create an instance, and then print it with the console. Something like this:
The existing renderables all use this protocol. See the code here, in particular syntax.py which you will probably want to use as a reference.
Mention me if you have any questions…
I’ll try to tackle this 😃 Any pointers are appreciated.