Fossil SCM

Modified /help page to show help text for /pages. Only pages with help text get hyperlinks.

stephan 2013-02-20 22:30 UTC help-www
Commit affccaa822793b11fbb05a11e3d6ba77065f8788
1 file changed +34 -2
+34 -2
--- src/main.c
+++ src/main.c
@@ -1075,17 +1075,17 @@
10751075
10761076
@ <h1>Available commands:</h1>
10771077
@ <table border="0"><tr>
10781078
for(i=j=0; i<count(aCommand); i++){
10791079
const char *z = aCommand[i].zName;
1080
- if( strncmp(z,"test",4)==0 ) continue;
1080
+ if( '/'==*z || strncmp(z,"test",4)==0 ) continue;
10811081
j++;
10821082
}
10831083
n = (j+6)/7;
10841084
for(i=j=0; i<count(aCommand); i++){
10851085
const char *z = aCommand[i].zName;
1086
- if( strncmp(z,"test",4)==0 ) continue;
1086
+ if( '/'==*z || strncmp(z,"test",4)==0 ) continue;
10871087
if( j==0 ){
10881088
@ <td valign="top"><ul>
10891089
}
10901090
@ <li><a href="%s(g.zTop)/help?cmd=%s(z)">%s(z)</a>
10911091
j++;
@@ -1096,10 +1096,42 @@
10961096
}
10971097
if( j>0 ){
10981098
@ </ul></td>
10991099
}
11001100
@ </tr></table>
1101
+
1102
+ @ <h1>Available pages:</h1>
1103
+ @ (Only pages with help text are linked.)
1104
+ @ <table border="0"><tr>
1105
+ for(i=j=0; i<count(aCommand); i++){
1106
+ const char *z = aCommand[i].zName;
1107
+ if( '/'!=*z ) continue;
1108
+ j++;
1109
+ }
1110
+ n = (j+5)/6;
1111
+ for(i=j=0; i<count(aCommand); i++){
1112
+ const char *z = aCommand[i].zName;
1113
+ if( '/'!=*z ) continue;
1114
+ if( j==0 ){
1115
+ @ <td valign="top"><ul>
1116
+ }
1117
+ if( aCmdHelp[i].zText && *aCmdHelp[i].zText ){
1118
+ @ <li><a href="%s(g.zTop)/help?cmd=%s(z)">%s(z)</a></li>
1119
+ }else{
1120
+ @ <li>%s(z)</li>
1121
+ }
1122
+ j++;
1123
+ if( j>=n ){
1124
+ @ </ul></td>
1125
+ j = 0;
1126
+ }
1127
+ }
1128
+ if( j>0 ){
1129
+ @ </ul></td>
1130
+ }
1131
+ @ </tr></table>
1132
+
11011133
}
11021134
style_footer();
11031135
}
11041136
11051137
/*
11061138
--- src/main.c
+++ src/main.c
@@ -1075,17 +1075,17 @@
1075
1076 @ <h1>Available commands:</h1>
1077 @ <table border="0"><tr>
1078 for(i=j=0; i<count(aCommand); i++){
1079 const char *z = aCommand[i].zName;
1080 if( strncmp(z,"test",4)==0 ) continue;
1081 j++;
1082 }
1083 n = (j+6)/7;
1084 for(i=j=0; i<count(aCommand); i++){
1085 const char *z = aCommand[i].zName;
1086 if( strncmp(z,"test",4)==0 ) continue;
1087 if( j==0 ){
1088 @ <td valign="top"><ul>
1089 }
1090 @ <li><a href="%s(g.zTop)/help?cmd=%s(z)">%s(z)</a>
1091 j++;
@@ -1096,10 +1096,42 @@
1096 }
1097 if( j>0 ){
1098 @ </ul></td>
1099 }
1100 @ </tr></table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1101 }
1102 style_footer();
1103 }
1104
1105 /*
1106
--- src/main.c
+++ src/main.c
@@ -1075,17 +1075,17 @@
1075
1076 @ <h1>Available commands:</h1>
1077 @ <table border="0"><tr>
1078 for(i=j=0; i<count(aCommand); i++){
1079 const char *z = aCommand[i].zName;
1080 if( '/'==*z || strncmp(z,"test",4)==0 ) continue;
1081 j++;
1082 }
1083 n = (j+6)/7;
1084 for(i=j=0; i<count(aCommand); i++){
1085 const char *z = aCommand[i].zName;
1086 if( '/'==*z || strncmp(z,"test",4)==0 ) continue;
1087 if( j==0 ){
1088 @ <td valign="top"><ul>
1089 }
1090 @ <li><a href="%s(g.zTop)/help?cmd=%s(z)">%s(z)</a>
1091 j++;
@@ -1096,10 +1096,42 @@
1096 }
1097 if( j>0 ){
1098 @ </ul></td>
1099 }
1100 @ </tr></table>
1101
1102 @ <h1>Available pages:</h1>
1103 @ (Only pages with help text are linked.)
1104 @ <table border="0"><tr>
1105 for(i=j=0; i<count(aCommand); i++){
1106 const char *z = aCommand[i].zName;
1107 if( '/'!=*z ) continue;
1108 j++;
1109 }
1110 n = (j+5)/6;
1111 for(i=j=0; i<count(aCommand); i++){
1112 const char *z = aCommand[i].zName;
1113 if( '/'!=*z ) continue;
1114 if( j==0 ){
1115 @ <td valign="top"><ul>
1116 }
1117 if( aCmdHelp[i].zText && *aCmdHelp[i].zText ){
1118 @ <li><a href="%s(g.zTop)/help?cmd=%s(z)">%s(z)</a></li>
1119 }else{
1120 @ <li>%s(z)</li>
1121 }
1122 j++;
1123 if( j>=n ){
1124 @ </ul></td>
1125 j = 0;
1126 }
1127 }
1128 if( j>0 ){
1129 @ </ul></td>
1130 }
1131 @ </tr></table>
1132
1133 }
1134 style_footer();
1135 }
1136
1137 /*
1138

Keyboard Shortcuts

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