Difference between revisions of "Template:Page category check"

From RimWorld Wiki
Jump to navigation Jump to search
(First solution. Is at maximum expansion depth and post-expand include size unfortunately)
 
(updated modification date)
 
(15 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly>{{#if: {{#vardefineecho:categories|
+
<includeonly>{{#if:
{{#replace:
+
 
{{#replace:
+
{{#replace:{{#replace:{{#replace:{{#replace:{{#replace:{{#replace:{{#replace:{{#replace:{{#replace:{{#replace:{{#replace:{{#replace:{{#replace:{{#replace:{{#replace:{{#replace:{{#replace:{{#replace:{{#replace:
{{#replace:
+
 
{{#replace:
+
<!-- Remove all verification categories -->
{{#replace:
+
{{#if:{{#vardefineecho:start|{{#pos:{{{Category}}}|Category:Articles verified for}} }}
{{#replace:
+
  | {{#replace:{{{Category}}}
{{#replace:
+
    | {{#sub:{{{Category}}}
{{#replace:
+
      | {{#var:start}}
{{#replace:
+
      | {{#if: {{#vardefineecho:end|{{#pos:{{{Category}}}|,| {{#var:start}} }} }} | {{#expr: {{#var:end}}-{{#var:start}} }} }}
{{#replace:
+
    }} }}
{{#replace:
+
  | {{{Category}}}
{{#replace:
+
}}
{{#replace:
+
 
{{#replace:
+
<!-- Remove all the maintenance categories -->
{{#replace:
+
  | Category:Stubs}}
{{#replace:
+
  <!--| Category:Pages that are obsolete}}--><!--Shouldn't be categorized actually-->
{{#replace:
 
{{#replace:
 
{{#replace:
 
{{#replace:
 
{{#replace:
 
{{#replace:
 
{{#replace:
 
{{#replace:
 
{{#replace:
 
{{#replace:
 
{{#replace:
 
{{#replace:
 
{{#replace:
 
<!--{{#replace:-->
 
<!--{{#replace:-->
 
<!--{{#replace:-->
 
<!--{{#replace:-->
 
  {{#replace:{{{?Category}}}
 
  | Category:Pages that are obsolete}}
 
 
  | Category:Pages that need fact checking}}
 
  | Category:Pages that need fact checking}}
 
  | Category:Pages that need images}}
 
  | Category:Pages that need images}}
  <!--| Category:Pages to be merged}}-->
+
  | Category:Pages to be merged}}
  <!--| Category:Pages to be moved}}-->
+
  | Category:Pages to be moved}}
  <!--| Category:Pages to be recoded}}-->
+
  | Category:Pages to be recoded}}
 
  | Category:Pages to be rewritten}}
 
  | Category:Pages to be rewritten}}
  <!--| Category:Pages to be split}}-->
+
  | Category:Pages to be split}}
 +
| Category:Pages with broken file links}}
 
  | Category:Pages with graphs}}
 
  | Category:Pages with graphs}}
  | Category:Stubs}}
+
  | Category:Pages with syntax highlighting errors}}
 +
| Category:Anomaly}}
 +
| Category:Biotech}}
 +
| Category:Ideology}}
 
  | Category:Royalty}}
 
  | Category:Royalty}}
  | Category:Ideology}}
+
  | Category:Console edition}}
  | Category:Biotech}}
+
  | Category:Impressive}}
 
  | Category:Unverified articles}}
 
  | Category:Unverified articles}}
| Category:Articles verified for Alpha 14C}}
 
| Category:Articles verified for Alpha 14D}}
 
| Category:Articles verified for 1.2.2723}}
 
| Category:Articles verified for 1.2.2753}}
 
| Category:Articles verified for 1.2.2900}}
 
| Category:Articles verified for 1.2.3005}}
 
| Category:Articles verified for 1.3.3066}}
 
| Category:Articles verified for 1.3.3069}}
 
| Category:Articles verified for 1.3.3072}}
 
| Category:Articles verified for 1.3.3080}}
 
| Category:Articles verified for 1.3.3087}}
 
| Category:Articles verified for 1.3.3101}}
 
| Category:Articles verified for 1.3.3117}}
 
| Category:Articles verified for 1.3.3159}}
 
| Category:Articles verified for 1.3.3200}}
 
| Category:Articles verified for 1.3.3287}}
 
| Category:Articles verified for 1.3.3326}}
 
| Category:Articles verified for 1.3.3387}}
 
