Wikiup:Lua/Modul/Vorlage:Auflistung/en

aus Wikipedia, der freien Enzyklopädie
< Wikiup:Lua‎ | Modul‎ | Vorlage:Auflistung
Dies ist die aktuelle Version dieser Seite, zuletzt bearbeitet am 27. Oktober 2020 um 14:30 Uhr durch imported>PerfektesChaos(310926) (Setup).
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Vorlagenprogrammierung Diskussionen Lua Unterseiten
Modul Deutsch English

Modul: Dokumentation

Vorlage:Auflistung – Module to present horizontal lists with separators as continuous text. The list itself is a block element.

Functions for templates

f
Present a list.
1
List of items; each line starting with one of * or #
If there is one item only no additional decoration will be generated.
nowrap
1 – Every item kept on the same line
sep
Contents of a separating <span> between items
styles
Name of a TemplateStyles page
classesBlock
Class(es) for entire block element
classesSep
Class(es) for separating <span>
failsafe
Version management

{{Wikipedia:Lua/Modul-Failsafe/en|Modul=Vorlage:Auflistung}}

Accessibility

Elements can be distinguished and navigated by screenreaders.

Functions for Lua modules (API)

All functions described above can be used by other modules per require():

local lucky, HorizontalList = pcall( require, "Module:Vorlage:Auflistung" )
if type( HorizontalList ) == "table" then
 HorizontalList = HorizontalList.HorizontalList()
else
 -- error case; HorizontalList contains message
 return "<span class=\"error\">" .. HorizontalList .. "</span>"
end

Subsequently there are available:

HorizontalList.f( all, altogether, apart, frame )
Generate horizontal list from wikitext.
  • allstring, with wikitext; each line starting with one of * or #
  • altogetherboolean, if nowrap applied around each regular item
  • apartstring, for separating <span> between items, if desired
  • frame – object, if available
Returns: string
HorizontalList.fiat( all, advance, altogether, apart, frame )
Generate horizontal list from table.
  • alltable, with sequence of items.
    • Each item is a string or a mw.html object.
  • advanceboolean, if <ol> requested
  • altogetherboolean, if nowrap applied around each regular item
  • apartstring, for separating <span> between items, if desired
  • frame – object, if available
Returns: string
HorizontalList.first( arglist )
Configuration of CSS environment
  • arglisttable, with optional configuration assignments; components:
    styles
    TemplateStyles page
    • string, with page name
    • mw.title object.
    classesBlock
    class(es) for entire block element
    • string, with class(es)
    • table, with components as string
    classesSep
    class(es) for separating <span>
    • string, with class(es)
    • table, with components as string
HorizontalList.failsafe( atleast )
atleast
optional; see above
Returns: string or boolean

Usage

General library; no limitations.

Dependencies

None.