@@ -13,6 +13,21 @@ from commands that produce dynamic or variable output.
13
13
Creating a transcript
14
14
=====================
15
15
16
+ Automatically
17
+ -------------
18
+ A transcript can automatically generated based upon commands previously executed in the *history *::
19
+
20
+ (Cmd) help
21
+ ...
22
+ (Cmd) help history
23
+ ...
24
+ (Cmd) history 1:2 -t transcript.txt
25
+ 2 commands and outputs saved to transcript file 'transcript.txt'
26
+
27
+ This is by far the easiest way to generate a transcript.
28
+
29
+ Manually
30
+ --------
16
31
Here's a transcript created from ``python examples/example.py ``::
17
32
18
33
(Cmd) say -r 3 Goodnight, Gracie
@@ -38,9 +53,9 @@ lines of the transcript as comments::
38
53
# Lines at the beginning of the transcript that do not
39
54
; start with the prompt i.e. '(Cmd) ' are ignored.
40
55
/* You can use them for comments. */
41
-
56
+
42
57
All six of these lines before the first prompt are treated as comments.
43
-
58
+
44
59
(Cmd) say -r 3 Goodnight, Gracie
45
60
Goodnight, Gracie
46
61
Goodnight, Gracie
@@ -105,21 +120,21 @@ the path instead of specifying it verbatim, or we can escape the slashes::
105
120
trailing spaces which are impossible to see. Instead of leaving them
106
121
invisible, you can add a regular expression to match them, so that you can
107
122
see where they are when you look at the transcript::
108
-
123
+
109
124
(Cmd) set prompt
110
125
prompt: (Cmd)/ /
111
-
126
+
112
127
Some terminal emulators strip trailing space when you copy text from them.
113
128
This could make the actual data generated by your app different than the
114
129
text you pasted into the transcript, and it might not be readily obvious why
115
130
the transcript is not passing. Consider using :ref: `output_redirection ` to
116
131
the clipboard or to a file to ensure you accurately capture the output of
117
132
your command.
118
-
133
+
119
134
If you aren't using regular expressions, make sure the newlines at the end
120
135
of your transcript exactly match the output of your commands. A common cause
121
136
of a failing transcript is an extra or missing newline.
122
-
137
+
123
138
If you are using regular expressions, be aware that depending on how you
124
139
write your regex, the newlines after the regex may or may not matter.
125
140
``\Z `` matches *after * the newline at the end of the string, whereas
0 commit comments