streamdown 0.22.0__tar.gz → 0.24.0__tar.gz
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-0.22.0 → streamdown-0.24.0}/PKG-INFO +1 -1
- {streamdown-0.22.0 → streamdown-0.24.0}/pyproject.toml +1 -1
- {streamdown-0.22.0 → streamdown-0.24.0}/streamdown/sd.py +11 -3
- streamdown-0.24.0/tools/deploy.sh +7 -0
- {streamdown-0.22.0 → streamdown-0.24.0}/.gitignore +0 -0
- {streamdown-0.22.0 → streamdown-0.24.0}/LICENSE.MIT +0 -0
- {streamdown-0.22.0 → streamdown-0.24.0}/README.md +0 -0
- {streamdown-0.22.0 → streamdown-0.24.0}/requirements.txt +0 -0
- {streamdown-0.22.0 → streamdown-0.24.0}/streamdown/__init__.py +0 -0
- {streamdown-0.22.0 → streamdown-0.24.0}/streamdown/plugins/README.md +0 -0
- {streamdown-0.22.0 → streamdown-0.24.0}/streamdown/plugins/latex.py +0 -0
- {streamdown-0.22.0 → streamdown-0.24.0}/tests/README.md +0 -0
- {streamdown-0.22.0 → streamdown-0.24.0}/tests/backtick-with-post-spaces.md +0 -0
- {streamdown-0.22.0 → streamdown-0.24.0}/tests/block.md +0 -0
- {streamdown-0.22.0 → streamdown-0.24.0}/tests/bold_reset_with_link.md +0 -0
- {streamdown-0.22.0 → streamdown-0.24.0}/tests/broken-code.md +0 -0
- {streamdown-0.22.0 → streamdown-0.24.0}/tests/broken-example.md +0 -0
- {streamdown-0.22.0 → streamdown-0.24.0}/tests/chunk-buffer.sh +0 -0
- {streamdown-0.22.0 → streamdown-0.24.0}/tests/cjk-table.md +0 -0
- {streamdown-0.22.0 → streamdown-0.24.0}/tests/cjk-wrap.md +0 -0
- {streamdown-0.22.0 → streamdown-0.24.0}/tests/code.md +0 -0
- {streamdown-0.22.0 → streamdown-0.24.0}/tests/example.md +0 -0
- {streamdown-0.22.0 → streamdown-0.24.0}/tests/fizzbuzz.md +0 -0
- {streamdown-0.22.0 → streamdown-0.24.0}/tests/inline.md +0 -0
- {streamdown-0.22.0 → streamdown-0.24.0}/tests/jimmy_webb.md +0 -0
- {streamdown-0.22.0 → streamdown-0.24.0}/tests/line-buffer.sh +0 -0
- {streamdown-0.22.0 → streamdown-0.24.0}/tests/line-wrap.md +0 -0
- {streamdown-0.22.0 → streamdown-0.24.0}/tests/links.md +0 -0
- {streamdown-0.22.0 → streamdown-0.24.0}/tests/managerie.md +0 -0
- {streamdown-0.22.0 → streamdown-0.24.0}/tests/mandlebrot.md +0 -0
- {streamdown-0.22.0 → streamdown-0.24.0}/tests/markdown.md +0 -0
- {streamdown-0.22.0 → streamdown-0.24.0}/tests/nested-example.md +0 -0
- {streamdown-0.22.0 → streamdown-0.24.0}/tests/outline.md +0 -0
- {streamdown-0.22.0 → streamdown-0.24.0}/tests/pvgo_512.jpg +0 -0
- {streamdown-0.22.0 → streamdown-0.24.0}/tests/pythonvgo.md +0 -0
- {streamdown-0.22.0 → streamdown-0.24.0}/tests/qwen3.md +0 -0
- {streamdown-0.22.0 → streamdown-0.24.0}/tests/rerun.zsh +0 -0
- {streamdown-0.22.0 → streamdown-0.24.0}/tests/slash.md +0 -0
- {streamdown-0.22.0 → streamdown-0.24.0}/tests/strip-chunks.sh +0 -0
- {streamdown-0.22.0 → streamdown-0.24.0}/tests/table-break.md +0 -0
- {streamdown-0.22.0 → streamdown-0.24.0}/tests/table_test.md +0 -0
- {streamdown-0.22.0 → streamdown-0.24.0}/tests/test.md +0 -0
- {streamdown-0.22.0 → streamdown-0.24.0}/tests/test_input.md +0 -0
- {streamdown-0.22.0 → streamdown-0.24.0}/tests/wm.md +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: streamdown
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.24.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
|
|
@@ -114,6 +114,8 @@ def debug_write(text):
|
|
|
114
114
|
|
|
115
115
|
def savebrace():
|
|
116
116
|
if state.Savebrace and state.code_buffer_raw:
|
|
117
|
+
tmp_dir = os.path.join(tempfile.gettempdir(), "sd")
|
|
118
|
+
os.makedirs(tmp_dir, exist_ok=True)
|
|
117
119
|
path = os.path.join(tempfile.gettempdir(), "sd", 'savebrace')
|
|
118
120
|
with open(path, "a") as f:
|
|
119
121
|
f.write(state.code_buffer_raw + "\x00")
|
|
@@ -479,7 +481,12 @@ def line_format(line):
|
|
|
479
481
|
tokenList = re.finditer(r"((~~|\*\*_|_\*\*|\*{1,3}|_{1,3}|`+)|[^~_*`]+)", line)
|
|
480
482
|
result = ""
|
|
481
483
|
|
|
484
|
+
last_pos = 0
|
|
482
485
|
for match in tokenList:
|
|
486
|
+
if match.span()[0] > last_pos:
|
|
487
|
+
result += line[last_pos:match.span()[0]]
|
|
488
|
+
|
|
489
|
+
last_pos = match.span()[1]
|
|
483
490
|
token = re.sub(r'\s+',' ', match.group(1))
|
|
484
491
|
next_token = line[match.end()] if match.end() < len(line) else ""
|
|
485
492
|
prev_token = line[match.start()-1] if match.start() > 0 else ""
|
|
@@ -507,6 +514,7 @@ def line_format(line):
|
|
|
507
514
|
state.code_buffer_raw += token
|
|
508
515
|
|
|
509
516
|
elif token == '~~' and (state.in_strikeout or not_text(prev_token)):
|
|
517
|
+
print("in strike")
|
|
510
518
|
state.in_strikeout = not state.in_strikeout
|
|
511
519
|
result += STRIKEOUT[0] if state.in_strikeout else STRIKEOUT[1]
|
|
512
520
|
|
|
@@ -795,8 +803,8 @@ def parse(stream):
|
|
|
795
803
|
#print("(",highlighted_code,")")
|
|
796
804
|
|
|
797
805
|
# Sometimes the highlighter will do things like a full reset or a background reset.
|
|
798
|
-
# This is not what we want
|
|
799
|
-
highlighted_code = re.sub(r"\033\[[34]9(;00|)m",
|
|
806
|
+
# This is mostly not what we want
|
|
807
|
+
highlighted_code = re.sub(r"\033\[[34]9(;00|)m", "\033[23m", highlighted_code)
|
|
800
808
|
|
|
801
809
|
# Since we are streaming we ignore the resets and newlines at the end
|
|
802
810
|
if highlighted_code.endswith(FGRESET + "\n"):
|
|
@@ -1023,7 +1031,7 @@ def width_calc():
|
|
|
1023
1031
|
]
|
|
1024
1032
|
|
|
1025
1033
|
def main():
|
|
1026
|
-
parser = ArgumentParser(description="Streamdown - A Streaming markdown renderer for modern terminals")
|
|
1034
|
+
parser = ArgumentParser(description="Streamdown - A Streaming markdown renderer for modern terminals. Latest version: https://github.com/day50-dev/Streamdown")
|
|
1027
1035
|
parser.add_argument("filenameList", nargs="*", help="Input file to process (also takes stdin)")
|
|
1028
1036
|
parser.add_argument("-l", "--loglevel", default="INFO", help="Set the logging level")
|
|
1029
1037
|
parser.add_argument("-b", "--base", default=None, help="Set the hsv base: h,s,v")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|