1.1.0 • Published 6 years ago
nhg-ruby v1.1.0
nhg-ruby
Web component to display japanese text with furigana.

Installation
npm install nhg-ruby --saveThen, import nhg-ruby into your element:
import 'nhg-ruby/nhg-ruby.js';or in an html file:
<script type="module" src="/path/to/nhg-ruby.js"></script>Usage
In your LitElement class:
static get properties() {
return {};
}
constructor() {
super();
}
render() {
return html`
<nhg-ruby
furigana="きょう、にほんご、べんきょう"
text="今日は日本語を勉強しましょう!">
</nhg-ruby>
`;
}Notes
furiganalist can be separated by both japanese or romanji comma, but without spaces after the comma.Text can also be displayed from top to bottom and right to left by setting
writing-modeCSS property tovertical-rltonhg-rubyor any of its parents.