Index: trunk/extensions/Validator/includes/parserHooks/Validator_Describe.php |
— | — | @@ -91,6 +91,7 @@ |
92 | 92 | public function render( array $parameters ) { |
93 | 93 | $parts = array(); |
94 | 94 | |
| 95 | + // Loop over the hooks for which the docs should be added. |
95 | 96 | foreach ( $parameters['hooks'] as $hookName ) { |
96 | 97 | $parserHook = $this->getParserHookInstance( $hookName ); |
97 | 98 | |
— | — | @@ -102,6 +103,7 @@ |
103 | 104 | } |
104 | 105 | } |
105 | 106 | |
| 107 | + // Parse the wikitext to HTML. |
106 | 108 | $output = $this->parser->parse( |
107 | 109 | implode( "\n\n", $parts ), |
108 | 110 | $this->parser->mTitle, |
— | — | @@ -114,6 +116,17 @@ |
115 | 117 | return str_replace( 'pre!>', 'pre>', $output->getText() ); |
116 | 118 | } |
117 | 119 | |
| 120 | + /** |
| 121 | + * Returns the wikitext description for a single parser hook. |
| 122 | + * |
| 123 | + * @since 0.4.3 |
| 124 | + * |
| 125 | + * @param string $hookName |
| 126 | + * @param array $parameters |
| 127 | + * @param ParserHook $parserHook |
| 128 | + * |
| 129 | + * @return string |
| 130 | + */ |
118 | 131 | protected function getParserHookDescription( $hookName, array $parameters, ParserHook $parserHook ) { |
119 | 132 | $descriptionData = $parserHook->getDescriptionData( ParserHook::TYPE_TAG ); // TODO |
120 | 133 | |
— | — | @@ -133,6 +146,15 @@ |
134 | 147 | return $description; |
135 | 148 | } |
136 | 149 | |
| 150 | + /** |
| 151 | + * Returns the wikitext for a table listing the provided parameters. |
| 152 | + * |
| 153 | + * @since 0.4.3 |
| 154 | + * |
| 155 | + * @param array $parameters |
| 156 | + * |
| 157 | + * @return string |
| 158 | + */ |
137 | 159 | protected function getParameterTable( array $parameters ) { |
138 | 160 | $tableRows = array(); |
139 | 161 | |
— | — | @@ -159,6 +181,15 @@ |
160 | 182 | return $table; // TODO |
161 | 183 | } |
162 | 184 | |
| 185 | + /** |
| 186 | + * Returns the wikitext for a table row describing a single parameter. |
| 187 | + * |
| 188 | + * @since 0.4.3 |
| 189 | + * |
| 190 | + * @param Parameter $parameter |
| 191 | + * |
| 192 | + * @return string |
| 193 | + */ |
163 | 194 | protected function getDescriptionRow( Parameter $parameter ) { |
164 | 195 | $aliases = $parameter->getAliases(); |
165 | 196 | $aliases = count( $aliases ) > 0 ? implode( ', ', $aliases ) : '-'; |