Module:Hatnote/doc: Difference between revisions

Content deleted Content added
and findNamespaceId
add formatPages
Line 94:
: {{code|mHatnote._findNamespaceId(':Category:Lions')|lua}} → 14
: {{code|mHatnote._findNamespaceId(':Category:Lions', false)|lua}} → 0 (the namespace is detected as ":Category", rather than "Category")
 
=== Format pages ===
 
<source lang="lua">
mHatnote._formatPages(...)
</source>
 
Formats a list of pages using the [[#Format link|_formatLink]] function, and returns the result as an array. For example, the code {{code|mHatnote._formatPages('Lion', 'Tiger', 'Lion#Etymology')|lua}} would produce an array like {{code|{'[[Lion]]', '[[Tiger]]', '[[Lion#Etymology|Lion § Etymology]]'}|lua}}.
 
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox||