Fossil SCM

add th1 command wiki_assoc which calls wiki_render_associated

jkosche 2025-01-18 10:51 ticket-wiki
Commit 723ba95411fa075f8ab50b84fecb8aafab2cd34592d9691689d49fc59c6bd241
1 file changed +20
--- src/th_main.c
+++ src/th_main.c
@@ -696,10 +696,29 @@
696696
wiki_convert(&src, 0, flags);
697697
blob_reset(&src);
698698
}
699699
return TH_OK;
700700
}
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
+}
701720
702721
/*
703722
** TH1 command: htmlize STRING
704723
**
705724
** Escape all characters of STRING which have special meaning in HTML.
@@ -2374,10 +2393,11 @@
23742393
{"unversioned", unversionedCmd, 0},
23752394
{"utime", utimeCmd, 0},
23762395
{"verifyCsrf", verifyCsrfCmd, 0},
23772396
{"verifyLogin", verifyLoginCmd, 0},
23782397
{"wiki", wikiCmd, (void*)&aFlags[0]},
2398
+ {"wiki_assoc", wikiAssocCmd, 0},
23792399
{0, 0, 0}
23802400
};
23812401
if( g.thTrace ){
23822402
Th_Trace("th1-init 0x%x => 0x%x<br>\n", g.th1Flags, flags);
23832403
}
23842404
--- 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

Keyboard Shortcuts

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