Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

Jump to content

Module:Driver standings/doc

From Wikipedia, the free encyclopedia

Module:Driver standings is intended to create motorsport championship standings tables given a championship, races, competitors, and results; a list of supported championships is given below.

Usage

[edit]

The basic command is {{#invoke:Driver standings|standings|championship=XXX}}. By default, position and points columns are sticky, and overflow-x is set to auto.

Championship

[edit]

The XXX in championship=XXX is to be replaced by one of the following series:

An input for championship is required, or an error will be thrown.

Auxillary championship

[edit]

For championships with auxillary championships or points to be displayed, the auxillary championship can be inputted via auxchampionship.

Columns

[edit]

To rename any of the standard columns for the standings table, use the following parameters:

  • Position - position (default Pos)
  • Driver/rider - competitor (default Driver)
  • Team (not present by default) - competitor_team (default Team)
  • Manufacturer (not present by default) - competitor_man (default Manufacturer)
  • Points - point (default Points)

Races

[edit]

Races are added with parameters of the pattern r*, where * is a unique "id" corresponding to the order the races should be displayed. For example, the first race would be entered as r1=race1, the second as r2=race2, etc. Whatever is inputted is directly displayed.

Input {{#invoke:Driver standings |standings |championship=XXX
|r1=race1 |r2=race2<br>rflag2}}
Display
Pos Driver race1 race2
rflag2
Points
Pos Driver race1 race2
rflag2
Points

Race lengths

[edit]

For championships where different points are given out for different races based on their distance/time, race lengths can be added with parameters of the pattern r*l, where * is the id of the race the length is given for. There is no "default" race length, meaning race lengths must be added for all races if applicable.

Subraces

[edit]

For races with multiple rounds, subraces can be added with parameters of the form r*s., where * is the id of the race where said multiple races are occurring and . is the round number of the race. For example, if the first race is r1=race1, then the first round would be inputted as r1s1=round1, the second round would be r1s2=round2, and so on. Whatever is inputted is directly displayed.

Input {{#invoke:Driver standings |standings |championship=XXX
|r1=race1 |r1s1=round1 |r1s2=round2}}
Display
Pos Driver race1 Points
round1 round2
Pos Driver race1 Points
round1 round2

Drivers/riders

[edit]

Drivers/riders are added with parameters of the pattern d*, where * is a numerical "id" unique to each competitor being added. Teammates should be added as separate ids; the function will not display them correctly otherwise. Whatever is inputted is directly displayed.

Input {{#invoke:Driver standings |standings |championship=XXX
|r1=race1<br>rflag1 |r2=race2<br>rflag2 |r3=race3<br>rflag3
|d1=driver1
|d2=dflag2 driver2}}
Display
Pos Driver Team Manufacturer race1
rflag1
race2
rflag2
race3
rflag3
Points
driver1 0
dflag2 driver2 0
Pos Driver Team Manufacturer race1
rflag1
race2
rflag2
race3
rflag3
Points

Driver/rider teams

[edit]

When a driver/rider's team should be displayed, they can be added with parameters of the pattern d*t., where * is the id of the driver, and . is the id of the team. Whatever is inputted is directly displayed.

Input {{#invoke:Driver standings |standings |championship=XXX
|r1=race1<br>rflag1 |r2=race2<br>rflag2 |r3=race3<br>rflag3
|d1=dflag1 driver1 |d1t1=team1
|d2=dflag2 driver2 |d2t1=tflag2 team2}}
Display
Pos Driver Team Manufacturer race1
rflag1
race2
rflag2
race3
rflag3
Points
dflag1 driver1 team1 0
dflag2 driver2 tflag2 team2 0
Pos Driver Team Manufacturer race1
rflag1
race2
rflag2
race3
rflag3
Points
Driver/rider team stints
[edit]

If a driver/rider competes with multiple teams, the rounds they compete with each team can be specified by using parameters of the form d*e., where * is the id of the driver and . is the id of the team/manufacturer. The first and last round the driver competes with said team/manufacturer should be separated by a hyphen. If the driver competes with the team/manufacturer for multiple distinct stints, separate the first-last round pairs by commas.

Input {{#invoke:Driver standings |standings |championship=XXX
|r1=race1<br>rflag1 |r2=race2<br>rflag2 |r3=race3<br>rflag3
|d1=dflag1 driver1 |d1t1=tflag1 team1 |d1e1=1-1,3-3 |d1t2=tflag3 team3:2-2 |d1e2=2-2
|d2=dflag2 driver2 |d2t1=tflag2 team2}}
Display
Pos Driver Team Manufacturer race1
rflag1
race2
rflag2
race3
rflag3
Points
dflag1 driver1 tflag1 team1 0
tflag3 team3
dflag2 driver2 tflag2 team2 0
Pos Driver Team Manufacturer race1
rflag1
race2
rflag2
race3
rflag3
Points

Driver/rider manufacturers

[edit]

When a driver/rider's manufacturer should be displayed, they can be added with parameters of the pattern d*m., where * is the id of the driver and . is the id of the manufacturer. Whatever is inputted is directly displayed.

Input {{#invoke:Driver standings |standings |championship=XXX
|r1=race1<br>rflag1 |r2=race2<br>rflag2 |r3=race3<br>rflag3
|d1=dflag1 driver1 |d1t1=tflag1 team1 |d1m1=manufacturer1
|d2=dflag2 driver2 |d2t1=tflag2 team2 |d2m1=mflag2 manufacturer2}}
Display
Pos Driver Team Manufacturer race1
rflag1
race2
rflag2
race3
rflag3
Points
dflag1 driver1 tflag1 team1 manufacturer1 0
dflag2 driver2 tflag2 team2 mflag2 manufacturer2 0
Pos Driver Team Manufacturer race1
rflag1
race2
rflag2
race3
rflag3
Points

Rookies

[edit]

If a driver/rider is a rookie, where being a rookie affects how they are displayed, use parameters of the form d*R. Any input other than nil will work correctly.

Results

[edit]

To add results for a driver, they can be added with parameters of the pattern d*r., where * is the id of the driver and . is the id the of the race the result is added for. Available results are all those according to a championship's classification key.

Input {{#invoke:Driver standings |standings |championship=XXX
|r1=race1<br>rflag1 |r2=race2<br>rflag2 |r3=race3<br>rflag3
|d1=dflag1 driver1 |d1t1=tflag1 team1 |d1m1=manufacturer1
|d1r1=1 |d1r2=DSQ,2,F |d1r3=1,P
|d2=dflag2 driver2 |d2t1=tflag2 team2 |d2m1=mflag2 manufacturer2
|d2r1=2 |d2r2=1,1,P |d2r3=Ret,F}}
Display
Pos Driver Team Manufacturer race1
rflag1
race2
rflag2
race3
rflag3
Points
1 dflag1 driver1 tflag1 team1 mflag1 manufacturer1 1 DSQ 2 F 1 P 232
2 dflag2 driver2 tflag2 team2 mflag2 manufacturer2 2 1 1 P Ret F 224
Pos Driver Team Manufacturer race1
rflag1
race2
rflag2
race3
rflag3
Points

To add secondary results for a driver (such as pole, fastest laps, sprint results, among others), they can be added using commas following the main finishing result. Supported secondary results are below:

  • Secondary result - finishing position
  • Pole - P (both superscript, such as resP, and typeface, such as res)
  • Fastest lap - F (both superscript, such as resF, and typeface, such as res)
  • Laps led - L
  • Most laps led - M

Only championships which award points for or display said secondary result should have these added, otherwise an error will be thrown.

Special results

[edit]

There are three types of special results. If a finishing position is preceded with one of the following characters, it will display the position with the background and classify the result according to the classification on the right. Points will be awarded based on the position.

  • R - Ret (retirement)
  • N - NC (not classified)
  • D - DSQ (disqualified)
Input {{#invoke:Driver standings |standings |championship=XXX
|r1=race1<br>rflag1 |r2=race2<br>rflag2 |r3=race3<br>rflag3
|d1=dflag1 driver1 |d1t1=tflag1 team1 |d1m1=manufacturer1
|d1r1=1 |d1r2=R2 |d1r3=D1
|d2=dflag2 driver2 |d2t1=tflag2 team2 |d2m1=mflag2 manufacturer2
|d2r1=2 |d2r2=1 |d2r3=N2}}
Display
Pos Driver Team Manufacturer race1
rflag1
race2
rflag2
race3
rflag3
Points
1 dflag1 driver1 tflag1 team1 mflag1 manufacturer1 1 2 1 290
2 dflag2 driver2 tflag2 team2 mflag2 manufacturer2 2 1 2† 280
Pos Driver Team Manufacturer race1
rflag1
race2
rflag2
race3
rflag3
Points

Class results

[edit]

For championships with multiple classes, where the position is displayed is overall but points are awarded according to class position, put the overall position first and class position second separated by an equal sign.

Input {{#invoke:Driver standings |standings |championship=XXX
|r1=race1<br>rflag1 |r2=race2<br>rflag2 |r3=race3<br>rflag3
|d1=dflag1 driver1 |d1t1=tflag1 team1 |d1m1=manufacturer1
|d1r1=12=1 |d1r2=2 |d1r3=20=1
|d2=dflag2 driver2 |d2t1=tflag2 team2 |d2m1=mflag2 manufacturer2
|d2r1=22=2 |d2r2=1 |d2r3=25=2}}
Display
Pos Driver Team Manufacturer race1
rflag1
race2
rflag2
race3
rflag3
Points
1 dflag1 driver1 tflag1 team1 mflag1 manufacturer1 12 2 20 290
2 dflag2 driver2 tflag2 team2 mflag2 manufacturer2 22 1 25 280
Pos Driver Team Manufacturer race1
rflag1
race2
rflag2
race3
rflag3
Points

Auxillary results

[edit]

For auxillary championship results, separate results for the first and second championship with a /. All the same rules for primary results apply to auxillary results as well.

Penalties

[edit]

If a driver/rider is given a points penalty, that can be recorded with parameters of the form d*p, where * is the id of the driver. The format of the input should be d*p=(amount of points penalized) Reason why penalty was applied. The amount of points penalized should be positive, and should representative the totality of penalties applied.

Input {{#invoke:Driver standings |standings |championship=XXX
|r1=race1<br>rflag1 |r2=race2<br>rflag2 |r3=race3<br>rflag3
|d1=dflag1 driver1 |d1t1=tflag1 team1 |d1m1=manufacturer1
|d1p=(10) Driver1 was penalized 10 points in order to show how the penalty parameter functioned.
|d1r1=1 |d1r2=DSQ,2,F |d1r3=1,P
|d2=dflag2 driver2 |d2t1=tflag2 team2 |d2m1=mflag2 manufacturer2
|d2r1=2 |d2r2=1,1,P |d2r3=Ret,F}}
Display
Pos Driver Team Manufacturer race1
rflag1
race2
rflag2
race3
rflag3
Points
1 dflag2 driver2 tflag2 team2 mflag2 manufacturer2 2 1 1 P Ret F 224
2 dflag1 driver1 tflag1 team1 mflag1 manufacturer1 1 DSQ 2 F 1 P 222
Pos Driver Team Manufacturer race1
rflag1
race2
rflag2
race3
rflag3
Points

Sources

[edit]

Sources can be added with sources.

Input {{#invoke:Driver standings |standings |championship=XXX
|r1=race1<br>rflag1 |r2=race2<br>rflag2 |r3=race3<br>rflag3
|d1=dflag1 driver1 |d1t1=tflag1 team1 |d1m1=manufacturer1
|d1r1=1 |d1r2=DSQ,2,F |d1r3=1,P
|d2=dflag2 driver2 |d2t1=tflag2 team2 |d2m1=mflag2 manufacturer2
|d2r1=2 |d2r2=1,1,P |d2r3=Ret,F
|sources=<ref>Thank you for being here!</ref>}}
Display
Pos Driver Team Manufacturer race1
rflag1
race2
rflag2
race3
rflag3
Points
1 dflag1 driver1 tflag1 team1 mflag1 manufacturer1 1 DSQ 2 F 1 P 232
2 dflag2 driver2 tflag2 team2 mflag2 manufacturer2 2 1 1 P Ret F 224
Pos Driver Team Manufacturer race1
rflag1
race2
rflag2
race3
rflag3
Points
Sources:[1]
  1. ↑ Thank you for being here!