Template:Rank/doc

From Darkest Dungeon Wiki
Jump to navigation Jump to search
Template-info.svg Documentation

Rank is a template that takes a rank specification and generates a sequence of dots corresponding to those ranks in Darkest Dungeon.

The first argument of Rank specifies whether the template should generate ally or enemy dots, or self for the special case Self.

When given ally or enemy, the second argument must be a rank specification, a string consisting of the following characters:

  • "o": indicating that a position is present, i.e. or .
  • ".": indicating that a position is not present, i.e. .
  • "-": indicating that two positions should be connected, i.e. or .

For performance reasons the module does no error-checking and may produce results that are not actually possible in the game! Specifically, the module will ignore all characters aside from "o", ".", and "-". See the examples below for more details.

Examples

Code Output Comments
{{Rank|self}} Self
{{Rank|ally|oooo}}
{{Rank|enemy|o.o.}}
{{Rank|ally|o-o-o-o}}
{{Rank|enemy|o-o..}}
{{Rank|ally|o---oo-oo}} Dashes that do not connect to dots will be ignored.
{{Rank|enemy|-o.o.-o-}} The parser can generate dashes pointing in directions that would not be possible in the game.
{{Rank|ally|---}} The parser can handle very short outputs, including empty ones...
{{Rank|enemy|o.o.o.o-o-o-o--o-o-o.oo-oo}} ...as well as very long ones.
{{Rank|ally|oxo.-oaohello.-llo-o}} The parser will attempt to skip invalid characters.

Implementation

Rank is a thin wrapper around Module:Rank, which is itself a wrapper around Module:RankParser. Note that per the Wikimedia style guide, is not recommended to call those modules directly but to use this template instead. Consult those modules for more details.

See Also