https://github.com/THeK3nger/obsidian-chessboard
Plugin to render chessboards in Obsidian using chessboardjs
https://github.com/THeK3nger/obsidian-chessboard
Last synced: 4 months ago
JSON representation
Plugin to render chessboards in Obsidian using chessboardjs
- Host: GitHub
- URL: https://github.com/THeK3nger/obsidian-chessboard
- Owner: THeK3nger
- Created: 2021-02-09T11:38:30.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-09-12T07:54:04.000Z (7 months ago)
- Last Synced: 2024-09-12T18:09:07.098Z (7 months ago)
- Language: TypeScript
- Size: 245 KB
- Stars: 27
- Watchers: 3
- Forks: 8
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
- jimsghstars - THeK3nger/obsidian-chessboard - Plugin to render chessboards in Obsidian using chessboardjs (TypeScript)
README
# Obsidian Chess Plugin
This plugin adds the capability to visualize Chess [FEN](https://en.wikipedia.org/wiki/Forsyth%E2%80%93Edwards_Notation) positions on a SVG chessboard directly in preview mode.
By design, this plugin is for visualization only. Do not expect interactivity or the possibility to handle entire games in PGN format. This plugin want to render just a SVG image and it is optimized for visualization and HTML/PDF exports.
If you want a more interactive plugin, I recommend [Chesser](https://github.com/SilentVoid13/Chesser).
## How to use it
After you installed the plugin, just write the FEN position representation inside a code block with the `chessboard` language.
### Example
````
```chessboard
fen: r1bqkbnr/pppp1ppp/2n5/1B2p3/4P3/5N2/PPPP1PPP/RNBQK2R
```
````
### Change Board Orientation
Use the `orientation` command. It can be `white` (default) or `black`.
````
```chessboard
fen: r1bqkbnr/pppp1ppp/2n5/1B2p3/4P3/5N2/PPPP1PPP/RNBQK2R
orientation: black
```
````## Annotations (Beta)
You can annotate your schema with arrows and highlights.
````
```chessboard
fen: r1bqkbnr/pppp1ppp/2n5/1B2p3/4P3/5N2/PPPP1PPP/RNBQK2R
annotations: Af8-b4 Hf8
```
````
### Syntax
- `A-`, draws an arrow from the first square to the second square. E.g., `Af8-b4`.
- `H`, highlight a specific square. E.g., `Hf8`.## How to compile the plugin
First, install the dependencies with
```bash
npm i
```Then, you can compile the plugin with:
```bash
npm run build
```This will create a `main.js` file in the project root. That is the entry point of the plugin.
## Planned Features
- [x] Chessboard color customization.
- [x] Pieces color customization.
- [x] Chessboard annotation and highlights.
- [ ] Custom annotation shapes.## Chess Pieces
The SVG pieces were made by jurgenwesterhof (adapted from work of Cburnett), CC BY-SA 3.0 , via [Wikimedia Commons](https://commons.wikimedia.org/wiki/File:Chess_Pieces_Sprite.svg).