Skip to content

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

@peterflynn

Description

@peterflynn

Topic

This is an issue regarding:

  • The tutorials contained within this repo.
  • 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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions