Fossil SCM
Improvements to the /test-all-help webpage.
Commit
9e4083401606246bff740526591e7386286b457b0ac22077bdfbff564f462b30
Parent
c2cf7ea14130e6a…
1 file changed
+36
-3
+36
-3
| --- src/dispatch.c | ||
| +++ src/dispatch.c | ||
| @@ -427,18 +427,51 @@ | ||
| 427 | 427 | ** |
| 428 | 428 | ** Show all help text on a single page. Useful for proof-reading. |
| 429 | 429 | */ |
| 430 | 430 | void test_all_help_page(void){ |
| 431 | 431 | int i; |
| 432 | + Blob buf; | |
| 433 | + blob_init(&buf,0,0); | |
| 432 | 434 | style_header("All Help Text"); |
| 435 | + @ <dl> | |
| 433 | 436 | for(i=0; i<MX_COMMAND; i++){ |
| 437 | + const char *zDesc; | |
| 438 | + unsigned int e = aCommand[i].eCmdFlags; | |
| 439 | + if( e & CMDFLAG_1ST_TIER ){ | |
| 440 | + zDesc = "1st tier command"; | |
| 441 | + }else if( e & CMDFLAG_2ND_TIER ){ | |
| 442 | + zDesc = "2nd tier command"; | |
| 443 | + }else if( e & CMDFLAG_TEST ){ | |
| 444 | + zDesc = "test command"; | |
| 445 | + }else if( e & CMDFLAG_WEBPAGE ){ | |
| 446 | + if( e & CMDFLAG_RAWCONTENT ){ | |
| 447 | + zDesc = "raw-content web page"; | |
| 448 | + }else{ | |
| 449 | + zDesc = "web page"; | |
| 450 | + } | |
| 451 | + }else{ | |
| 452 | + blob_reset(&buf); | |
| 453 | + if( e & CMDFLAG_VERSIONABLE ){ | |
| 454 | + blob_appendf(&buf, "versionable "); | |
| 455 | + } | |
| 456 | + if( e & CMDFLAG_BLOCKTEXT ){ | |
| 457 | + blob_appendf(&buf, "block-text "); | |
| 458 | + } | |
| 459 | + if( e & CMDFLAG_BOOLEAN ){ | |
| 460 | + blob_appendf(&buf, "boolean "); | |
| 461 | + } | |
| 462 | + blob_appendf(&buf,"setting"); | |
| 463 | + zDesc = blob_str(&buf); | |
| 464 | + } | |
| 434 | 465 | if( memcmp(aCommand[i].zName, "test", 4)==0 ) continue; |
| 435 | - @ <h2>%s(aCommand[i].zName):</h2> | |
| 436 | - @ <blockquote> | |
| 466 | + @ <dt><big><b>%s(aCommand[i].zName)</b></big> (%s(zDesc))</dt> | |
| 467 | + @ <dd> | |
| 437 | 468 | help_to_html(aCommand[i].zHelp, cgi_output_blob()); |
| 438 | - @ </blockquote> | |
| 469 | + @ </dd> | |
| 439 | 470 | } |
| 471 | + @ </dl> | |
| 472 | + blob_reset(&buf); | |
| 440 | 473 | style_footer(); |
| 441 | 474 | } |
| 442 | 475 | |
| 443 | 476 | static void multi_column_list(const char **azWord, int nWord){ |
| 444 | 477 | int i, j, len; |
| 445 | 478 |
| --- src/dispatch.c | |
| +++ src/dispatch.c | |
| @@ -427,18 +427,51 @@ | |
| 427 | ** |
| 428 | ** Show all help text on a single page. Useful for proof-reading. |
| 429 | */ |
| 430 | void test_all_help_page(void){ |
| 431 | int i; |
| 432 | style_header("All Help Text"); |
| 433 | for(i=0; i<MX_COMMAND; i++){ |
| 434 | if( memcmp(aCommand[i].zName, "test", 4)==0 ) continue; |
| 435 | @ <h2>%s(aCommand[i].zName):</h2> |
| 436 | @ <blockquote> |
| 437 | help_to_html(aCommand[i].zHelp, cgi_output_blob()); |
| 438 | @ </blockquote> |
| 439 | } |
| 440 | style_footer(); |
| 441 | } |
| 442 | |
| 443 | static void multi_column_list(const char **azWord, int nWord){ |
| 444 | int i, j, len; |
| 445 |
| --- src/dispatch.c | |
| +++ src/dispatch.c | |
| @@ -427,18 +427,51 @@ | |
| 427 | ** |
| 428 | ** Show all help text on a single page. Useful for proof-reading. |
| 429 | */ |
| 430 | void test_all_help_page(void){ |
| 431 | int i; |
| 432 | Blob buf; |
| 433 | blob_init(&buf,0,0); |
| 434 | style_header("All Help Text"); |
| 435 | @ <dl> |
| 436 | for(i=0; i<MX_COMMAND; i++){ |
| 437 | const char *zDesc; |
| 438 | unsigned int e = aCommand[i].eCmdFlags; |
| 439 | if( e & CMDFLAG_1ST_TIER ){ |
| 440 | zDesc = "1st tier command"; |
| 441 | }else if( e & CMDFLAG_2ND_TIER ){ |
| 442 | zDesc = "2nd tier command"; |
| 443 | }else if( e & CMDFLAG_TEST ){ |
| 444 | zDesc = "test command"; |
| 445 | }else if( e & CMDFLAG_WEBPAGE ){ |
| 446 | if( e & CMDFLAG_RAWCONTENT ){ |
| 447 | zDesc = "raw-content web page"; |
| 448 | }else{ |
| 449 | zDesc = "web page"; |
| 450 | } |
| 451 | }else{ |
| 452 | blob_reset(&buf); |
| 453 | if( e & CMDFLAG_VERSIONABLE ){ |
| 454 | blob_appendf(&buf, "versionable "); |
| 455 | } |
| 456 | if( e & CMDFLAG_BLOCKTEXT ){ |
| 457 | blob_appendf(&buf, "block-text "); |
| 458 | } |
| 459 | if( e & CMDFLAG_BOOLEAN ){ |
| 460 | blob_appendf(&buf, "boolean "); |
| 461 | } |
| 462 | blob_appendf(&buf,"setting"); |
| 463 | zDesc = blob_str(&buf); |
| 464 | } |
| 465 | if( memcmp(aCommand[i].zName, "test", 4)==0 ) continue; |
| 466 | @ <dt><big><b>%s(aCommand[i].zName)</b></big> (%s(zDesc))</dt> |
| 467 | @ <dd> |
| 468 | help_to_html(aCommand[i].zHelp, cgi_output_blob()); |
| 469 | @ </dd> |
| 470 | } |
| 471 | @ </dl> |
| 472 | blob_reset(&buf); |
| 473 | style_footer(); |
| 474 | } |
| 475 | |
| 476 | static void multi_column_list(const char **azWord, int nWord){ |
| 477 | int i, j, len; |
| 478 |