Module:Highlight/doc

MyWikiBiz, Author Your Legacy — Wednesday November 13, 2024
Jump to navigationJump to search

This is the documentation page for Module:Highlight

Template:Module rating

Usage

{{#invoke:Highlight|main|regex|page name|style}}

  • regex is a Lua pattern (a somewhat limited form of regular expression -- see mw:Extension:Scribunto/Lua_reference_manual#Patterns). Note that quotes around the regex are not needed and captures should have no effect (however, you can use them to break up blocks of [ or { characters that interfere with the processing of the #invoke block). Omitting the regex results in blank output.
  • page is the name of the page to highlight. However, it can be omitted, in which case the current page is used. However, if the page name ends in "/highlight", then that part is removed before the page is looked up.
  • style is an optional parameter. In addition to the default, it can presently be "yellow" for a classic yellow highlighter look, or "oval" for a bolder, oval-ish red outline. The span style="..." statements for accomplishing this are defined near the top of the module for your convenience in editing.
  • All of these parameters can be passed with names (regex = , page = , style =) if desired.
  • Therefore, a convenient way to use this function is to preview the text {{#invoke:Highlight|main|''regex''}} at (your-page-name)/highlight to view the text of (your-page-name) with markup added. Unless you'd like to share the marked-up text with others you shouldn't Save the page.