From a71b513e9ac39470ae24c047b12b9d5f3928c976 Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Tue, 9 Jan 2024 10:23:56 +0530 Subject: [PATCH] docs: add image zoom to docs (#5778) This PR adds a zoom feature to the docs. Interact with the images to blow them up to fill the screen. It leaves the header in place and offsets images. It has some problems with particularly large images, but they seem to be edge cases. --- website/docusaurus.config.js | 6 ++++++ website/package.json | 1 + website/yarn.lock | 11 +++++++++++ 3 files changed, 18 insertions(+) diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index 1093bed1c3..07ded3914c 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -151,6 +151,11 @@ module.exports = { }, }, image: 'img/logo.png', + imageZoom: { + // Optional medium-zoom options at + // https://www.npmjs.com/package/medium-zoom#options + options: {}, + } }, presets: [ [ @@ -770,6 +775,7 @@ module.exports = { noRuntimeDownloads: true, }, ], + 'plugin-image-zoom', ], themes: [ 'docusaurus-theme-openapi-docs', // Allows use of @theme/ApiItem and other components diff --git a/website/package.json b/website/package.json index 191dd9489f..219076171e 100644 --- a/website/package.json +++ b/website/package.json @@ -34,6 +34,7 @@ "docusaurus-theme-openapi-docs": "2.0.0-beta.2", "file-loader": "6.2.0", "immer": "^9.0.6", + "plugin-image-zoom": "flexanalytics/plugin-image-zoom", "react": "18.2.0", "react-dom": "18.2.0", "unleash-proxy-client": "2.5.0", diff --git a/website/yarn.lock b/website/yarn.lock index b4e24a2ef6..0fa57e2270 100644 --- a/website/yarn.lock +++ b/website/yarn.lock @@ -8048,6 +8048,11 @@ media-typer@0.3.0: resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" integrity sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ== +medium-zoom@^1.0.8: + version "1.1.0" + resolved "https://registry.yarnpkg.com/medium-zoom/-/medium-zoom-1.1.0.tgz#6efb6bbda861a02064ee71a2617a8dc4381ecc71" + integrity sha512-ewyDsp7k4InCUp3jRmwHBRFGyjBimKps/AJLjRSox+2q/2H4p/PNpQf+pwONWlJiOudkBXtbdmVbFjqyybfTmQ== + memfs@^3.1.2, memfs@^3.4.3: version "3.4.10" resolved "https://registry.yarnpkg.com/memfs/-/memfs-3.4.10.tgz#4cdff7cfd21351a85e11b08aa276ebf100210a4d" @@ -9044,6 +9049,12 @@ pkg-up@^3.1.0: dependencies: find-up "^3.0.0" +plugin-image-zoom@flexanalytics/plugin-image-zoom: + version "1.1.0" + resolved "https://codeload.github.com/flexanalytics/plugin-image-zoom/tar.gz/8e1b866c79ed6d42cefc4c52f851f1dfd1d0c7de" + dependencies: + medium-zoom "^1.0.8" + pluralize@^8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-8.0.0.tgz#1a6fa16a38d12a1901e0320fa017051c539ce3b1"