Conversation
|
|
|
I am on the fence about this once. Is having an |
|
Are you on the fence about the value of the method, or just the naming convention? I'm happy to have it changed to just html(). I find it useful to watch the games while I interactively code in the IPython notebook, without having to connect to some other GUI frontend. |
|
Both. First: Clearly if Then: Something about the CSS and HTML seams so arbitrary to me. I guess I don't fully appreciate the usefulness because I never used IPython notebooks. Then again having such an |
|
It's used somewhat frequently in web development libraries, e.g. here. But I'll change it to .html() if that's your vote. For the arbitrariness of the CSS and HTML, an alternative implementation would be to have a static template (a board.html file in the project) with tags like {{A1}, {{A2}}, and so on, and then the html method would use a template engine (jinja or Mako, or simply string.Template) to substitute the corresponding pieces (their unicode representations) or lack thereof. This keeps content and style separate. As for the utility of it, it goes beyond an IPython notebook. Any web interface using python-chess as part of the backend will want to have a board rendered in HTML. |
|
Oh, so Edit: Added some more nitpicking. |
chess/__init__.py
Outdated
There was a problem hiding this comment.
Oops, I fixed this before but it reverted somehow... I think I branched from before the fix. I'll take care of it.
|
Thank you! Committed and pushed. I took the liberty to remove the remaining trailing spaces. |
You can display the board in an Ipython notebook with:
from IPython import displayIf you have a game running, you can continuously display the moves in one output cell with: