BAAQMD / charting-annual-data

Charting Annual Data: An Inventory Cookbook
0 stars 0 forks source link

Can't easily select code in code blocks when viewed in browser #1

Closed aseagram closed 4 years ago

aseagram commented 4 years ago

When viewed in a browser, it is nearly impossible to select parts of the code blocks (with mouse, with the goal of copy+paste) with a standard mouse. Perhaps line-endings have something to do with it?

See example demonstration of trying to select part of the code block with a mouse.

highlight

Tested with Google Chrome 80.0.3987.149 (Official Build) (64-bit)

dholstius commented 4 years ago

This seems like it could be an issue experienced by other bookdown users.

@arihusain : Can you replicate this? If so, could you do some quick Googling?

arihusain commented 4 years ago

Could not find a perfect solution, but quickest fix is to use the copy icon in the upper right hand corner of the code snippet and edit from there. Will continue looking in free time for better solution.

Copy-Paste-Bookdown

@holstius @aseagram

aseagram commented 4 years ago

Hm, good point. That's still not the most convenient (re: wanting just a line of two of the snippet), but works.

This isn't the case for viewing the raw HTML file hosted internally though; I may have been looking at that instead, which doesn't have the copy button.

dholstius commented 4 years ago

Can reproduce:

But, oddly, things work just fine on Safari (13.0.4, OS X).

Filing this issue at the bookdown repo is warranted, I think, by the fact that it reproduces on the author's own examples. @aseagram do you have time to do this?

aseagram commented 4 years ago

Filed rstudio/bookdown#874 ; from my (novice) perspective, looks like some squirrely HTML/CSS combinations.

We'll see what happens here, but in the mean time, you can inspect element > uncheck pointer-events: none...!

aseagram commented 4 years ago

@holstius see: https://github.com/rstudio/bookdown/issues/874#issuecomment-614943327 Maybe check what version of pandoc is on the server

aseagram commented 4 years ago

@dholstius see: https://github.com/rstudio/bookdown/issues/874#issuecomment-624870311 can this be updated now on our server?

dholstius commented 4 years ago

pandoc 2.9 now installed on RStudio server via:

cd ~
wget https://github.com/jgm/pandoc/releases/download/2.9.2.1/pandoc-2.9.2.1-1-amd64.deb
sudo dpkg -i pandoc-2.9.2.1-1-amd64.deb

... following instructions at the official Pandoc site. Verified with:

which pandoc
/usr/bin/pandoc --version

@aseagram Rebuild of gitbook seems good. I can select arbitrary lines in the same code chunk you posted a .gif of at the top of this issue. How does it look to you?

aseagram commented 4 years ago

It works! Excellent. Thanks for updating the server.