nischayn22 / PageQuality

A MediaWiki extension to monitor and improve Page Quality
MIT License
0 stars 1 forks source link

Alllow to ignore audits (scorers) #6

Closed drorsnir closed 2 years ago

drorsnir commented 3 years ago

Not every audit is relevant to every article type in our system. For example, "emphasis_gov_symbol" isn't relevant to articles of type "guide". What do you think would be the best way to handle such exceptions? A parser function to set ignored audits, a hook that another extension will use to change the scorer list based on the article type, etc.?

nischayn22 commented 3 years ago

I don't think the parser function approach is the right way, it allows editors to bypass the audits completely as well. Besides one needs to add it to every page/template.

Another extension shouldn't be required as this is a basic feature which should be provided by PageQuality itself.

I think the best way would be to specify the type of pages for a scorer in the settings page. It all depends on how we are able to classify such pages? Are they all in one namespace or do they all use a particular template?

drorsnir commented 3 years ago

Recognizing the type of page can be done in a few ways:

  1. Each page has a property "articletype" saved into the page_props table (see https://github.com/kolzchut/mediawiki-extensions-WRArticleType). This is done through a parser function used in a wikitemplate. Properties can be read in PHP this way:
    PageProps::getInstance()->getProperties( $this->getTitle(), 'ArticleType' );
  2. In HTML, the body element has a class "article-type-x", where X is right/term/etc., the same as the "articletype" property.
nischayn22 commented 2 years ago

Closing as per our discussion on Google Meet.