Page MenuHomePhabricator

Track magic word usage
Open, LowPublicFeature

Description

Is it possible to have some form of categorisation (done fairly quickly) on all pages that transclude the MW Template {{DISPLAYTITLE}}

Or some other way to get a list of all the pages that transclude it?

We used to use Template:Underscore and Template:Lowercase and underscore in AWB to prevent link changing, now this has been properly enabled, and those templates removed on en.wp, we cant get a list of the pages.

Thanks

Sam


Version: 1.13.x
Severity: enhancement
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=33033

Details

Reference
bz14685

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 10:13 PM
bzimport set Reference to bz14685.
bzimport added a subscriber: Unknown Object (MLST).

overlordq wrote:

Template:Underscore still exists.

But doing a text search for DISPLAYTITLE[1] does't work? Although it returns results I'd imagine there'd be more then two results.

[1] http://en.wikipedia.org/w/api.php?action=query&generator=search&gsrsearch=DISPLAYTITLE&prop=info&gsrwhat=text

Maybe so, but there should be a way to be able to get a list of what transcludes that template (shouldnt have to duplicate the work!)

Bryan.TongMinh wrote:

{{DISPLAYTITLE}} is a magic word that is not indexed in any way. We could perhaps add an entry to page_props.

Anything would be useful

Was just using that as an example!

An entry to page_props could also help with tracking other strange parts of page text like NOINDEX, etc.

Bryan.TongMinh wrote:

Yeah(In reply to comment #8)

An entry to page_props could also help with tracking other strange parts of
page text like NOINDEX, etc.

Good idea. Changing subject accordingly.

Cluttering category tree with purely technical categories doesn't seem the best way to me.

I'd suggest the following approach instead:

Have some way how to store in database usage of random (preferably all) magic words and other syntax constructions.

For example, something like this:

table magicwords

  • according to possible confusion with mw prefix, it can be named e. g. syntaxtracking with prefix "st" or whatever

mw_page

  • equal to page_id

mw_word

  • {{CURRENTDAY}}, NOTOC, {{lc:}}, {{#if:}}, <gallery>, (other forms)

mw_type

  • 1, 2, 3, 4, 5 (or in words, like "curly bracket magic word", "underscore magic word", "colon function", "parser function", "tag")

Maybe also:
mw_source

  • possible identification of where such magic word comes from, NULL for core or the extension name, so in case you want to deinstall some extension, you can simply run some maintenance task to find out (and e. g. possibly remove) which pages use magic words introduced by such extension.

I'm not db expert, so I'm pretty sure it will need some optimalization, therefore it is just the basic idea.

Then there would be new special page, say Special:MagicWordsUsage (Special:SyntaxTracking, ...) on which you could simply select from <select> the magic word you want to have listed + common existing namespace selector. You hit submit button and all pages according to the criteria would be listed. URL shortcut like "Special:SyntaxTracking/<gallery>" would be handy as well.

Things to think about:

  • Tracking of pages which _directly_ contain such syntax construction in their wikitext versus tracking all pages containing that via transclusion.
  • Track #REDIRECT?

(changed the summary to be yet more general)

Bryan.TongMinh wrote:

Double underscore magic and behavioral parser magic is tracked in page_props as of r69235. I do not intend to track usage of things like {{#if}} and similar.

Now somebody needs to write a special page and api module to query to pages.

(In reply to comment #11)

Now somebody needs to write a special page and api module to query to pages.

The api module was added with r70638, but the $wgPageProps (added in the same revision) needs update to match the new page_props.

Aklapper changed the subtype of this task from "Task" to "Feature Request".Feb 4 2022, 11:01 AM
Aklapper removed a subscriber: wikibugs-l-list.