Extensión:Capiunto
Appearance
Estado de la versión: estable |
|
|---|---|
| Descripción | Provides basic Infobox functionality for Scribunto. |
| Autor(es) | Marius Hoch (Hoo mandiscusión) |
| Política de compatibilidad | Se publican nuevas instantáneas junto con MediaWiki. La rama maestra no es retrocompatible. |
| MediaWiki | 1.25+ |
| Cambios en la base de datos | No |
| Licencia | Licencia Pública General de GNU 2.0 o posterior |
| Descargar | |
| Traduce la extensión Capiunto si está disponible en translatewiki.net | |
| Incidentes | Tareas abiertas · Reportar un error |
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' )
Requisitos
Capiunto depends on the Scribunto extension.
Instalación
- Descarga y mueve la carpeta
Capiuntoextraída a tu directorioextensions/.
Los desarrolladores y contribuidores de código deberían instalar la extensión desde Git en su lugar, usando:cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Capiunto
- Añade el siguiente código en la parte final de tu archivo LocalSettings.php:
wfLoadExtension( 'Capiunto' );
Hecho – Navega a Special:Version en el wiki para verificar que la extensión se haya instalado correctamente.
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
}}
|
Véase también
| Esta extensión está incluida en los siguientes anfitriones/granjas wiki y/o paquetes: |
Categories:
- Stable extensions/es
- Extensions with invalid or missing type/es
- GPL licensed extensions/es
- Extensions in Wikimedia version control/es
- ScribuntoExternalLibraries extensions/es
- ScribuntoExternalLibraryPaths extensions/es
- All extensions/es
- Extensions included in Miraheze/es
- Scribunto extensions/es
- Infobox extensions/es
