@@ -8,6 +8,7 @@ GAPDoc2TextProcs.OtherThemes := rec();
8
8
# - a string a starting with TextAttr.CSI for [a, TextAttr.reset]
9
9
# - another string a for [a, a]
10
10
GAPDoc2TextProcs.OtherThemes.classic := rec (
11
+ info := " similar to GAPDoc default until GAP 4.4" ,
11
12
reset := TextAttr.reset,
12
13
Heading := Concatenation(TextAttr.bold, TextAttr.underscore, TextAttr.1 ),
13
14
Func := Concatenation(TextAttr.bold, TextAttr.4 ),
@@ -32,7 +33,7 @@ GAPDoc2TextProcs.OtherThemes.classic := rec(
32
33
Q := [ " \" " ," \" " ] ,
33
34
M := [ " " ," " ] ,
34
35
Math := [ " $" ," $" ] ,
35
- Display := [ " $$ " ," $$ " ] ,
36
+ Display := [ " " ," " ] ,
36
37
Prompt := Concatenation(TextAttr.bold,TextAttr.4 ),
37
38
BrkPrompt := Concatenation(TextAttr.bold,TextAttr.1 ),
38
39
GAPInput := TextAttr.1 ,
@@ -48,8 +49,9 @@ GAPDoc2TextProcs.OtherThemes.classic := rec(
48
49
);
49
50
50
51
GAPDoc2TextProcs.OtherThemes.default := rec (
52
+ info := " the default theme" ,
51
53
reset := TextAttr.reset,
52
- Heading := Concatenation(TextAttr.bold , TextAttr.underscore),
54
+ Heading := Concatenation(TextAttr.normal , TextAttr.underscore),
53
55
Func := Concatenation(TextAttr.normal, TextAttr.4 ),
54
56
Arg := Concatenation(TextAttr.normal, TextAttr.2 ),
55
57
Example := Concatenation(TextAttr.normal, TextAttr.0 ),
@@ -87,7 +89,8 @@ GAPDoc2TextProcs.OtherThemes.default := rec(
87
89
flush := " both" ,
88
90
);
89
91
90
- GAPDoc2TextProcs.OtherThemes.gap3 := rec (
92
+ GAPDoc2TextProcs.OtherThemes.old := rec (
93
+ info := " similar to old style manuals in GAP 3 and GAP 4.4" ,
91
94
reset := " " ,
92
95
Heading := [ " " ," " ] ,
93
96
Func := [ " `" ," '" ] ,
@@ -126,7 +129,13 @@ GAPDoc2TextProcs.OtherThemes.gap3 := rec(
126
129
format := " " ,
127
130
flush := " both"
128
131
);
129
-
132
+ GAPDoc2TextProcs.OtherThemes.equalquotes := rec (
133
+ info := " (together with \" old\" ) uses '...' instead of `...'" ,
134
+ C := " '" ,
135
+ F := " '" ,
136
+ K := " '" ,
137
+ Func := " '"
138
+ );
130
139
131
140
132
141
GAPDoc2TextProcs.OtherThemes.none := rec ();
@@ -140,61 +149,55 @@ GAPDoc2TextProcs.f := function()
140
149
for a in [ " Q" , " DefLineMarker" , " ListBullet" , " FillString" , " EnumMarks" ] do
141
150
GAPDoc2TextProcs.OtherThemes.none.(a) := dt.(a);
142
151
od ;
152
+ GAPDoc2TextProcs.OtherThemes.none.info := " plain text without markup" ;
143
153
end ;
144
154
GAPDoc2TextProcs.f();
145
155
Unbind (GAPDoc2TextProcs.f);
146
156
157
+ GAPDoc2TextProcs.OtherThemes.ColorPrompt := rec (
158
+ info := " show examples in ColorPrompt(true) style" ,
159
+ Prompt := Concatenation(TextAttr.bold,TextAttr.4 ),
160
+ BrkPrompt := Concatenation(TextAttr.bold,TextAttr.1 ),
161
+ GAPInput := TextAttr.1 ,
162
+ GAPOutput := TextAttr.reset
163
+ );
164
+
165
+ GAPDoc2TextProcs.OtherThemes.noColorPrompt := rec (
166
+ info := " show examples in ColorPrompt(false) style" ,
167
+ Prompt := " " ,
168
+ BrkPrompt := " " ,
169
+ GAPInput := " " ,
170
+ GAPOutput := " "
171
+ );
172
+
147
173
InstallValue(GAPDocTextTheme, rec ());
148
174
149
175
# argument doesn't need all component, the missing ones are taken from default
150
176
InstallGlobalFunction(SetGAPDocTextTheme, function (arg )
151
- local r, len, res, h, af, v, i, f ;
177
+ local r, res, h, af, v, a, nam, f, i ;
152
178
153
- if Length(arg) = 0 then
154
- r := rec ();
155
- else
156
- r := arg[ 1 ] ;
157
- fi ;
158
- if IsString(r) then
159
- if not IsBound (GAPDoc2TextProcs.OtherThemes.(r)) then
160
- Print(" Only the following named text themes are available:\n " ,
161
- RecFields(GAPDoc2TextProcs.OtherThemes), " \n " );
162
- return ;
163
- else
164
- r := GAPDoc2TextProcs.OtherThemes.(r);
165
- fi ;
166
- fi ;
167
- len := function (s ) return WidthUTF8String(StripEscapeSequences(s)); end ;
168
- # normalize ListBullet and EnumMarks
169
- if IsBound (r.ListBullet) then
170
- if not IsString(r.ListBullet) then
171
- r.ListBullet := r.ListBullet[ 1 ] ;
172
- fi ;
173
- while len(r.ListBullet) < 2 do
174
- Add(r.ListBullet, ' ' );
175
- od ;
176
- if len(r.ListBullet) > 2 then
177
- r.ListBullet := r.ListBullet{[ 1 .. 2 ]} ;
178
- fi ;
179
- fi ;
180
- if IsBound (r.EnumMarks) then
181
- if IsString(r.EnumMarks) then
182
- r.EnumMarks := [ r.EnumMarks, r.EnumMarks] ;
183
- fi ;
184
- if Sum(r.EnumMarks, len) > 2 then
185
- if len(r.EnumMarks[ 1 ] ) = 0 then
186
- r.EnumMarks[ 2 ] := r.EnumMarks[ 2 ]{[ 1 ,2 ]} ;
187
- elif len(r.EnumMarks[ 2 ] ) = 0 then
188
- r.EnumMarks[ 1 ] := r.EnumMarks[ 1 ]{[ 1 ,2 ]} ;
179
+ r := rec ();
180
+ for a in arg do
181
+ if IsString(a) then
182
+ if not IsBound (GAPDoc2TextProcs.OtherThemes.(a)) then
183
+ Print(" Only the following named text themes are available \
184
+ (choose one or several):\n " );
185
+ for nam in RecFields(GAPDoc2TextProcs.OtherThemes) do
186
+ Print(" " ,String(Concatenation(" \" " ,nam," \" " ), - 25 ),
187
+ GAPDoc2TextProcs.OtherThemes.(nam).info, " \n " );
188
+ od ;
189
+ return ;
189
190
else
190
- r.EnumMarks[ 1 ] := r.EnumMarks[ 1 ]{[ 1 ]} ;
191
- r.EnumMarks[ 2 ] := r.EnumMarks[ 2 ]{[ 1 ]} ;
191
+ for f in RecFields(GAPDoc2TextProcs.OtherThemes.(a)) do
192
+ r.(f) := GAPDoc2TextProcs.OtherThemes.(a).(f);
193
+ od ;
192
194
fi ;
195
+ else
196
+ for f in RecFields(a) do
197
+ r.(f) := a.(f);
198
+ od ;
193
199
fi ;
194
- while Sum(r.EnumMarks, len) < 2 do
195
- Add(r.EnumMarks[ 2 ] , ' ' );
196
- od ;
197
- fi ;
200
+ od ;
198
201
199
202
res := rec (hash := [[] , []] );
200
203
h := res.hash;
0 commit comments