Remove empty Default, Example and Auto value sections of the output table

Bug: T125333
Change-Id: I1f7135cdf22c04aaa31744096900fd7ea65f9a37
This commit is contained in:
Agabi10 2018-09-02 00:36:06 +00:00
parent ad5c1f4a73
commit 348edb68d2
3 changed files with 13 additions and 37 deletions

View file

@ -23,11 +23,8 @@
"templatedata-doc-format-inline": "This template prefers inline formatting of parameters.", "templatedata-doc-format-inline": "This template prefers inline formatting of parameters.",
"templatedata-doc-no-params-set": "No parameters specified", "templatedata-doc-no-params-set": "No parameters specified",
"templatedata-doc-param-autovalue": "Auto value", "templatedata-doc-param-autovalue": "Auto value",
"templatedata-doc-param-autovalue-empty": "empty",
"templatedata-doc-param-default": "Default", "templatedata-doc-param-default": "Default",
"templatedata-doc-param-default-empty": "empty",
"templatedata-doc-param-example": "Example", "templatedata-doc-param-example": "Example",
"templatedata-doc-param-example-empty": "empty",
"templatedata-doc-param-desc": "Description", "templatedata-doc-param-desc": "Description",
"templatedata-doc-param-desc-empty": "no description", "templatedata-doc-param-desc-empty": "no description",
"templatedata-doc-param-name": "Parameter", "templatedata-doc-param-name": "Parameter",

View file

@ -34,11 +34,8 @@
"templatedata-doc-format-inline": "Use inline formatting of the template parameters in wikitext.", "templatedata-doc-format-inline": "Use inline formatting of the template parameters in wikitext.",
"templatedata-doc-no-params-set": "A message shown when there are no parameters set in the TemplateData string.", "templatedata-doc-no-params-set": "A message shown when there are no parameters set in the TemplateData string.",
"templatedata-doc-param-autovalue": "Used as column heading in the table for auto fill value.\n{{Related|Templatedata-doc-param}}", "templatedata-doc-param-autovalue": "Used as column heading in the table for auto fill value.\n{{Related|Templatedata-doc-param}}",
"templatedata-doc-param-autovalue-empty": "Displayed when a template parameter has no auto filled value (should not be a full sentence, used in a table).\n{{Identical|Empty}}",
"templatedata-doc-param-default": "Used as column heading in the table.\n{{Related|Templatedata-doc-param}}\n{{Identical|Default}}", "templatedata-doc-param-default": "Used as column heading in the table.\n{{Related|Templatedata-doc-param}}\n{{Identical|Default}}",
"templatedata-doc-param-default-empty": "Displayed when a template parameter has no default value (should not be a full sentence, used in a table).\n{{Identical|Empty}}",
"templatedata-doc-param-example": "Used as column heading in the table.\n{{Related|Templatedata-doc-param}}\n{{Identical|Example}}", "templatedata-doc-param-example": "Used as column heading in the table.\n{{Related|Templatedata-doc-param}}\n{{Identical|Example}}",
"templatedata-doc-param-example-empty": "Displayed when a template parameter has no example value (should be short, used in a table).\n{{Identical|Empty}}",
"templatedata-doc-param-desc": "Used as column heading in the table.\n{{Related|Templatedata-doc-param}}\n{{Identical|Description}}", "templatedata-doc-param-desc": "Used as column heading in the table.\n{{Related|Templatedata-doc-param}}\n{{Identical|Description}}",
"templatedata-doc-param-desc-empty": "Displayed when a template parameter has no description (should not be a full sentence, used in a table cell).\n{{Identical|No description}}", "templatedata-doc-param-desc-empty": "Displayed when a template parameter has no description (should not be a full sentence, used in a table cell).\n{{Identical|No description}}",
"templatedata-doc-param-name": "Used as column heading in the table. Each cell (row) of this column contains the name of one parameter of the template described by the table.\n{{Related|Templatedata-doc-param}}\n{{Identical|Parameter}}", "templatedata-doc-param-name": "Used as column heading in the table. Each cell (row) of this column contains the name of one parameter of the template described by the table.\n{{Related|Templatedata-doc-param}}\n{{Identical|Parameter}}",

View file

@ -837,45 +837,27 @@ class TemplateDataBlob {
wfMessage( 'templatedata-doc-param-desc-empty' )->inLanguage( $lang )->text() wfMessage( 'templatedata-doc-param-desc-empty' )->inLanguage( $lang )->text()
) )
. Html::rawElement( 'dl', [], . Html::rawElement( 'dl', [],
Html::element( 'dt', [], // Default
( $paramObj->default !== null ? ( Html::element( 'dt', [],
wfMessage( 'templatedata-doc-param-default' )->inLanguage( $lang )->text() wfMessage( 'templatedata-doc-param-default' )->inLanguage( $lang )->text()
) )
// Default . Html::element( 'dd', [],
. Html::element( 'dd', [ $paramObj->default
'class' => [ ) ) : '' )
'mw-templatedata-doc-muted' => $paramObj->default === null
]
],
$paramObj->default !== null ?
$paramObj->default :
wfMessage( 'templatedata-doc-param-default-empty' )->inLanguage( $lang )->text()
)
// Example // Example
. Html::element( 'dt', [], . ( $paramObj->example !== null ? ( Html::element( 'dt', [],
wfMessage( 'templatedata-doc-param-example' )->inLanguage( $lang )->text() wfMessage( 'templatedata-doc-param-example' )->inLanguage( $lang )->text()
) )
. Html::element( 'dd', [ . Html::element( 'dd', [],
'class' => [ $paramObj->example
'mw-templatedata-doc-muted' => $paramObj->example === null ) ) : '' )
]
],
$paramObj->example !== null ?
$paramObj->example :
wfMessage( 'templatedata-doc-param-example-empty' )->inLanguage( $lang )->text()
)
// Auto value // Auto value
. Html::element( 'dt', [], . ( $paramObj->autovalue !== null ? ( Html::element( 'dt', [],
wfMessage( 'templatedata-doc-param-autovalue' )->inLanguage( $lang )->text() wfMessage( 'templatedata-doc-param-autovalue' )->inLanguage( $lang )->text()
) )
. Html::rawElement( 'dd', [ . Html::rawElement( 'dd', [],
'class' => [ Html::element( 'code', [], $paramObj->autovalue )
'mw-templatedata-doc-muted' => $paramObj->autovalue === null ) ) : '' )
]
],
$paramObj->autovalue !== null ?
Html::element( 'code', [], $paramObj->autovalue ) :
wfMessage( 'templatedata-doc-param-autovalue-empty' )->inLanguage( $lang )->escaped()
)
) )
) )
// Type // Type