Template:Chess viewer/doc
| This is a documentation subpage for Template:Chess viewer. It may contain usage information, categories and other content that is not part of the original template page. |
| This template is rated as beta. It is considered ready for widespread use, but as it is still relatively new, it should be applied with some caution to ensure results are as expected. |
| This template uses Template:Calculator. |
| This template uses Lua: |
This template allows showing chess games with arrows to allow the viewer to move through the game. It is similar to {{Chess diagram}} except it allows showing the entire game
Usage
[edit]{{Chess viewer|pgn=PGN HERE}}
The syntax is the same at {{Chess diagram}} with the addition of a ply= to determine the starting ply number and animate= argument to disable animations. There is also show_move=true to add the current move to the caption.
Example
[edit]{{Chess viewer|align=none|pgn=1. d4 Nf6 2. Nf3 d5 3. g3 e6 4. Bg2 Be7 5. O-O O-O 6. b3 c5 7. dxc5 Bxc5 8. c4 dxc4 9. Qc2 Qe7 10. Nbd2 Nc6 11. Nxc4 b5 12. Nce5 Nb4 13. Qb2 Bb7 14. a3 Nc6 15. Nd3 Bb6 16. Bg5 Rfd8 17. Bxf6 gxf6 18. Rac1 Nd4 19. Nxd4 Bxd4 20. Qa2 Bxg2 21. Kxg2 Qb7+ 22. Kg1 Qe4 23. Qc2 a5 24. Rfd1 Kg7 25. Rd2 Rac8 26. Qxc8 Rxc8 27. Rxc8 Qd5 28. b4 a4 29. e3 Be5 30. h4 h5 31. Kh2 Bb2 32. Rc5 Qd6 33. Rd1 Bxa3 34. Rxb5 Qd7 35. Rc5 e5 36. Rc2 Qd5 37. Rdd2 Qb3 38. Ra2 e4 39. Nc5 Qxb4 40. Nxe4 Qb3 41. Rac2 Bf8 42. Nc5 Qb5 43. Nd3 a3 44. Nf4 Qa5 45. Ra2 Bb4 46. Rd3 Kh6 47. Rd1 Qa4 48. Rda1 Bd6 49. Kg1 Qb3 50. Ne2 Qd3}} produces:
| a | b | c | d | e | f | g | h | ||
| 8 | 8 | ||||||||
| 7 | 7 | ||||||||
| 6 | 6 | ||||||||
| 5 | 5 | ||||||||
| 4 | 4 | ||||||||
| 3 | 3 | ||||||||
| 2 | 2 | ||||||||
| 1 | 1 | ||||||||
| a | b | c | d | e | f | g | h | ||
Arguments
[edit]Display a chess game
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| style | style | Type of game to show
| String | optional |
| reverse | reverse | Show from black's view | Boolean | optional |
| letters | letters | Show letters
| String | optional |
| numbers | numbers | Show numbers
| String | optional |
| pgn | pgn | Game in PGN format | String | required |
| header | header 2 | Wikitext to add as a header | Content | optional |
| footer | footer | Wikitext to add as a footer | Content | optional |
| align | align 1 | Extra css class
| String | optional |
| clear | clear | Stop other floated content from floating past
| String | optional |
| ply | ply | Which move (ply) to start the board at
| Number | suggested |
| size | size | no description
| Number | optional |
| animate | animate | Animate moving of chess pieces
| Boolean | optional |
| color | color | Color scheme for the chess board. From images in Commons:Category:Chessboard480.
| String | optional |
| show_move | show_move | Show the current move in algebraic notation in the caption | Boolean | optional |
| initial_caption | initial_caption | When using show_move=true, this will override the move text in the initial state of the board before the user interacts with it. After the first interaction this initial_caption is removed to show the current move. This can be used if you want to highlight something about the current position that wouldn't make sense after the user moved to a new position. Compare to footer= which is always shown. Must contain only plain text. | String | optional |