Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Support PGN code blocks #51

Open
purefan opened this issue Mar 26, 2023 · 1 comment
Open

[Feature Request] Support PGN code blocks #51

purefan opened this issue Mar 26, 2023 · 1 comment

Comments

@purefan
Copy link

purefan commented Mar 26, 2023

Hello!

I dont know if this is out of scope for your plugin but here it goes... Chess games are written in a standard format called PGN (portable game notation). We have a fantastic open source PGN viewer provided by lichess here:
https://github.com/lichess-org/pgn-viewer#usage

My request is to take a block of pgn code and append the viewer after, for example:

```pgn
1. e4 c5 2. Nf3 d6
` `` 

would trigger something like:

import LichessPgnViewer from 'lichess-pgn-viewer';

LichessPgnViewer(newDomElement, { pgn: '1. e4 c5 2. Nf3 d6' });
  • Your plugin needs to create newDomElement right after the pgn block.
  • The default settings for the chess viewer are fine
  • The idea is to have a chess board after the PGN where we can move back and forth to follow the game
  • The viewer implements all the functionality to browse the game. You dont have to implement any logic to flip the board, go to the next move or anything like that
  • The viewer supports another string called FEN, that is to display a specific position. I would say that is not needed right now, but if you feel like it maybe a block code named FEN/fen would do it, in that case instead of the second argument having the property pgn it would be fen

Much obliged :)

@CalebJohn
Copy link
Owner

Very cool suggestion! I wasn't familiar with PGN. I would say that it's out of scope of this plugin. Rich markdown aims to improve the markdown viewing experience of the base Joplin (without plugins). PGN viewing is not a Joplin feature, and thus not something I intend to explicitly support in this plugin. That said, it should be possible to create what you suggest as a separate plugin, rich markdown doesn't do anything too special that can't be done in other plugins.

That said, eventually I would like to support any renderable item from the viewer to be shown inline in the markdown view. So if someone ever creates a PGN renderer for Joplin, it might be brought in to this plugin :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants