Skip to content

Commit 7bbb526

Browse files
authored
Go over screenshots (#94)
* Adjust style="" to do the right thing. and squelch "set:raw" error in trying set PygmentsStyle * Add gif for prompt-toolkit. Revise GNU gif.
1 parent 4fc3781 commit 7bbb526

9 files changed

+183
-67
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,15 @@
2525
/.eggs
2626
/.hypothesis
2727
/.mypy_cache
28+
/.pyodide-xbuildenv*
2829
/.pytest_cache
2930
/.python-version
3031
/.tox
3132
/.venv*/*
3233
/ChangeLog
3334
/ChangeLog.orig
3435
/ChangeLog.rej
36+
/ChangeLog.spell-corrected
3537
/PKG-INFO
3638
/README
3739
/README.html

mathicsscript/autoload/settings.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616

1717
Settings`$ShowFullFormInput = False
1818

19-
(* This is a workarund for a bug in mathicsscript of mathics-core.
19+
(* This is a workaround for a bug in mathicsscript of mathics-core.
2020
Remove this and we get error:
2121
Set::setraw: Cannot assign to raw object colorful. *)
22-
Settings`$PygmentsStyle = False
22+
Settings`$PygmentsStyle = Null
2323

2424
Settings`$PygmentsStyle::usage = "This variable sets the Pygments style used to colorize output. The value should be a string.
2525

mathicsscript/termshell.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# Copyright (C) 2020-2022, 2024 Rocky Bernstein <rb@dustyfeet.com>
2+
# Copyright (C) 2020-2022, 2024, 2025 Rocky Bernstein <rb@dustyfeet.com>
33

44
from columnize import columnize
55

@@ -67,7 +67,7 @@
6767
SymbolPygmentsStylesAvailable = Symbol("Settings`PygmentsStylesAvailable")
6868

6969

70-
def is_pygments_style(style: str):
70+
def is_pygments_style(style: str) -> bool:
7171
if style not in ALL_PYGMENTS_STYLES:
7272
print(f"Pygments style name '{style}' not found.")
7373
print(f"Style names are:\n{columnize(ALL_PYGMENTS_STYLES)}")
@@ -154,7 +154,7 @@ def __init__(
154154
)
155155

156156
def change_pygments_style(self, style: str):
157-
if style == self.pygments_style:
157+
if not style or style == self.pygments_style:
158158
return False
159159
if is_pygments_style(style):
160160
self.terminal_formatter = Terminal256Formatter(style=style)

screenshots/README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Character entry and highlighting
22

3-
![demo session - part 1](mathicsscript1.gif)
3+
![demo session - part 1](mathicsscript1-gnu.gif)
44

55
### Demo Notes
66

@@ -12,9 +12,7 @@ I hit the _Tab_ key after `Inte` to get the completions
1212

1313
Ater adding `gr` though there was just one completion: `Integrate`.
1414

15-
To get the theta (θ), I entered: _escape_ theta _escape_.
16-
17-
The next time around I entered `\[The` and the _Tab_ key.
15+
To get the theta (θ), I entered: _escape_ .Theta _escape_.
1816

1917
The orange color is in output is the color the Pygments default dark style `paraiso-dark` uses for numbers.
2018

@@ -43,7 +41,7 @@ The "cast" screenshot was made with asciienema and then running through `asciica
4341
For example:
4442

4543
```
46-
$ asciinema play mathicsscript1.caste
44+
$ asciinema play mathicsscript1.cast
4745
```
4846

4947
You can edit the `.cast` files. The specific commands used after this were:

screenshots/mathicsscript1-gnu.gif

164 KB
Loading

screenshots/mathicsscript1-prompt.cast

Lines changed: 122 additions & 0 deletions
Large diffs are not rendered by default.

screenshots/mathicsscript1-prompt.gif

171 KB
Loading

screenshots/mathicsscript1.cast

Lines changed: 51 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,51 @@
1-
{"version": 2, "width": 93, "height": 37, "timestamp": 1603631223, "env": {"SHELL": "/bin/bash", "TERM": "xterm-256color"}}
2-
[0.005791, "o", "\u001b[33m$ \u001b[0m"]
3-
[0.502157, "o", "math"]
4-
[1.062212, "o", "ics"]
5-
[1.502028, "o", "script"]
6-
[2.034574, "o", "\r\n"]
7-
[2.82522, "o", "\r\nMathicsscript: 8.0.0, Mathics 8.0.0\r\non CPython 3.12.8 (main, Dec 9 2024, 11:38:23) [GCC 13.2.0]\r\nusing SymPy 1.13.3, mpmath 1.130, cython 3.0.11\r\n\r\nCopyright (C) 2011-2025 The Mathics Team.\r\nThis program comes with ABSOLUTELY NO WARRANTY.\r\nThis is free software, and you are welcome to redistribute it\r\nunder certain conditions.\r\nSee the documentation for the full license.\r\n\r\nQuit by pressing CONTROL-D\r\n\r\n"]
8-
[2.825361, "o", "\u001b[32mIn[\u001b[1m1\u001b[22m]:= \u001b[39m"]
9-
[3.695122, "o", "I"]
10-
[3.967145, "o", "n"]
11-
[4.726812, "o", "t"]
12-
[5.007269, "o", "e"]
13-
[5.335371, "o", "g"]
14-
[6.12223, "o", "\u0007"]
15-
[6.815785, "o", "\r\nInteger IntegerExponent IntegerQ IntegerString Integrate\r\nIntegerDigits IntegerLength IntegerReverse Integers \r\n\u001b[32mIn[\u001b[1m1\u001b[22m]:= \u001b[39mInteg"]
16-
[6.871228, "o", "r"]
17-
[7.000000, "o", "\u0007"]
18-
[7.520555, "o", "ate"]
19-
[7.675848, "o", "["]
20-
[8.031685, "o", "Sin["]
21-
[9.656405, "o", "θ"]
22-
[10.25736, "o", "]"]
23-
[10.817809, "o", ", "]
24-
[11.01777, "o", "{"]
25-
[11.737943, "o", "\\"]
26-
[11.773814, "o", "["]
27-
[11.961852, "o", "The"]
28-
[12.458474, "o", "\u0007"]
29-
[13.386332, "o", "ta"]
30-
[13.562337, "o", ", "]
31-
[14.130843, "o", "0"]
32-
[14.426842, "o", ", 1"]
33-
[15.090745, "o", "}]"]
34-
[15.555296, "o", "\r\n"]
35-
[15.632594, "o", "\u001b[31mOut[\u001b[1m1\u001b[22m]= \u001b[39m\u001b[38;5;208m1\u001b[39m\u001b[38;5;7m \u001b[39m\u001b[38;5;79m-\u001b[39m\u001b[38;5;7m \u001b[39m\u001b[38;5;7mCos\u001b[39m\u001b[38;5;7m[\u001b[39m\u001b[38;5;208m1\u001b[39m\u001b[38;5;7m]\u001b[39m\r\n\r\n"]
36-
[16.032643, "o", "\u001b[32mIn[\u001b[1m2\u001b[22m]:= \u001b[39m"]
37-
[17.028024, "o", "N[%]"]
38-
[17.435874, "o", "\r\n"]
39-
[17.443821, "o", "\u001b[31mOut[\u001b[1m2\u001b[22m]= \u001b[39m\u001b[38;5;208m0.459698\u001b[39m\r\n\r\n"]
40-
[17.443857, "o", "\u001b[32mIn[\u001b[1m3\u001b[22m]:= \u001b[39m"]
41-
[17.436374, "o", "N[%]"]
42-
[18.988696, "o", "\b\b\b\bIntegrate[Sin[θ], {θ, 0, 1}]"]
43-
[19.11296, "o", "\b\u001b[K"]
44-
[19.445726, "o", "\r\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[K"]
45-
[20.533847, "o", "Integrate[Sin[θ], {\\[Theta], 0, 1}]"]
46-
[20.845902, "o", "\b"]
47-
[21.069995, "o", "\b"]
48-
[21.222015, "o", "\b"]
49-
[22.846123, "o", "P1}]\b\b\b"]
50-
[23.278141, "o", "i1}]\b\b\b"]
51-
[23.629824, "o", "\u001b[1P}]\b\b"]
52-
[24.533706, "o", "\u001b[C\u001b[C"]
53-
[25.318366, "o", "\r\n"]
54-
[25.337909, "o", "\u001b[31mOut[\u001b[1m3\u001b[22m]= \u001b[39m\u001b[38;5;208m2\u001b[39m\r\n\r\n"]
55-
[25.337952, "o", "\u001b[32mIn[\u001b[1m4\u001b[22m]:= \u001b[39m"]
56-
[26.477806, "o", "\r\n\r\nGoodbye!\r\n\r\n"]
57-
[26.480035, "o", "\u001b[0m"]
1+
{"version": 2, "width": 80, "height": 24, "timestamp": 1738279347, "env": {"SHELL": "/bin/bash", "TERM": "xterm-256color"}}
2+
[0.004157, "o", "\u001b[?2004h\u001b[33m$ \u001b[0m"]
3+
[1.358551, "o", "\u001b[H\u001b[2J\u001b[33m$ \u001b[0m"]
4+
[1.798216, "o", "mathicsscript --readline GNU"]
5+
[2.773018, "o", "\r\n\u001b[?2004l\r"]
6+
[3.447708, "o", "\r\nMathicscript: 8.0.0, Mathics 8.0.0\r\non CPython 3.12.8 (main, Dec 9 2024, 11:38:23) [GCC 13.2.0]\r\n\r\nUsing:\r\nSymPy 1.13.3, mpmath 1.3.0, numpy 1.26.4\r\ncython 3.0.11, matplotlib 3.9.3,\r\nAsymptote version 2.95\r\n\r\nCopyright (C) 2011-2025 The Mathics3 Team.\r\nThis program comes with ABSOLUTELY NO WARRANTY.\r\nThis is free software, and you are welcome to redistribute it\r\nunder certain conditions.\r\nSee the documentation for the full license.\r\n\r\nQuit by evaluating Quit[] or by pressing CONTROL-D.\r\n\r\n"]
7+
[3.447822, "o", "\u001b[32mIn[\u001b[1m1\u001b[22m]:= \u001b[39m"]
8+
[5.680936, "o", "I"]
9+
[6.08154, "o", "n"]
10+
[6.537755, "o", "t"]
11+
[7.009703, "o", "e"]
12+
[8.050647, "o", "g"]
13+
[8.703203, "o", "\u0007"]
14+
[9.172915, "o", "\r\nInteger IntegerLength IntegerQ Integers\r\nIntegerDigits IntegerPart IntegerReverse Integrate\r\nIntegerExponent IntegerPartitions IntegerString \r\n\u001b[32mIn[\u001b[1m1\u001b[22m]:= \u001b[39mInteg"]
15+
[10.30575, "o", "r"]
16+
[11.091369, "o", "ate"]
17+
[12.09041, "o", "["]
18+
[14.5699, "o", "S"]
19+
[14.856797, "o", "i"]
20+
[15.05787, "o", "n"]
21+
[15.321605, "o", "["]
22+
[16.514906, "o", "θ̣"]
23+
[16.977232, "o", "]"]
24+
[17.354395, "o", ","]
25+
[17.448072, "o", " "]
26+
[18.06578, "o", "{"]
27+
[22.489797, "o", "θ̣"]
28+
[23.102821, "o", ","]
29+
[23.175574, "o", " "]
30+
[23.455224, "o", "0"]
31+
[23.697182, "o", ","]
32+
[23.776832, "o", " "]
33+
[24.353501, "o", "1"]
34+
[24.89733, "o", "}"]
35+
[25.263849, "o", "]"]
36+
[28.497772, "o", "\r\n"]
37+
[30.567943, "o", "\u001b[31mOut[\u001b[1m1\u001b[22m]\u001b[39m= \u001b[38;5;57;01m1\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[38;5;236m-\u001b[39m\u001b[38;5;250m \u001b[39m\u001b[38;5;25;01mCos\u001b[39;00m[\u001b[38;5;57;01m1\u001b[39;00m]\r\n\r\n\u001b[32mIn[\u001b[1m2\u001b[22m]:= \u001b[39m"]
38+
[33.001598, "o", "%"]
39+
[33.880615, "o", " "]
40+
[34.194293, "o", "/"]
41+
[34.366569, "o", "/"]
42+
[34.435965, "o", " "]
43+
[34.421543, "o", "N"]
44+
[35.819642, "o", "\r\n"]
45+
[35.83116, "o", "\u001b[31mOut[\u001b[1m2\u001b[22m]\u001b[39m= \u001b[38;5;57;01m0.459698\u001b[39;00m\r\n\r\n"]
46+
[35.831283, "o", "\u001b[32mIn[\u001b[1m3\u001b[22m]:= \u001b[39m"]
47+
[36.001598, "o", "Quit[]"]
48+
[36.819642, "o", "\r\n"]
49+
[37.713122, "o", "\r\n\r\nGoodbye!\r\n\r\n"]
50+
[37.714901, "o", "\u001b[0m"]
51+
[38.073713, "o", "\u001b[?2004l\r\r\n"]

screenshots/mathicsscript1.gif

-41.8 KB
Binary file not shown.

0 commit comments

Comments
 (0)