@gengotech/ngx-furigana
TypeScript icon, indicating that this package has built-in type declarations

0.0.21 • Public • Published

Furigana for Angular

An Angular component that intelligently displays Furigana.

example

<!-- Kana between Kanji -->
<furigana word="日の人" reading="ひのひと"></furigana>

<!-- Kana between Kanji -->
<furigana word="あの日の人" reading="あのひのひと"></furigana>

<!-- Trailing kana -->
<furigana word="対抗する" reading="たいこうする"></furigana>

<!-- Kanji between kana  -->
<furigana word="ぶん回す" reading="ぶんまわす"></furigana>

<!-- Full kana  -->
<furigana word="稲葉曇" reading="いなばくもり"></furigana>

<!-- Full kana  -->
<furigana word="" reading="にち"></furigana>

It was built in order to display Japanese text and readings programatically from sources such as JMdict.

Installation

npm install @gengotech/ngx-furigana --save

Add NgxFuriganaModule to your app.module.ts imports:

import { NgxFuriganaModule } from '@gengotech/ngx-furigana';

@NgModule({
 
  imports: [
    NgxFuriganaModule
  ],
  
})

Usage

<furigana [word]="対抗する'" [reading]="'たいこうする'"></furigana>

example

As you can see, the "する" part is automatically ignored even if it is present in the reading.

It can also handle words where there's kana on both ends:

<furigana [word]="'ぶん回す'" [reading]="'ぶんまわす'"></furigana>

example

API

If any of the inputs are changed, the component will automatically re-render.

Inputs

Name Type Default Description
word string The main word that will be displayed.
reading string The reading for the word.
showFurigana boolean true Optional switch to turn off furigana display.

Package Sidebar

Install

npm i @gengotech/ngx-furigana

Weekly Downloads

5

Version

0.0.21

License

GPL-3.0-or-later

Unpacked Size

177 kB

Total Files

24

Last publish

Collaborators

  • gengotech