https://github.com/loujine/sgf2ebook
Converter from Go game records in SGF format to a simple ebook in EPUB format
https://github.com/loujine/sgf2ebook
baduk board-game ebook epub epub-generation goban igo python3 sgf weiqi
Last synced: about 2 months ago
JSON representation
Converter from Go game records in SGF format to a simple ebook in EPUB format
- Host: GitHub
- URL: https://github.com/loujine/sgf2ebook
- Owner: loujine
- License: mit
- Created: 2021-12-27T14:38:38.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-12-29T22:27:15.000Z (over 3 years ago)
- Last Synced: 2025-01-26T15:26:43.584Z (3 months ago)
- Topics: baduk, board-game, ebook, epub, epub-generation, goban, igo, python3, sgf, weiqi
- Language: Python
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
sgf2ebook
=========Basic script to convert a Go game record in `SGF` format to a simple e-book in `EPUB` format.
The ebook will be structured with one SVG diagram per page showing one new move.
Requirements
------------The script requires the Rust executable [sgf-render](https://github.com/julianandrews/sgf-render) to convert SGF files to SVG diagrams. Downloading the latest version of `sgf-render` to this folder should be enough.
The script uses Python libraries defined in `requirements.txt`, namely jinja2 for templates and `sente` to parse the SGF files and obtain the moves sequence.
Use
---Run the script with
```bash
python sgf2ebook -i sgf/ -o epub/
```This invocation would look for input SGF files in a `sgf/` subdirectory and save
EPUB files in a `epub/` subdirectory.Notes
-----The path to sgf-render is stored in variable `SGF_RENDER_EXECUTABLE` at the
beginning of the script, change it there if needed.The EPUB files are generated from template files located in `epub_template`. I
tried using calibre's `ebook-convert` utility to convert from HTML to EPUB and
generating a one-page ebook but I prefer to create a multi-page one to use my
book reader tools.Todo list
---------Possible improvements, in order of my personal priorities, include:
* [X] adding the game metadata on the first page
* [X] adding move comments
* [ ] adding internal links to jump 1/10/50 moves
* [ ] adding support for variation sequences
* [ ] adding a book coverBut given my limited time, don't expect anything.