Code Monkey home page Code Monkey logo

chesser's Introduction

Chesser

A chess game viewer/editor for Obsidian.

Demonstration

chesser_demo

Usage

To use Chesser, you first need to declare a chess code block like so:

chesser_block

This will create a basic chess board in the start position.

You can declare various settings inside the chess code block, like a FEN string to describe a particular board position. You can find the full settings list below.

Settings

Here are the available settings for a chesr code block:

Name Possible Values Description
fen A valid FEN string Starts the chess board with a particular position.
orientation white/black Orientation of the board.
pieceStyle A valid piece style name.
Check this to view available styles.
Style of the pieces on the board.
boardStyle A valid board style name.
Check this to view available styles.
Style of the chess board.
drawable true/false Controls the ability to draw annotations (arrows, circles) on the board.
viewOnly true/false If enabled, displays a static chess board (no moves, annotations, ...).
free true/false If enabled, disables the chess logic, all moves are valid.

You can permanently set some settings in Chesser's obsidian plugin settings.

TODO

  • Add PGN format support

Installation

After disabling Safe Mode, you can find third-party plugins in Settings > Community plugins > Browse > Search for "Chesser".

After installing, you can then find the installed plugins under Settings > Community plugins. They need to be enabled in order to take effect. You can also uninstall them there.

Alternatives

Contributing

Feel free to contribute.

You can create an issue to report a bug, suggest an improvement for this plugin, etc.

You can make a pull request to contribute to this plugin development.

License

Chesser is licensed under the GNU AGPLv3 license. Refer to LICENSE for more informations.

Support

If you want to support me and my work, you can donate me a little something by clicking here.

chesser's People

Contributors

liamcain avatar silentvoid13 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

chesser's Issues

[Feature] Would love the ability to either disable the menu completely or have a simplified view.

I would like have the menu be able to be disabled.
It is nice to have a move list that will let you click through the moves as well.

Use case: I would love to have a board with a loaded state (ideally from PGN) and a move listing that can you can click through a game with. I do notes post game and I just load the PGN into my stockfish app later, it would be awesome if this supported it, I would not need to leave obsidian to write notes.

Pawn at row 8 doesn't turn into anything

Plugin informations (please complete the following information):

  • OS: Arch Linux
  • Chesser version: 0.1.5
  • Obsidian version: 0.12.15

Describe the bug
Whenever I put a pawn on row 8, it doesn't give me the option to become a queen/bishup/rook/knight

Expected behavior
Get a choice that is like chess.com or something

Screenshots
If applicable, add screenshots to help explain your problem.
image

Change board size

I am currently writing a bit about chess basics and when I wanted to include small diagrams, I noticed that I cant resize the chesser window.

I think that a "resize" parameter would be a great addition to the already helpful "viewOnly" parameter.

FEN description line or command to copy and paste a current board position

I'm using this fab plugin to document and examine opening strategies. One of the things I like to do is start with a particular position using FEN notation and then try out various variations. If I get to a position I like I would love to be able to copy that position and paste it as another board. Ideally this would be via a simple command to copy the current position as a FEN string so I could create a new board or alternatively an option to show the FEN string below the board (possibly next to the forward and back buttons - see my other request :-))

Thanks very much for a great plugin.

David

Back and forward buttons

I just decided to learn chess a couple of weeks ago and a few days ago wondered if there was any way to add images of chess boards into obsidian and immediately came across this fantastic plugin. The universe clearly wants me to learn chess :-).

I love the fact that the boards can be interactive but would it be possible to add back and forward buttons like on lichess.com as I'm always making moves that I regret when examining opening variations and want to take moves back without resetting the entire board back to the initial FEN position.

Thanks,
David

[Feature] Support for boards with labeled ranks and files

I am happy to open a PR for this, it is going to take me a little while though, so if someone else can add them it would be great!
Chess.com has very non intrusive labels,

Not sure how this will affect the orientation code, I have not looked at how you all handle that just yet.

Plugin broken on mobile

Plugin informations (please complete the following information):

  • OS: Android 13
  • Chesser version: 0.2.1
  • Obsidian version: 1.4.1

Describe the bug
When using a chesser annotated block in a file, the file can't be opened with the plugin enabled

Expected behavior
Open the file and render the block or show the text instead if render fails

Screenshots
Screenshot_20230103-023835
Screenshot_20230103-023748

Additional context
Add any other context about the problem here.

Position occasionally reverts back to starting position

Plugin informations (please complete the following information):

  • OS: Windows 11
  • Chesser version: most recent
  • Obsidian version: 1.3

Describe the bug
When I first compile the Chesser block, everything is great and it render. But then upon making an edit, it seems to first revert back to the starting position. I then move my cursor back into the chesser block and it fixes itself at the second try. It works but is very annoying to constantly deal with.

Expected behavior
Once the Chesser block is created, it should persist the FEN every time it's compiled

Recording.2023-06-02.150827.mp4

Storing positions and annotations

If I use chesser within a note to reach a certain position on the board I lose that position whenever I move away from that note. Same issue applies to annotations i have made.

It would be great to be able to store positions and annotations for later use.

Add PGN format support

Hello,

I see in your TODO list @SilentVoid13 that you planned to add PGN format support.
Indeed it would be great if we can play a complete game (not only a position) like it is possible to embed a lichess study with iframe.

