Template:inflection-table-top

From Wiktionary, the free dictionary
Jump to navigation Jump to search

This template is designed to make it easy to create inflection tables that:

  • appear correctly for readers using mobiles and tablets as well as computers
  • fit in with the consistent look and feel of Wiktionary
  • use contrasting text and background colours that meet accessibility guidelines in both light mode and dark mode
  • do not require in-depth knowledge of HTML or CSS syntax on the part of the creator

Usage

These templates are not intended to be used directly in entries. Instead, they can be transcluded from inflection table templates.

{{inflection-table-top}} takes the following parameters:

|title=
The title of the inflection table. Defaults to Inflection of PAGENAME if not specified. You can set this parameter to - if you don't want a title at all.
|palette=
Select a color palette from the following options:
grey, red, scarlet, orange, amber, yellow, lime, green, teal, cyan, blue, indigo, purple, magenta, rose, brown
All palettes are currently dark-on-light ("pastel" colours); this can be easily changed if needed.
The default palette is grey.
|lang= (optional)
You can specify the language code of this inflection table. This is only used for applying a CSS class inflection-table-{{{lang}}} to the table, which may be referenced by scripts or personal stylesheets. It doesn't affect the look or content of the table at all.
|tall=yes NOT YET IMPLEMENTED
This should be specified on tables with more than about 8 lines of content. It makes the table hidden by default.

In between the two templates, write wikitext table syntax to construct the inflection table (see examples below).

{{inflection-table-bottom}} takes one parameter:

|notes= (optional)
Contains notes to be shown at the foot of the table.

Examples

Basic example

Create a new template page and insert the following wikitext:

{{inflection-table-top|title=Inflection of {{m|en||{{PAGENAME}}}}|palette=blue}}
! 
! singular
! plural
|-
! nominative
| {{l|en|{{PAGENAME}}}}
| {{l|en|{{PAGENAME}}s}}
|-
! possessive 
| {{l|en|{{PAGENAME}}'s}}
| {{l|en|{{PAGENAME}}s'}}
{{inflection-table-bottom}}

Notice carefully how ! and | have been used at the beginning of each line to create headers and regular cells, respectively.

When you use your new template on the entry carrot, the following table would appear:

My title
singular plural
nominative carrot carrots
possessive carrot's carrots'

Style guide

  • At the time of creation of this template, the majority of inflection table templates on Wiktionary used lowercase grammatical labels ("singular", "present", "nominative").


[[Category:]]