1.1.0 • Published 3 years ago

textlint-rule-max-ruby-len v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

textlint-rule-max-ruby-len

ルビ親文字とルビ文字の文字数を制限するtextlintルールです。

対応しているルビ構文は次のとおりです。

|親文字《ルビ》
|親文字《ルビ》

インストール

npm install textlint-rule-max-ruby-len

使い方

// .textlintrc
{
  "rules": {
    "max-ruby-len": true,
  }
}

オプション

// .textlintrc
{
  "rules": {
    "max-ruby-len": {
      "rubyBase": 10,
      "rubyText": 10,
      "useStringLength": false
    },
  }
}
  • rubyBase: number
    default: 10
    ルビ親文字の最大文字数。
  • rubyText: number
    default: 10
    ルビ文字の最大文字数。
  • useStringLength: boolean
    default: false
    文字の数え方。
    初期状態ではString Iteratorを使い[...striing].lengthで数えます。
    string.lengthで数えたい場合にtrueを指定します。
    よくわからない場合は、お使いの投稿サイトで𩸽が2文字と判定されたらtrueにしておくとよいでしょう。

License

MIT