How prepare lichess interactive lessons from pgn file (with pgn-extract)
This article can help you to fast prepare a lichess interactive lessons from pgn fileWhen you should use this method?
Very often I had situation when I had a large pgn file and i wanted to make a lichess interactive lesson to better learn material. But problem is if I paste a complex pgn to lichess study I can use only main line. Dividing this game manually to separate lines could be very hard, it need a lot of time and its very easy to make mistake. Luckily I found a nice solution to make it faster.
What do you need?
First important thing - you need a computer with Windows system. Probably you can use computer with Linux, but I didn't test it and I'm not sure It could works. Second thing is you need to download a pgn-extract program (it is full free). Link to download program is here. You should download pgn-extract.exe
Next step is move that pgn-extract to folder where you have a pgn file. Its very important (probably you can make environment variable instead of this but I tried and it not worked, it is safe method)
Last step is open console (don't afraid it will be simple) in folder where you have files. To open it you have to click right mouse button on folder simultaneously with right shift pressed, and choose “Open PowerShell window here”
Divide a pgn file with many games to separate games
Lichess has some limits in creation studies. For example if you import chapters from file, you can import only 32 chapters from 1 file and one lesson can has only 64 chapters. So it could be helpfull to divide a pgn file with many games to separate games. If you have open console you have to type
.\pgn-extract <name_of_file>.pgn -#1
and press Enter. Now we have many files with names 1.pgn, 2pgn etc.
Divide one game to one-line variations
Now we are prepared to divide game to chapters. In console we have to type
.\pgn-extract <name_of_file>.pgn --splitvariants --output <name_of_new_file>.pgn
and press Enter. Now we have prepared file with one-line variations and we can import it in Lichess study. I believe it help you to prepare lichess interactive lessons
About pgn-extract
I'm not author of pgn-extract, but I highly recommend this program because it has a lot of interesting features. I don't know most of them yet and I recommend you to familiarize yourself with them. Documentation for it can be found here
