|
1 | | -# mirador-citation-plugin |
2 | | -A Mirador 3 plugin for displaying Harvard-specific citations |
| 1 | +# Mirador citation plugin |
| 2 | + |
| 3 | +A Mirador 3 plugin for displaying Harvard-specific citations. |
| 4 | + |
| 5 | +## Requirements |
| 6 | + |
| 7 | +- [NVM](https://github.com/nvm-sh/nvm) |
| 8 | + |
| 9 | +## Setup |
| 10 | + |
| 11 | +1. Run `nvm use` to ensure your version of matches that in the `.nvmrc` file |
| 12 | +2. Run `npm i` to install dependencies |
| 13 | +3. Use one of the [NPM scripts](#npm-scripts) to perform the actions described below. |
| 14 | + |
| 15 | +## NPM scripts |
| 16 | + |
| 17 | +The following are some useful scripts can be ran using `npm run <script>`. A full list can be seen in [package.json](./package.json) |
| 18 | + |
| 19 | +| Script | Description | |
| 20 | +| ------- | -------------------------------------------------------------------------------------------------------------------------- | |
| 21 | +| `clean` | Removes the `dist` directories | |
| 22 | +| `build` | Builds the source files into the `./dist` directory | |
| 23 | +| `serve` | Runs a local web server where the plugin can be viewed in a vanilla Mirador instance (helpful for testing and development) | |
| 24 | +| `test` | Runs the automated test suites |
| 25 | + |
| 26 | +## Installing in Mirador |
| 27 | + |
| 28 | +The `mirador-citation-plugin` requires an instance of Mirador 3. Visit the [Mirador wiki](https://github.com/ProjectMirador/mirador/wiki) to learn how to [install an existing plugin](https://github.com/ProjectMirador/mirador/wiki/Mirador-3-plugins#installing-an-existing-plugin) and for additional information about plugins. |
| 29 | + |
| 30 | +Package you will need to install: |
| 31 | + |
| 32 | +```bash |
| 33 | +npm i @harvard-lts/mirador-citation-plugin |
| 34 | +``` |
| 35 | + |
| 36 | +## Configuration |
| 37 | + |
| 38 | +Configurations for this plugin are injected when Mirador is initialized under the `miradorCitationPlugin` key. See the [demo entry](./demo/demoEntry.js) for an example of importing and configuring `mirador-citation-plugin`. Note: the demo entry does not contain a valid citation API endpoint. You must fill it in for the demo to work. |
| 39 | + |
| 40 | +```js |
| 41 | +... |
| 42 | + id: 'mirador', |
| 43 | + miradorCitationPlugin: { |
| 44 | + ... |
| 45 | + } |
| 46 | +... |
| 47 | +``` |
| 48 | + |
| 49 | +| Config Key | Type | Description | |
| 50 | +| --- | --- | --- | |
| 51 | +| `citationAPI` | string | The API endpoint of your custom citation service | |
| 52 | + |
| 53 | +Additionally, the `aria-label` and `title` of the buttons are injected when Mirador is initialized under the `translations` key. See the [demo entry](./demo/demoEntry.js) for an example. The common configuration is also listed below. |
| 54 | + |
| 55 | +```js |
| 56 | +... |
| 57 | + id: 'mirador', |
| 58 | + translations: { |
| 59 | + en: { |
| 60 | + openCompanionWindow_CitationKey: 'Cite', |
| 61 | + openCompanionWindow_RelatedLinksKey: 'Related Links' |
| 62 | + } |
| 63 | + } |
| 64 | +... |
| 65 | +``` |
| 66 | + |
| 67 | +| Config Key | Type | Description | |
| 68 | +| --- | --- | --- | |
| 69 | +| `openCompanionWindow_CitationKey` | string | The text you wish to appear in the `aria-label` and `title` of the Citation button | |
| 70 | +| `openCompanionWindow_RelatedLinksKey` | string | The text you wish to appear in the `aria-label` and `title` of the Related Links button | |
| 71 | + |
| 72 | +## Contribute |
| 73 | +Mirador's development, design, and maintenance is driven by community needs and ongoing feedback and discussion. Join us at our regularly scheduled community calls, on [IIIF slack #mirador](http://bit.ly/iiif-slack), or the [mirador-tech](https://groups.google.com/forum/#!forum/mirador-tech) and [iiif-discuss](https://groups.google.com/forum/#!forum/iiif-discuss) mailing lists. To suggest features, report bugs, and clarify usage, please submit a GitHub issue. |
| 74 | + |
| 75 | +[build-badge]: https://img.shields.io/travis/projectmirador/mirador-citation-plugin/master.png?style=flat-square |
| 76 | +[build]: https://travis-ci.org/projectmirador/mirador-citation-plugin |
| 77 | + |
| 78 | +[npm-badge]: https://img.shields.io/npm/v/mirador-citation-plugin.png?style=flat-square |
| 79 | +[npm]: https://www.npmjs.org/package/mirador-citation-plugin |
0 commit comments