| Category:Articles verified for 1.4.3525}}
 
 
  | ,}}
 
  | ,}}
}} || [[{{{page}}}]] ({{#var:categories}}),&nbsp;}}</includeonly><noinclude>
 
{{Documentation|content=The following pages only have a maintenance category defined:
 
  
{{#ask: [[:+]] [[Modification date::+]]
+
<!-- If there is no category left, return the name of the page -->
  | limit = 500 | format = template | template = Page category check | link = none | searchlabel =
+
|| [[{{{page}}}]],&#32;}}{{#vardefine:date|{{{Date}}} }}</includeonly><noinclude>
 +
{{Documentation|content=
 +
== Explanation ==
 +
This template checks whether a content page is properly categorized. This is necessary since [[Special:UncategorizedPages]] doesn't work if the pages have categories like [[:Category:Biotech]], [[:Category:Stubs]] or [[:Category:Unverified articles]] defined.
 +
 
 +
The pages are scanned with the following code:
 +
<pre>
 +
{{#ask: [[:+]] [[Modification date::>28 October 2022 08:53:21]]
 +
  | limit = 500 | format = template | template = Page category check | link = none
 
  | named args = yes
 
  | named args = yes
 
  | ? = page
 
  | ? = page
  | ?Category = ?Category
+
  | ?Category = Category
  | sort = Category, Modification date | order = ascending
+
| ?Modification date = Date
 +
  | sort = Modification date
 
  | offset = 0
 
  | offset = 0
 
}}
 
}}
 +
</pre>
 +
As the limit of 500 cannot be exceeded, if the template doesn't return any pages, the modification date should be set the last checked date as returned under ''Output'' below. Since issues can only arise after new edits, pages that were last edited a long time ago don't have to be scanned again.
 +
}}
 +
 +
== Output ==
 +
The following pages (ordered by ''Modification date'') only have a maintenance category defined:
  
{{#ask: [[:+]] [[Modification date::+]]
+
{{#ask: [[:+]] [[Modification date::>21 January 2024 02:10:00]]
  | limit = 500 | format = template | template = Page category check | link = none | searchlabel =
+
  | limit = 500 | format = template | template = Page category check | link = none
 
  | named args = yes
 
  | named args = yes
 
  | ? = page
 
  | ? = page
  | ?Category = ?Category
+
  | ?Category = Category
  | sort = Category, Modification date | order = ascending
+
| ?Modification date = Date
  | offset = 500
+
  | sort = Modification date
 +
  | offset = 0
 
}}
 
}}
}}</noinclude>
+
 
 +
The last checked page has a ''Modification date'' of: {{#var:date}} {{#ifeq: {{#var:date}} | {{#show: {{#ask: [[:+]] [[Modification date::+]] | limit = 1 | link = none | searchlabel = | sort = Modification date | order = descending }} | ?Modification date }} | Which is the date of the most recent edit. {{Check}} | There are still more to go. {{Cross}} }}
 +
 
 +
[[Category:Wiki maintenance]]</noinclude>

Latest revision as of 09:49, 5 April 2024

Documentation icon Template documentation

Explanation

This template checks whether a content page is properly categorized. This is necessary since Special:UncategorizedPages doesn't work if the pages have categories like Category:Biotech, Category:Stubs or Category:Unverified articles defined.

The pages are scanned with the following code:

{{#ask: [[:+]] [[Modification date::>28 October 2022 08:53:21]]
 | limit = 500 | format = template | template = Page category check | link = none
 | named args = yes
 | ? = page
 | ?Category = Category
 | ?Modification date = Date
 | sort = Modification date
 | offset = 0
}}

As the limit of 500 cannot be exceeded, if the template doesn't return any pages, the modification date should be set the last checked date as returned under Output below. Since issues can only arise after new edits, pages that were last edited a long time ago don't have to be scanned again.

Output[edit]

The following pages (ordered by Modification date) only have a maintenance category defined:

Embryo, Deathrest capacity serum, Stasis cocoon, Nerve bundle, Fleshmass neural lump, Revenant flesh chunk, Gray flesh sample, Twisted archotech support, Void metal wall, Void metal mass, Pocket map, Metal hell, Revenant invisibility, Books, Events/Anomaly, Fleshmass, Undercave, Ovum, Smoothed slate, Smoothed limestone, Smoothed sandstone, Smoothed marble, Fleshmass spitter, Smoothed granite, Containment, ... further results

The last checked page has a Modification date of: 31 July 2024 23:20:29 There are still more to go. Ex.png