KenCorbettJr / remark-automatic-glossary-markup

Automatically add markup for glossary terms used within a markdown file

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remark Automatic Glossary Markup

remark-automatic-glossary-markup

This is a simple and straightforward remark plugin that, when given a list of glossary terms, will wrap the first occurance of that term within a paragraph of the markdown file within a link. That link will be to #glossary-${urlEncodedGlossaryTerm} which you can then use to drive your glossary behavior.

You must provide the terms that you would like to be marked up to this plugin like this:

import remark from "remark";
import remarkAutomaticGlossaryMarkup from "remark-automatic-glossary-markup";

remark().use(remarkAutomaticGlossaryMarkup, {
  terms: [{ term: "API" }, { term: "JSON" }],
});

About

Automatically add markup for glossary terms used within a markdown file


Languages

Language:JavaScript 100.0%