streamdown 0.15.0__py3-none-any.whl → 0.16.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- streamdown/sd.py +3 -4
- {streamdown-0.15.0.dist-info → streamdown-0.16.0.dist-info}/METADATA +18 -17
- {streamdown-0.15.0.dist-info → streamdown-0.16.0.dist-info}/RECORD +6 -6
- {streamdown-0.15.0.dist-info → streamdown-0.16.0.dist-info}/WHEEL +0 -0
- {streamdown-0.15.0.dist-info → streamdown-0.16.0.dist-info}/entry_points.txt +0 -0
- {streamdown-0.15.0.dist-info → streamdown-0.16.0.dist-info}/licenses/LICENSE.MIT +0 -0
streamdown/sd.py
CHANGED
|
@@ -22,7 +22,6 @@ import subprocess
|
|
|
22
22
|
import traceback
|
|
23
23
|
import colorsys
|
|
24
24
|
import base64
|
|
25
|
-
import importlib
|
|
26
25
|
from io import BytesIO
|
|
27
26
|
from term_image.image import from_file, from_url
|
|
28
27
|
import pygments.util
|
|
@@ -569,9 +568,10 @@ def parse(stream):
|
|
|
569
568
|
# <code><pre>
|
|
570
569
|
#
|
|
571
570
|
if not state.in_code:
|
|
572
|
-
code_match = re.match(r"
|
|
571
|
+
code_match = re.match(r"^\s*```\s*([^\s]+|$)\s*$", line)
|
|
573
572
|
if code_match:
|
|
574
573
|
state.in_code = Code.Backtick
|
|
574
|
+
state.code_indent = len(line) - len(line.lstrip())
|
|
575
575
|
state.code_language = code_match.group(1) or 'Bash'
|
|
576
576
|
|
|
577
577
|
elif state.CodeSpaces and last_line_empty_cache and not state.in_list:
|
|
@@ -596,6 +596,7 @@ def parse(stream):
|
|
|
596
596
|
|
|
597
597
|
if state.in_code:
|
|
598
598
|
try:
|
|
599
|
+
# This is turning it OFF
|
|
599
600
|
if not state.code_first_line and (
|
|
600
601
|
( state.in_code == Code.Backtick and line.strip() == "```" ) or
|
|
601
602
|
(state.CodeSpaces and state.in_code == Code.Spaces and not line.startswith(' '))
|
|
@@ -625,9 +626,7 @@ def parse(stream):
|
|
|
625
626
|
state.emit_flush = True
|
|
626
627
|
yield RESET
|
|
627
628
|
|
|
628
|
-
|
|
629
629
|
if code_type == Code.Backtick:
|
|
630
|
-
state.code_indent = len(line) - len(line.lstrip())
|
|
631
630
|
continue
|
|
632
631
|
else:
|
|
633
632
|
# otherwise we don't want to consume
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: streamdown
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.16.0
|
|
4
4
|
Summary: A streaming markdown renderer for modern terminals with syntax highlighting
|
|
5
5
|
Project-URL: Homepage, https://github.com/kristopolous/Streamdown
|
|
6
6
|
Project-URL: Bug Tracker, https://github.com/kristopolous/Streamdown/issues
|
|
@@ -27,44 +27,45 @@ Requires-Dist: term-image
|
|
|
27
27
|
Requires-Dist: toml
|
|
28
28
|
Description-Content-Type: text/markdown
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
<p align="center">
|
|
31
|
+
<img src=https://github.com/user-attachments/assets/0468eac0-2a00-4e98-82ca-09e6ac679357/>
|
|
32
|
+
<br/>
|
|
33
|
+
<a href=https://pypi.org/project/streamdown><img src=https://badge.fury.io/py/streamdown.svg/></a>
|
|
34
|
+
</p>
|
|
31
35
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
It's fully streaming and does not block
|
|
36
|
+
The streaming markdown renderer for the terminal that rocks!
|
|
37
|
+
Streamdown works with [simonw's llm](https://github.com/simonw/llm) along with any other streaming markdown. You even get full readline and keyboard navigation support.
|
|
38
|
+
```bash
|
|
39
|
+
$ pip install streamdown
|
|
40
|
+
```
|
|
38
41
|

|
|
39
42
|
|
|
40
43
|
### Provides clean copyable code for long code lines
|
|
41
|
-
You may have noticed
|
|
44
|
+
You may have noticed *inferior* renderers inject line breaks when copying code that wraps around. We're better and now you are too!
|
|
42
45
|

|
|
43
46
|
|
|
44
47
|
### Supports images
|
|
45
48
|
Here's kitty and alacritty. Try to do that in glow...
|
|
46
|
-

|
|
47
50
|
|
|
48
|
-
###
|
|
51
|
+
### Supports hyperlinks (OSC 8) and clipboard (OSC 52)
|
|
49
52
|
[links.webm](https://github.com/user-attachments/assets/a5f71791-7c58-4183-ad3b-309f470c08a3)
|
|
50
53
|
|
|
51
|
-
###
|
|
54
|
+
### Supports tables
|
|
52
55
|

|
|
53
56
|
|
|
54
57
|
As well as everything else...
|
|
55
|
-
|
|
56
58
|

|
|
57
59
|
|
|
58
60
|
### Colors are highly (and quickly) configurable for people who care a lot, or just a little.
|
|
59
|
-

|
|
60
62
|
|
|
61
63
|
### Has a [Plugin](https://github.com/kristopolous/Streamdown/tree/main/streamdown/plugins) system to extend the parser and renderer.
|
|
62
64
|
For instance, here is the [latex plugin](https://github.com/kristopolous/Streamdown/blob/main/streamdown/plugins/latex.py) doing math inside a table:
|
|
63
65
|

|
|
64
66
|
|
|
65
67
|
|
|
66
|
-
## Configuration
|
|
67
|
-
|
|
68
|
+
## TOML Configuration
|
|
68
69
|
|
|
69
70
|
Streamdown uses a TOML configuration file located at `~/.config/streamdown/config.toml` (following the XDG Base Directory Specification). If this file does not exist upon first run, it will be created with default values.
|
|
70
71
|
|
|
@@ -114,7 +115,7 @@ Width = 120
|
|
|
114
115
|
Timeout = 1.0
|
|
115
116
|
```
|
|
116
117
|
|
|
117
|
-
##
|
|
118
|
+
## Command Line
|
|
118
119
|
The most exciting feature here is `--exec` with it you can do full readline support like this:
|
|
119
120
|
|
|
120
121
|
$ sd --exec "llm chat"
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
streamdown/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
streamdown/sd.py,sha256=
|
|
2
|
+
streamdown/sd.py,sha256=0Ug2grAsf_RWVMyDMOc0j_ZTmL8N6dOPpk24LKBPkhA,35641
|
|
3
3
|
streamdown/tt.mds,sha256=srDldQ9KnMJd5P8GdTXTJl4mjTowwV9y58ZIaBVbtFY,359
|
|
4
4
|
streamdown/plugins/README.md,sha256=KWqYELs9WkKJmuDzYv3cvPlZMkArsNCBUe4XDoTLjLA,1143
|
|
5
5
|
streamdown/plugins/latex.py,sha256=xZMGMdx_Sw4X1piZejXFHfEG9qazU4fGeceiMI0h13Y,648
|
|
6
6
|
streamdown/scrape/file_0.py,sha256=OiFxFGGHu2C2iO9LVnhXKCybqCsnw0bu8MmI2E0vs_s,610
|
|
7
7
|
streamdown/scrape/file_1.js,sha256=JnXSvlsk9UmU5LsGOfXkP3sGId8VNEJRJo8-uRohRCM,569
|
|
8
8
|
streamdown/scrape/file_2.cpp,sha256=4hbT9TJzDNmrU7BVwaIuCMlI2BvUEVeTKoH6wUJRkrI,397
|
|
9
|
-
streamdown-0.
|
|
10
|
-
streamdown-0.
|
|
11
|
-
streamdown-0.
|
|
12
|
-
streamdown-0.
|
|
13
|
-
streamdown-0.
|
|
9
|
+
streamdown-0.16.0.dist-info/METADATA,sha256=sq6eIyimqRI8cZHKkNbDdP3OoYpEPYCU-v5LFhBgYfQ,7968
|
|
10
|
+
streamdown-0.16.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
11
|
+
streamdown-0.16.0.dist-info/entry_points.txt,sha256=HroKFsFMGf_h9PRTE96NjvjJQWupMW5TGP5RGUr1O_Q,74
|
|
12
|
+
streamdown-0.16.0.dist-info/licenses/LICENSE.MIT,sha256=SnY46EPirUsF20dZDR8HpyVgS2_4Tjxuc6f-4OdqO7U,1070
|
|
13
|
+
streamdown-0.16.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|