Module:DetectMarkup/doc
Appearance
|
|
This is a documentation subpage for Module:DetectMarkup (see that page for the module itself). It contains usage information, categories and other content that is not part of the original module page. |
Purpose
[edit]This module is designed for use in Wikimedia templates to detect whether a page contains the {{verify}} template. It returns "true" if {{verify}} is present in the page's wikitext, and "false" otherwise.
This functionality supports automated workflows that help identify markup in draft articles, enabling template logic or tools to take appropriate action based on whether cleanup markup is present.
Usage
[edit]This module is typically invoked within a template to conditionally display content based on whether the page includes {{verify}}.
Basic Usage in a Template
[edit]{{#invoke:DetectMarkup|detectMarkup}}
- Returns
"true"if the page contains{{verify}}(with or without parameters). - Returns
"false"if the template is not present.
Conditional Display Example
[edit]This example changes output based on the result from the module:
{{#switch: {{#invoke:DetectMarkup|detectMarkup}}
| true = <span style="color:orange;">This page contains markup for verification.</span>
| false = <span style="color:green;">No verification markup detected on this page.</span>
| #default = <span style="color:gray;">Unable to determine markup status.</span>
}}
How It Works
[edit]- The module retrieves the raw wikitext of the current page.
- It checks if
{{verify}}appears in the wikitext, allowing for optional parameters. - If the template is found, the module returns
"true". - If not found, the module returns
"false".
Limitations
[edit]- The module only checks the raw wikitext of the page. If
{{verify}}is transcluded via another template, it may not be detected. - The module currently detects only the
{{verify}}template. It is structured to allow additional templates to be added in the future.
|
|
This is a documentation subpage for Module:DetectMarkup (see that page for the module itself). It contains usage information, categories and other content that is not part of the original module page. |