Page MenuHomePhabricator

SkinMustache::getTemplateData keys should be hyphenated and existing in a dictionary
Closed, ResolvedPublic

Description

The following keys are a little misleading and I would like to rename them before SkinMustache is considered stable and sees more usage.

acceptance criteria

  • html-headelement is removed from the array of data and appended directly in generateHTML
  • html-printtail is removed from the array of data and appended directly in generateHTML
  • html-bodycontent is renamed html-page-body to reflect that it is the body of the article.
  • html-printfooter in all wikimedia skins comes after html-bodycontent so as a result it will be merged into html-body-content/html-page-body so that it becomes non-optional and removed from the array of data
  • html-catlinks is renamed html-categories to be more descriptive.
  • A comment exists informing developers about the naming criteria

For completeness

In https://gerrit.wikimedia.org/r/c/mediawiki/core/+/610294 several variables were introduced. In a follow up these will be renamed as follows:

  • updating html-data-aftercontent to html-after-content
  • html-userlangattributes to html-user-language-attributes
  • Update html-sitenotice to html-site-notice

Developer notes

Desired end result regarding html-headelement and html-printtail:

return $out->headElement( $this ) . $templateParser->processTemplate(
	$this->options['template'] ?? 'skin',
	$this->getTemplateData()
) . WrappedStringList::join( "\n", $tail );

Event Timeline

Jdlrobson added subscribers: Ammarpad, Volker_E.

Let me know if the names make sense (thumbs up) or not (comment)!

I like that a lot. Only minor note on html-page-body, I don't think that's in anyway clearer than currently as HTML is commonly referred to as HTML pages. So I'd assume that is the HTML page body redundantly named.

I like that a lot. Only minor note on html-page-body, I don't think that's in anyway clearer than currently as HTML is commonly referred to as HTML pages. So I'd assume that is the HTML page body redundantly named.

So is this a suggestion to keep html-bodycontent or use html-content or html-page ?

We also have 'html-userlangattributes'. Maybe it should be hyphenated too

Jdlrobson updated the task description. (Show Details)
Jdlrobson awarded a token.
Jdlrobson added a project: MW-1.35-release.

We also have 'html-userlangattributes'. Maybe it should hyphenated too

Yup, sorry I made this clearer.

I've added the 1.35 tag as I'd like SkinMustache to be in stable a stable state for new developers to use as they discover it.

updating data-aftercontent to data-after-content

I am not sure if we want name this data-. It's actually a string, it can even be empty string.

Change 611328 had a related patch set uploaded (by Ammarpad; owner: Ammarpad):
[mediawiki/core@master] Refactor SkinMustache and make template data keys consistent

https://gerrit.wikimedia.org/r/611328

Change 610867 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/skins/Vector@master] Rename template variable from html-dataAfterContent to html-after-content

https://gerrit.wikimedia.org/r/610867

Change 611328 merged by jenkins-bot:
[mediawiki/core@master] Refactor SkinMustache and make template variables name consistent

https://gerrit.wikimedia.org/r/611328

Reedy updated the task description. (Show Details)

Change 612402 had a related patch set uploaded (by VolkerE; owner: VolkerE):
[mediawiki/core@master] Rename SkinMustache html-site-notice template variable

https://gerrit.wikimedia.org/r/612402

Change 612402 merged by jenkins-bot:
[mediawiki/core@master] Rename SkinMustache html-site-notice template variable

https://gerrit.wikimedia.org/r/612402

Change 610867 merged by jenkins-bot:
[mediawiki/skins/Vector@master] Rename template variables to mirror SkinMustache

https://gerrit.wikimedia.org/r/610867