Weiqi plugin demo

This is a demo page of the Weiqi plugin for DokuWiki. It allows you to display some diagrams of this game (also called Go or Igo or Baduk) in your wiki pages. See this Wikipedia article to learn what Weiqi is.

If you find it nice, it's only because of the nice images provided by Dragon Go Server. Thanks guys.

Sorry, you can't edit this page to try the plugin here. You can go to the playground instead. But first, have a look at these examples.

The basics

The diagram syntax begins with <weiqi> and ends with </weiqi>.

Then if you start a line with attributes:, you can change some characteristics of the goban (size of the squares, color…). Attributes are space separated.

You can display a caption for your diagram starting a line with caption:.

For the diagram code itself you have two modes: normal code and advanced code. In normal code, each character represents an intersection, and in advanced code two characters are needed for each intersection.

Standard code

First example

The attributes:demo item allows us to see the wiki code used to produce the diagram automaticly. I think you won't use it very often.

A full 19×19 goban is easier to see with grid_size=17. The grid_size=xx attribute will make the Weiqi plugin display images in the img/xx/ directory. If the relevant directory is not found, it will send an error message.

You can see all the different sizes available on this full test page (when using it yourself, be sure to download all the image files).

attributes: demo grid_size=17
+-----------------+
|.................|
|Xo..o........x...|
|.xo.....,.....,x.|
|.................|
|.x...............|
|...............o.|
|.................|
|.................|
|.x,.....,.....,o.|
|.................|
|.................|
|.................|
|.o...............|
|.................|
|..o.....,.....x..|
|............x....|
|.................|
+-----------------+
 +-----------------+
|.................|
|Xo..o........x...|
|.xo.....,.....,x.|
|.................|
|.x...............|
|...............o.|
|.................|
|.................|
|.x,.....,.....,o.|
|.................|
|.................|
|.................|
|.o...............|
|.................|
|..o.....,.....x..|
|............x....|
|.................|
+-----------------+

Note that if you use an uppercase 'o' you'll get a marked white stone, while an uppercase 'x' will give you a marked black stone like the one in the top left corner.

You can also use letters (except o, O, x and X) and numbers from 1 to 9, as in the next example.

Letters and numbers

attributes: demo
+--------------------------+
|abcdefghijklmnopqrstuvwxyz|
|ABCDEFGHIJKLMNOPQRSTUVWXYZ|
|123456789,................|
+--------------------------+
 +--------------------------+
|abcdefghijklmnopqrstuvwxyz|
|ABCDEFGHIJKLMNOPQRSTUVWXYZ|
|123456789,................|
+--------------------------+

These are the only board symbols you can have with the standard code.

Now let's explore some other possibilities of the standard code, this concerns caption, goban color and co-ordinates.

Caption, goban color and co-ordinates

You can display a caption using with a line like caption:This is my caption.

By default we have goban=1 while goban=2 will just change the goban color.

The goban=xx attribute will make the Weiqi plugin display images in the img/images/ directory with the xx suffix. If the relevant files are not found, it will send an error message.

coords displays co-ordinates all around the goban. Only images from 1 to 25, a to h and j to z are available.

caption:Black to kill
attributes: demo goban=2 coords
|.........
xxx,.x....
oooxx.....
|..oox....
+ox--x----
Black to kill
  abcdefghjk
5 |......... 5
4xxx,.x....4
3oooxx.....3
2|..oox....2
1+ox--x----1
  abcdefghjk

That could be enough but you can also reverse_letters and reverse_numbers.

Reverse co-ordinates

attributes: demo coords reverse_letters reverse_numbers
+---+
|...|
|.xX|
|..o|
+---+
  edcba
1 +---+ 1
2|...|2
3|.xX|3
4|..o|4
5+---+5
  edcba

But it's not as useful as starting the numbers or letters from something else than 1 or a.

Corners

attributes: demo coords start_number=15 start_letter=n
_-----+
......|
..x...|
...,x.|
......|
  nopqrst
19 @-----+ 19
18......|18
17..x...|17
16...,x.|16
15......|15
  nopqrst

Note that if the Weiqi plugin doesn't understand a character (“_” is a mistake here), it will report it as a blinking @. Anyway you can use those mistakes on purpose too…

