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

18.0.0 • Public • Published

ngx-furigana

This projet is an inspiration of helephant Gem.
The library is full compatible with Angular, and it's simple to use.

Source code

Source code can be found on my GitHub.

Browsers

Compatible with all browsers.

Install

npm install @clemox/ngx-furigana

Usage

  1. Declare service
import { NgxFuriganaService } from '@clemox/ngx-furigana';

constructor(
    private furigana: NgxFuriganaService
) { }
  1. Call the service

The method "getReading" returns the input text.

// return 食[た]べ物[もの]が好きです
this.furigana.getReading('食[た]べ物[もの]が好きです');

The method "getExpression" returns the text without [...] hiragana.

// return 食べ物が好きです
this.furigana.getExpression('食[た]べ物[もの]が好きです');

The method "getHiragana" returns only the hiragana.

// return たべものが好きです
this.furigana.getExpression('食[た]べ物[もの]が好きです');

The method "getReadingHtml" returns only the RUBY HTML.

// return <ruby><rb>食</rb><rt>た</rt></ruby>べ<ruby><rb>物</rb><rt>もの</rt></ruby>が好きです
this.furigana.getReadingHtml('食[た]べ物[もの]が好きです');

Package Sidebar

Install

npm i @clemox/ngx-furigana

Weekly Downloads

1

Version

18.0.0

License

none

Unpacked Size

31 kB

Total Files

12

Last publish

Collaborators

  • clemox