Fossil SCM

pikchr command doc updates.

stephan 2020-09-14 00:27 pikchr-th
Commit f2248f819dbcd59f391bcdd93c08d426fac5a92e50e42ff0abfd9e0a646955d4
1 file changed +36 -24
+36 -24
--- src/pikchrshow.c
+++ src/pikchrshow.c
@@ -171,38 +171,50 @@
171171
/*
172172
** COMMAND: pikchr
173173
**
174174
** Usage: %fossil pikchr [options] ?INFILE? ?OUTFILE?
175175
**
176
-** Accepts a pikchr script as input and outputs the rendered
177
-** script as an SVG graphic.
176
+** Accepts a pikchr script as input and outputs the rendered script as
177
+** an SVG graphic. The INFILE and OUTFILE options default to stdin
178
+** resp. stdout, and the names "-" can be used as aliases for those
179
+** streams.
178180
**
179181
** Options:
180182
**
181
-** -div On success, adds a DIV wrapper around the
182
-** resulting SVG output which limits its max-width.
183
-**
184
-** -th Process the input using TH1 before passing it to pikchr.
185
-**
186
-** -th-novar Disable $var and $<var> TH1 processing. Only applies
187
-** with the -th flag. Use this if the pikchr script uses
188
-** '$' for its own purposes.
189
-**
190
-** -th-nosvg When using -th, output the post-TH1'd script
191
-** instead of the pikchr-rendered output.
192
-**
193
-** -th-trace Trace TH1 execution (for debugging purposes)
194
-**
195
-** TH1 Caveats:
183
+** -div On success, adds a DIV wrapper around the
184
+** resulting SVG output which limits its max-width to
185
+** its computed maximum ideal size, in order to mimic
186
+** how fossil's web-based components work.
187
+**
188
+** -th Process the input using TH1 before passing it to pikchr.
189
+**
190
+** -th-novar Disable $var and $<var> TH1 processing. Use this if the
191
+** pikchr script uses '$' for its own purposes and that
192
+** causes
193
+**
194
+** -th-nosvg When using -th, output the post-TH1'd script
195
+** instead of the pikchr-rendered output.
196
+**
197
+** -th-trace Trace TH1 execution (for debugging purposes).
198
+**
199
+** TH1-related Notes and Caveats:
196200
**
197201
** If the -th flag is used, this command must open a fossil database
198
-** for certain functionality to work. It will run TH1 without opening
199
-** a db if one cannot be found in the current checkout or with the -R
200
-** REPO flag, but any TH1 commands which require a db will then fail.
202
+** for certain functionality to work (via a checkout or the -R REPO
203
+** flag). If opening a db fails, execution will continue but any TH1
204
+** commands which require a db will trigger a fatal error.
205
+**
206
+** In Fossil skins, TH1 vars in the form $x are expanded as-is and
207
+** those in the form $<x> are htmlized in the resulting output. This
208
+** processor disables the htmlizing step, so $x and $<x> are
209
+** equivalent UNLESS the TH1-processed pikchr script invokes the TH1
210
+** enable_htmlify command to enable it. Normally that option will
211
+** interfere with pikchr output, however, e.g. by HTML-encoding
212
+** double-quotes.
201213
**
202
-** Many of the fossil-installed TH1 functions do not make any sense
203
-** for pikchr scripts
214
+** Many of the fossil-installed TH1 functions simply do not make any
215
+** sense for pikchr scripts
204216
*/
205217
void pikchr_cmd(void){
206218
Blob bIn = empty_blob;
207219
Blob bOut = empty_blob;
208220
const char * zInfile = "-";
@@ -258,15 +270,15 @@
258270
}
259271
blob_append(&bOut, zOut, -1);
260272
if(fWithDiv){
261273
blob_append(&bOut,"</div>\n", 7);
262274
}
275
+ fossil_free(zOut);
263276
}else{
264277
isErr = 2;
265
- blob_append(&bOut, zOut, -1);
278
+ blob_set_dynamic(&bOut, zOut);
266279
}
267
- fossil_free(zOut);
268280
}
269281
}
270282
if(isErr){
271283
/*fossil_print("ERROR: raw input:\n%b\n", &bIn);*/
272284
fossil_fatal("%s ERROR: %b", 1==isErr ? "TH1" : "pikchr",
273285
--- src/pikchrshow.c
+++ src/pikchrshow.c
@@ -171,38 +171,50 @@
171 /*
172 ** COMMAND: pikchr
173 **
174 ** Usage: %fossil pikchr [options] ?INFILE? ?OUTFILE?
175 **
176 ** Accepts a pikchr script as input and outputs the rendered
177 ** script as an SVG graphic.
 
 
178 **
179 ** Options:
180 **
181 ** -div On success, adds a DIV wrapper around the
182 ** resulting SVG output which limits its max-width.
183 **
184 ** -th Process the input using TH1 before passing it to pikchr.
185 **
186 ** -th-novar Disable $var and $<var> TH1 processing. Only applies
187 ** with the -th flag. Use this if the pikchr script uses
188 ** '$' for its own purposes.
189 **
190 ** -th-nosvg When using -th, output the post-TH1'd script
191 ** instead of the pikchr-rendered output.
192 **
193 ** -th-trace Trace TH1 execution (for debugging purposes)
194 **
195 ** TH1 Caveats:
 
 
196 **
197 ** If the -th flag is used, this command must open a fossil database
198 ** for certain functionality to work. It will run TH1 without opening
199 ** a db if one cannot be found in the current checkout or with the -R
200 ** REPO flag, but any TH1 commands which require a db will then fail.
 
 
 
 
 
 
 
 
201 **
202 ** Many of the fossil-installed TH1 functions do not make any sense
203 ** for pikchr scripts
204 */
205 void pikchr_cmd(void){
206 Blob bIn = empty_blob;
207 Blob bOut = empty_blob;
208 const char * zInfile = "-";
@@ -258,15 +270,15 @@
258 }
259 blob_append(&bOut, zOut, -1);
260 if(fWithDiv){
261 blob_append(&bOut,"</div>\n", 7);
262 }
 
263 }else{
264 isErr = 2;
265 blob_append(&bOut, zOut, -1);
266 }
267 fossil_free(zOut);
268 }
269 }
270 if(isErr){
271 /*fossil_print("ERROR: raw input:\n%b\n", &bIn);*/
272 fossil_fatal("%s ERROR: %b", 1==isErr ? "TH1" : "pikchr",
273
--- src/pikchrshow.c
+++ src/pikchrshow.c
@@ -171,38 +171,50 @@
171 /*
172 ** COMMAND: pikchr
173 **
174 ** Usage: %fossil pikchr [options] ?INFILE? ?OUTFILE?
175 **
176 ** Accepts a pikchr script as input and outputs the rendered script as
177 ** an SVG graphic. The INFILE and OUTFILE options default to stdin
178 ** resp. stdout, and the names "-" can be used as aliases for those
179 ** streams.
180 **
181 ** Options:
182 **
183 ** -div On success, adds a DIV wrapper around the
184 ** resulting SVG output which limits its max-width to
185 ** its computed maximum ideal size, in order to mimic
186 ** how fossil's web-based components work.
187 **
188 ** -th Process the input using TH1 before passing it to pikchr.
189 **
190 ** -th-novar Disable $var and $<var> TH1 processing. Use this if the
191 ** pikchr script uses '$' for its own purposes and that
192 ** causes
193 **
194 ** -th-nosvg When using -th, output the post-TH1'd script
195 ** instead of the pikchr-rendered output.
196 **
197 ** -th-trace Trace TH1 execution (for debugging purposes).
198 **
199 ** TH1-related Notes and Caveats:
200 **
201 ** If the -th flag is used, this command must open a fossil database
202 ** for certain functionality to work (via a checkout or the -R REPO
203 ** flag). If opening a db fails, execution will continue but any TH1
204 ** commands which require a db will trigger a fatal error.
205 **
206 ** In Fossil skins, TH1 vars in the form $x are expanded as-is and
207 ** those in the form $<x> are htmlized in the resulting output. This
208 ** processor disables the htmlizing step, so $x and $<x> are
209 ** equivalent UNLESS the TH1-processed pikchr script invokes the TH1
210 ** enable_htmlify command to enable it. Normally that option will
211 ** interfere with pikchr output, however, e.g. by HTML-encoding
212 ** double-quotes.
213 **
214 ** Many of the fossil-installed TH1 functions simply do not make any
215 ** sense for pikchr scripts
216 */
217 void pikchr_cmd(void){
218 Blob bIn = empty_blob;
219 Blob bOut = empty_blob;
220 const char * zInfile = "-";
@@ -258,15 +270,15 @@
270 }
271 blob_append(&bOut, zOut, -1);
272 if(fWithDiv){
273 blob_append(&bOut,"</div>\n", 7);
274 }
275 fossil_free(zOut);
276 }else{
277 isErr = 2;
278 blob_set_dynamic(&bOut, zOut);
279 }
 
280 }
281 }
282 if(isErr){
283 /*fossil_print("ERROR: raw input:\n%b\n", &bIn);*/
284 fossil_fatal("%s ERROR: %b", 1==isErr ? "TH1" : "pikchr",
285

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button