chrislicodes_obsidian-chess.../README.md
2023-05-17 21:09:04 +02:00

4.5 KiB

Chessify

A chess study helper and PGN viewer/editor for Obsidian.

With this plugin, you can either import PGNs or simply start a fresh new game. It allows you to add comments and arrows for each move, which will be persisted within a JSON File in your vault. Although it is not a full analysis board, it serves as a valuable tool to support your chess notetaking in Obsidian.

Table of contents

Motivation

I love Obsidian and its tools, but managing screenshots of chess positions is getting out of hand and is also annoying to update. It would be great to have a PGN Viewer similar to the ones offered by lichess.org or chess.com within Obsidian. It should allow us to effortlessly view PGNs, add arrows and comments, while also persisting them inside the Obsidian vault. The currently existing alternatives primarily focus on visualizing FEN snapshots, which is why this side project started.

Installation

Once you have disabled Safe Mode, you can find third-party plugins by navigating to Settings > Community Plugins > Browse and search for "Chessify". Once you have installed the plugin, you can access it under Settings > Community Plugins. Please note that you must enable the plugin to use it. You can also unsintall the plugin from there.

Usage

To start, position your cursor where you want to place the PGN viewer/editor within your note. Execute the Obsidian command Chessify: Insert PGN-Editor at cursor position.

This action will trigger a modal window, where you have the option to paste your PGN or leave it empty for a fresh new game. Here is what it will look like:

chessify-modal

Once you click Submit, Chessify will parse the PGN, generate a new JSON file in your vault located at .obsidian/plugins/obsidian-chessify/storage/{id}.json, and insert a chessify codeblock at the cursor's position. Here's an example of the chessify codeblock:

chessify-codeblock

After that the PGN viewer/editor will render and you are good to go:

chessify-codeblock

Features

  • Import PGNs
  • Store game state in JSON
  • Add custom PGN viewer
  • Only allow legal moves
  • Move through the moves via navigation buttons and direct click
  • Draw and sync shapes
  • Add and sync comments with Markdown support

Settings

Here are the available settings for a chessify code block:

Setting Possible Values Description
chessifyId Valid nanoid Valid ID for a file stored in the plugin storage
boardOrientation white | black Orientation of the board
boardColor green | brown Color of the board

You can permanently set some settings in the Obsidian plugin settings for Chessify.

Roadmap

  • Add support for variants
  • Add view to manage stored games
  • Add more styles
  • Add more settings

Tools Used

  • Chess visuals are powered by Chessground
  • Chess logic is powered by Chess.js
  • The markdown editor is powered by TipTap
  • Icons are provided by Lucide
  • Everything is tied together by React

Alternatives

If you want to have a look at FENs instead, check out these alternative Obsidian plugins:

License

Chessify is licensed under the MIT license. Refer to LICENSE for more informations.