Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/theopenwebjp/ruby-extractor

Ruby extraction library.
https://github.com/theopenwebjp/ruby-extractor

japanese javascript kana

Last synced: about 1 month ago
JSON representation

Ruby extraction library.

Awesome Lists containing this project

README

        

# Description

Ruby extraction library.
Extracts information from ruby tags including the Katakana/hiragana AND the linked Japanese character(s).

## Usage

```bash
npm install @theopenweb/ruby-extractor
```

```js
import {
extractReadableRubyFromPage,
extractRubyFromPage,
extractRubyFromElement,
extractFromRubyElement,
makeRubyDataListReadable
} from './index.js'

/*
RubyData: {
str: string;
ruby: string;
}
*/

/**
* ๐Ÿน: ใƒใƒ ใ‚นใ‚ฟใƒผ
๐Ÿผ: ใƒ‘ใƒณใƒ€ใƒผ
*/
extractReadableRubyFromPage({ lf: '
' }) // 1st arg optional

/**
* @return {RubyData[]}
*/
extractRubyFromPage()

/**
* @return {RubyData[]}
*/
extractRubyFromElement(element)

/**
* @return {RubyData[]}
*/
extractFromRubyElement(rb)

/**
* ๐Ÿน: ใƒใƒ ใ‚นใ‚ฟใƒผ
๐Ÿผ: ใƒ‘ใƒณใƒ€ใƒผ
* @param {RubyData[]} rubyDataList
*/
makeRubyDataListReadable(rubyDataList, { lf: '
' }) // 2nd arg optional

```

## Test

```bash
npx http-server ./
# http://localhost:8080
```

## Localization

- [ๆ—ฅๆœฌ่ชž](./README_JA.md)