mirror of https://github.com/Textualize/rich.git
test card fix
This commit is contained in:
parent
d5c56bfea3
commit
1eba8c5308
|
@ -129,29 +129,30 @@ def make_test_card() -> Table:
|
||||||
table.add_row("Tables", example_table)
|
table.add_row("Tables", example_table)
|
||||||
|
|
||||||
code = '''\
|
code = '''\
|
||||||
def iter_last(values: Iterable[T]) -> Iterable[Tuple[bool, T]]:
|
def iter_last(values: Iterable[T]) -> Iterable[Tuple[bool, T]]:
|
||||||
"""Iterate and generate a tuple with a flag for last value."""
|
"""Iterate and generate a tuple with a flag for last value."""
|
||||||
iter_values = iter(values)
|
iter_values = iter(values)
|
||||||
try:
|
try:
|
||||||
previous_value = next(iter_values)
|
previous_value = next(iter_values)
|
||||||
except StopIteration:
|
except StopIteration:
|
||||||
return
|
return
|
||||||
for value in iter_values:
|
for value in iter_values:
|
||||||
yield False, previous_value
|
yield False, previous_value
|
||||||
previous_value = value
|
previous_value = value
|
||||||
yield True, previous_value'''
|
yield True, previous_value'''
|
||||||
|
|
||||||
table.add_row("Syntax highlighting", Syntax(code, "python3", line_numbers=True))
|
table.add_row("Syntax highlighting", Syntax(code, "python3", line_numbers=True))
|
||||||
|
|
||||||
markdown_example = """\
|
markdown_example = """\
|
||||||
# Markdown
|
# Markdown
|
||||||
|
|
||||||
Supports much of the *markdown*, __syntax__!
|
Supports much of the *markdown*, __syntax__!
|
||||||
|
|
||||||
- Headers
|
- Headers
|
||||||
- Basic formatting: bold, italic, code etc
|
- Basic formatting: bold, italic, code etc
|
||||||
- Block quotes
|
- Block quotes
|
||||||
- Lists, and more... """
|
- Lists, and more...
|
||||||
|
"""
|
||||||
table.add_row("Markdown", comparison(markdown_example, Markdown(markdown_example)))
|
table.add_row("Markdown", comparison(markdown_example, Markdown(markdown_example)))
|
||||||
|
|
||||||
table.add_row(
|
table.add_row(
|
||||||
|
|
Loading…
Reference in New Issue