Commit graph

720 commits

Author SHA1 Message Date
Darren Burns
68faf4f344
Add test case to ensure wrapping when length greater than available width 2022-05-24 17:05:22 +01:00
Andy Gimblett
d9a0d47946 Add Rule.__rich_measure__ and tests vs behaviour in tables
See [issue #2266](https://github.com/Textualize/rich/issues/2266)
2022-05-24 13:42:42 +01:00
Darren Burns
7975c563e1
Fix numerous typos in tests 2022-05-24 13:26:40 +01:00
Will McGugan
6b824b6477 test fix 2022-05-24 07:30:25 +01:00
Will McGugan
2d44195482 svg fixes 2022-05-23 16:54:07 +01:00
Will McGugan
b423f742ad refinements to SVG out 2022-05-23 09:43:12 +01:00
Will McGugan
bcf6cff58d test fix 2022-05-08 15:40:48 +01:00
Will McGugan
1e0e33e944 tweaked backgorund and border of terminal 2022-05-08 15:37:30 +01:00
Will McGugan
4761fa9eeb fix test 2022-05-08 12:16:23 +01:00
Martin Larralde
ca94962307 Forward the internal handle name wrapped in rich.progress._Reader 2022-05-05 12:26:52 +02:00
Darren Burns
79a41db38f
Add padding support to Syntax (#2247)
* Add padding to Syntax constructor

* Add padding to from_path constructor, use correct type

* Padding for `Syntax` - support vertical padding

* Extract logic for create base syntax without padding

* Add test for padded `Syntax`

* Small refactor of Syntax padding

* Small refactor of Syntax padding

* Remove some dead code

* Update changelog
2022-05-03 16:32:50 +01:00
Darren Burns
5a999f49f9
Render height fix (#2246)
* Fix issue where height - totalvpad < 0 would cause render_lines crash

* Update changelog
2022-05-03 13:23:43 +01:00
Will McGugan
95db6abced made dim less dim 2022-05-03 10:32:13 +01:00
Will McGugan
fd6dea6356 fix tests 2022-05-03 10:19:58 +01:00
Will McGugan
e2332480eb fix test 2022-05-02 20:25:44 +01:00
Will McGugan
95049662d6 fix background 2022-05-02 20:18:28 +01:00
Will McGugan
b290fdcc55 no hash 2022-05-02 20:07:50 +01:00
Will McGugan
79a4245cd1 tweaks 2022-05-02 19:52:21 +01:00
Will McGugan
7f8565c10a tweaks 2022-05-02 17:44:20 +01:00
Will McGugan
113997ac51 SVG output 2022-05-02 16:20:23 +01:00
Olivier Philippon
f0ca6ff2bc [traceback] Make _rich_traceback_guard more consistent with _rich_traceback_omit 2022-04-26 13:43:41 +01:00
Olivier Philippon
740b89f49a [traceback] Add traceback frame opt-out via a _rich_traceback_omit = True machinery 2022-04-26 12:41:43 +01:00
Olivier Philippon
83af951663 [traceback] Fix "missing whitespace" bug
It turns out that we intentionally don't add such a whitespace at the beginning of the trace rendering, but we were actually doing so for the 2nd item of the stack rather than the 1st one
2022-04-26 11:36:43 +01:00
Olivier Philippon
69003a772c [highlighter] Fine-tuning on complex numbers pattern matching 2022-04-26 09:17:36 +01:00
Olivier Philippon
5e67e22ba4 [highlighter] Extract more complex numbers pattern matching on its own one, rather than being part of the number one 2022-04-25 16:57:05 +01:00
Olivier Philippon
f67f426a6b [highlighter] Add complex numbers pattern to our highlighter's number matching 2022-04-25 14:51:47 +01:00
Will McGugan
b2ef89655d added test 2022-04-21 16:42:35 +01:00
Will McGugan
759ed784d7 progress speed 2022-04-21 16:31:28 +01:00
Will McGugan
33889ab893 sorted 2022-04-21 10:16:42 +01:00
Darren Burns
8a9e9a2022
SVG export - Safari - Prevent box appearing on rounded corners (#2201)
* Use box-shadow instead of outline for Safari support

* Update changelog re Safari SVG export square corner bug
2022-04-20 09:53:26 +01:00
Darren Burns
cb56ec7ebb
Setting terminal window title (#2200)
* Adding tests for setting console title

* Add Windows note

* Update changelog regarding changing terminal window title

* Add test for window title control code -> legacy windows conversion

* Fix docstring typo
2022-04-19 17:20:17 +01:00
Olivier Philippon
d2830c89b7 [progress] Adapt the rendering of some our columns when the total we pass to a Progress renderable is None 2022-04-14 16:26:28 +01:00
Olivier Philippon
5daf99f612 [progress] Add a test for a "None" total passed to a Progress renderable 2022-04-13 11:02:28 +01:00
Will McGugan
193903dff5 fix escaping issue 2022-04-12 14:16:54 +01:00
Will McGugan
e3fdf33043
Merge pull request #2170 from Textualize/console-svg-isolate-css-selectors-and-font-name
[console] namespace SVG elements to avoid conflicts with surrounding HTML page
2022-04-06 13:45:53 +01:00
Olivier Philippon
d98d671c49 Fall back to sys.__stderr__ on non-Windows OS to get size
This fixes the "pipe" bug, where we could not determine the available size correctly when the output of Rich is piped to another process
2022-04-06 11:37:56 +01:00
Olivier Philippon
b4ec058305 [console] SVG elements namespacing is now done with a hash of the content 2022-04-06 09:46:19 +01:00
Olivier Philippon
55c80fbeb1 [console] PR feedback on SVG elements namespacing 2022-04-05 16:29:32 +01:00
Olivier Philippon
ec3e849737 [console] namespace SVG elements to avoid conflicts with surrounding HTML page 2022-04-05 15:08:30 +01:00
Will McGugan
dc3998a821
Merge pull request #2133 from Textualize/lexer-not-found-fix
Fallback to text lexer when lexer not found
2022-04-01 10:23:44 +01:00
Darren Burns
7a870e4a4b
Merge branch 'master' into progress-reader 2022-03-30 13:42:58 +01:00
Darren Burns
c77dbb4888
Fallback to text lexer when no suitable lexer found 2022-03-30 12:25:57 +01:00
Darren Burns
9f43cccfce
Exporting console content to SVG (#2101)
* Add skeleton export_svg and save_svg methods to Console

* Exporting SVG

* SVG export - Writing HTML foreign object into naively calculated SVG rect background

* Exporting as foreign object SVG

* Working with drop-shadow

* Update terminal output style to include tab and background/border

* Add more terminal themes, support dim, reverse in SVG output

* Fix some HTML export tests

* Allow for templating of SVG output

* Fix mypy issue involving shadowed variable in SVG export

* Remove unused code from main block in console.py

* Remove unused record=True in __main__.py Console init

* Small tidy ups in console.py SVG export

* Add test for exporting to SVG

* Add tests for export SVG and save SVG

* Update docs with info on SVG exports

* Add support for blink and blink2 to SVG export, use Fira Code webfont fallback

* Update tests for SVG exporting

* Add more information to docs about SVG exporting

* Update SVG exporting tests

* Explain how to use different terminal theme in SVG export docs

* Remove some development testing code

* Remove some more testing code

* Improve docs, fix typo

* Fixing a typo

* Add note to changelog about SVG export functionality

* Use CSS styling instead of inline styles on SVG export

* Fix issues noted in code review, fix reverse style

* Update SVG used in Rich docs
2022-03-29 17:34:14 +01:00
Will McGugan
9faafa0ab1 fix for ansi issue 2022-03-26 14:40:20 +00:00
Will McGugan
f7aa3fb78e fix for ansi issue 2022-03-26 12:59:20 +00:00
Wasi Master
f06da9b94c
Format with black 2022-03-22 20:17:21 +06:00
Wasi Master
fc292780aa
Add test for the end parameter 2022-03-22 20:13:30 +06:00
Will McGugan
6d443ddaf0 panel bug 2022-03-21 16:31:41 +00:00
Martin Larralde
aa5ca607eb Fix failing tests in tests.test_progress 2022-03-21 13:32:11 +01:00
Will McGugan
0daccb0768 fix uuid highlighter 2022-03-18 17:17:10 +00:00