kiwa-hyphenizer
v0.4.1
Published
Perfect hyphenation for your Website.
Downloads
14
Readme
Kiwa Hyphenizer
Perfect hyphenation for your Website.
Installation
This library is made for the use with Node. Add it to your project by running $ npm install kiwa-hyphenizer or add it with another dependency manager by your choice.
Usage
Set up the hyphenation like that:
import { Hyphenation } from "kiwa-hyphenizer";
/**
* List of words to hyphenate.
* The pipe marks the point at which you want to hyphenate.
*/
const words = {
"Silbentrennung": "Silben|trennung"
};
/**
* List of elements, whose text should be hyphenated.
*/
const elements = [
...document.querySelectorAll("h1"),
...document.querySelectorAll("p")
];
const hyphenation = new Hyphenation(words);
hyphenation.addElements(elements);Fetching hyphenated words
You can fetch hyphenated versions of your words from the Hyphenizer API automatically. Please note that the Hyphenizer API requires you to have a valid API token.
Help
If you have any questions, feel free to contact us under [email protected].
Further information about Bit&Black can be found under www.bitandblack.com.
