Fossil SCM
add th1 command wiki_assoc which calls wiki_render_associated
Commit
723ba95411fa075f8ab50b84fecb8aafab2cd34592d9691689d49fc59c6bd241
Parent
66ece81274c6dc7…
1 file changed
+20
+20
| --- src/th_main.c | ||
| +++ src/th_main.c | ||
| @@ -696,10 +696,29 @@ | ||
| 696 | 696 | wiki_convert(&src, 0, flags); |
| 697 | 697 | blob_reset(&src); |
| 698 | 698 | } |
| 699 | 699 | return TH_OK; |
| 700 | 700 | } |
| 701 | + | |
| 702 | +/* | |
| 703 | +** TH1 command: wiki_assoc STRING STRING | |
| 704 | +** | |
| 705 | +** Render the wiki site associated with the strings. | |
| 706 | +*/ | |
| 707 | +static int wikiAssocCmd( | |
| 708 | + Th_Interp *interp, | |
| 709 | + void *p, | |
| 710 | + int argc, | |
| 711 | + const char **argv, | |
| 712 | + int *argl | |
| 713 | +){ | |
| 714 | + if( argc!=3 ){ | |
| 715 | + return Th_WrongNumArgs(interp, "wiki_assoc STRING STRING"); | |
| 716 | + } | |
| 717 | + wiki_render_associated((char*)argv[1], (char*)argv[2], 0); | |
| 718 | + return TH_OK; | |
| 719 | +} | |
| 701 | 720 | |
| 702 | 721 | /* |
| 703 | 722 | ** TH1 command: htmlize STRING |
| 704 | 723 | ** |
| 705 | 724 | ** Escape all characters of STRING which have special meaning in HTML. |
| @@ -2374,10 +2393,11 @@ | ||
| 2374 | 2393 | {"unversioned", unversionedCmd, 0}, |
| 2375 | 2394 | {"utime", utimeCmd, 0}, |
| 2376 | 2395 | {"verifyCsrf", verifyCsrfCmd, 0}, |
| 2377 | 2396 | {"verifyLogin", verifyLoginCmd, 0}, |
| 2378 | 2397 | {"wiki", wikiCmd, (void*)&aFlags[0]}, |
| 2398 | + {"wiki_assoc", wikiAssocCmd, 0}, | |
| 2379 | 2399 | {0, 0, 0} |
| 2380 | 2400 | }; |
| 2381 | 2401 | if( g.thTrace ){ |
| 2382 | 2402 | Th_Trace("th1-init 0x%x => 0x%x<br>\n", g.th1Flags, flags); |
| 2383 | 2403 | } |
| 2384 | 2404 |
| --- src/th_main.c | |
| +++ src/th_main.c | |
| @@ -696,10 +696,29 @@ | |
| 696 | wiki_convert(&src, 0, flags); |
| 697 | blob_reset(&src); |
| 698 | } |
| 699 | return TH_OK; |
| 700 | } |
| 701 | |
| 702 | /* |
| 703 | ** TH1 command: htmlize STRING |
| 704 | ** |
| 705 | ** Escape all characters of STRING which have special meaning in HTML. |
| @@ -2374,10 +2393,11 @@ | |
| 2374 | {"unversioned", unversionedCmd, 0}, |
| 2375 | {"utime", utimeCmd, 0}, |
| 2376 | {"verifyCsrf", verifyCsrfCmd, 0}, |
| 2377 | {"verifyLogin", verifyLoginCmd, 0}, |
| 2378 | {"wiki", wikiCmd, (void*)&aFlags[0]}, |
| 2379 | {0, 0, 0} |
| 2380 | }; |
| 2381 | if( g.thTrace ){ |
| 2382 | Th_Trace("th1-init 0x%x => 0x%x<br>\n", g.th1Flags, flags); |
| 2383 | } |
| 2384 |
| --- src/th_main.c | |
| +++ src/th_main.c | |
| @@ -696,10 +696,29 @@ | |
| 696 | wiki_convert(&src, 0, flags); |
| 697 | blob_reset(&src); |
| 698 | } |
| 699 | return TH_OK; |
| 700 | } |
| 701 | |
| 702 | /* |
| 703 | ** TH1 command: wiki_assoc STRING STRING |
| 704 | ** |
| 705 | ** Render the wiki site associated with the strings. |
| 706 | */ |
| 707 | static int wikiAssocCmd( |
| 708 | Th_Interp *interp, |
| 709 | void *p, |
| 710 | int argc, |
| 711 | const char **argv, |
| 712 | int *argl |
| 713 | ){ |
| 714 | if( argc!=3 ){ |
| 715 | return Th_WrongNumArgs(interp, "wiki_assoc STRING STRING"); |
| 716 | } |
| 717 | wiki_render_associated((char*)argv[1], (char*)argv[2], 0); |
| 718 | return TH_OK; |
| 719 | } |
| 720 | |
| 721 | /* |
| 722 | ** TH1 command: htmlize STRING |
| 723 | ** |
| 724 | ** Escape all characters of STRING which have special meaning in HTML. |
| @@ -2374,10 +2393,11 @@ | |
| 2393 | {"unversioned", unversionedCmd, 0}, |
| 2394 | {"utime", utimeCmd, 0}, |
| 2395 | {"verifyCsrf", verifyCsrfCmd, 0}, |
| 2396 | {"verifyLogin", verifyLoginCmd, 0}, |
| 2397 | {"wiki", wikiCmd, (void*)&aFlags[0]}, |
| 2398 | {"wiki_assoc", wikiAssocCmd, 0}, |
| 2399 | {0, 0, 0} |
| 2400 | }; |
| 2401 | if( g.thTrace ){ |
| 2402 | Th_Trace("th1-init 0x%x => 0x%x<br>\n", g.th1Flags, flags); |
| 2403 | } |
| 2404 |