MkDiag: make html chess diagrams
© 15sep2002 by Alain Brobecker (aka baah/Arm's Tech)

MkDiag is a HTML preprocessor to create chess diagrams. It runs under the RiscOS command line or do$ prompt, and can be ported to other systems. Here's an example:
Brobecker Alain (NC) - Deluermoz Francois (1909)
Open International de Geneve, ronde 7, 07/04/2002

1.d4 Cf6 2.c4 g6 3.Cc3 d5 4.cxd5 Cxd5 5.e4 Cxc3 6.bxc3 c5 7.Fc4 Fg7 8.Ce2 0-0 9.Fe3 Cc6 10.0-0 e6 11.Fb5 De7 12.Fxc6 bxc6 13.Tb1 Fa6 14.Te1 Tad8 15.f3 cxd4 16.Cxd4 Dh4 17.Ff2 Dg5 18.Da4 Fd3 19.Cxc6 Fxb1 20.Cxd8 Fd3 21.Cc6 Fb5 22.Ce7+ Rh8 23.Dxa7 Fxc3 24.Fe3 Df6 25.Td1 Te8 26.Dc5 Fa4 27.Td4 Txe7 28.Txa4 Rg7 29.Fg5 1-0

27.Td4, for my biggest pride, Joseph Gallagher came and watched this position for 5 minutes...

The one above was made by creating a file "MkDiag.txt" containing:

    <html>
    blah... blah... blah...
    <!diag a2e4f3g2h2Rg1Dc5Td4Fe3Ce7-e6f7g6h7Rh8Df6Te8Fc3Fa4>
    </html>
Then by typing in the CLI (RiscOS version):
     mkdiag MkDiag/txt MkDiag/htm
Or by typing at the do$ prompt (do$/window$ version):
     mkdiag MkDiag.txt MkDiag.htm
And copying "MkDiag.htm" with the "0" directory containing pieces' images (a.gif to z.gif).

As you can see, you simply list white pieces (here with their French abbreviations) in algebraic notation, put a minus, then list black pieces. If you want you can put semicolons, spaces or line feeds in the pieces listing. You can have coordinates by using the "<!diagc " tag instead of "<!diag ". Moreover i've enclosed English and German versions of MkDiag (MkDiagUK & MkDiagDe). So the following will give the same diagram:
 * <!diagc Re7Ce4f6-Rc1Fb3>
 * <!diagc f6Ce4Re7-Fb3Rc1>
 * <!diagc Re7;Ce4;f6-Rc1;Fb3>
 * <!diagc Re7 Ce4 f6 - Rc1 Fb3>
 * <!diagc Re7;Ce4;f6
   - Rc1;Fb3 >
 * <!diagc Ke7Ne4f6-Kc1Bb3> (MkDiagUK)
 * <!diagc Ke7Se4f6-Kc1Lb3> (MkDiagDe)


Oh, btw, white plays and win! ;)
8
7
6
5
4
3
2
1
a
b
c
d
e
f
g
h

Important: The "<!diag " or "<!diagc " tag still exists in the output file (allowing easy access for people who get only the generated file), so it's better to have distinct input and output files.

Oh! Still reading? What do you want? Solution, what solution? ;) Ok, here it is: 1.Cg5 (threat. Ce6) Fg8 2.Cf7 (threat. Rf8) Fh7 3.Ch6 Fg6 4.Cf5 Rd2 5.Ch4 Fh5 6.Cg2 then 7.Cf4.

PS: In may 2005 i added the possibility to add white or black discs on the board, for example to show squares that can be accessed by pieces, to symbolise fairy pieces or else... To do this just use the 'Z' letter before the square in the appropriate color list. For example:
  <!diag Da1
         Za2Za3Za4Za5Za6Za7Za8
         Zb1Zc1Zd1Ze1Zf1Zg1Zh1
         Zb2Zc3Zd4Ze5Zf6Zg7Zh8->

Alas i removed the RiscOS and UK/DE versions in the archive, so if you need them you must get your hands in a compilator.