Extension:Capiunto/de

This page is a translated version of the page Extension:Capiunto and the translation is 12% complete.
MediaWiki-Erweiterungen
OOjs UI icon advanced-invert.svg
Capiunto
Freigabestatus: stabil
Beschreibung Provides basic Infobox functionality for Scribunto.
Autor(en) Marius Hoch (Hoo manDiskussion)
Kompatibilitätspolitik Snapshots releases along with MediaWiki. Master is not backward compatible.
MediaWiki 1.25+
Datenbankänderungen Nein
Lizenz GNU General Public License 2.0 oder neuer
Herunterladen
Übersetze die Capiunto-Erweiterung, wenn sie auf translatewiki.net verfügbar ist

Prüfe die Benutzungs- und Versionsmatrix.

Probleme Offene Aufgaben · Einen Fehler melden

The Capiunto (Latin: "they shall contain") extension provides a basic Infobox functionality for Scribunto.

An overview of the Lua methods which Capiunto provides can be found at /Infobox.

Capiunto provides flexible Infobox functionality for Scribunto and generates HTML for Infobox features such as headers and rows.

Capiunto is designed for clean and modern Infoboxes. Using Lua as a scripting language for Infobox templates, it was developed to make Infoboxes:

  • clean and clutter-free
  • usable across different language versions
  • driven by data from Wikidata
  • easy to maintain and extend

With Capiunto Lua code to create a basic Infobox might look like this:

local capiunto = require 'capiunto'
capiunto.create( {
	title = 'Title of the Infobox'
} )
:addRow( 'A label', 'some data' )
:addHeader( 'A header between the data rows' )
:addRow( 'Another label', 'more data' )

Capiunto depends on the Scribunto extension.

Installation

  • Die Erweiterung herunterladen und die Datei(en) in ein Verzeichnis namens Capiunto im Ordner extensions/ ablegen.
  • Folgenden Code am Ende der LocalSettings.php hinzufügen:
    wfLoadExtension( 'Capiunto' );
    
  •   Erledigt – Zu Special:Version in dem Wiki (bei Einstellung auf deutsch nach Spezial:Version) navigieren, um die erfolgreiche Installierung der Erweiterung zu überprüfen.

Example usage

Module
(Module:CapiuntoTest)
Template
(Template:CapiuntoTest)
Article
local capiunto = require 'capiunto'

local p = {}

function p.main(frame)
	local args = frame:getParent().args
	local headerStyle
	if args.headerstyle and args.headerstyle ~= '' then
		headerStyle = string.format('background-color:%s;', args.headerstyle)
	else
		headerStyle = 'background-color:grey;'
	end
	local retval = capiunto.create( {
		title = args.title,
		headerStyle = headerStyle, 
	} )
	:addImage( args.image, args.caption )
	:addRow( 'Foo', args.foo )
	:addHeader( 'A header between the data rows' )
	:addRow( 'Bar', args.bar )
	return retval
end

return p
<includeonly>{{#invoke:CapiuntoTest|main}}</includeonly>
{{CapiuntoTest
| title       = The title
| headerstyle = (defaults to background-color:grey)
| image       = [[File:Example.svg|200px]]
| caption     = An example image
| foo         = Something
| ("A header between the data rows")
| bar         = Something else
}}

Siehe auch