Jump to content

Module:Check DYK hook/doc

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Mr. Stradivarius (talk | contribs) at 14:12, 25 October 2020 (fix syntax). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.


This module checks hooks used in Wikipedia:Did you know.

Usage

This module can be used from templates or from other Lua modules.

From templates

From templates, call the isValidHook function with the hook as the first positional parameter.

{{#invoke:Check DYK hook|isValidHook|hook}}

Valid hooks will return a value of "yes"; invalid hooks will return the empty string.

From modules

From modules, call the _isValidHook function with the hook as the first positional parameter.

mCheckDYKHook = require('Module:Check DYK hook')
result = mCheckDYKHook._isValidHook(hook)

Valid hooks will return a true; invalid hooks will return false.