Template:Ws diclist

From Wikisource
Jump to navigation Jump to search
Documentation icon Template documentation[view] [edit] [history] [purge]

This is a helper template, to assist in formatting definition lists (such as dictionary or thesaurus entries, using Template Styles..

Usage[edit]

{{ws_diclist|
;Term 1
:Definition A
:Definition B
;Term 2
:Definition C
:Definition D
...
}}

or if page spanning

{{ws_diclist/s}}
;Term 1
:Definition A
:Definition B
;Term 2
:Definition C
:Definition D
...
;Term X
:Definition x
:Definition y
:Definition z
{{ws_diclist/e}}

= Flat list style[edit]

An additional named model parameter can be supplied in {{ws_diclist}} or {{ws_diclist/s}} to specify the class name to use.

The default styling for this produces:

Term 1
Definition A.
Definition B,
Term 2
Definition C,
Definition D.

...

Term X
Definition x,
Definition y,
Definition z.

Alternatively in situations where it is desirable for the list to be flat (for example, a list of synonyms for a defined root word), the model parameter can be used.

The model paremeter can be used to specify the _ws_diclist_scflat CSS class, which "flattens" the list down, by making certain elements "inline", and inserting a line-break before a definition item using CSS attributes on the elements of the definition list.

The output of the template using this "model" is :

Term 1
Definition A,
Definition B.
Term 2
Definition C,
Definition D.

...

Term X
Definition x,
Definition y,
Definition z.

Implementing additional models[edit]

The model parameter can also be used to implement additional models using CSS styles.

These should be added to Template:Ws diclist/styles.css using an appropriate name.

If you add additional classes, please update the documentation here accordingly.