Weitere Optionen
Du bist aus dem folgenden Grund nicht berechtigt, diese Seite bearbeiten:
Du kannst den Quelltext dieser Seite betrachten und kopieren.
-- Calculate estimated reading time for any page rounded to multiple of 5. Outputs "X-Y minutes".
-- invoke on any page or template with {{#invoke:Lesezeit|estimateReadingTime|YourPageHere}} (change YourPageHere)
local p = {}
local mw = require("mw")
function p.estimateReadingTime(frame)
-- Get the page title from the frame parameter
local pageTitle = frame.args[1]
-- Ensure that pageTitle is a string
if type(pageTitle) == "string" then
-- Use MediaWiki's built-in function to get the page content
local content = mw.title.new(pageTitle):getContent()
-- Ensure that content is a string
if type(content) == "string" then
-- Count words using a more robust pattern
local wordCount = 0
for word in content:gmatch("%S+") do
000
1:0
Die folgende Vorlage wird auf dieser Seite verwendet:
Zurück zur Seite Modul:Lesezeit.