Module:Check DYK hook/doc: Difference between revisions
More actions
Created page with "{{doc sub}} <!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see Wikipedia:Wikidata) --> This module checks the format of Wikipedia:Did you know hooks used in {{tl|DYK talk}} and {{tl|Article history}}. == Usage == This module can be used from templates or from other Lua modules. === From templates === From templates, call the <code>isValidHook</code> function, and use the {{para|hook}} parameter to specify t..." |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 30: | Line 30: | ||
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | | | <includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | | | ||
<!-- Categories below this line, please; interwikis at Wikidata --> | <!-- Categories below this line, please; interwikis at Wikidata --> | ||
[[Category:Modules]] | |||
}}</includeonly> | }}</includeonly> | ||
<noinclude> | <noinclude> | ||
[[Category:Module | [[Category:Module documents]] | ||
</noinclude> | </noinclude> |
Latest revision as of 00:48, 11 March 2025
This is a documentation subpage for Module:Check DYK hook. It may contain usage information, categories and other content that is not part of the original module page. |
This module checks the format of Wikipedia:Did you know hooks used in {{DYK talk}} and {{Article history}}.
Usage
This module can be used from templates or from other Lua modules.
From templates
From templates, call the isValidHook
function, and use the |hook=
parameter to specify the hook.
{{#invoke:Check DYK hook|isValidHook|hook=hook}}
Valid hooks will return a value of "yes"; invalid hooks will return the empty string.
You can also use the first positional parameter to specify the hook. If you do this, it is recommended to use |1=
explicitly; if not, and the hook contains an equals sign, the text before the equals sign will be treated as a parameter name and the hook will not be recognised.
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 true
; invalid hooks will return false
.