This is a package for RitterIM that queries our glossary and outputs definitions as titles on abbr
HTML tags.
-
Install via NPM: (Note - Currently this package is unavailable via NPM!)
npm install @ritterim/abbr
-
Import package into your
main.js
file:import Abbr from '@ritterim/abbr';
-
Declare a new Abbr class and run the
init()
methodconst abbr = new Abbr(); abbr.init();
You can create a JS Object for the glossary and pass it in with the set()
method:
const glossary = [{
abbr: "FFS",
definition: "Fee for service is a payment model in healthcare, where providers are paid for each service performed. Examples of services include individual tests, procedures, or treatments.",
role: null,
term: "Fee for Service"
}];
abbr.set(glossary);
abbr.init();
You can also set the glossary by passing in the path to a JSON file:
const glossary = './data/glossary.json';
abbr.set(glossary);
abbr.init();
- Clone this repo
- Navigate into the directory
- Run
npm install
- Start the application by running:
npm run dev
- Script is located in
lib/main.js
- Test script by updating
index.html
- Browse to
http://localhost:3000/
- To build package, run:
npm run build