Module:Utilisateur:Maëlan/Test
La documentation de ce module est générée par le modèle {{Documentation module}}.
Les éditeurs peuvent travailler dans le bac à sable (créer).
Voir les statistiques d'appel depuis le wikicode sur l'outil wstat et les appels depuis d'autres modules.
-- My test module
-- the module table
local m = {}
function m.hello(frame)
return tostring(
mw.html.create("div")
:attr({ id = "my_div" })
:css({ color = "red", ["font-size"] = "24pt" })
:wikitext("un peu de HTML")
:tag("ol")
:tag("li") :wikitext("premier item") :done()
:tag("li") :wikitext("deuxième item") :done()
:tag("li") :wikitext("troisième item") :done()
:done()
:wikitext("maintenant, une image SVG donnée par son code source")
:node([[
<svg width="300" height="200">
<rect width="100%" height="100%" fill="black" />
<circle cx="150" cy="100" r="90" fill="blue" />
</svg>
]])
:wikitext("la même image SVG mais construite via la bibliothèque mw.html")
:tag("svg")
:attr({ width="300", height="200" })
:tag("rect") :attr({ width="100%", height="100%", fill="black" }) :done()
:tag("circle") :attr({ cx="150", cy="100", r="90", fill="blue" }) :done()
:done()
:wikitext("fin du HTML")
)
end
return m