Template:User gender/documentation

Usage
When included on a user or user talk page, it returns the gender of that user as set in their preferences. It returns  if set to male,   if set to female, and   if not set. It also returns  when included on a page that is not a user page.

The template has an optional first parameter which merely exists for convenience. If not empty, the template simply returns that parameter instead of retrieving the setting from the preference. This way, any templates that need the gender but allow it to be overridden can simply use (without a first parameter, the equivalent would be:  which is longer).