This project will let you use puzzles from OGS as flashcards in Anki. You can use it to study Go/Baduk/Weiqi problems using spaced repetition. The project has two parts:
- The Anki note type
- The OGS collection exporter
This is the part you need to play the puzzles within Anki.
You have two options to get the custom note type into Anki.
- The easy way is to import example-deck.apkg into Anki. This will automatically create the note type.
- The other way is to create the note type yourself.
- Create a new note type in Anki. The name doesn't matter.
- Create the fields listed in fields.txt.
- Set the front template of the card to the code in front-template.html.
- Set the back template of the card to the code in back-template.html.
- Set the styling of the card to the code in styling.css.
The flashcard will load the OGS website where you will be able to play through the puzzle. You cannot play offline.
The puzzle is on the back of the card. On PC, the puzzle will automatically be displayed. On other platforms, you may need to press "Show answer" first.
The flashcards use the ID field to load the puzzle, for example https://online-go.com/puzzle/2824. You can enter cards by hand or use the OGS collection exporter.
This part lets you download puzzle collections directly from the OGS website, so you can import them into Anki using the custom note type.
- Install the Tampermonkey browser extension.
- Install exporter.user.js into Tampermonkey.
- On the page for that file, click the "Raw" button and Tampermonkey will offer to install it.
On the OGS website, puzzle pages will have an "Export to Anki" link just below the name of the puzzle collection. You may need to refresh the page to see it. Clicking the link will download a file containing the puzzle collection in CSV format.
You can import the file into Anki using the "Text separated by tabs or semicolons" format. Be sure to select the correct note type when importing.