File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
plugins/docusaurus-plugin-ionic-component-api Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -173,6 +173,25 @@ function renderEvents({ events }) {
173
173
${ events . map ( ( event ) => `| \`${ event . event } \` | ${ formatMultiline ( event . docs ) } | \`${ event . bubbles } \` |` ) . join ( '\n' ) } `;
174
174
}
175
175
176
+ /**
177
+ * Formats method parameters for the optional Parameters row of each method table
178
+ * @param {* } paramsArr Array of method parameters
179
+ * @returns formatted parameters for methods table
180
+ */
181
+ function renderParameters ( paramsArr ) {
182
+ if ( ! paramsArr . some ( ( param ) => param . docs ) ) {
183
+ return '' ;
184
+ }
185
+
186
+ const documentedParams = paramsArr . filter ( ( param ) => param . docs ) ;
187
+ const formattedParams = documentedParams
188
+ . map ( ( param ) => {
189
+ return `**${ param . name } **: ${ formatMultiline ( param . docs ) } ` ;
190
+ } )
191
+ . join ( '<br/>' ) ;
192
+ return `| **Parameters** | ${ formattedParams } |` ;
193
+ }
194
+
176
195
function renderMethods ( { methods } ) {
177
196
if ( methods . length === 0 ) {
178
197
return 'No public methods available for this component.' ;
@@ -189,6 +208,7 @@ ${methods
189
208
| --- | --- |
190
209
| **Description** | ${ formatMultiline ( method . docs ) } |
191
210
| **Signature** | \`${ method . signature . replace ( / \| / g, '\uff5c' ) } \` |
211
+ ${ method . parameters . length !== 0 ? renderParameters ( method . parameters ) : '' }
192
212
`
193
213
)
194
214
. join ( '\n' ) }
You can’t perform that action at this time.
0 commit comments