plugin-docs icon indicating copy to clipboard operation
plugin-docs copied to clipboard

Gitbook 'fancybox' plugin makes it impossible to use 2x (Retina-friendly) images

Open peterflynn opened this issue 6 years ago • 1 comments

Topic

This is an issue regarding:

  • [x] The tutorials contained within this repo.
  • [x] The samples contained within this repo.

Description of the issue

We use the 'fancybox' plugin for Gitbook to enable clicking an image in the docs to see a larger version. However, this plugin doesn't appear to understand 2x image assets, so it renders all such images at double the correct size.

Once we find a better solution, we should scrub through all our diagrams and other assets and update them to nicer, crisp Retina images.

Proposed solution or attempted solutions that failed

We can't work around this via the usual Markdown escape hatch of raw HTML, since the fancybox plugin processes raw <img>tags too and it throws away any attributes you put on the tag.

Looking at the fancybox plugin's source code, the template they use has no accomodation for size, style, or other attributes (https://github.com/ly-tools/gitbook-plugin-fancybox/blob/master/index.js#L8-L10) and there is no way to have it ignore some images (which wouldn't be ideal anyway).

peterflynn avatar Feb 20 '19 19:02 peterflynn

Filed ly-tools/gitbook-plugin-fancybox#4 on this issue in case the Fancybox plugin is willing to fix this on their end. It hasn't been updated in years though, and a bug filed in May 2016 never got any response...

peterflynn avatar Feb 20 '19 19:02 peterflynn