Index: trunk/extensions/Validator/includes/parserHooks/Validator_Describe.php |
— | — | @@ -135,7 +135,11 @@ |
136 | 136 | $descriptionData = $parserHook->getDescriptionData( ParserHook::TYPE_TAG ); // TODO |
137 | 137 | $this->sortParameters( $descriptionData['parameters'], $descriptionData['defaults'] ); |
138 | 138 | |
139 | | - $description = "<h2> {$hookName} </h2>\n\n"; |
| 139 | + $description = |
| 140 | + ( $parameters['pre'] ? '== ' : '<h2>' ) . |
| 141 | + $hookName . |
| 142 | + ( $parameters['pre'] ? ' ==' : '</h2>' ) . "\n\n"; |
| 143 | + |
140 | 144 | |
141 | 145 | if ( $descriptionData['description'] !== false ) { |
142 | 146 | $description .= wfMsgExt( 'validator-describe-descriptionmsg', 'parsemag', $descriptionData['description'] ); |
— | — | @@ -169,10 +173,10 @@ |
170 | 174 | $description .= "\n\n"; |
171 | 175 | } |
172 | 176 | |
173 | | - $description .= $this->getParameterTable( $descriptionData['parameters'], $descriptionData['defaults'] ); |
| 177 | + $description .= $this->getParameterTable( $descriptionData['parameters'], $descriptionData['defaults'], $parameters['pre'] ); |
174 | 178 | |
175 | 179 | if ( $parserHook->forTagExtensions || $parserHook->forParserFunctions ) { |
176 | | - $description .= $this->getSyntaxExamples( $hookName, $descriptionData['parameters'], $parserHook, $descriptionData['defaults'] ); |
| 180 | + $description .= $this->getSyntaxExamples( $hookName, $descriptionData['parameters'], $parserHook, $descriptionData['defaults'], $parameters['pre'] ); |
177 | 181 | } |
178 | 182 | |
179 | 183 | if ( $parameters['pre'] ) { |
— | — | @@ -219,11 +223,16 @@ |
220 | 224 | * @param array $parameters |
221 | 225 | * @param ParserHook $parserHook |
222 | 226 | * @param array $defaults |
| 227 | + * @param boolean $pre |
223 | 228 | * |
224 | 229 | * @return string |
225 | 230 | */ |
226 | | - protected function getSyntaxExamples( $hookName, array $parameters, ParserHook $parserHook, array $defaults ) { |
227 | | - $result = '<h3>' . wfMsg( 'validator-describe-syntax' ) . "</h3>\n\n"; |
| 231 | + protected function getSyntaxExamples( $hookName, array $parameters, ParserHook $parserHook, array $defaults, $pre ) { |
| 232 | + $result = "\n\n" . |
| 233 | + ( $pre ? '=== ' : '<h3>' ) . |
| 234 | + wfMsg( 'validator-describe-syntax' ) . |
| 235 | + ( $pre ? ' ===' : '</h3>' ); |
| 236 | + $result .= "\n\n"; |
228 | 237 | |
229 | 238 | $params = array(); |
230 | 239 | $requiredParams = array(); |
— | — | @@ -331,10 +340,11 @@ |
332 | 341 | * |
333 | 342 | * @param array $parameters |
334 | 343 | * @param array $defaults |
| 344 | + * @param boolean $pre |
335 | 345 | * |
336 | 346 | * @return string |
337 | 347 | */ |
338 | | - protected function getParameterTable( array $parameters, array $defaults ) { |
| 348 | + protected function getParameterTable( array $parameters, array $defaults, $pre ) { |
339 | 349 | $tableRows = array(); |
340 | 350 | |
341 | 351 | foreach ( $parameters as $parameter ) { |
— | — | @@ -353,7 +363,12 @@ |
354 | 364 | |
355 | 365 | $table = implode( "\n|-\n", $tableRows ); |
356 | 366 | |
357 | | - $table = '<h3>' . wfMsg( 'validator-describe-parameters' ) . '</h3>' . "\n" . |
| 367 | + $h3 = |
| 368 | + ( $pre ? '=== ' : '<h3>' ) . |
| 369 | + wfMsg( 'validator-describe-parameters' ) . |
| 370 | + ( $pre ? ' ===' : '</h3>' ); |
| 371 | + |
| 372 | + $table = "$h3\n\n" . |
358 | 373 | '{| class="wikitable sortable"' . "\n" . |
359 | 374 | $table . |
360 | 375 | "\n|}"; |