grnet / docusaurus-terminology

Home of Docusaurus Terminology Plugin
BSD 2-Clause "Simplified" License
35 stars 5 forks source link

chore(plugins): make glossary and term preview customizable #12

Closed VasiaKoum closed 1 year ago

VasiaKoum commented 1 year ago

Users will have the ability to use their own custom components for the glossary file and term preview tooltip, instead of using the ones provided by @grnet/docusaurus-term-preview and @grnet/docusaurus-glossary-view.

To modify the default options, users can edit the plugins section in docusaurus.config.js as shown below:

plugins: [
    ['@grnet/docusaurus-terminology', {
      termsDir: './docs/terms',
      docsDir: './docs/',
      glossaryFilepath: './docs/glossary.md',
      glossaryComponentPath: 'path/to/your/component',
      termPreviewComponentPath: 'path/to/your/component',
    }],
  ],

If the user doesn't provide the glossaryComponentPath and termPreviewPath, or prefers to use the defaults, the options will be as follows:

plugins: [
    ['@grnet/docusaurus-terminology', {
      ...
      glossaryComponentPath: '@grnet/docusaurus-glossary-view',
      termPreviewComponentPath: '@grnet/docusaurus-term-preview',
    }],
  ],