Jump to content

User:Michael.C.Wright/MarkupManager

From Wikinews, the free news source you can write!

The MarkupManager script is designed to help Wikinews reviewers and contributors detect and clean up draft-only templates like {{verify}} and {{highlight}} before articles are published.

Currently, the tool supports:

  • Scanning the target article for:
    • Any instances of {{verify}}
    • Any instances of {{highlight}} (case-insensitive name, any parameters)
  • Hiding all instances of {{verify}} in the target article by adding visibility=hidden
  • Unhiding all instances of {{verify}} in the target article by removing visibility=hidden
  • Removing all instances of {{verify}} from the target article
  • Removing all instances of {{highlight}} from the target article while preserving the underlying text
    • The tool keeps the value of text= when present, otherwise the first unnamed parameter
  • Removing all supported markup in one step (both {{verify}} and {{highlight}}), again preserving the text previously wrapped by {{highlight}}

If you need help or want to suggest improvements, visit the talk page.

Installation

To install the script, add the following line to your common.js page:

mw.loader.load('//en.wikinews.org/w/index.php?title=User:Michael.C.Wright/js/MarkupManager.js&action=raw&ctype=text/javascript');

Once the script is installed, return to and refresh (i.e., Ctrl + R) this page. You will see a control panel, with buttons, in the MarkupManager Interface section below.

Usage

Screenshot of MarkupManager Interface
Screenshot of MarkupManager Interface

Enter the article title into the title field in the MarkupManager Interface below. You then have the following actions you can perform:

  • Scan the article for markup
    • Detects whether the article contains {{verify}} or {{highlight}} (case-insensitive, with or without parameters).
  • Hide all
    • Adds visibility=hidden to all {{verify}} templates that are not already hidden.
  • Unhide all
    • Removes visibility=hidden from all {{verify}} templates where it is present.
  • Remove all
    • Deletes all {{verify}} templates from the article.
  • Remove all {{{1}}}
    • Deletes all {{highlight}} templates (any casing) but preserves the underlying text.
    • If a text= parameter exists, that value is kept; otherwise, the first unnamed parameter is kept.
  • Remove all markup
    • Removes both {{verify}} and {{highlight}} in a single operation, preserving text previously wrapped by {{highlight}} as above.

Currently, the markup recognized by this tool is:

  • {{verify}}
  • {{highlight}}

MarkupManager Interface

   The MarkupManager script has not been loaded or installed. Once loaded, a cleanup tool will appear here.

Future Plans

  • Support for additional templates like {{PhraseReview}}.
  • Automatic tracking of markup present in published articles.

See Also