[pmwiki-users] Questions about chess.php

Patrick R. Michaud pmichaud at pobox.com
Mon Dec 26 13:13:30 CST 2005


On Sat, Dec 24, 2005 at 06:00:27PM +0100, Christian Bartolomaeus wrote:
> ====
> #1
> I would suggest to insert the following line in 
> chess.php (above line 184):
>   table.chesstable td.square0 { background-color: #ffffff; }
> Otherwise the white squares have the background color, which hasn't to
> be white. (I use some gray as the default background color and the
> chessboard looks strange with gray squares.)

Reasonable, but I'm thinking I'll leave that as a local customization
rather than forcing white.

> #2
> Is it possible to add a title like "White to move" or "position after
> 3. Nf3" directly below a chessboard, generated using the
> (:chessboard:) directive? I think there are ways to do that manually,
> but it would be nice if those title could somehow remain stuck to the
> chessboard, however this is aligned or styled. Maybe there is a way to
> do that with (:div:) directives? I tried 
> 
>   (:div align=center:)(:chessboard:)Title goes here(:divend:)
> 
> which is okay for align=center and align=left but looks murky for
> align=right.

I might be able to add a "caption=" argument.

> #3
> Analysing chess games, it is -- as you surely know -- common to give
> variations like:
> 
>   1. e4 d6 2. d4 Nf6 3. Nc3 g6 4. f4 Bg7 5. Nf3 c5 6. Bb5+ Bd7 
>   7. e5 Ng4 8. e6 fxe6
> 
>     Another variation is 8. ... Bxb5 9. exf7+ Kd7 10. Nxb5 Qa5+ 
>     11. Nc3 cxd4 12. Nxd4 Bxd4 13. Qxd4 with a promising position for
>     white (D)
> 
>   9. Ng5 (D)
> 
> Unfortunately it isn't possible to just copy such an analysis into
> PmWiki and replace (D) with (:chessboard:), since the 8th move of
> black will not be restored to the "main variation" (8. ... fxe6), so
> that the second board will be displayed the wrong way.
> 
> Do you think it is possible to alter chess.php in a way that it takes
> care of such situations? 

Not really, since there could have been many alternate variations
and the chess markup can't reliably infer which one the author
intends.  So, the easiest way around this is to have the author
explicitly indicate the line being restarted (possibly using a comment
to save the line, as you observed).

We could have some mechanism to "copy" and "paste" previous game
positions, but I think that restating the move for the original
line of analysis is ultimately simpler for authors-- less typing and
doesn't require learning another markup sequence.

Pm




More information about the pmwiki-users mailing list