Skip to main content

Manual configuration

You may want to skip the preset if you're already using a custom preset, or if you only want the glossary page (no auto-linking).

With the classic preset and auto-linking

Configure the remarkremark A markdown processor. Remark plugins transform the markdown AST before it becomes HTML/JSX. plugin yourself using the getRemarkPlugin helper:

const glossaryPlugin = require('docusaurus-plugin-glossary');

module.exports = {
presets: [
[
'@docusaurus/preset-classic',
{
docs: {
remarkPlugins: [
glossaryPlugin.getRemarkPlugin(
{ glossaryPath: 'glossary/glossary.json', routePath: '/glossary' },
{ siteDir: __dirname },
),
],
},
pages: {
remarkPlugins: [
glossaryPlugin.getRemarkPlugin(
{ glossaryPath: 'glossary/glossary.json', routePath: '/glossary' },
{ siteDir: __dirname },
),
],
},
},
],
],
plugins: [
[
'docusaurus-plugin-glossary',
{ glossaryPath: 'glossary/glossary.json', routePath: '/glossary' },
],
],
};

Using the raw remarkPlugin export

If you need full control:

const glossaryPlugin = require('docusaurus-plugin-glossary');

module.exports = {
presets: [
[
'@docusaurus/preset-classic',
{
docs: {
remarkPlugins: [
[
glossaryPlugin.remarkPlugin,
{
glossaryPath: 'glossary/glossary.json',
routePath: '/glossary',
siteDir: __dirname,
},
],
],
},
},
],
],
plugins: [
[
'docusaurus-plugin-glossary',
{ glossaryPath: 'glossary/glossary.json', routePath: '/glossary' },
],
],
};

Just the page, no auto-linking

Skip the remarkremark A markdown processor. Remark plugins transform the markdown AST before it becomes HTML/JSX. plugin entirely. The /glossary route and manual <GlossaryTerm> usage still work:

module.exports = {
plugins: [
[
'docusaurus-plugin-glossary',
{ glossaryPath: 'glossary/glossary.json', routePath: '/glossary' },
],
],
};