Is it always a project?

Thank you!

[Proposal] Persisting the state in the markdown itself

Hi, I noticed that the state is currently being persisted in local storage. I found this a bit confusing specially because my moves don't get synced to my other devices. So I'm wondering, have you considered persisting the state in the markdown block itself?

Basically, everytime the user does a move, update the markdown block with the new PGN/FEN. I've implemented this in my fork (https://github.com/MohamedBassem/Chesser) and I'm happy to send a pull request if you think that this is a better approach than using local storage.

Here's a video with the feature in action

Chesser.mov

FEN files don't work

Hey there !

I've been using Chesser for a bit of time and I encountered a little problem :

I cannot find the way to use the FEN files, i've tried the line below and it always start in the same position (the normal one).

Would there be a way to fix this ?

The line

fen: rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
orientation: black
pieceStyle: cburnett
boardStyle: brown
viewOnly: false
drawable: true
id: WpCKva9P

Otherwise very good job guys this is beautiful I was so excited when I discovered your plugin and everything else works just perfectly.
Thanks for your contribution to the community =)

arrow tips not displaying in reading mode

Plugin informations (please complete the following information):

  • OS: Windows 11
  • Chesser version: 0.2.1
  • Obsidian version: 1.4.16

Describe the bug
In reading mode you can't see the tips of the arrows you are drawing on the board

Expected behavior
You should be able to see the arrows tips in reading mode just like you are in live preview mode

Screenshots
image
image

Live Preview broken

Plugin informations (please complete the following information):

  • OS: Ubuntu 20.04
  • Chesser version: 0.2.1
  • Obsidian version: 0.13.33

Describe the bug
In "Reading Mode", the chess board is displayed correctly. In "Live Preview" mode, it always displays the starting position instead of the one defined with the "fen" parameter.

Expected behavior
Displays the defined position in "Live Preview" mode, too.

Additional context
Downgrading to 0.1.5 makes this work again, so this has been broken in a recent update.

Support for iOS / Mobile

Is your feature request related to a problem? Please describe.
I'm frustrated that while I can view my notes of a position of game, I am unable to see the board on mobile (tested on iOS 15.6.1, as well as iPad.

Describe the solution you'd like
In an ideal world, the mobile version would act the same as the desktop. It's a great plugin.

Describe alternatives you've considered
A view of the board that is static in the position as last given in the desktop version would be a great alternative.

Id overwrites settings when editing

Plugin informations (please complete the following information):

  • OS: Linux
  • Chesser version: 0.2.1
  • Obsidian version: 1.0.3

Describe the bug

Unable to edit settings of a existing board because it's overwrited by id setting

ex. I tried to write fen:
writing fen

Expected behavior
I expect to edit settings without interferences

Screenshots

Additional context

Dead code editor.replaceRange

Plugin informations

  • OS: Windows 10
  • Chesser version: 0.2.0
  • Obsidian version: 1.4.5

Describe the bug
I noticed the function editor.replaceRange is used in Chesser.ts to replace the content of the markdown code block. After some testing, it doesn't seems to work because the view is in read mode when the chessboard view is shown. After some testing, the following code does the trick instead of editor.replaceRange :

view.app.vault.read(view.file).then((content) => {
  const lines = content.split("\n");
  const newContent = lines.slice(0, from.line).join("\n") + "\n" + updated + lines.slice(from.line).join("\n") ;
  view.app.vault.modify(view.file, newContent);
});

Also I suggest storing all the modifications to the markdown code block instead of the localstorage so it can work across devices.

Expected behavior
The markdown block should be updated.

Additional context
I'm trying to contribute to the project.

No way to disable the menu next to the chess board

Plugin informations (please complete the following information):

  • OS: Ubuntu 20.04
  • Chesser version: 0.2.1
  • Obsidian version: 0.13.33

Describe the bug
I'm displaying a simple chess board with the following code:

fen: rnbqkbnr/pppp1ppp/4p3/8/4P3/8/PPPP1PPP/RNBQKBNR w KQkq - 0 1
viewOnly: true

In the global plugin settings, I have "Drawable" and "Free" turned off, and "View-only" turned on.

The plugin renders a chess board, and next to the chess board there's a menu where I can switch to different positions,

Expected behavior
With these settings, I would expect the plugin to just render a chess board with the given position, nothing else. Am I doing something wrong, or is this not how the plugin is supposed to work? I'm looking for a plugin to just render a chess board so I don't actually need all that movement and engine stuff, but the other Chess plugins for Obsidian that I found all had other issues ...

The animation in the readme makes it look like that use case is supposed to work, as that doesn't show this menu either.

If I download v0.1.5, the plugin is behaving as expected. In v0.2.0 and v0.2.1, it has the buggy behaviour (no way to disable the menu).

Screenshots

*** Current behaviour ***
Screenshot
*** Expected behaviour ***
Screenshot

Memory for arrow annotations

Is your feature request related to a problem? Please describe.
It's easy to forget the main ideas, goals and threats looking at a static board. Annotations help develop the ability to read the board intuitively.

Describe the solution you'd like
An automatically generated list of currently displayed annotations that can then be saved onto the markdown to be automatically displayed on page load.

Describe alternatives you've considered
I've looked at the alternative plugin THeK3nger/obsidian-chessboard that implements this functionality, but lacks other elements found in this plugin.

Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.