[pmwiki-users] Defining and displaying chess diagrams in WikiPages

Christian Bartolomaeus bartolin at gmx.de
Mon Nov 21 17:19:02 CST 2005


Hi Patrick,

* On 21.11.2005 Patrick R. Michaud (pmichaud at pobox.com) wrote:
> [...]
> Even *cooler* would be to have PmWiki calculate the board position
> from a set of moves given standard algebraic format and display
> that.
> 
> Thus an author could write:
> 
>      1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 
> 
>      (:chessboard:)
> 
>      4. ... d6 5. Nf3 O-O 6. Bd3 Bg4 7. h3 
> 
>      (:chessboard:)

actually, that was my original idea. I thought about a syntax like

  (:chessmode: on:)

  1. d4 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4

  (:diagram:)

  4. ... d6 5. Nf3 0-0 6. Bd3 Bg4 7. h3

  ...

  And here a different position
  
  (:diagram White: Kf6, Nf7, Bf4 Black: Kf8:)
  
  (:chessmode off:)
  
This way the diagram would either be taken from the notation of the
game or from the optional arguments of (:diagram:) (BTW: I like
(:chessboard:) better than (:diagram:). So I will change this in my
script.) One idea was, that some special characters which are used
for comments of chess games like "with the idea of" could be
interpreted by PmWiki while "chessmode" is on. One could even think
about displaying images instead of abbreviations for pieces (a small
image of a Rook instead of "R".

> and the (:chessboard:) directives would display the board as it exists
> as of the current set of moves.  Of course, moves would be allowed
> to appear on separate lines and with other text commentary mixed in
> between them.  And the code wouldn't need to check the validity of
> the moves -- it could assume that they're valid -- it just needs to 
> place pieces where indicated by the moves.

The huge advantage of this approach would be, that one could very
easily insert a game from a given .pgn-file.

Because of my very limited knowledge of PHP (and other programming
languages) I decided to start with a more simple approach. But I would
like to implement the interpretation of PGN-Notation as well. Maybe I
should try to learn how that could be done. I searched for some free
PGN-to-HTML or PGN-to-Javascript converters, thinking I could make use
of those.  Unfortunately I didn't find such open source programs.

Well, if I find more time, I will try to dig into this ... Your
positiv feedback is quite motivating ;-)

Greetings

Christian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : /pipermail/pmwiki-users/attachments/20051122/49216058/attachment.bin 


More information about the pmwiki-users mailing list