Advanced code

First example

Now a diagram symbol is defined by two characters. If the second is a blank, standard code applies (don't forget the last space). If it's not a blank, you gain access to new symbols, like squares, circles, triangles… for stones or empty intersections.

attributes: demo advanced
+ - - - + 
| . . . | 
| . x X | 
| . . o | 
+ - - - + 
 + - - - +
| . . . |
| . x X |
| . . o |
+ - - - +

Note that if the Weiqi plugin doesn't understand a pair of characters (“_ ” or “-:” are mistakes here), it will report it as a blinking @ too.

All the available symbols in a few diagrams

This section will show you all the available symbols at size 25, while this page shows them in all available sizes: 5, 7, 9, 11, 13, 17, 21, 25, 29, 35, 42 and 50.

Again, many thanks to Dragon Go Server for the image files.

The remaining letters and numbers

If you append an “l” to “o”, “O”, “x” or “X”, you can display the missing letters of the normal code.

Numbers from 10 to 99 are now available.

attributes: demo advanced
+ - - - - - - - - - - - - - - - - - - - - - - - - - - + 
| a b c d e f g h i j k l m n olp q r s t u v w xly z | 
| A B C D E F G H I J K L M N OlP Q R S T U V W XlY Z | 
| 1 2 3 4 5 6 7 8 9 1011121314151617181920212223. 9899| 
+ - - - - - - - - - - - - - - - - - - - - - - - - - - + 
 + - - - - - - - - - - - - - - - - - - - - - - - - - - +
| abcdefghijklmnopqrstuvwxyz|
| ABCDEFGHIJKLMNOPQRSTUVWXYZ|
| 1234567891011121314151617181920212223. 9899|
+ - - - - - - - - - - - - - - - - - - - - - - - - - - +

Stones

caption:Available stone symbols with advanced code
attributes: demo advanced
+ - - - - - - - - - - - - - - - - - + 
| x X xcxsxtxw. x1x2x3x4x5x6x7x8x9x0| 
| o O ocosot. obo1o2o3o4o5o6o7o8o9o0| 
+ - - - - - - - - - - - - - - - - - + 
Available stone symbols with advanced code
 + - - - - - - - - - - - - - - - - - +
| x X xcxsxtxw. x1x2x3x4x5x6x7x8x9x0|
| o O ocosot. obo1o2o3o4o5o6o7o8o9o0|
+ - - - - - - - - - - - - - - - - - +

Marks

attributes: demo advanced
+c-c-c+c
|c.c,c|c
+c-c-c+c
 +c-c-c+c
|c.c,c|c
+c-c-c+c
attributes: demo advanced
+s-s-s+s
|s.s,s|s
+s-s-s+s
 +s-s-s+s
|s.s,s|s
+s-s-s+s
attributes: demo advanced
+t-t-t+t
|t.t,t|t
+t-t-t+t
 +t-t-t+t
|t.t,t|t
+t-t-t+t
attributes: demo advanced
+b-b-b+b
|b.b,b|b
+b-b-b+b
 +b-b-b+b
|b.b,b|b
+b-b-b+b
attributes: demo advanced
+w-w-w+w
|w.w,w|w
+w-w-w+w
 +w-w-w+w
|w.w,w|w
+w-w-w+w
attributes: demo advanced
+x-x-x+x
|x.x,x|x
+x-x-x+x
 +x-x-x+x
|x.x,x|x
+x-x-x+x
attributes: demo advanced
+r-r-r+r
|r.r,r|r
+r-r-r+r
 +r-r-r+r
|r.r,r|r
+r-r-r+r
attributes: demo advanced
+g-g-g+g
|g.g,g|g
+g-g-g+g
 +g-g-g+g
|g.g,g|g
+g-g-g+g

Notes

Some error messages are produced if ever the wiki code is not correct, whether in the attributes or on the diagram (red lines instead of the diagram or blinking @s).

Please refer to the Weiqi plugin homepage for further information.

 
go/weiqi_plugin/accueil.txt · Dernière modification: 25/01/2009 15:00 (modification externe)
 
Recent changes RSS feed Creative Commons License Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki