Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed Feb 22, 2020
1 parent 556536d commit b48a2f6
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 235 deletions.
224 changes: 0 additions & 224 deletions color.html

This file was deleted.

2 changes: 1 addition & 1 deletion docs/source/markup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Formatting

for bold, italic, and strikethrough, Rich uses the same convention as Markdown::

For italics, wrap text in asterisks or underscores. e.g. ``*this is italics*`` or ``_this is also italics_``.
For italics, wrap text in asterisks or underscores, e.g. ``*this is italics*`` or ``_this is also italics_``.

For bold, wrap the text in *two* asterisks or underscores. e.g. ``**this is bold**`` or ``__this is also bold__``.

Expand Down
1 change: 1 addition & 0 deletions docs/source/reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Reference
reference/markdown.rst
reference/render_width.rst
reference/panel.rst
reference/rule.rst
reference/segment.rst
reference/style.rst
reference/syntax.rst
Expand Down
5 changes: 5 additions & 0 deletions docs/source/reference/rule.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
rich.rule
=========

.. automodule:: rich.rule
:members:
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "rich"
homepage = "https://github.com/willmcgugan/rich"
documentation = "https://rich.readthedocs.io/en/latest/"
version = "0.3.3"
version = "0.4.0"
description = "Render rich text, tables, syntax highlighting, markdown and more to the terminal"
authors = ["Will McGugan <willmcgugan@gmail.com>"]
license = "MIT"
Expand Down
4 changes: 2 additions & 2 deletions rich/rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ def __console__(self, console: Console, options: ConsoleOptions) -> RenderResult

rule_text = Text()
center = (width - len(title_text)) // 2
rule_text.append(self.character * (center - 1) + " ", self.rule_style)
rule_text.append(self.character * (center - 1) + " ", self.style)
rule_text.append(title_text)
rule_text.append(
" " + self.character * (width - len(rule_text) - 1), self.rule_style
" " + self.character * (width - len(rule_text) - 1), self.style
)
yield rule_text

Expand Down
6 changes: 3 additions & 3 deletions rich/segment.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,16 +151,16 @@ def set_shape(
height: int = None,
style: Style = None,
) -> List[List["Segment"]]:
"""Set the shape of a list of lines (enclosing rectangle)
"""Set the shape of a list of lines (enclosing rectangle).
Args:
lines (List[List[Segment]]): A list of lines.
width (int): Desired width.
height (int, optional): Desired height or None for no change..
height (int, optional): Desired height or None for no change.
style (Style, optional): Style of any padding added. Defaults to None.
Returns:
[type]: New list of lines that fits width x height.
List[List[Segment]]: New list of lines that fits width x height.
"""
if height is None:
height = len(lines)
Expand Down
7 changes: 3 additions & 4 deletions rich/traceback.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
from .highlighter import RegexHighlighter, ReprHighlighter
from .padding import Padding
from .panel import Panel
from .pygments_themes.base16_dark import base16_default_dark
from .rule import Rule
from .segment import Segment
from .text import Text
Expand Down Expand Up @@ -183,7 +182,7 @@ def extract(
append(frame)

cause = exc_value.__context__
if cause:
if cause and cause.__traceback__:
exc_type = cause.__class__
exc_value = cause
traceback = cause.__traceback__
Expand Down Expand Up @@ -274,7 +273,7 @@ def _render_stack(self, stack: Stack) -> RenderResult:
yield Padding.indent(syntax, 2)


if __name__ == "__main__": # type: ignore
if __name__ == "__main__": # pragma: no cover

from .console import Console

Expand All @@ -291,7 +290,7 @@ def foo(a):
try:
foo(0)
except:
slfkjsldkfj
slfkjsldkfj # type: ignore
except:
tb = Traceback()
# print(fooads)
Expand Down

0 comments on commit b48a2f6

Please sign in to comment.