lichess-org / chessground-examples

Usage examples for chessground
https://lichess.org
GNU General Public License v3.0
57 stars 32 forks source link

More example code, please. #3

Closed stanleyng8 closed 6 years ago

stanleyng8 commented 6 years ago

Thanks for lichess and GPL'ing this wonderful code. I am trying to bundle together a couple of games with stockfish running on the browser. Much like the analysis board you are demo'ing. I looked through the example given in index.standalone.html and index.html. By changing the location of the libraries and downloading chessboard.js, I have managed to get the page to display a board. But I don't know how to connect it up to a pgn file/string as there doesn't seem to be other examples or additional documentation.

I have downloaded the source code for the lichess analysis board to reverse engineer the process. Within the HTML, there's something that looks like <div class="pgn">[Event "Rated Bullet game"] ... </div> where the entire pgn is there. I tried doing the same on the index.standalone.html but I am missing the navigation buttons.

Also, the saved down analysis board source code, when re-opened in the browser is missing board image. I can see pieces but not the board. So that prevents me from starting with the lichess analysis board and discarding stuff till I get the minimal example that I want.

I was wondering if you could put up an example showing how to connect the chessground board to a pgn file/string in a HTML file like the index.standalone.html. Thanks very much.