Fossil SCM

Improvements to the "help" webpage.

drh 2010-12-25 23:55 trunk
Commit 01b3c9c1a8f31327ae3822e64a57a74dbf7fd1cd
1 file changed +34 -15
+34 -15
--- src/main.c
+++ src/main.c
@@ -684,17 +684,18 @@
684684
** WEBPAGE: help
685685
** URL: /help?cmd=CMD
686686
*/
687687
void help_page(void){
688688
const char * zCmd = P("cmd");
689
-
690
- style_header("Command line help %s%s",zCmd?" - ":"",zCmd?zCmd:"");
689
+
690
+ style_header("Command-line Help");
691691
if( zCmd ){
692692
int rc, idx;
693693
char *z, *s, *d;
694694
695
- @ <h1>%s(zCmd)</h1>
695
+ style_submenu_element("Command-List", "Command-List", "%s/help", g.zTop);
696
+ @ <h1>The "%s(zCmd)" command:</h1>
696697
rc = name_search(zCmd, aCommand, count(aCommand), &idx);
697698
if( rc==1 ){
698699
@ unknown command: %s(zCmd)
699700
}else if( rc==2 ){
700701
@ ambiguous command prefix: %s(zCmd)
@@ -710,26 +711,44 @@
710711
}else{
711712
*d++ = *s++;
712713
}
713714
}
714715
*d = 0;
715
- @ <pre>%s(z)</pre>
716
+ @ <blockquote><pre>
717
+ @ %h(z)
718
+ @ </pre></blockquote>
716719
free(z);
717720
}
718721
}
719
- @ <hr/><a href="help">available commands</a> in fossil
720
- @ version %s(MANIFEST_VERSION" "MANIFEST_DATE) UTC
721722
}else{
722
- int i;
723
-
724
- @ <h1>Available commands</h1>
725
- for(i=0; i<count(aCommand); i++){
726
- if( strncmp(aCommand[i].zName,"test",4)==0 ) continue;
727
- @ <kbd><a href="help?cmd=%s(aCommand[i].zName)">
728
- @ %s(aCommand[i].zName)</a></kbd>
729
- }
730
- @ <hr/>fossil version %s(MANIFEST_VERSION" "MANIFEST_DATE) UTC
723
+ int i, j, n;
724
+
725
+ @ <h1>Available commands:</h1>
726
+ @ <table border="0"><tr>
727
+ for(i=j=0; i<count(aCommand); i++){
728
+ const char *z = aCommand[i].zName;
729
+ if( strncmp(z,"test",4)==0 ) continue;
730
+ j++;
731
+ }
732
+ n = (j+6)/7;
733
+ for(i=j=0; i<count(aCommand); i++){
734
+ const char *z = aCommand[i].zName;
735
+ if( strncmp(z,"test",4)==0 ) continue;
736
+ if( j==0 ){
737
+ @ <td valign="top"><ul>
738
+ }
739
+ @ <li><a href="%s(g.zTop)/help?cmd=%s(z)">%s(z)</a>
740
+ j++;
741
+ if( j>=n ){
742
+ @ </ul></td>
743
+ j = 0;
744
+ }
745
+ }
746
+ if( j>0 ){
747
+ @ </ul></td>
748
+ }
749
+ @ </tr></table>
731750
}
732751
style_footer();
733752
}
734753
735754
/*
736755
--- src/main.c
+++ src/main.c
@@ -684,17 +684,18 @@
684 ** WEBPAGE: help
685 ** URL: /help?cmd=CMD
686 */
687 void help_page(void){
688 const char * zCmd = P("cmd");
689
690 style_header("Command line help %s%s",zCmd?" - ":"",zCmd?zCmd:"");
691 if( zCmd ){
692 int rc, idx;
693 char *z, *s, *d;
694
695 @ <h1>%s(zCmd)</h1>
 
696 rc = name_search(zCmd, aCommand, count(aCommand), &idx);
697 if( rc==1 ){
698 @ unknown command: %s(zCmd)
699 }else if( rc==2 ){
700 @ ambiguous command prefix: %s(zCmd)
@@ -710,26 +711,44 @@
710 }else{
711 *d++ = *s++;
712 }
713 }
714 *d = 0;
715 @ <pre>%s(z)</pre>
 
 
716 free(z);
717 }
718 }
719 @ <hr/><a href="help">available commands</a> in fossil
720 @ version %s(MANIFEST_VERSION" "MANIFEST_DATE) UTC
721 }else{
722 int i;
723
724 @ <h1>Available commands</h1>
725 for(i=0; i<count(aCommand); i++){
726 if( strncmp(aCommand[i].zName,"test",4)==0 ) continue;
727 @ <kbd><a href="help?cmd=%s(aCommand[i].zName)">
728 @ %s(aCommand[i].zName)</a></kbd>
729 }
730 @ <hr/>fossil version %s(MANIFEST_VERSION" "MANIFEST_DATE) UTC
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
731 }
732 style_footer();
733 }
734
735 /*
736
--- src/main.c
+++ src/main.c
@@ -684,17 +684,18 @@
684 ** WEBPAGE: help
685 ** URL: /help?cmd=CMD
686 */
687 void help_page(void){
688 const char * zCmd = P("cmd");
689
690 style_header("Command-line Help");
691 if( zCmd ){
692 int rc, idx;
693 char *z, *s, *d;
694
695 style_submenu_element("Command-List", "Command-List", "%s/help", g.zTop);
696 @ <h1>The "%s(zCmd)" command:</h1>
697 rc = name_search(zCmd, aCommand, count(aCommand), &idx);
698 if( rc==1 ){
699 @ unknown command: %s(zCmd)
700 }else if( rc==2 ){
701 @ ambiguous command prefix: %s(zCmd)
@@ -710,26 +711,44 @@
711 }else{
712 *d++ = *s++;
713 }
714 }
715 *d = 0;
716 @ <blockquote><pre>
717 @ %h(z)
718 @ </pre></blockquote>
719 free(z);
720 }
721 }
 
 
722 }else{
723 int i, j, n;
724
725 @ <h1>Available commands:</h1>
726 @ <table border="0"><tr>
727 for(i=j=0; i<count(aCommand); i++){
728 const char *z = aCommand[i].zName;
729 if( strncmp(z,"test",4)==0 ) continue;
730 j++;
731 }
732 n = (j+6)/7;
733 for(i=j=0; i<count(aCommand); i++){
734 const char *z = aCommand[i].zName;
735 if( strncmp(z,"test",4)==0 ) continue;
736 if( j==0 ){
737 @ <td valign="top"><ul>
738 }
739 @ <li><a href="%s(g.zTop)/help?cmd=%s(z)">%s(z)</a>
740 j++;
741 if( j>=n ){
742 @ </ul></td>
743 j = 0;
744 }
745 }
746 if( j>0 ){
747 @ </ul></td>
748 }
749 @ </tr></table>
750 }
751 style_footer();
752 }
753
754 /*
755

Keyboard Shortcuts

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