|
64 | 64 | {
|
65 | 65 | const char *cmd; /* the command name */
|
66 | 66 | const char *help; /* the help associated with it */
|
| 67 | + const char *docbook_id; /* DocBook XML id (for generating URL) */ |
67 | 68 | void (*syntaxfunc)(PQExpBuffer); /* function that prints the syntax associated with it */
|
68 | 69 | int nl_count; /* number of newlines in syntax (for pager) */
|
69 | 70 | };
|
|
92 | 93 |
|
93 | 94 | foreach my $file (sort readdir DIR)
|
94 | 95 | {
|
95 |
| - my (@cmdnames, $cmddesc, $cmdsynopsis); |
| 96 | + my ($cmdid, @cmdnames, $cmddesc, $cmdsynopsis); |
96 | 97 | $file =~ /\.sgml$/ or next;
|
97 | 98 |
|
98 | 99 | open(my $fh, '<', "$docdir/$file") or next;
|
|
104 | 105 | m!<refmiscinfo>\s*SQL - Language Statements\s*</refmiscinfo>!i
|
105 | 106 | or next;
|
106 | 107 |
|
| 108 | + $filecontent =~ m!<refentry id="([a-z-]+)">! |
| 109 | + and $cmdid = $1; |
| 110 | + |
107 | 111 | # Collect multiple refnames
|
108 | 112 | LOOP:
|
109 | 113 | {
|
|
116 | 120 | $filecontent =~ m!<synopsis>\s*(.+?)\s*</synopsis>!is
|
117 | 121 | and $cmdsynopsis = $1;
|
118 | 122 |
|
119 |
| - if (@cmdnames && $cmddesc && $cmdsynopsis) |
| 123 | + if (@cmdnames && $cmddesc && $cmdid && $cmdsynopsis) |
120 | 124 | {
|
121 | 125 | s/\"/\\"/g foreach @cmdnames;
|
122 | 126 |
|
|
144 | 148 | foreach my $cmdname (@cmdnames)
|
145 | 149 | {
|
146 | 150 | $entries{$cmdname} = {
|
| 151 | + cmdid => $cmdid, |
147 | 152 | cmddesc => $cmddesc,
|
148 | 153 | cmdsynopsis => $cmdsynopsis,
|
149 | 154 | params => \@params,
|
|
186 | 191 | $id =~ s/ /_/g;
|
187 | 192 | print $cfile_handle " { \"$_\",
|
188 | 193 | N_(\"$entries{$_}{cmddesc}\"),
|
| 194 | + \"$entries{$_}{cmdid}\", |
189 | 195 | sql_help_$id,
|
190 | 196 | $entries{$_}{nl_count} },
|
191 | 197 |
|
|
0 commit comments