Using Sensei's Library format to prepare Go diagrams

Introduction

Sensei's Library is a popular collaborative web site about the game of Go. To facilitate discussions of Go board positions, the website defines an easy-to-use markup language and uses a back-end program to generate Go diagrams from text input. This open-source program has been integrated into Go4Go's content management system so all user posts here can also benefit from such nice feature.

Let's start from an example. The following text is magically converted into the image below:

[diagram] $$c Small avalanche joseki $$ -------------- $$ | . . . . . . . $$ | . . . 3 a . . $$ | . 4 2 X O b . $$ | . . X O . . . $$ | . . X O . . . $$ | . . . 1 . . . $$ | . . . . . . . [/diagram]

Small avalanche joseki

First of all, all texts for a diagram have to be enclosed by diagram tags like:
[diagram]......[/diagram]
For users coming from other popular Go websites, such as lifein19x19.com, it is also possible to use [go]......[/go]
The basic grammar can be easily summarised as follows:

  • Each line starts with $$.
  • Go board boundaries are described using -- (two minus signs for each column) and | (for each row).
  • Black stones, white stones, empty points and hoshi (star) points are represented using letter X, letter O, dots (.), and commas (,), respectively.
  • Up to 10 moves may be placed on the board using numbers (0 is interpreted as move 10).
  • Lower-case letters a...z can be used to annotate game positions.

A number of upper-case letters and symbols may be used to generate special effects on the board, as shown below:

[diagram] $$ Board markup $$ . X . B . # . Y . Z . $$ O . W . @ . Q . P . . $$ . , . C . S . T . M . [/diagram]

Board markup

User can optionally set a number of options in the first line to configure the board. Some useful settings are:

  • Set $$W so that white side plays first. Default is $$B but letter B can be omitted.
  • Use $$c to turn on coordinate on the board. If combined with the above option, use something like $$Wc.
  • Use the m option to set the starting move number, e.g. if $$Wm7 is used, then move corresponding to number 1 in the text is displayed as White 7 .
  • After all the keywords, a text description can be provided which will be reproduced as a caption to the generated diagram.

Finally, the generated diagrams are clickable. Once clicked, corresponding SGF files can be donwloaded for offline viewing in Go software.

The short tutorial here should cover most practical situations. For the full description of the input format, see How Diagrams Work.

Tools for diagram generation:

Tags: