Module:Columns/doc: Difference between revisions

From Linguifex
Jump to navigation Jump to search
(Created page with "This module creates a list with automatically balanced columns. It should not be used directly in entries, but in templates such as {{temp|der2}} or {{temp|der3}}. List entrie...")
 
m (clean up)
Tag: Replaced
Line 1: Line 1:
This module creates a list with automatically balanced columns. It should not be used directly in entries, but in templates such as {{temp|der2}} or {{temp|der3}}. List entries are given as parameters to the template.


==Examples==
[[Category:Modules]]{{module documentation}}{{documentation subpage}}
* <code><nowiki>{{#invoke:columns|display|sort=1|collapse=1|columns=3|title=Derived terms}} -> {{der3|en|z|y|x|w|v|u|t}} </nowiki></code>
{{der3|en|z|y|x|w|v|u|t}}
 
* <code><nowiki>{{#invoke:columns|display|sort=1|collapse=1|columns=2|title=Derived terms}} -> {{der2|nl|a|b|c|d|e|f|g}}</nowiki></code>
{{der2|nl|a|b|c|d|e|f|g}}
 
==Parameters==
 
===create_list===
<source lang="lua">export.create_list {
column_count = number,
content = list, alphabetize = boolean,
background_color = string, collapse = boolean,
toggle_category = string,
class = string, lang = language_object,
}</source>
; <code>content</code>: A list of terms: <code>{ "term1", "term2", "term3", ... }</code>.
; <code>lang</code>: The language of the terms in the list. (Must be a language object from [[Module:languages]].)
; <code>collapse</code>: If true, table will be collapsed if it has enough items.
; <code>column_count</code>: Number of columns in the table. Defaults to 1.
; <code>sort</code>: Toggle sorting of the entries in the table. Defaults to false.
; <code>toggle_category</code>: Determines the text for the "Show <toggle_category>" or "Hide <toggle category>" button in the "visibility" part of the toolbar. The default is "derived terms".
; <code>class</code>: HTML class to add to the <code>div</code> tag that contains the list. Defaults to <code>derivedterms</code>.
; <code>background_color</code>: A HTML color value for the list.
 
===create_table===
The old name for the main function. It is now just a wrapper for <code>create_list</code>.
 
===display===
The template-invokable function.
 
<includeonly>
[[Category:General utility modules]]
</includeonly>

Revision as of 21:53, 19 March 2021