Fossil SCM
Added captureTh1 to www/th1.md, hyperlinked the entries of the th1 command list to their doc sections, and replaced "a name=..." with "a id=...", as the former is long since deprecated (has the same effect, though).
Commit
e7dcfc90f04cc98904c4052ad8ca2e353faaa13e9c952a48af78e04c1e36dc7c
Parent
c3991493b9889d6…
1 file changed
+123
-110
+123
-110
| --- www/th1.md | ||
| +++ www/th1.md | ||
| @@ -164,116 +164,129 @@ | ||
| 164 | 164 | --------------------- |
| 165 | 165 | |
| 166 | 166 | There are many new commands added to TH1 and used to access the special |
| 167 | 167 | features of Fossil. The following is a summary of the extended commands: |
| 168 | 168 | |
| 169 | - * anoncap | |
| 170 | - * anycap | |
| 171 | - * artifact | |
| 172 | - * cgiHeaderLine | |
| 173 | - * checkout | |
| 174 | - * combobox | |
| 175 | - * copybtn | |
| 176 | - * date | |
| 177 | - * decorate | |
| 178 | - * defHeader | |
| 179 | - * dir | |
| 180 | - * enable\_output | |
| 181 | - * encode64 | |
| 182 | - * getParameter | |
| 183 | - * glob\_match | |
| 184 | - * globalState | |
| 185 | - * hascap | |
| 186 | - * hasfeature | |
| 187 | - * html | |
| 188 | - * htmlize | |
| 189 | - * http | |
| 190 | - * httpize | |
| 191 | - * insertCsrf | |
| 192 | - * linecount | |
| 193 | - * markdown | |
| 194 | - * nonce | |
| 195 | - * puts | |
| 196 | - * query | |
| 197 | - * randhex | |
| 198 | - * redirect | |
| 199 | - * regexp | |
| 200 | - * reinitialize | |
| 201 | - * render | |
| 202 | - * repository | |
| 203 | - * searchable | |
| 204 | - * setParameter | |
| 205 | - * setting | |
| 206 | - * stime | |
| 207 | - * styleHeader | |
| 208 | - * styleFooter | |
| 209 | - * styleScript | |
| 210 | - * tclEval | |
| 211 | - * tclExpr | |
| 212 | - * tclInvoke | |
| 213 | - * tclIsSafe | |
| 214 | - * tclMakeSafe | |
| 215 | - * tclReady | |
| 216 | - * trace | |
| 217 | - * unversioned content | |
| 218 | - * unversioned list | |
| 219 | - * utime | |
| 220 | - * verifyCsrf | |
| 221 | - * verifyLogin | |
| 222 | - * wiki | |
| 169 | + * [anoncap](#anoncap) | |
| 170 | + * [anycap](#anycap) | |
| 171 | + * [artifact](#artifact) | |
| 172 | + * [captureTh1](#captureTh1) | |
| 173 | + * [cgiHeaderLine](#cgiHeaderLine) | |
| 174 | + * [checkout](#checkout) | |
| 175 | + * [combobox](#combobox) | |
| 176 | + * [copybtn](#copybtn) | |
| 177 | + * [date](#date) | |
| 178 | + * [decorate](#decorate) | |
| 179 | + * [defHeader](#defHeader) | |
| 180 | + * [dir](#dir) | |
| 181 | + * [enable\_output](#enable_output) | |
| 182 | + * [encode64](#encode64) | |
| 183 | + * [getParameter](#getParameter) | |
| 184 | + * [glob\_match](#glob_match) | |
| 185 | + * [globalState](#globalState) | |
| 186 | + * [hascap](#hascap) | |
| 187 | + * [hasfeature](#hasfeature) | |
| 188 | + * [html](#html) | |
| 189 | + * [htmlize](#htmlize) | |
| 190 | + * [http](#http) | |
| 191 | + * [httpize](#httpize) | |
| 192 | + * [insertCsrf](#insertCsrf) | |
| 193 | + * [linecount](#linecount) | |
| 194 | + * [markdown](#markdown) | |
| 195 | + * [nonce](#nonce) | |
| 196 | + * [puts](#puts) | |
| 197 | + * [query](#query) | |
| 198 | + * [randhex](#randhex) | |
| 199 | + * [redirect](#redirect) | |
| 200 | + * [regexp](#regexp) | |
| 201 | + * [reinitialize](#reinitialize) | |
| 202 | + * [render](#render) | |
| 203 | + * [repository](#repository) | |
| 204 | + * [searchable](#searchable) | |
| 205 | + * [setParameter](#setParameter) | |
| 206 | + * [setting](#setting) | |
| 207 | + * [stime](#stime) | |
| 208 | + * [styleHeader](#styleHeader) | |
| 209 | + * [styleFooter](#styleFooter) | |
| 210 | + * [styleScript](#styleScript) | |
| 211 | + * [tclEval](#tclEval) | |
| 212 | + * [tclExpr](#tclExpr) | |
| 213 | + * [tclInvoke](#tclInvoke) | |
| 214 | + * [tclIsSafe](#tclIsSafe) | |
| 215 | + * [tclMakeSafe](#tclMakeSafe) | |
| 216 | + * [tclReady](#tclReady) | |
| 217 | + * [trace](#trace) | |
| 218 | + * [unversioned content](#unversioned_content) | |
| 219 | + * [unversioned list](#unversioned_list) | |
| 220 | + * [utime](#utime) | |
| 221 | + * [verifyCsrf](#verifyCsrf) | |
| 222 | + * [verifyLogin](#verifyLogin) | |
| 223 | + * [wiki](#wiki) | |
| 223 | 224 | |
| 224 | 225 | Each of the commands above is documented by a block comment above their |
| 225 | 226 | implementation in the th\_main.c or th\_tcl.c source files. |
| 226 | 227 | |
| 227 | 228 | All commands starting with "tcl", with the exception of "tclReady", |
| 228 | 229 | require the Tcl integration subsystem be included at compile-time. |
| 229 | 230 | Additionally, the "tcl" repository setting must be enabled at runtime |
| 230 | 231 | in order to successfully make use of these commands. |
| 231 | 232 | |
| 232 | -<a name="anoncap"></a>TH1 anoncap Command | |
| 233 | +<a id="anoncap"></a>TH1 anoncap Command | |
| 233 | 234 | ----------------------------------------- |
| 234 | 235 | |
| 235 | 236 | * anoncap STRING... |
| 236 | 237 | |
| 237 | 238 | Returns true if the anonymous user has all of the capabilities listed |
| 238 | 239 | in STRING. |
| 239 | 240 | |
| 240 | -<a name="anycap"></a>TH1 anycap Command | |
| 241 | +<a id="anycap"></a>TH1 anycap Command | |
| 241 | 242 | --------------------------------------- |
| 242 | 243 | |
| 243 | 244 | * anycap STRING |
| 244 | 245 | |
| 245 | 246 | Returns true if the current user user has any one of the capabilities |
| 246 | 247 | listed in STRING. |
| 247 | 248 | |
| 248 | -<a name="artifact"></a>TH1 artifact Command | |
| 249 | +<a id="artifact"></a>TH1 artifact Command | |
| 249 | 250 | ------------------------------------------- |
| 250 | 251 | |
| 251 | 252 | * artifact ID ?FILENAME? |
| 252 | 253 | |
| 253 | 254 | Attempts to locate the specified artifact and return its contents. An |
| 254 | 255 | error is generated if the repository is not open or the artifact cannot |
| 255 | 256 | be found. |
| 256 | 257 | |
| 257 | -<a name="cgiHeaderLine"></a>TH1 cgiHeaderLine Command | |
| 258 | +<a id="captureTh1"></a>TH1 captureTh1 Command | |
| 259 | +----------------------------------------------------- | |
| 260 | + | |
| 261 | + * captureTh1 STRING | |
| 262 | + | |
| 263 | +Executes its single argument as TH1 code and captures any | |
| 264 | +TH1-generated output as a string, which becomes the result of the | |
| 265 | +function call. e.g. any `puts` calls made from that block will not | |
| 266 | +generate any output, and instead their output will become part of the | |
| 267 | +result string. | |
| 268 | + | |
| 269 | + | |
| 270 | +<a id="cgiHeaderLine"></a>TH1 cgiHeaderLine Command | |
| 258 | 271 | ----------------------------------------------------- |
| 259 | 272 | |
| 260 | 273 | * cgiHeaderLine line |
| 261 | 274 | |
| 262 | 275 | Adds the specified line to the CGI header. |
| 263 | 276 | |
| 264 | -<a name="checkout"></a>TH1 checkout Command | |
| 277 | +<a id="checkout"></a>TH1 checkout Command | |
| 265 | 278 | ------------------------------------------- |
| 266 | 279 | |
| 267 | 280 | * checkout ?BOOLEAN? |
| 268 | 281 | |
| 269 | 282 | Return the fully qualified directory name of the current checkout or an |
| 270 | 283 | empty string if it is not available. Optionally, it will attempt to find |
| 271 | 284 | the current checkout, opening the configuration ("user") database and the |
| 272 | 285 | repository as necessary, if the boolean argument is non-zero. |
| 273 | 286 | |
| 274 | -<a name="combobox"></a>TH1 combobox Command | |
| 287 | +<a id="combobox"></a>TH1 combobox Command | |
| 275 | 288 | ------------------------------------------- |
| 276 | 289 | |
| 277 | 290 | * combobox NAME TEXT-LIST NUMLINES |
| 278 | 291 | |
| 279 | 292 | Generates and emits an HTML combobox. NAME is both the name of the |
| @@ -280,11 +293,11 @@ | ||
| 280 | 293 | CGI parameter and the name of a variable that contains the currently |
| 281 | 294 | selected value. TEXT-LIST is a list of possible values for the |
| 282 | 295 | combobox. NUMLINES is 1 for a true combobox. If NUMLINES is greater |
| 283 | 296 | than one then the display is a listbox with the number of lines given. |
| 284 | 297 | |
| 285 | -<a name="copybtn"></a>TH1 copybtn Command | |
| 298 | +<a id="copybtn"></a>TH1 copybtn Command | |
| 286 | 299 | ----------------------------------------- |
| 287 | 300 | |
| 288 | 301 | * copybtn TARGETID FLIPPED TEXT ?COPYLENGTH? |
| 289 | 302 | |
| 290 | 303 | Output TEXT with a click-to-copy button next to it. Loads the copybtn.js |
| @@ -302,34 +315,34 @@ | ||
| 302 | 315 | * >= 3: Truncate TEXT after COPYLENGTH (single-byte) characters. |
| 303 | 316 | * 1: Use the "hash-digits" setting as the limit. |
| 304 | 317 | * 2: Use the length appropriate for URLs as the limit (defined at |
| 305 | 318 | compile-time by `FOSSIL_HASH_DIGITS_URL`, defaults to 16). |
| 306 | 319 | |
| 307 | -<a name="date"></a>TH1 date Command | |
| 320 | +<a id="date"></a>TH1 date Command | |
| 308 | 321 | ----------------------------------- |
| 309 | 322 | |
| 310 | 323 | * date ?-local? |
| 311 | 324 | |
| 312 | 325 | Return a strings which is the current time and date. If the -local |
| 313 | 326 | option is used, the date appears using localtime instead of UTC. |
| 314 | 327 | |
| 315 | -<a name="decorate"></a>TH1 decorate Command | |
| 328 | +<a id="decorate"></a>TH1 decorate Command | |
| 316 | 329 | ------------------------------------------- |
| 317 | 330 | |
| 318 | 331 | * decorate STRING |
| 319 | 332 | |
| 320 | 333 | Renders STRING as wiki content; however, only links are handled. No |
| 321 | 334 | other markup is processed. |
| 322 | 335 | |
| 323 | -<a name="defHeader"></a>TH1 defHeader Command | |
| 336 | +<a id="defHeader"></a>TH1 defHeader Command | |
| 324 | 337 | --------------------------------------------- |
| 325 | 338 | |
| 326 | 339 | * defHeader |
| 327 | 340 | |
| 328 | 341 | Returns the default page header. |
| 329 | 342 | |
| 330 | -<a name="dir"></a>TH1 dir Command | |
| 343 | +<a id="dir"></a>TH1 dir Command | |
| 331 | 344 | --------------------------------- |
| 332 | 345 | |
| 333 | 346 | * dir CHECKIN ?GLOB? ?DETAILS? |
| 334 | 347 | |
| 335 | 348 | Returns a list containing all files in CHECKIN. If GLOB is given only |
| @@ -337,42 +350,42 @@ | ||
| 337 | 350 | If DETAILS is non-zero, the result will be a list-of-lists, with each |
| 338 | 351 | element containing at least three elements: the file name, the file |
| 339 | 352 | size (in bytes), and the file last modification time (relative to the |
| 340 | 353 | time zone configured for the repository). |
| 341 | 354 | |
| 342 | -<a name="enable_output"></a>TH1 enable\_output Command | |
| 355 | +<a id="enable_output"></a>TH1 enable\_output Command | |
| 343 | 356 | ------------------------------------------------------ |
| 344 | 357 | |
| 345 | 358 | * enable\_output BOOLEAN |
| 346 | 359 | |
| 347 | 360 | Enable or disable sending output when the combobox, copybtn, puts, or wiki |
| 348 | 361 | commands are used. |
| 349 | 362 | |
| 350 | -<a name="encode64"></a>TH1 encode64 Command | |
| 363 | +<a id="encode64"></a>TH1 encode64 Command | |
| 351 | 364 | ------------------------------------------- |
| 352 | 365 | |
| 353 | 366 | * encode64 STRING |
| 354 | 367 | |
| 355 | 368 | Encode the specified string using Base64 and return the result. |
| 356 | 369 | |
| 357 | -<a name="getParameter"></a>TH1 getParameter Command | |
| 370 | +<a id="getParameter"></a>TH1 getParameter Command | |
| 358 | 371 | --------------------------------------------------- |
| 359 | 372 | |
| 360 | 373 | * getParameter NAME ?DEFAULT? |
| 361 | 374 | |
| 362 | 375 | Returns the value of the specified query parameter or the specified |
| 363 | 376 | default value when there is no matching query parameter. |
| 364 | 377 | |
| 365 | -<a name="glob_match"></a>TH1 glob\_match Command | |
| 378 | +<a id="glob_match"></a>TH1 glob\_match Command | |
| 366 | 379 | ------------------------------------------------ |
| 367 | 380 | |
| 368 | 381 | * glob\_match ?-one? ?--? patternList string |
| 369 | 382 | |
| 370 | 383 | Checks the string against the specified glob pattern -OR- list of glob |
| 371 | 384 | patterns and returns non-zero if there is a match. |
| 372 | 385 | |
| 373 | -<a name="globalState"></a>TH1 globalState Command | |
| 386 | +<a id="globalState"></a>TH1 globalState Command | |
| 374 | 387 | ------------------------------------------------- |
| 375 | 388 | |
| 376 | 389 | * globalState NAME ?DEFAULT? |
| 377 | 390 | |
| 378 | 391 | Returns a string containing the value of the specified global state |
| @@ -390,19 +403,19 @@ | ||
| 390 | 403 | |
| 391 | 404 | Attempts to query for unsupported global state variables will result |
| 392 | 405 | in a script error. Additional global state variables may be exposed |
| 393 | 406 | in the future. |
| 394 | 407 | |
| 395 | -<a name="hascap"></a>TH1 hascap Command | |
| 408 | +<a id="hascap"></a>TH1 hascap Command | |
| 396 | 409 | --------------------------------------- |
| 397 | 410 | |
| 398 | 411 | * hascap STRING... |
| 399 | 412 | |
| 400 | 413 | Returns true if the current user has all of the capabilities listed |
| 401 | 414 | in STRING. |
| 402 | 415 | |
| 403 | -<a name="hasfeature"></a>TH1 hasfeature Command | |
| 416 | +<a id="hasfeature"></a>TH1 hasfeature Command | |
| 404 | 417 | ----------------------------------------------- |
| 405 | 418 | |
| 406 | 419 | * hasfeature STRING |
| 407 | 420 | |
| 408 | 421 | Returns true if the binary has the given compile-time feature enabled. |
| @@ -425,26 +438,26 @@ | ||
| 425 | 438 | 1. **see** -- _Uses the SQLite Encryption Extension._ |
| 426 | 439 | |
| 427 | 440 | Specifying an unknown feature will return a value of false, it will not |
| 428 | 441 | raise a script error. |
| 429 | 442 | |
| 430 | -<a name="html"></a>TH1 html Command | |
| 443 | +<a id="html"></a>TH1 html Command | |
| 431 | 444 | ----------------------------------- |
| 432 | 445 | |
| 433 | 446 | * html STRING |
| 434 | 447 | |
| 435 | 448 | Outputs the STRING escaped for HTML. |
| 436 | 449 | |
| 437 | -<a name="htmlize"></a>TH1 htmlize Command | |
| 450 | +<a id="htmlize"></a>TH1 htmlize Command | |
| 438 | 451 | ----------------------------------------- |
| 439 | 452 | |
| 440 | 453 | * htmlize STRING |
| 441 | 454 | |
| 442 | 455 | Escape all characters of STRING which have special meaning in HTML. |
| 443 | 456 | Returns the escaped string. |
| 444 | 457 | |
| 445 | -<a name="http"></a>TH1 http Command | |
| 458 | +<a id="http"></a>TH1 http Command | |
| 446 | 459 | ----------------------------------- |
| 447 | 460 | |
| 448 | 461 | * http ?-asynchronous? ?--? url ?payload? |
| 449 | 462 | |
| 450 | 463 | Performs an HTTP or HTTPS request for the specified URL. If a |
| @@ -453,58 +466,58 @@ | ||
| 453 | 466 | be used. Upon success, if the -asynchronous option is used, an |
| 454 | 467 | empty string is returned as the result; otherwise, the response |
| 455 | 468 | from the server is returned as the result. Synchronous requests |
| 456 | 469 | are not currently implemented. |
| 457 | 470 | |
| 458 | -<a name="httpize"></a>TH1 httpize Command | |
| 471 | +<a id="httpize"></a>TH1 httpize Command | |
| 459 | 472 | ----------------------------------------- |
| 460 | 473 | |
| 461 | 474 | * httpize STRING |
| 462 | 475 | |
| 463 | 476 | Escape all characters of STRING which have special meaning in URI |
| 464 | 477 | components. Returns the escaped string. |
| 465 | 478 | |
| 466 | -<a name="insertCsrf"></a>TH1 insertCsrf Command | |
| 479 | +<a id="insertCsrf"></a>TH1 insertCsrf Command | |
| 467 | 480 | ----------------------------------------------- |
| 468 | 481 | |
| 469 | 482 | * insertCsrf |
| 470 | 483 | |
| 471 | 484 | While rendering a form, call this command to add the Anti-CSRF token |
| 472 | 485 | as a hidden element of the form. |
| 473 | 486 | |
| 474 | -<a name="linecount"></a>TH1 linecount Command | |
| 487 | +<a id="linecount"></a>TH1 linecount Command | |
| 475 | 488 | --------------------------------------------- |
| 476 | 489 | |
| 477 | 490 | * linecount STRING MAX MIN |
| 478 | 491 | |
| 479 | 492 | Returns one more than the number of \n characters in STRING. But |
| 480 | 493 | never returns less than MIN or more than MAX. |
| 481 | 494 | |
| 482 | -<a name="markdown"></a>TH1 markdown Command | |
| 495 | +<a id="markdown"></a>TH1 markdown Command | |
| 483 | 496 | ------------------------------------------- |
| 484 | 497 | |
| 485 | 498 | * markdown STRING |
| 486 | 499 | |
| 487 | 500 | Renders the input string as markdown. The result is a two-element list. |
| 488 | 501 | The first element contains the body, rendered as HTML. The second element |
| 489 | 502 | is the text-only title string. |
| 490 | 503 | |
| 491 | -<a name="nonce"></a>TH1 nonce Command | |
| 504 | +<a id="nonce"></a>TH1 nonce Command | |
| 492 | 505 | ------------------------------------- |
| 493 | 506 | |
| 494 | 507 | * nonce |
| 495 | 508 | |
| 496 | 509 | Returns the value of the cryptographic nonce for the request being processed. |
| 497 | 510 | |
| 498 | -<a name="puts"></a>TH1 puts Command | |
| 511 | +<a id="puts"></a>TH1 puts Command | |
| 499 | 512 | ----------------------------------- |
| 500 | 513 | |
| 501 | 514 | * puts STRING |
| 502 | 515 | |
| 503 | 516 | Outputs the STRING unchanged. |
| 504 | 517 | |
| 505 | -<a name="query"></a>TH1 query Command | |
| 518 | +<a id="query"></a>TH1 query Command | |
| 506 | 519 | ------------------------------------- |
| 507 | 520 | |
| 508 | 521 | * query ?-nocomplain? SQL CODE |
| 509 | 522 | |
| 510 | 523 | Runs the SQL query given by the SQL argument. For each row in the result |
| @@ -512,19 +525,19 @@ | ||
| 512 | 525 | |
| 513 | 526 | In SQL, parameters such as $var are filled in using the value of variable |
| 514 | 527 | "var". Result values are stored in variables with the column name prior |
| 515 | 528 | to each invocation of CODE. |
| 516 | 529 | |
| 517 | -<a name="randhex"></a>TH1 randhex Command | |
| 530 | +<a id="randhex"></a>TH1 randhex Command | |
| 518 | 531 | ----------------------------------------- |
| 519 | 532 | |
| 520 | 533 | * randhex N |
| 521 | 534 | |
| 522 | 535 | Returns a string of N*2 random hexadecimal digits with N<50. If N is |
| 523 | 536 | omitted, use a value of 10. |
| 524 | 537 | |
| 525 | -<a name="redirect"></a>TH1 redirect Command | |
| 538 | +<a id="redirect"></a>TH1 redirect Command | |
| 526 | 539 | ------------------------------------------- |
| 527 | 540 | |
| 528 | 541 | * redirect URL ?withMethod? |
| 529 | 542 | |
| 530 | 543 | Issues an HTTP redirect to the specified URL and then exits the process. |
| @@ -532,43 +545,43 @@ | ||
| 532 | 545 | argument is present and non-zero, an HTTP status code of 307 is used, which |
| 533 | 546 | should force the user agent to preserve the original method for the request |
| 534 | 547 | (e.g. GET, POST) instead of (possibly) forcing the user agent to change the |
| 535 | 548 | method to GET. |
| 536 | 549 | |
| 537 | -<a name="regexp"></a>TH1 regexp Command | |
| 550 | +<a id="regexp"></a>TH1 regexp Command | |
| 538 | 551 | --------------------------------------- |
| 539 | 552 | |
| 540 | 553 | * regexp ?-nocase? ?--? exp string |
| 541 | 554 | |
| 542 | 555 | Checks the string against the specified regular expression and returns |
| 543 | 556 | non-zero if it matches. If the regular expression is invalid or cannot |
| 544 | 557 | be compiled, an error will be generated. |
| 545 | 558 | |
| 546 | -<a name="reinitialize"></a>TH1 reinitialize Command | |
| 559 | +<a id="reinitialize"></a>TH1 reinitialize Command | |
| 547 | 560 | --------------------------------------------------- |
| 548 | 561 | |
| 549 | 562 | * reinitialize ?FLAGS? |
| 550 | 563 | |
| 551 | 564 | Reinitializes the TH1 interpreter using the specified flags. |
| 552 | 565 | |
| 553 | -<a name="render"></a>TH1 render Command | |
| 566 | +<a id="render"></a>TH1 render Command | |
| 554 | 567 | --------------------------------------- |
| 555 | 568 | |
| 556 | 569 | * render STRING |
| 557 | 570 | |
| 558 | 571 | Renders the TH1 template and writes the results. |
| 559 | 572 | |
| 560 | -<a name="repository"></a>TH1 repository Command | |
| 573 | +<a id="repository"></a>TH1 repository Command | |
| 561 | 574 | ----------------------------------------------- |
| 562 | 575 | |
| 563 | 576 | * repository ?BOOLEAN? |
| 564 | 577 | |
| 565 | 578 | Returns the fully qualified file name of the open repository or an empty |
| 566 | 579 | string if one is not currently open. Optionally, it will attempt to open |
| 567 | 580 | the repository if the boolean argument is non-zero. |
| 568 | 581 | |
| 569 | -<a name="searchable"></a>TH1 searchable Command | |
| 582 | +<a id="searchable"></a>TH1 searchable Command | |
| 570 | 583 | ----------------------------------------------- |
| 571 | 584 | |
| 572 | 585 | * searchable STRING... |
| 573 | 586 | |
| 574 | 587 | Return true if searching in any of the document classes identified |
| @@ -593,54 +606,54 @@ | ||
| 593 | 606 | if {[searchable cdtw]} {...} |
| 594 | 607 | |
| 595 | 608 | This command is useful for enabling or disabling a "Search" entry on the |
| 596 | 609 | menu bar. |
| 597 | 610 | |
| 598 | -<a name="setParameter"></a>TH1 setParameter Command | |
| 611 | +<a id="setParameter"></a>TH1 setParameter Command | |
| 599 | 612 | --------------------------------------------------- |
| 600 | 613 | |
| 601 | 614 | * setParameter NAME VALUE |
| 602 | 615 | |
| 603 | 616 | Sets the value of the specified query parameter. |
| 604 | 617 | |
| 605 | -<a name="setting"></a>TH1 setting Command | |
| 618 | +<a id="setting"></a>TH1 setting Command | |
| 606 | 619 | ----------------------------------------- |
| 607 | 620 | |
| 608 | 621 | * setting name |
| 609 | 622 | |
| 610 | 623 | Gets and returns the value of the specified setting. |
| 611 | 624 | |
| 612 | -<a name="stime"></a>TH1 stime Command | |
| 625 | +<a id="stime"></a>TH1 stime Command | |
| 613 | 626 | ------------------------------------- |
| 614 | 627 | |
| 615 | 628 | * stime |
| 616 | 629 | |
| 617 | 630 | Returns the number of microseconds of CPU time consumed by the current |
| 618 | 631 | process in system space. |
| 619 | 632 | |
| 620 | -<a name="styleHeader"></a>TH1 styleHeader Command | |
| 633 | +<a id="styleHeader"></a>TH1 styleHeader Command | |
| 621 | 634 | ------------------------------------------------- |
| 622 | 635 | |
| 623 | 636 | * styleHeader TITLE |
| 624 | 637 | |
| 625 | 638 | Render the configured style header for the selected skin. |
| 626 | 639 | |
| 627 | -<a name="styleFooter"></a>TH1 styleFooter Command | |
| 640 | +<a id="styleFooter"></a>TH1 styleFooter Command | |
| 628 | 641 | ------------------------------------------------- |
| 629 | 642 | |
| 630 | 643 | * styleFooter |
| 631 | 644 | |
| 632 | 645 | Render the configured style footer for the selected skin. |
| 633 | 646 | |
| 634 | -<a name="styleScript"></a>TH1 styleScript Command | |
| 647 | +<a id="styleScript"></a>TH1 styleScript Command | |
| 635 | 648 | ------------------------------------------------- |
| 636 | 649 | |
| 637 | 650 | * styleScript |
| 638 | 651 | |
| 639 | 652 | Render the configured JavaScript for the selected skin. |
| 640 | 653 | |
| 641 | -<a name="tclEval"></a>TH1 tclEval Command | |
| 654 | +<a id="tclEval"></a>TH1 tclEval Command | |
| 642 | 655 | ----------------------------------------- |
| 643 | 656 | |
| 644 | 657 | **This command requires the Tcl integration feature.** |
| 645 | 658 | |
| 646 | 659 | * tclEval arg ?arg ...? |
| @@ -647,11 +660,11 @@ | ||
| 647 | 660 | |
| 648 | 661 | Evaluates the Tcl script and returns its result verbatim. If a Tcl script |
| 649 | 662 | error is generated, it will be transformed into a TH1 script error. The |
| 650 | 663 | Tcl interpreter will be created automatically if it has not been already. |
| 651 | 664 | |
| 652 | -<a name="tclExpr"></a>TH1 tclExpr Command | |
| 665 | +<a id="tclExpr"></a>TH1 tclExpr Command | |
| 653 | 666 | ----------------------------------------- |
| 654 | 667 | |
| 655 | 668 | **This command requires the Tcl integration feature.** |
| 656 | 669 | |
| 657 | 670 | * tclExpr arg ?arg ...? |
| @@ -659,11 +672,11 @@ | ||
| 659 | 672 | Evaluates the Tcl expression and returns its result verbatim. If a Tcl |
| 660 | 673 | script error is generated, it will be transformed into a TH1 script |
| 661 | 674 | error. The Tcl interpreter will be created automatically if it has not |
| 662 | 675 | been already. |
| 663 | 676 | |
| 664 | -<a name="tclInvoke"></a>TH1 tclInvoke Command | |
| 677 | +<a id="tclInvoke"></a>TH1 tclInvoke Command | |
| 665 | 678 | --------------------------------------------- |
| 666 | 679 | |
| 667 | 680 | **This command requires the Tcl integration feature.** |
| 668 | 681 | |
| 669 | 682 | * tclInvoke command ?arg ...? |
| @@ -670,21 +683,21 @@ | ||
| 670 | 683 | |
| 671 | 684 | Invokes the Tcl command using the supplied arguments. No additional |
| 672 | 685 | substitutions are performed on the arguments. The Tcl interpreter |
| 673 | 686 | will be created automatically if it has not been already. |
| 674 | 687 | |
| 675 | -<a name="tclIsSafe"></a>TH1 tclIsSafe Command | |
| 688 | +<a id="tclIsSafe"></a>TH1 tclIsSafe Command | |
| 676 | 689 | --------------------------------------------- |
| 677 | 690 | |
| 678 | 691 | **This command requires the Tcl integration feature.** |
| 679 | 692 | |
| 680 | 693 | * tclIsSafe |
| 681 | 694 | |
| 682 | 695 | Returns non-zero if the Tcl interpreter is "safe". The Tcl interpreter |
| 683 | 696 | will be created automatically if it has not been already. |
| 684 | 697 | |
| 685 | -<a name="tclMakeSafe"></a>TH1 tclMakeSafe Command | |
| 698 | +<a id="tclMakeSafe"></a>TH1 tclMakeSafe Command | |
| 686 | 699 | ------------------------------------------------- |
| 687 | 700 | |
| 688 | 701 | **This command requires the Tcl integration feature.** |
| 689 | 702 | |
| 690 | 703 | * tclMakeSafe |
| @@ -692,51 +705,51 @@ | ||
| 692 | 705 | Forces the Tcl interpreter into "safe" mode by removing all "unsafe" |
| 693 | 706 | commands and variables. This operation cannot be undone. The Tcl |
| 694 | 707 | interpreter will remain "safe" until the process terminates. The Tcl |
| 695 | 708 | interpreter will be created automatically if it has not been already. |
| 696 | 709 | |
| 697 | -<a name="tclReady"></a>TH1 tclReady Command | |
| 710 | +<a id="tclReady"></a>TH1 tclReady Command | |
| 698 | 711 | ------------------------------------------- |
| 699 | 712 | |
| 700 | 713 | * tclReady |
| 701 | 714 | |
| 702 | 715 | Returns true if the binary has the Tcl integration feature enabled and it |
| 703 | 716 | is currently available for use by TH1 scripts. |
| 704 | 717 | |
| 705 | -<a name="trace"></a>TH1 trace Command | |
| 718 | +<a id="trace"></a>TH1 trace Command | |
| 706 | 719 | ------------------------------------- |
| 707 | 720 | |
| 708 | 721 | * trace STRING |
| 709 | 722 | |
| 710 | 723 | Generates a TH1 trace message if TH1 tracing is enabled. |
| 711 | 724 | |
| 712 | -<a name="unversioned_content"></a>TH1 unversioned content Command | |
| 725 | +<a id="unversioned_content"></a>TH1 unversioned content Command | |
| 713 | 726 | ----------------------------------------------------------------- |
| 714 | 727 | |
| 715 | 728 | * unversioned content FILENAME |
| 716 | 729 | |
| 717 | 730 | Attempts to locate the specified unversioned file and return its contents. |
| 718 | 731 | An error is generated if the repository is not open or the unversioned file |
| 719 | 732 | cannot be found. |
| 720 | 733 | |
| 721 | -<a name="unversioned_list"></a>TH1 unversioned list Command | |
| 734 | +<a id="unversioned_list"></a>TH1 unversioned list Command | |
| 722 | 735 | ----------------------------------------------------------- |
| 723 | 736 | |
| 724 | 737 | * unversioned list |
| 725 | 738 | |
| 726 | 739 | Returns a list of the names of all unversioned files held in the local |
| 727 | 740 | repository. An error is generated if the repository is not open. |
| 728 | 741 | |
| 729 | -<a name="utime"></a>TH1 utime Command | |
| 742 | +<a id="utime"></a>TH1 utime Command | |
| 730 | 743 | ------------------------------------- |
| 731 | 744 | |
| 732 | 745 | * utime |
| 733 | 746 | |
| 734 | 747 | Returns the number of microseconds of CPU time consumed by the current |
| 735 | 748 | process in user space. |
| 736 | 749 | |
| 737 | -<a name="verifyCsrf"></a>TH1 verifyCsrf Command | |
| 750 | +<a id="verifyCsrf"></a>TH1 verifyCsrf Command | |
| 738 | 751 | ----------------------------------------------- |
| 739 | 752 | |
| 740 | 753 | * verifyCsrf |
| 741 | 754 | |
| 742 | 755 | Before using the results of a form, first call this command to verify |
| @@ -743,19 +756,19 @@ | ||
| 743 | 756 | that this Anti-CSRF token is present and is valid. If the Anti-CSRF token |
| 744 | 757 | is missing or is incorrect, that indicates a cross-site scripting attack. |
| 745 | 758 | If the event of an attack is detected, an error message is generated and |
| 746 | 759 | all further processing is aborted. |
| 747 | 760 | |
| 748 | -<a name="verifyLogin"></a>TH1 verifyLogin Command | |
| 761 | +<a id="verifyLogin"></a>TH1 verifyLogin Command | |
| 749 | 762 | ------------------------------------------------- |
| 750 | 763 | |
| 751 | 764 | * verifyLogin |
| 752 | 765 | |
| 753 | 766 | Returns non-zero if the specified user name and password represent a |
| 754 | 767 | valid login for the repository. |
| 755 | 768 | |
| 756 | -<a name="wiki"></a>TH1 wiki Command | |
| 769 | +<a id="wiki"></a>TH1 wiki Command | |
| 757 | 770 | ----------------------------------- |
| 758 | 771 | |
| 759 | 772 | * wiki STRING |
| 760 | 773 | |
| 761 | 774 | Renders STRING as wiki content. |
| @@ -769,24 +782,24 @@ | ||
| 769 | 782 | Tcl commands: |
| 770 | 783 | |
| 771 | 784 | * th1Eval |
| 772 | 785 | * th1Expr |
| 773 | 786 | |
| 774 | -<a name="th1Eval"></a>Tcl th1Eval Command | |
| 787 | +<a id="th1Eval"></a>Tcl th1Eval Command | |
| 775 | 788 | ----------------------------------------- |
| 776 | 789 | |
| 777 | 790 | **This command requires the Tcl integration feature.** |
| 778 | 791 | |
| 779 | 792 | * th1Eval arg |
| 780 | 793 | |
| 781 | 794 | Evaluates the TH1 script and returns its result verbatim. If a TH1 script |
| 782 | 795 | error is generated, it will be transformed into a Tcl script error. |
| 783 | 796 | |
| 784 | -<a name="th1Expr"></a>Tcl th1Expr Command | |
| 797 | +<a id="th1Expr"></a>Tcl th1Expr Command | |
| 785 | 798 | ----------------------------------------- |
| 786 | 799 | |
| 787 | 800 | **This command requires the Tcl integration feature.** |
| 788 | 801 | |
| 789 | 802 | * th1Expr arg |
| 790 | 803 | |
| 791 | 804 | Evaluates the TH1 expression and returns its result verbatim. If a TH1 |
| 792 | 805 | script error is generated, it will be transformed into a Tcl script error. |
| 793 | 806 |
| --- www/th1.md | |
| +++ www/th1.md | |
| @@ -164,116 +164,129 @@ | |
| 164 | --------------------- |
| 165 | |
| 166 | There are many new commands added to TH1 and used to access the special |
| 167 | features of Fossil. The following is a summary of the extended commands: |
| 168 | |
| 169 | * anoncap |
| 170 | * anycap |
| 171 | * artifact |
| 172 | * cgiHeaderLine |
| 173 | * checkout |
| 174 | * combobox |
| 175 | * copybtn |
| 176 | * date |
| 177 | * decorate |
| 178 | * defHeader |
| 179 | * dir |
| 180 | * enable\_output |
| 181 | * encode64 |
| 182 | * getParameter |
| 183 | * glob\_match |
| 184 | * globalState |
| 185 | * hascap |
| 186 | * hasfeature |
| 187 | * html |
| 188 | * htmlize |
| 189 | * http |
| 190 | * httpize |
| 191 | * insertCsrf |
| 192 | * linecount |
| 193 | * markdown |
| 194 | * nonce |
| 195 | * puts |
| 196 | * query |
| 197 | * randhex |
| 198 | * redirect |
| 199 | * regexp |
| 200 | * reinitialize |
| 201 | * render |
| 202 | * repository |
| 203 | * searchable |
| 204 | * setParameter |
| 205 | * setting |
| 206 | * stime |
| 207 | * styleHeader |
| 208 | * styleFooter |
| 209 | * styleScript |
| 210 | * tclEval |
| 211 | * tclExpr |
| 212 | * tclInvoke |
| 213 | * tclIsSafe |
| 214 | * tclMakeSafe |
| 215 | * tclReady |
| 216 | * trace |
| 217 | * unversioned content |
| 218 | * unversioned list |
| 219 | * utime |
| 220 | * verifyCsrf |
| 221 | * verifyLogin |
| 222 | * wiki |
| 223 | |
| 224 | Each of the commands above is documented by a block comment above their |
| 225 | implementation in the th\_main.c or th\_tcl.c source files. |
| 226 | |
| 227 | All commands starting with "tcl", with the exception of "tclReady", |
| 228 | require the Tcl integration subsystem be included at compile-time. |
| 229 | Additionally, the "tcl" repository setting must be enabled at runtime |
| 230 | in order to successfully make use of these commands. |
| 231 | |
| 232 | <a name="anoncap"></a>TH1 anoncap Command |
| 233 | ----------------------------------------- |
| 234 | |
| 235 | * anoncap STRING... |
| 236 | |
| 237 | Returns true if the anonymous user has all of the capabilities listed |
| 238 | in STRING. |
| 239 | |
| 240 | <a name="anycap"></a>TH1 anycap Command |
| 241 | --------------------------------------- |
| 242 | |
| 243 | * anycap STRING |
| 244 | |
| 245 | Returns true if the current user user has any one of the capabilities |
| 246 | listed in STRING. |
| 247 | |
| 248 | <a name="artifact"></a>TH1 artifact Command |
| 249 | ------------------------------------------- |
| 250 | |
| 251 | * artifact ID ?FILENAME? |
| 252 | |
| 253 | Attempts to locate the specified artifact and return its contents. An |
| 254 | error is generated if the repository is not open or the artifact cannot |
| 255 | be found. |
| 256 | |
| 257 | <a name="cgiHeaderLine"></a>TH1 cgiHeaderLine Command |
| 258 | ----------------------------------------------------- |
| 259 | |
| 260 | * cgiHeaderLine line |
| 261 | |
| 262 | Adds the specified line to the CGI header. |
| 263 | |
| 264 | <a name="checkout"></a>TH1 checkout Command |
| 265 | ------------------------------------------- |
| 266 | |
| 267 | * checkout ?BOOLEAN? |
| 268 | |
| 269 | Return the fully qualified directory name of the current checkout or an |
| 270 | empty string if it is not available. Optionally, it will attempt to find |
| 271 | the current checkout, opening the configuration ("user") database and the |
| 272 | repository as necessary, if the boolean argument is non-zero. |
| 273 | |
| 274 | <a name="combobox"></a>TH1 combobox Command |
| 275 | ------------------------------------------- |
| 276 | |
| 277 | * combobox NAME TEXT-LIST NUMLINES |
| 278 | |
| 279 | Generates and emits an HTML combobox. NAME is both the name of the |
| @@ -280,11 +293,11 @@ | |
| 280 | CGI parameter and the name of a variable that contains the currently |
| 281 | selected value. TEXT-LIST is a list of possible values for the |
| 282 | combobox. NUMLINES is 1 for a true combobox. If NUMLINES is greater |
| 283 | than one then the display is a listbox with the number of lines given. |
| 284 | |
| 285 | <a name="copybtn"></a>TH1 copybtn Command |
| 286 | ----------------------------------------- |
| 287 | |
| 288 | * copybtn TARGETID FLIPPED TEXT ?COPYLENGTH? |
| 289 | |
| 290 | Output TEXT with a click-to-copy button next to it. Loads the copybtn.js |
| @@ -302,34 +315,34 @@ | |
| 302 | * >= 3: Truncate TEXT after COPYLENGTH (single-byte) characters. |
| 303 | * 1: Use the "hash-digits" setting as the limit. |
| 304 | * 2: Use the length appropriate for URLs as the limit (defined at |
| 305 | compile-time by `FOSSIL_HASH_DIGITS_URL`, defaults to 16). |
| 306 | |
| 307 | <a name="date"></a>TH1 date Command |
| 308 | ----------------------------------- |
| 309 | |
| 310 | * date ?-local? |
| 311 | |
| 312 | Return a strings which is the current time and date. If the -local |
| 313 | option is used, the date appears using localtime instead of UTC. |
| 314 | |
| 315 | <a name="decorate"></a>TH1 decorate Command |
| 316 | ------------------------------------------- |
| 317 | |
| 318 | * decorate STRING |
| 319 | |
| 320 | Renders STRING as wiki content; however, only links are handled. No |
| 321 | other markup is processed. |
| 322 | |
| 323 | <a name="defHeader"></a>TH1 defHeader Command |
| 324 | --------------------------------------------- |
| 325 | |
| 326 | * defHeader |
| 327 | |
| 328 | Returns the default page header. |
| 329 | |
| 330 | <a name="dir"></a>TH1 dir Command |
| 331 | --------------------------------- |
| 332 | |
| 333 | * dir CHECKIN ?GLOB? ?DETAILS? |
| 334 | |
| 335 | Returns a list containing all files in CHECKIN. If GLOB is given only |
| @@ -337,42 +350,42 @@ | |
| 337 | If DETAILS is non-zero, the result will be a list-of-lists, with each |
| 338 | element containing at least three elements: the file name, the file |
| 339 | size (in bytes), and the file last modification time (relative to the |
| 340 | time zone configured for the repository). |
| 341 | |
| 342 | <a name="enable_output"></a>TH1 enable\_output Command |
| 343 | ------------------------------------------------------ |
| 344 | |
| 345 | * enable\_output BOOLEAN |
| 346 | |
| 347 | Enable or disable sending output when the combobox, copybtn, puts, or wiki |
| 348 | commands are used. |
| 349 | |
| 350 | <a name="encode64"></a>TH1 encode64 Command |
| 351 | ------------------------------------------- |
| 352 | |
| 353 | * encode64 STRING |
| 354 | |
| 355 | Encode the specified string using Base64 and return the result. |
| 356 | |
| 357 | <a name="getParameter"></a>TH1 getParameter Command |
| 358 | --------------------------------------------------- |
| 359 | |
| 360 | * getParameter NAME ?DEFAULT? |
| 361 | |
| 362 | Returns the value of the specified query parameter or the specified |
| 363 | default value when there is no matching query parameter. |
| 364 | |
| 365 | <a name="glob_match"></a>TH1 glob\_match Command |
| 366 | ------------------------------------------------ |
| 367 | |
| 368 | * glob\_match ?-one? ?--? patternList string |
| 369 | |
| 370 | Checks the string against the specified glob pattern -OR- list of glob |
| 371 | patterns and returns non-zero if there is a match. |
| 372 | |
| 373 | <a name="globalState"></a>TH1 globalState Command |
| 374 | ------------------------------------------------- |
| 375 | |
| 376 | * globalState NAME ?DEFAULT? |
| 377 | |
| 378 | Returns a string containing the value of the specified global state |
| @@ -390,19 +403,19 @@ | |
| 390 | |
| 391 | Attempts to query for unsupported global state variables will result |
| 392 | in a script error. Additional global state variables may be exposed |
| 393 | in the future. |
| 394 | |
| 395 | <a name="hascap"></a>TH1 hascap Command |
| 396 | --------------------------------------- |
| 397 | |
| 398 | * hascap STRING... |
| 399 | |
| 400 | Returns true if the current user has all of the capabilities listed |
| 401 | in STRING. |
| 402 | |
| 403 | <a name="hasfeature"></a>TH1 hasfeature Command |
| 404 | ----------------------------------------------- |
| 405 | |
| 406 | * hasfeature STRING |
| 407 | |
| 408 | Returns true if the binary has the given compile-time feature enabled. |
| @@ -425,26 +438,26 @@ | |
| 425 | 1. **see** -- _Uses the SQLite Encryption Extension._ |
| 426 | |
| 427 | Specifying an unknown feature will return a value of false, it will not |
| 428 | raise a script error. |
| 429 | |
| 430 | <a name="html"></a>TH1 html Command |
| 431 | ----------------------------------- |
| 432 | |
| 433 | * html STRING |
| 434 | |
| 435 | Outputs the STRING escaped for HTML. |
| 436 | |
| 437 | <a name="htmlize"></a>TH1 htmlize Command |
| 438 | ----------------------------------------- |
| 439 | |
| 440 | * htmlize STRING |
| 441 | |
| 442 | Escape all characters of STRING which have special meaning in HTML. |
| 443 | Returns the escaped string. |
| 444 | |
| 445 | <a name="http"></a>TH1 http Command |
| 446 | ----------------------------------- |
| 447 | |
| 448 | * http ?-asynchronous? ?--? url ?payload? |
| 449 | |
| 450 | Performs an HTTP or HTTPS request for the specified URL. If a |
| @@ -453,58 +466,58 @@ | |
| 453 | be used. Upon success, if the -asynchronous option is used, an |
| 454 | empty string is returned as the result; otherwise, the response |
| 455 | from the server is returned as the result. Synchronous requests |
| 456 | are not currently implemented. |
| 457 | |
| 458 | <a name="httpize"></a>TH1 httpize Command |
| 459 | ----------------------------------------- |
| 460 | |
| 461 | * httpize STRING |
| 462 | |
| 463 | Escape all characters of STRING which have special meaning in URI |
| 464 | components. Returns the escaped string. |
| 465 | |
| 466 | <a name="insertCsrf"></a>TH1 insertCsrf Command |
| 467 | ----------------------------------------------- |
| 468 | |
| 469 | * insertCsrf |
| 470 | |
| 471 | While rendering a form, call this command to add the Anti-CSRF token |
| 472 | as a hidden element of the form. |
| 473 | |
| 474 | <a name="linecount"></a>TH1 linecount Command |
| 475 | --------------------------------------------- |
| 476 | |
| 477 | * linecount STRING MAX MIN |
| 478 | |
| 479 | Returns one more than the number of \n characters in STRING. But |
| 480 | never returns less than MIN or more than MAX. |
| 481 | |
| 482 | <a name="markdown"></a>TH1 markdown Command |
| 483 | ------------------------------------------- |
| 484 | |
| 485 | * markdown STRING |
| 486 | |
| 487 | Renders the input string as markdown. The result is a two-element list. |
| 488 | The first element contains the body, rendered as HTML. The second element |
| 489 | is the text-only title string. |
| 490 | |
| 491 | <a name="nonce"></a>TH1 nonce Command |
| 492 | ------------------------------------- |
| 493 | |
| 494 | * nonce |
| 495 | |
| 496 | Returns the value of the cryptographic nonce for the request being processed. |
| 497 | |
| 498 | <a name="puts"></a>TH1 puts Command |
| 499 | ----------------------------------- |
| 500 | |
| 501 | * puts STRING |
| 502 | |
| 503 | Outputs the STRING unchanged. |
| 504 | |
| 505 | <a name="query"></a>TH1 query Command |
| 506 | ------------------------------------- |
| 507 | |
| 508 | * query ?-nocomplain? SQL CODE |
| 509 | |
| 510 | Runs the SQL query given by the SQL argument. For each row in the result |
| @@ -512,19 +525,19 @@ | |
| 512 | |
| 513 | In SQL, parameters such as $var are filled in using the value of variable |
| 514 | "var". Result values are stored in variables with the column name prior |
| 515 | to each invocation of CODE. |
| 516 | |
| 517 | <a name="randhex"></a>TH1 randhex Command |
| 518 | ----------------------------------------- |
| 519 | |
| 520 | * randhex N |
| 521 | |
| 522 | Returns a string of N*2 random hexadecimal digits with N<50. If N is |
| 523 | omitted, use a value of 10. |
| 524 | |
| 525 | <a name="redirect"></a>TH1 redirect Command |
| 526 | ------------------------------------------- |
| 527 | |
| 528 | * redirect URL ?withMethod? |
| 529 | |
| 530 | Issues an HTTP redirect to the specified URL and then exits the process. |
| @@ -532,43 +545,43 @@ | |
| 532 | argument is present and non-zero, an HTTP status code of 307 is used, which |
| 533 | should force the user agent to preserve the original method for the request |
| 534 | (e.g. GET, POST) instead of (possibly) forcing the user agent to change the |
| 535 | method to GET. |
| 536 | |
| 537 | <a name="regexp"></a>TH1 regexp Command |
| 538 | --------------------------------------- |
| 539 | |
| 540 | * regexp ?-nocase? ?--? exp string |
| 541 | |
| 542 | Checks the string against the specified regular expression and returns |
| 543 | non-zero if it matches. If the regular expression is invalid or cannot |
| 544 | be compiled, an error will be generated. |
| 545 | |
| 546 | <a name="reinitialize"></a>TH1 reinitialize Command |
| 547 | --------------------------------------------------- |
| 548 | |
| 549 | * reinitialize ?FLAGS? |
| 550 | |
| 551 | Reinitializes the TH1 interpreter using the specified flags. |
| 552 | |
| 553 | <a name="render"></a>TH1 render Command |
| 554 | --------------------------------------- |
| 555 | |
| 556 | * render STRING |
| 557 | |
| 558 | Renders the TH1 template and writes the results. |
| 559 | |
| 560 | <a name="repository"></a>TH1 repository Command |
| 561 | ----------------------------------------------- |
| 562 | |
| 563 | * repository ?BOOLEAN? |
| 564 | |
| 565 | Returns the fully qualified file name of the open repository or an empty |
| 566 | string if one is not currently open. Optionally, it will attempt to open |
| 567 | the repository if the boolean argument is non-zero. |
| 568 | |
| 569 | <a name="searchable"></a>TH1 searchable Command |
| 570 | ----------------------------------------------- |
| 571 | |
| 572 | * searchable STRING... |
| 573 | |
| 574 | Return true if searching in any of the document classes identified |
| @@ -593,54 +606,54 @@ | |
| 593 | if {[searchable cdtw]} {...} |
| 594 | |
| 595 | This command is useful for enabling or disabling a "Search" entry on the |
| 596 | menu bar. |
| 597 | |
| 598 | <a name="setParameter"></a>TH1 setParameter Command |
| 599 | --------------------------------------------------- |
| 600 | |
| 601 | * setParameter NAME VALUE |
| 602 | |
| 603 | Sets the value of the specified query parameter. |
| 604 | |
| 605 | <a name="setting"></a>TH1 setting Command |
| 606 | ----------------------------------------- |
| 607 | |
| 608 | * setting name |
| 609 | |
| 610 | Gets and returns the value of the specified setting. |
| 611 | |
| 612 | <a name="stime"></a>TH1 stime Command |
| 613 | ------------------------------------- |
| 614 | |
| 615 | * stime |
| 616 | |
| 617 | Returns the number of microseconds of CPU time consumed by the current |
| 618 | process in system space. |
| 619 | |
| 620 | <a name="styleHeader"></a>TH1 styleHeader Command |
| 621 | ------------------------------------------------- |
| 622 | |
| 623 | * styleHeader TITLE |
| 624 | |
| 625 | Render the configured style header for the selected skin. |
| 626 | |
| 627 | <a name="styleFooter"></a>TH1 styleFooter Command |
| 628 | ------------------------------------------------- |
| 629 | |
| 630 | * styleFooter |
| 631 | |
| 632 | Render the configured style footer for the selected skin. |
| 633 | |
| 634 | <a name="styleScript"></a>TH1 styleScript Command |
| 635 | ------------------------------------------------- |
| 636 | |
| 637 | * styleScript |
| 638 | |
| 639 | Render the configured JavaScript for the selected skin. |
| 640 | |
| 641 | <a name="tclEval"></a>TH1 tclEval Command |
| 642 | ----------------------------------------- |
| 643 | |
| 644 | **This command requires the Tcl integration feature.** |
| 645 | |
| 646 | * tclEval arg ?arg ...? |
| @@ -647,11 +660,11 @@ | |
| 647 | |
| 648 | Evaluates the Tcl script and returns its result verbatim. If a Tcl script |
| 649 | error is generated, it will be transformed into a TH1 script error. The |
| 650 | Tcl interpreter will be created automatically if it has not been already. |
| 651 | |
| 652 | <a name="tclExpr"></a>TH1 tclExpr Command |
| 653 | ----------------------------------------- |
| 654 | |
| 655 | **This command requires the Tcl integration feature.** |
| 656 | |
| 657 | * tclExpr arg ?arg ...? |
| @@ -659,11 +672,11 @@ | |
| 659 | Evaluates the Tcl expression and returns its result verbatim. If a Tcl |
| 660 | script error is generated, it will be transformed into a TH1 script |
| 661 | error. The Tcl interpreter will be created automatically if it has not |
| 662 | been already. |
| 663 | |
| 664 | <a name="tclInvoke"></a>TH1 tclInvoke Command |
| 665 | --------------------------------------------- |
| 666 | |
| 667 | **This command requires the Tcl integration feature.** |
| 668 | |
| 669 | * tclInvoke command ?arg ...? |
| @@ -670,21 +683,21 @@ | |
| 670 | |
| 671 | Invokes the Tcl command using the supplied arguments. No additional |
| 672 | substitutions are performed on the arguments. The Tcl interpreter |
| 673 | will be created automatically if it has not been already. |
| 674 | |
| 675 | <a name="tclIsSafe"></a>TH1 tclIsSafe Command |
| 676 | --------------------------------------------- |
| 677 | |
| 678 | **This command requires the Tcl integration feature.** |
| 679 | |
| 680 | * tclIsSafe |
| 681 | |
| 682 | Returns non-zero if the Tcl interpreter is "safe". The Tcl interpreter |
| 683 | will be created automatically if it has not been already. |
| 684 | |
| 685 | <a name="tclMakeSafe"></a>TH1 tclMakeSafe Command |
| 686 | ------------------------------------------------- |
| 687 | |
| 688 | **This command requires the Tcl integration feature.** |
| 689 | |
| 690 | * tclMakeSafe |
| @@ -692,51 +705,51 @@ | |
| 692 | Forces the Tcl interpreter into "safe" mode by removing all "unsafe" |
| 693 | commands and variables. This operation cannot be undone. The Tcl |
| 694 | interpreter will remain "safe" until the process terminates. The Tcl |
| 695 | interpreter will be created automatically if it has not been already. |
| 696 | |
| 697 | <a name="tclReady"></a>TH1 tclReady Command |
| 698 | ------------------------------------------- |
| 699 | |
| 700 | * tclReady |
| 701 | |
| 702 | Returns true if the binary has the Tcl integration feature enabled and it |
| 703 | is currently available for use by TH1 scripts. |
| 704 | |
| 705 | <a name="trace"></a>TH1 trace Command |
| 706 | ------------------------------------- |
| 707 | |
| 708 | * trace STRING |
| 709 | |
| 710 | Generates a TH1 trace message if TH1 tracing is enabled. |
| 711 | |
| 712 | <a name="unversioned_content"></a>TH1 unversioned content Command |
| 713 | ----------------------------------------------------------------- |
| 714 | |
| 715 | * unversioned content FILENAME |
| 716 | |
| 717 | Attempts to locate the specified unversioned file and return its contents. |
| 718 | An error is generated if the repository is not open or the unversioned file |
| 719 | cannot be found. |
| 720 | |
| 721 | <a name="unversioned_list"></a>TH1 unversioned list Command |
| 722 | ----------------------------------------------------------- |
| 723 | |
| 724 | * unversioned list |
| 725 | |
| 726 | Returns a list of the names of all unversioned files held in the local |
| 727 | repository. An error is generated if the repository is not open. |
| 728 | |
| 729 | <a name="utime"></a>TH1 utime Command |
| 730 | ------------------------------------- |
| 731 | |
| 732 | * utime |
| 733 | |
| 734 | Returns the number of microseconds of CPU time consumed by the current |
| 735 | process in user space. |
| 736 | |
| 737 | <a name="verifyCsrf"></a>TH1 verifyCsrf Command |
| 738 | ----------------------------------------------- |
| 739 | |
| 740 | * verifyCsrf |
| 741 | |
| 742 | Before using the results of a form, first call this command to verify |
| @@ -743,19 +756,19 @@ | |
| 743 | that this Anti-CSRF token is present and is valid. If the Anti-CSRF token |
| 744 | is missing or is incorrect, that indicates a cross-site scripting attack. |
| 745 | If the event of an attack is detected, an error message is generated and |
| 746 | all further processing is aborted. |
| 747 | |
| 748 | <a name="verifyLogin"></a>TH1 verifyLogin Command |
| 749 | ------------------------------------------------- |
| 750 | |
| 751 | * verifyLogin |
| 752 | |
| 753 | Returns non-zero if the specified user name and password represent a |
| 754 | valid login for the repository. |
| 755 | |
| 756 | <a name="wiki"></a>TH1 wiki Command |
| 757 | ----------------------------------- |
| 758 | |
| 759 | * wiki STRING |
| 760 | |
| 761 | Renders STRING as wiki content. |
| @@ -769,24 +782,24 @@ | |
| 769 | Tcl commands: |
| 770 | |
| 771 | * th1Eval |
| 772 | * th1Expr |
| 773 | |
| 774 | <a name="th1Eval"></a>Tcl th1Eval Command |
| 775 | ----------------------------------------- |
| 776 | |
| 777 | **This command requires the Tcl integration feature.** |
| 778 | |
| 779 | * th1Eval arg |
| 780 | |
| 781 | Evaluates the TH1 script and returns its result verbatim. If a TH1 script |
| 782 | error is generated, it will be transformed into a Tcl script error. |
| 783 | |
| 784 | <a name="th1Expr"></a>Tcl th1Expr Command |
| 785 | ----------------------------------------- |
| 786 | |
| 787 | **This command requires the Tcl integration feature.** |
| 788 | |
| 789 | * th1Expr arg |
| 790 | |
| 791 | Evaluates the TH1 expression and returns its result verbatim. If a TH1 |
| 792 | script error is generated, it will be transformed into a Tcl script error. |
| 793 |
| --- www/th1.md | |
| +++ www/th1.md | |
| @@ -164,116 +164,129 @@ | |
| 164 | --------------------- |
| 165 | |
| 166 | There are many new commands added to TH1 and used to access the special |
| 167 | features of Fossil. The following is a summary of the extended commands: |
| 168 | |
| 169 | * [anoncap](#anoncap) |
| 170 | * [anycap](#anycap) |
| 171 | * [artifact](#artifact) |
| 172 | * [captureTh1](#captureTh1) |
| 173 | * [cgiHeaderLine](#cgiHeaderLine) |
| 174 | * [checkout](#checkout) |
| 175 | * [combobox](#combobox) |
| 176 | * [copybtn](#copybtn) |
| 177 | * [date](#date) |
| 178 | * [decorate](#decorate) |
| 179 | * [defHeader](#defHeader) |
| 180 | * [dir](#dir) |
| 181 | * [enable\_output](#enable_output) |
| 182 | * [encode64](#encode64) |
| 183 | * [getParameter](#getParameter) |
| 184 | * [glob\_match](#glob_match) |
| 185 | * [globalState](#globalState) |
| 186 | * [hascap](#hascap) |
| 187 | * [hasfeature](#hasfeature) |
| 188 | * [html](#html) |
| 189 | * [htmlize](#htmlize) |
| 190 | * [http](#http) |
| 191 | * [httpize](#httpize) |
| 192 | * [insertCsrf](#insertCsrf) |
| 193 | * [linecount](#linecount) |
| 194 | * [markdown](#markdown) |
| 195 | * [nonce](#nonce) |
| 196 | * [puts](#puts) |
| 197 | * [query](#query) |
| 198 | * [randhex](#randhex) |
| 199 | * [redirect](#redirect) |
| 200 | * [regexp](#regexp) |
| 201 | * [reinitialize](#reinitialize) |
| 202 | * [render](#render) |
| 203 | * [repository](#repository) |
| 204 | * [searchable](#searchable) |
| 205 | * [setParameter](#setParameter) |
| 206 | * [setting](#setting) |
| 207 | * [stime](#stime) |
| 208 | * [styleHeader](#styleHeader) |
| 209 | * [styleFooter](#styleFooter) |
| 210 | * [styleScript](#styleScript) |
| 211 | * [tclEval](#tclEval) |
| 212 | * [tclExpr](#tclExpr) |
| 213 | * [tclInvoke](#tclInvoke) |
| 214 | * [tclIsSafe](#tclIsSafe) |
| 215 | * [tclMakeSafe](#tclMakeSafe) |
| 216 | * [tclReady](#tclReady) |
| 217 | * [trace](#trace) |
| 218 | * [unversioned content](#unversioned_content) |
| 219 | * [unversioned list](#unversioned_list) |
| 220 | * [utime](#utime) |
| 221 | * [verifyCsrf](#verifyCsrf) |
| 222 | * [verifyLogin](#verifyLogin) |
| 223 | * [wiki](#wiki) |
| 224 | |
| 225 | Each of the commands above is documented by a block comment above their |
| 226 | implementation in the th\_main.c or th\_tcl.c source files. |
| 227 | |
| 228 | All commands starting with "tcl", with the exception of "tclReady", |
| 229 | require the Tcl integration subsystem be included at compile-time. |
| 230 | Additionally, the "tcl" repository setting must be enabled at runtime |
| 231 | in order to successfully make use of these commands. |
| 232 | |
| 233 | <a id="anoncap"></a>TH1 anoncap Command |
| 234 | ----------------------------------------- |
| 235 | |
| 236 | * anoncap STRING... |
| 237 | |
| 238 | Returns true if the anonymous user has all of the capabilities listed |
| 239 | in STRING. |
| 240 | |
| 241 | <a id="anycap"></a>TH1 anycap Command |
| 242 | --------------------------------------- |
| 243 | |
| 244 | * anycap STRING |
| 245 | |
| 246 | Returns true if the current user user has any one of the capabilities |
| 247 | listed in STRING. |
| 248 | |
| 249 | <a id="artifact"></a>TH1 artifact Command |
| 250 | ------------------------------------------- |
| 251 | |
| 252 | * artifact ID ?FILENAME? |
| 253 | |
| 254 | Attempts to locate the specified artifact and return its contents. An |
| 255 | error is generated if the repository is not open or the artifact cannot |
| 256 | be found. |
| 257 | |
| 258 | <a id="captureTh1"></a>TH1 captureTh1 Command |
| 259 | ----------------------------------------------------- |
| 260 | |
| 261 | * captureTh1 STRING |
| 262 | |
| 263 | Executes its single argument as TH1 code and captures any |
| 264 | TH1-generated output as a string, which becomes the result of the |
| 265 | function call. e.g. any `puts` calls made from that block will not |
| 266 | generate any output, and instead their output will become part of the |
| 267 | result string. |
| 268 | |
| 269 | |
| 270 | <a id="cgiHeaderLine"></a>TH1 cgiHeaderLine Command |
| 271 | ----------------------------------------------------- |
| 272 | |
| 273 | * cgiHeaderLine line |
| 274 | |
| 275 | Adds the specified line to the CGI header. |
| 276 | |
| 277 | <a id="checkout"></a>TH1 checkout Command |
| 278 | ------------------------------------------- |
| 279 | |
| 280 | * checkout ?BOOLEAN? |
| 281 | |
| 282 | Return the fully qualified directory name of the current checkout or an |
| 283 | empty string if it is not available. Optionally, it will attempt to find |
| 284 | the current checkout, opening the configuration ("user") database and the |
| 285 | repository as necessary, if the boolean argument is non-zero. |
| 286 | |
| 287 | <a id="combobox"></a>TH1 combobox Command |
| 288 | ------------------------------------------- |
| 289 | |
| 290 | * combobox NAME TEXT-LIST NUMLINES |
| 291 | |
| 292 | Generates and emits an HTML combobox. NAME is both the name of the |
| @@ -280,11 +293,11 @@ | |
| 293 | CGI parameter and the name of a variable that contains the currently |
| 294 | selected value. TEXT-LIST is a list of possible values for the |
| 295 | combobox. NUMLINES is 1 for a true combobox. If NUMLINES is greater |
| 296 | than one then the display is a listbox with the number of lines given. |
| 297 | |
| 298 | <a id="copybtn"></a>TH1 copybtn Command |
| 299 | ----------------------------------------- |
| 300 | |
| 301 | * copybtn TARGETID FLIPPED TEXT ?COPYLENGTH? |
| 302 | |
| 303 | Output TEXT with a click-to-copy button next to it. Loads the copybtn.js |
| @@ -302,34 +315,34 @@ | |
| 315 | * >= 3: Truncate TEXT after COPYLENGTH (single-byte) characters. |
| 316 | * 1: Use the "hash-digits" setting as the limit. |
| 317 | * 2: Use the length appropriate for URLs as the limit (defined at |
| 318 | compile-time by `FOSSIL_HASH_DIGITS_URL`, defaults to 16). |
| 319 | |
| 320 | <a id="date"></a>TH1 date Command |
| 321 | ----------------------------------- |
| 322 | |
| 323 | * date ?-local? |
| 324 | |
| 325 | Return a strings which is the current time and date. If the -local |
| 326 | option is used, the date appears using localtime instead of UTC. |
| 327 | |
| 328 | <a id="decorate"></a>TH1 decorate Command |
| 329 | ------------------------------------------- |
| 330 | |
| 331 | * decorate STRING |
| 332 | |
| 333 | Renders STRING as wiki content; however, only links are handled. No |
| 334 | other markup is processed. |
| 335 | |
| 336 | <a id="defHeader"></a>TH1 defHeader Command |
| 337 | --------------------------------------------- |
| 338 | |
| 339 | * defHeader |
| 340 | |
| 341 | Returns the default page header. |
| 342 | |
| 343 | <a id="dir"></a>TH1 dir Command |
| 344 | --------------------------------- |
| 345 | |
| 346 | * dir CHECKIN ?GLOB? ?DETAILS? |
| 347 | |
| 348 | Returns a list containing all files in CHECKIN. If GLOB is given only |
| @@ -337,42 +350,42 @@ | |
| 350 | If DETAILS is non-zero, the result will be a list-of-lists, with each |
| 351 | element containing at least three elements: the file name, the file |
| 352 | size (in bytes), and the file last modification time (relative to the |
| 353 | time zone configured for the repository). |
| 354 | |
| 355 | <a id="enable_output"></a>TH1 enable\_output Command |
| 356 | ------------------------------------------------------ |
| 357 | |
| 358 | * enable\_output BOOLEAN |
| 359 | |
| 360 | Enable or disable sending output when the combobox, copybtn, puts, or wiki |
| 361 | commands are used. |
| 362 | |
| 363 | <a id="encode64"></a>TH1 encode64 Command |
| 364 | ------------------------------------------- |
| 365 | |
| 366 | * encode64 STRING |
| 367 | |
| 368 | Encode the specified string using Base64 and return the result. |
| 369 | |
| 370 | <a id="getParameter"></a>TH1 getParameter Command |
| 371 | --------------------------------------------------- |
| 372 | |
| 373 | * getParameter NAME ?DEFAULT? |
| 374 | |
| 375 | Returns the value of the specified query parameter or the specified |
| 376 | default value when there is no matching query parameter. |
| 377 | |
| 378 | <a id="glob_match"></a>TH1 glob\_match Command |
| 379 | ------------------------------------------------ |
| 380 | |
| 381 | * glob\_match ?-one? ?--? patternList string |
| 382 | |
| 383 | Checks the string against the specified glob pattern -OR- list of glob |
| 384 | patterns and returns non-zero if there is a match. |
| 385 | |
| 386 | <a id="globalState"></a>TH1 globalState Command |
| 387 | ------------------------------------------------- |
| 388 | |
| 389 | * globalState NAME ?DEFAULT? |
| 390 | |
| 391 | Returns a string containing the value of the specified global state |
| @@ -390,19 +403,19 @@ | |
| 403 | |
| 404 | Attempts to query for unsupported global state variables will result |
| 405 | in a script error. Additional global state variables may be exposed |
| 406 | in the future. |
| 407 | |
| 408 | <a id="hascap"></a>TH1 hascap Command |
| 409 | --------------------------------------- |
| 410 | |
| 411 | * hascap STRING... |
| 412 | |
| 413 | Returns true if the current user has all of the capabilities listed |
| 414 | in STRING. |
| 415 | |
| 416 | <a id="hasfeature"></a>TH1 hasfeature Command |
| 417 | ----------------------------------------------- |
| 418 | |
| 419 | * hasfeature STRING |
| 420 | |
| 421 | Returns true if the binary has the given compile-time feature enabled. |
| @@ -425,26 +438,26 @@ | |
| 438 | 1. **see** -- _Uses the SQLite Encryption Extension._ |
| 439 | |
| 440 | Specifying an unknown feature will return a value of false, it will not |
| 441 | raise a script error. |
| 442 | |
| 443 | <a id="html"></a>TH1 html Command |
| 444 | ----------------------------------- |
| 445 | |
| 446 | * html STRING |
| 447 | |
| 448 | Outputs the STRING escaped for HTML. |
| 449 | |
| 450 | <a id="htmlize"></a>TH1 htmlize Command |
| 451 | ----------------------------------------- |
| 452 | |
| 453 | * htmlize STRING |
| 454 | |
| 455 | Escape all characters of STRING which have special meaning in HTML. |
| 456 | Returns the escaped string. |
| 457 | |
| 458 | <a id="http"></a>TH1 http Command |
| 459 | ----------------------------------- |
| 460 | |
| 461 | * http ?-asynchronous? ?--? url ?payload? |
| 462 | |
| 463 | Performs an HTTP or HTTPS request for the specified URL. If a |
| @@ -453,58 +466,58 @@ | |
| 466 | be used. Upon success, if the -asynchronous option is used, an |
| 467 | empty string is returned as the result; otherwise, the response |
| 468 | from the server is returned as the result. Synchronous requests |
| 469 | are not currently implemented. |
| 470 | |
| 471 | <a id="httpize"></a>TH1 httpize Command |
| 472 | ----------------------------------------- |
| 473 | |
| 474 | * httpize STRING |
| 475 | |
| 476 | Escape all characters of STRING which have special meaning in URI |
| 477 | components. Returns the escaped string. |
| 478 | |
| 479 | <a id="insertCsrf"></a>TH1 insertCsrf Command |
| 480 | ----------------------------------------------- |
| 481 | |
| 482 | * insertCsrf |
| 483 | |
| 484 | While rendering a form, call this command to add the Anti-CSRF token |
| 485 | as a hidden element of the form. |
| 486 | |
| 487 | <a id="linecount"></a>TH1 linecount Command |
| 488 | --------------------------------------------- |
| 489 | |
| 490 | * linecount STRING MAX MIN |
| 491 | |
| 492 | Returns one more than the number of \n characters in STRING. But |
| 493 | never returns less than MIN or more than MAX. |
| 494 | |
| 495 | <a id="markdown"></a>TH1 markdown Command |
| 496 | ------------------------------------------- |
| 497 | |
| 498 | * markdown STRING |
| 499 | |
| 500 | Renders the input string as markdown. The result is a two-element list. |
| 501 | The first element contains the body, rendered as HTML. The second element |
| 502 | is the text-only title string. |
| 503 | |
| 504 | <a id="nonce"></a>TH1 nonce Command |
| 505 | ------------------------------------- |
| 506 | |
| 507 | * nonce |
| 508 | |
| 509 | Returns the value of the cryptographic nonce for the request being processed. |
| 510 | |
| 511 | <a id="puts"></a>TH1 puts Command |
| 512 | ----------------------------------- |
| 513 | |
| 514 | * puts STRING |
| 515 | |
| 516 | Outputs the STRING unchanged. |
| 517 | |
| 518 | <a id="query"></a>TH1 query Command |
| 519 | ------------------------------------- |
| 520 | |
| 521 | * query ?-nocomplain? SQL CODE |
| 522 | |
| 523 | Runs the SQL query given by the SQL argument. For each row in the result |
| @@ -512,19 +525,19 @@ | |
| 525 | |
| 526 | In SQL, parameters such as $var are filled in using the value of variable |
| 527 | "var". Result values are stored in variables with the column name prior |
| 528 | to each invocation of CODE. |
| 529 | |
| 530 | <a id="randhex"></a>TH1 randhex Command |
| 531 | ----------------------------------------- |
| 532 | |
| 533 | * randhex N |
| 534 | |
| 535 | Returns a string of N*2 random hexadecimal digits with N<50. If N is |
| 536 | omitted, use a value of 10. |
| 537 | |
| 538 | <a id="redirect"></a>TH1 redirect Command |
| 539 | ------------------------------------------- |
| 540 | |
| 541 | * redirect URL ?withMethod? |
| 542 | |
| 543 | Issues an HTTP redirect to the specified URL and then exits the process. |
| @@ -532,43 +545,43 @@ | |
| 545 | argument is present and non-zero, an HTTP status code of 307 is used, which |
| 546 | should force the user agent to preserve the original method for the request |
| 547 | (e.g. GET, POST) instead of (possibly) forcing the user agent to change the |
| 548 | method to GET. |
| 549 | |
| 550 | <a id="regexp"></a>TH1 regexp Command |
| 551 | --------------------------------------- |
| 552 | |
| 553 | * regexp ?-nocase? ?--? exp string |
| 554 | |
| 555 | Checks the string against the specified regular expression and returns |
| 556 | non-zero if it matches. If the regular expression is invalid or cannot |
| 557 | be compiled, an error will be generated. |
| 558 | |
| 559 | <a id="reinitialize"></a>TH1 reinitialize Command |
| 560 | --------------------------------------------------- |
| 561 | |
| 562 | * reinitialize ?FLAGS? |
| 563 | |
| 564 | Reinitializes the TH1 interpreter using the specified flags. |
| 565 | |
| 566 | <a id="render"></a>TH1 render Command |
| 567 | --------------------------------------- |
| 568 | |
| 569 | * render STRING |
| 570 | |
| 571 | Renders the TH1 template and writes the results. |
| 572 | |
| 573 | <a id="repository"></a>TH1 repository Command |
| 574 | ----------------------------------------------- |
| 575 | |
| 576 | * repository ?BOOLEAN? |
| 577 | |
| 578 | Returns the fully qualified file name of the open repository or an empty |
| 579 | string if one is not currently open. Optionally, it will attempt to open |
| 580 | the repository if the boolean argument is non-zero. |
| 581 | |
| 582 | <a id="searchable"></a>TH1 searchable Command |
| 583 | ----------------------------------------------- |
| 584 | |
| 585 | * searchable STRING... |
| 586 | |
| 587 | Return true if searching in any of the document classes identified |
| @@ -593,54 +606,54 @@ | |
| 606 | if {[searchable cdtw]} {...} |
| 607 | |
| 608 | This command is useful for enabling or disabling a "Search" entry on the |
| 609 | menu bar. |
| 610 | |
| 611 | <a id="setParameter"></a>TH1 setParameter Command |
| 612 | --------------------------------------------------- |
| 613 | |
| 614 | * setParameter NAME VALUE |
| 615 | |
| 616 | Sets the value of the specified query parameter. |
| 617 | |
| 618 | <a id="setting"></a>TH1 setting Command |
| 619 | ----------------------------------------- |
| 620 | |
| 621 | * setting name |
| 622 | |
| 623 | Gets and returns the value of the specified setting. |
| 624 | |
| 625 | <a id="stime"></a>TH1 stime Command |
| 626 | ------------------------------------- |
| 627 | |
| 628 | * stime |
| 629 | |
| 630 | Returns the number of microseconds of CPU time consumed by the current |
| 631 | process in system space. |
| 632 | |
| 633 | <a id="styleHeader"></a>TH1 styleHeader Command |
| 634 | ------------------------------------------------- |
| 635 | |
| 636 | * styleHeader TITLE |
| 637 | |
| 638 | Render the configured style header for the selected skin. |
| 639 | |
| 640 | <a id="styleFooter"></a>TH1 styleFooter Command |
| 641 | ------------------------------------------------- |
| 642 | |
| 643 | * styleFooter |
| 644 | |
| 645 | Render the configured style footer for the selected skin. |
| 646 | |
| 647 | <a id="styleScript"></a>TH1 styleScript Command |
| 648 | ------------------------------------------------- |
| 649 | |
| 650 | * styleScript |
| 651 | |
| 652 | Render the configured JavaScript for the selected skin. |
| 653 | |
| 654 | <a id="tclEval"></a>TH1 tclEval Command |
| 655 | ----------------------------------------- |
| 656 | |
| 657 | **This command requires the Tcl integration feature.** |
| 658 | |
| 659 | * tclEval arg ?arg ...? |
| @@ -647,11 +660,11 @@ | |
| 660 | |
| 661 | Evaluates the Tcl script and returns its result verbatim. If a Tcl script |
| 662 | error is generated, it will be transformed into a TH1 script error. The |
| 663 | Tcl interpreter will be created automatically if it has not been already. |
| 664 | |
| 665 | <a id="tclExpr"></a>TH1 tclExpr Command |
| 666 | ----------------------------------------- |
| 667 | |
| 668 | **This command requires the Tcl integration feature.** |
| 669 | |
| 670 | * tclExpr arg ?arg ...? |
| @@ -659,11 +672,11 @@ | |
| 672 | Evaluates the Tcl expression and returns its result verbatim. If a Tcl |
| 673 | script error is generated, it will be transformed into a TH1 script |
| 674 | error. The Tcl interpreter will be created automatically if it has not |
| 675 | been already. |
| 676 | |
| 677 | <a id="tclInvoke"></a>TH1 tclInvoke Command |
| 678 | --------------------------------------------- |
| 679 | |
| 680 | **This command requires the Tcl integration feature.** |
| 681 | |
| 682 | * tclInvoke command ?arg ...? |
| @@ -670,21 +683,21 @@ | |
| 683 | |
| 684 | Invokes the Tcl command using the supplied arguments. No additional |
| 685 | substitutions are performed on the arguments. The Tcl interpreter |
| 686 | will be created automatically if it has not been already. |
| 687 | |
| 688 | <a id="tclIsSafe"></a>TH1 tclIsSafe Command |
| 689 | --------------------------------------------- |
| 690 | |
| 691 | **This command requires the Tcl integration feature.** |
| 692 | |
| 693 | * tclIsSafe |
| 694 | |
| 695 | Returns non-zero if the Tcl interpreter is "safe". The Tcl interpreter |
| 696 | will be created automatically if it has not been already. |
| 697 | |
| 698 | <a id="tclMakeSafe"></a>TH1 tclMakeSafe Command |
| 699 | ------------------------------------------------- |
| 700 | |
| 701 | **This command requires the Tcl integration feature.** |
| 702 | |
| 703 | * tclMakeSafe |
| @@ -692,51 +705,51 @@ | |
| 705 | Forces the Tcl interpreter into "safe" mode by removing all "unsafe" |
| 706 | commands and variables. This operation cannot be undone. The Tcl |
| 707 | interpreter will remain "safe" until the process terminates. The Tcl |
| 708 | interpreter will be created automatically if it has not been already. |
| 709 | |
| 710 | <a id="tclReady"></a>TH1 tclReady Command |
| 711 | ------------------------------------------- |
| 712 | |
| 713 | * tclReady |
| 714 | |
| 715 | Returns true if the binary has the Tcl integration feature enabled and it |
| 716 | is currently available for use by TH1 scripts. |
| 717 | |
| 718 | <a id="trace"></a>TH1 trace Command |
| 719 | ------------------------------------- |
| 720 | |
| 721 | * trace STRING |
| 722 | |
| 723 | Generates a TH1 trace message if TH1 tracing is enabled. |
| 724 | |
| 725 | <a id="unversioned_content"></a>TH1 unversioned content Command |
| 726 | ----------------------------------------------------------------- |
| 727 | |
| 728 | * unversioned content FILENAME |
| 729 | |
| 730 | Attempts to locate the specified unversioned file and return its contents. |
| 731 | An error is generated if the repository is not open or the unversioned file |
| 732 | cannot be found. |
| 733 | |
| 734 | <a id="unversioned_list"></a>TH1 unversioned list Command |
| 735 | ----------------------------------------------------------- |
| 736 | |
| 737 | * unversioned list |
| 738 | |
| 739 | Returns a list of the names of all unversioned files held in the local |
| 740 | repository. An error is generated if the repository is not open. |
| 741 | |
| 742 | <a id="utime"></a>TH1 utime Command |
| 743 | ------------------------------------- |
| 744 | |
| 745 | * utime |
| 746 | |
| 747 | Returns the number of microseconds of CPU time consumed by the current |
| 748 | process in user space. |
| 749 | |
| 750 | <a id="verifyCsrf"></a>TH1 verifyCsrf Command |
| 751 | ----------------------------------------------- |
| 752 | |
| 753 | * verifyCsrf |
| 754 | |
| 755 | Before using the results of a form, first call this command to verify |
| @@ -743,19 +756,19 @@ | |
| 756 | that this Anti-CSRF token is present and is valid. If the Anti-CSRF token |
| 757 | is missing or is incorrect, that indicates a cross-site scripting attack. |
| 758 | If the event of an attack is detected, an error message is generated and |
| 759 | all further processing is aborted. |
| 760 | |
| 761 | <a id="verifyLogin"></a>TH1 verifyLogin Command |
| 762 | ------------------------------------------------- |
| 763 | |
| 764 | * verifyLogin |
| 765 | |
| 766 | Returns non-zero if the specified user name and password represent a |
| 767 | valid login for the repository. |
| 768 | |
| 769 | <a id="wiki"></a>TH1 wiki Command |
| 770 | ----------------------------------- |
| 771 | |
| 772 | * wiki STRING |
| 773 | |
| 774 | Renders STRING as wiki content. |
| @@ -769,24 +782,24 @@ | |
| 782 | Tcl commands: |
| 783 | |
| 784 | * th1Eval |
| 785 | * th1Expr |
| 786 | |
| 787 | <a id="th1Eval"></a>Tcl th1Eval Command |
| 788 | ----------------------------------------- |
| 789 | |
| 790 | **This command requires the Tcl integration feature.** |
| 791 | |
| 792 | * th1Eval arg |
| 793 | |
| 794 | Evaluates the TH1 script and returns its result verbatim. If a TH1 script |
| 795 | error is generated, it will be transformed into a Tcl script error. |
| 796 | |
| 797 | <a id="th1Expr"></a>Tcl th1Expr Command |
| 798 | ----------------------------------------- |
| 799 | |
| 800 | **This command requires the Tcl integration feature.** |
| 801 | |
| 802 | * th1Expr arg |
| 803 | |
| 804 | Evaluates the TH1 expression and returns its result verbatim. If a TH1 |
| 805 | script error is generated, it will be transformed into a Tcl script error. |
| 806 |