Overview

As the title suggests, this article describes how to add plugins such as mirador-image-tools to Mirador 3 and bundle them into a single JS file for distribution.

Due to my limited knowledge of JavaScript, there may be some inaccuracies. I would appreciate it if you could point out any mistakes.

Goal

The goal is to create an application like the one at the following URL by writing an HTML file as shown below. It uses Mirador 3 with the mirador-image-tools plugin enabled.

https://nakamura196.github.io/mirador-integration-alt/

<<!h/Dt<<hOmh/b/tCle<<ho<<<<bmT>amtedd!ss/olYdeiayi-cccc}Msd>P>ttd>v-rroo;icyEal>iinniw]rr>eippssdiaihc>dtttt:n{}dpthB=>d,otmaa"s{c"oiimr>lrsdrModwmma.>siecinesaanvecm=rfm:ggiito"aioeefe=M"hdg"[TTew"i>to,ooseur<tr=ootrta/p,llI(fdds{ssdc-oi:mEO:o8rv/inpn"<>/rae"fnabnhitadl:tgikoet,tardtplmI:rs[eumu:.>rate/.agr,/.1euim9Teii6o,ir.ofagl.disdotPlrhl.Iuuimbgta.icgin.eo}uT/-om=toiolriksanyPdtoloe.urgag-rciia.nntj]tip)eo/;gnrreaptoi/oini-iafl/tf/bddi0s4t7/9mba-idnb.bj4s-"4>e<a/as-c9r5ibp8t->f27e1c423e4b/manifest",

The key point is the line marked with <!-- ポイント --> in the source code above. By loading a single JS file, you can use both Mirador 3 and the mirador-image-tools plugin.

Also note that Mirador and miradorImageToolsPlugin are accessed through a variable called integration. There is room for improvement on this point in the future.

Below, I will explain how to use and create this JS file.

Usage

Using the Pre-built Version

As with the HTML file described above, you can use it by referencing the following JS file URL.

https://nakamura196.github.io/mirador-integration-alt/dist/main.js

Building and Using

I created the following GitHub repository.

https://github.com/nakamura196/mirador-integration-alt

This repository was created based on the official repository.

First, clone the repository.

gitclonehttps://github.com/nakamura196/mirador-integration-alt

Next, install the required libraries.

cndpmmiirnasdtoarl-lintegration-alt

Then, run webpack as follows.

npmrunwebpack

A file called main.js will be created in the dist folder (it should already exist when you clone the repository).

Customization

The following file uses Mirador and the mirador-image-tools plugin. You can customize it by adding other plugins here.

https://github.com/nakamura196/mirador-integration-alt/blob/main/src/index.js

Summary

I described how to add plugins such as mirador-image-tools to Mirador 3 and bundle them into a single JS file for distribution. There may be some inaccuracies, but I hope you find this helpful.