-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Render documentation for provider
init
callbacks (#224)
By default, we want the following behavior: * Custom init callback specified * The set of parameters for the init callback equals the set of fields for the provider; and the docs for the init callback's parameters are either empty or equal to corresponding field docs * Some init parameters have a default value: -> Render a single "Fields" table with 3 columns (name, doc, default value) * ... otherwise -> Render a single "Fields" table with 2 columns * ... otherwise -> Render two tables - "Constructor parameters" and "Fields" - with the links from the summary blurb (interfixed with "_init") leading to the parameters table (not the fields table) * ... otherwise -> Trivial case - single "Fields" table (as before). Fixes #182
- Loading branch information
Showing
12 changed files
with
511 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,80 @@ | ||
<a id="${providerName}"></a> | ||
#if ($providerInfo.hasInit() && $initParamNamesEqualFieldNames && !$initParamsHaveDistinctDocs && !$initParamsWithInferredDocs.isEmpty()) | ||
#set ($mergeParamsAndFields = true) | ||
#else | ||
#set ($mergeParamsAndFields = false) | ||
#end | ||
|
||
#[[##]]# ${providerName} | ||
|
||
<pre> | ||
#if ($providerInfo.hasInit() && !$mergeParamsAndFields) | ||
${util.providerSummaryWithInitAnchor($providerName, $providerInfo)} | ||
#else | ||
${util.providerSummary($providerName, $providerInfo)} | ||
#end | ||
</pre> | ||
#if (!$providerInfo.docString.isEmpty()) | ||
|
||
${providerInfo.docString} | ||
#end | ||
#if ($providerInfo.hasInit() && !$providerInfo.init.deprecated.docString.isEmpty()) | ||
|
||
**FIELDS** | ||
**DEPRECATED** | ||
|
||
${providerInfo.init.deprecated.docString} | ||
#end | ||
#if ($providerInfo.hasInit() && !$providerInfo.init.parameterList.isEmpty() && !$mergeParamsAndFields) | ||
|
||
**CONSTRUCTOR PARAMETERS** | ||
|
||
| Name | Description | Default Value | | ||
| :------------- | :------------- | :------------- | | ||
#foreach ($param in $initParamsWithInferredDocs) | ||
| <a id="${providerName}-_init-${param.name}"></a>$param.name | ## | ||
#if (!$param.docString.isEmpty()) | ||
${util.markdownCellFormat($param.docString)} ## | ||
#else | ||
<p align="center">-</p> ## | ||
#end | ||
| ## | ||
#if (!$param.getDefaultValue().isEmpty()) | ||
${util.markdownCodeSpan($param.defaultValue)} ## | ||
#else | ||
none ## | ||
#end | ||
| | ||
#end | ||
#end | ||
#if (!$providerInfo.fieldInfoList.isEmpty()) | ||
|
||
**FIELDS** | ||
|
||
#if ($mergeParamsAndFields) | ||
| Name | Description #if ($initParamsHaveDefaultValues)| Default Value #end| | ||
| :------------- | :------------- #if ($initParamsHaveDefaultValues)| :------------- #end| | ||
#foreach ($param in $initParamsWithInferredDocs) | ||
| <a id="${providerName}-${param.name}"></a>$param.name | ## | ||
#if (!$param.docString.isEmpty()) | ||
${util.markdownCellFormat($param.docString)} ## | ||
#else | ||
<p align="center"> - </p> ## | ||
#end | ||
#if($initParamsHaveDefaultValues) | ||
| ## | ||
#if (!$param.getDefaultValue().isEmpty()) | ||
${util.markdownCodeSpan($param.defaultValue)} ## | ||
#else | ||
none ## | ||
#end | ||
#end | ||
| | ||
#end | ||
#else | ||
| Name | Description | | ||
| :------------- | :------------- | | ||
#foreach ($field in $providerInfo.fieldInfoList) | ||
| <a id="${providerName}-${field.name}"></a>$field.name | #if(!$field.docString.isEmpty()) ${util.markdownCellFormat($field.docString)} #else - #end | | ||
#end | ||
#end | ||
#end |
Oops, something went wrong.