chrislicodes / obsidian-chess-study

A chess study helper and PGN viewer/editor for Obsidian.
GNU General Public License v3.0
32 stars 4 forks source link

Support importing variants from Lichess #16

Open myAlterX opened 6 months ago

myAlterX commented 6 months ago

Hi! First of all, this is great work. Thank you very much! I tried importing a Lichess analysis with variants and noticed it imported only the main line.

I then tried to check your variant work and it works on top of the import, but ignores what was there. Here's an example I created on Lichess:

1. d4 f5 2. h3 Nf6 3. g4 fxg4 4. hxg4 Nxg4 5. Qd3 h6 (5... Nf6 6. Rxh7 Rxh7 (6... Nxh7 7. Qg6#) 7. Qg6#) (5... g6 6. Qg3 d5) 6. Qg6#

Is there a different variant syntax you use? Or is importing variants not (yet) supported?

chrislicodes commented 6 months ago

Hi!

This is using https://github.com/jhlywa/chess.js for parsing the FENs and PGNs and by looking at this I realized that we could get the comments of the PGN, but I don't think this supports variants yet.

latenitecoding commented 6 months ago

I actually have this feature on my local machine. I'll put together the PR for it.