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.

// request.cf · coarse context

A page that knows where it met you.

Only coarse request metadata is shown. This demo does not display or persist visitor IP addresses.

Country
US
Cloudflare location
CMH
Connection
HTTP/2
Language
Not provided

Ray ID: a4048baf299a19ef

Jump to content

Module:Goban/doc

From Wikipedia, the free encyclopedia

This module reimplements the version of {{Goban}} as of 11:29, 4 September 2024. It accepts the same tile codes, but draws the board with CSS alone instead of one image per intersection: the grid lines, hoshi, stones and rings are styled spans from Module:Goban/style.css (loaded with TemplateStyles), and letters, numbers and the triangle mark are text. It also comes with a description of the position, hidden using {{Screen reader-only}}. It accepts arbitrary sizes and can implement the pre-existing variants ({{Goban 5x5}}, {{Goban 9x9}}, {{Goban 11x11}}, {{Goban 13x13}}, {{Goban 7x11}}).

Usage

[edit]

The module should not be invoked directly from articles. Use one of the templates instead. If you need a new size, create a template and wrap this module like this:

<includeonly>{{#invoke:Goban|board|rows=13|cols=13|u=u|d=d|l=l|r=r}}</includeonly><noinclude>{{documentation}}</noinclude>

See Template:Goban/doc/instructions for the tile codes. {{#invoke:Goban|tile|bT|32}} renders a single tile at the given size, for documentation.

Rendering

[edit]

The tile size argument becomes the font-size of the board and the stylesheet measures everything in em, so one intersection is exactly one em square. Each intersection is a span.goban-pt whose grid lines are two background gradients; the classes goban-u, goban-ul and so on drop the line towards a board edge. A hoshi is a ::before dot, a red ring a ::after border, and a stone a child span.goban-stone with a radial gradient. Marks are text: letters are shown lower-case italic, the triangle is U+25B3 and the square is a bordered pseudo-element.

Screen readers

[edit]

The drawn board is marked aria-hidden, so a screen reader announces none of its spans. The submodule Module:Goban/accessibility instead puts a description wrapped in {{Screen reader-only}} at the start of the board. The text is generated from the cell codes:

  • Go board, 19 by 19. followed by any stones without a move order, Black stones: D4, Q16., White stones: …, any moves, Moves: 1 black K10; 2 white D4. (from the 00–99, 000–999 and b1–w9 tiles, in move order), and any marks Marks: triangle on black stone at D4; letter A at E5; X at F6; circle at G7. Unrecognised codes are read out as, for example, zz tile at H8.
  • An empty board reads Go board, 19 by 19, empty.
  • Coordinates use Go notation relative to the diagram: columns A–T from the left (skipping I), rows numbered from the bottom of the diagram.