lichess-org / lila

♞ lichess.org: the forever free, adless and open source chess server ♞
https://lichess.org
GNU Affero General Public License v3.0
15.05k stars 2.23k forks source link

Lichess studies: Copying moves contains no whitespace #9687

Closed infiniteflash24 closed 3 years ago

infiniteflash24 commented 3 years ago

https://lichess.org/study/rYA7IOUe/ss25FLRY

Whenever I want to copy lines by copy & pasting in lichess studies, I can highlight the moves & range I want, but the text itself comes out like this:

What we have currently after copying: 4.Nf3Be75.Bf4O-O6.e3c57.dxc5Bxc58.Qc2Nc6 What I want: 4.Nf3 Be7 5.Bf4 O-O 6.e3 c5 7.dxc5 Bxc5 8.Qc2 Nc6

Could a developer please consider adding whitespace between the moves so that we're copying text that's usable without the user having to add spaces afterwards? I have to always retroactively add spaces between the moves always and it would be nice if I didn't have to always.

ornicar commented 3 years ago

The UI is not meant to be selected/copied that way... You can export your study as PGN from the share tab under the board.

infiniteflash24 commented 3 years ago

Hi @ornicar

TLDR:

I understand that the UI is not meant to be selected/copied that way, but let me provide you some background about why it could be useful: I write courses on the website chessable.com

I don't know if there's an easy solution to this, but it would be amazing if there was a button to convert "subvariations" on lichess into "clickables" on chessable.com. This helps Chessable authors greatly.


I understand that the UI is not meant to be selected/copied that way, but let me provide you some background about why it could be useful: I write courses on the website chessable.com

When I write material to be posted on chessable.com, I sometimes need to insert what are called, "clickable" variations. This post elaborates what a clickable variation is. See the "Adding details (clickable subs and hyperlinks)" section.

I need to copy entire lines manually in the text for these clickables to work. They are inserted manually using the following format:

Example: @@StartV@@ 4.Nf3 Be7 5.Bf4 O-O 6.e3 c5 7.dxc5 Bxc5 8.Qc2 Nc6 @@EndV@@

All this is doing is inserting a variation into Chessable's variation viewer window.

After I write this example text into a lichess study, when I export the PGN onto Chessable, Chessable's PGN reader interprets this as a clickable variation for users to click on and scroll through. It's different from a regular subvariation on lichess because of how Chessable's PGN reader works.

This is why I asked in the OP about copying entire lines. All I want to do is copy these lines so I can make clickables out of them. I understand that the lichess UI is not meant to be copied that way, but it would be helpful for me to have that space because adding the spaces myself is cumbersome.

I don't know if there's an easy solution to this, but it would be amazing if there was a button to convert "subvariations" into "clickables". This helps Chessable authors greatly.

ornicar commented 3 years ago

I went to try and support your use case, but did not find a good way to do it without complicating the existing code, sorry.

draconicfae commented 3 years ago

I'm not sure I understand the value of the use case. Rather than feeding the pgn directly to chessable, can't you open it in a text editor, which will give you your spaces, and copy/paste from there?

infiniteflash24 commented 3 years ago

I was hoping to avoid using the text editor altogether. It feels primitive in nature to have a user download the file from lichess, copy text from the downloaded file, then paste it back into lichess. Seems like something that could be automated or done on the website itself. I'm also not sure if copy + pasting works properly if there are multiple subvariations within a move branch.

It looks like copy + pasting is the best option though. I'll have to test.

@draconicfae


Thanks for taking a look thibault!